Trust undecided local projects automatically (#36935)

## What changed

- Replace the TUI directory-trust prompt with automatic trust for local projects whose trust level is unset. Keep explicit trust settings and remote workspaces unchanged.
- Persist trust for the resolved Git or configured project root, then reload configuration so project-local settings take effect.
- Fall back to an in-memory trust override and an embedded app server when the config update cannot be persisted.

## Testing

- Cover persisted and in-memory trust, custom project-root markers, and the working directories selected by resume and fork flows.

GitOrigin-RevId: 8fd51eb4cd88267073324bfd7dc4106a56d7c745
This commit is contained in:
Eric Traut authored and copyberry committed 2026-08-04 17:49:54 +00:00
1 parent 90314a9207
commit 1e59dc5bda
12 files changed
+388 -690

No files matched your search

+17
View File
@@ -256,6 +256,9 @@ pub struct ConfigLayerStack {
/// `None` means the loader did not check for stack-level warnings, while
/// `Some(vec![])` means it checked and found nothing to report.
startup_warnings: Option<Vec<String>>,
/// Project root resolved from the non-project config layers.
project_root: Option<AbsolutePathBuf>,
}
impl ConfigLayerStack {
@@ -272,9 +275,21 @@ impl ConfigLayerStack {
requirements_toml,
ignore_user_and_project_exec_policy_rules: false,
startup_warnings: None,
project_root: None,
})
}
/// Records the project root resolved while loading this stack.
pub fn with_project_root(mut self, project_root: Option<AbsolutePathBuf>) -> Self {
self.project_root = project_root;
self
}
/// Returns the project root resolved from the non-project layers.
pub fn project_root(&self) -> Option<&AbsolutePathBuf> {
self.project_root.as_ref()
}
pub fn with_user_and_project_exec_policy_rules_ignored(
mut self,
ignore_user_and_project_exec_policy_rules: bool,
@@ -401,6 +416,7 @@ impl ConfigLayerStack {
ignore_user_and_project_exec_policy_rules: self
.ignore_user_and_project_exec_policy_rules,
startup_warnings: self.startup_warnings.clone(),
project_root: self.project_root.clone(),
})
}
@@ -435,6 +451,7 @@ impl ConfigLayerStack {
ignore_user_and_project_exec_policy_rules: self
.ignore_user_and_project_exec_policy_rules,
startup_warnings: self.startup_warnings.clone(),
project_root: self.project_root.clone(),
}
}