Per-session workspace folder + structural identity reminder

- At the first interaction the session name locks and a personal folder is created under the workspace root (default ~/.strata-ctl/<slug>, configurable via workspace_root); slug is filesystem-safe and unique. Stored in sessions.folder (idempotent migration).

- build_request always prepends a structural identity reminder ('Il tuo nome è X. La tua cartella personale è Y.') before the session SP — not an editable setting; gives the agent awareness of its workspace. router_with_store takes the workspace root. 114 tests green; verified live (folder created, name locked).
This commit is contained in:
adm committed 2026-11-25 15:48:39 +01:00
1 parent 0568b92e06
commit c199953927
6 files changed
+148 -14

No files matched your search

+14
View File
@@ -84,6 +84,10 @@ pub struct Config {
#[serde(default)]
pub system_prompt: Option<String>,
/// Parent of the per-session personal workspace folders (default `~/.strata-ctl`).
#[serde(default)]
pub workspace_root: Option<String>,
/// Startup (wait for `READY`) and silence-watchdog timeouts, in seconds.
/// Optional: both default to 600s when absent.
#[serde(default)]
@@ -224,6 +228,16 @@ impl Config {
}
}
/// Effective workspace root: config > `~/.strata-ctl`. Each session's
/// personal folder is created under this root at its first interaction.
pub fn workspace_root(&self) -> PathBuf {
if let Some(p) = &self.workspace_root {
return PathBuf::from(p);
}
let home = std::env::var("HOME").unwrap_or_default();
PathBuf::from(home).join(".strata-ctl")
}
/// The top-level keys present in the file that we are not acting on —
/// reported by `--check` so the shared-file contract stays visible.
pub fn ignored_keys(&self) -> Vec<&str> {