Sprint B.6: CLI guardrails — --dry-run, protected_repos, VULP_AGENT marker
- global --dry-run: sync/release/init/collab/license print 'DRY RUN: would...' and exit 0 (no auth needed for previews where possible) - config protected_repos (name/basename, case-insensitive): mutating commands exit 1 on listed repos unless --force; checked before dry-run - VULP_AGENT env: activity::log centrally appends '· via agent' to detail, covering both CLI and TUI writers - sync: unknown --action now rejected before touching any repo
This commit is contained in:
1 parent
f1432d1cd3
commit
8119cdeba7
8 files changed
+133
-14
No files matched your search
+11
-1
@@ -55,7 +55,17 @@ fn log_path() -> PathBuf {
|
||||
/// the Activity tab's commit feed (sourced straight from git log) covers
|
||||
/// separately and accurately regardless of how it happened.
|
||||
pub fn log(entry: &ActivityEntry) {
|
||||
let Ok(line) = serde_json::to_string(entry) else { return };
|
||||
// Executor marker: AI agents set VULP_AGENT so their actions are
|
||||
// distinguishable from the human's in the shared log.
|
||||
let mut entry = entry.clone();
|
||||
if std::env::var("VULP_AGENT").map(|v| !v.is_empty()).unwrap_or(false) {
|
||||
entry.detail = if entry.detail.is_empty() {
|
||||
"via agent".into()
|
||||
} else {
|
||||
format!("{} · via agent", entry.detail)
|
||||
};
|
||||
}
|
||||
let Ok(line) = serde_json::to_string(&entry) else { return };
|
||||
let path = log_path();
|
||||
if let Some(parent) = path.parent() {
|
||||
let _ = std::fs::create_dir_all(parent);
|
||||
|
||||
Reference in new issue
Block a user