fix(TASK-046): make inspection flags look-don't-touch and pin the contracts
- Skip the builtins bootstrap, function-binary build, and tool-scope rebuild for inspection-only runs (--info/--list-*/--mcp-list/ --list-secrets without --agent/--role): a pristine COYOTE_CONFIG_DIR now stays byte-empty (was 269 files written before dispatch) - Tolerate a model-less default config on the inspection surface via AppConfig::from_config_lenient + Model::default() in bootstrap; strict 'No available model' behavior unchanged for the REPL path and all mutating mcp/vault flags - --list-secrets degrades to an rc=0 informational message in sandbox mode (mutating vault flags still fail there), pinned by test - Add the 041.7-4 regression test: a malformed COYOTE_<NAME>_GLOBAL_TOOLS env override logs the debug message and leaves global_tools untouched - Adopt scripts/usage-probe-inspection.sh (10 flags: rc=0 + zero writes, output required only for --info) and add binary-level tests/inspection_flags.rs, incl. the agent+--info still-bootstraps pin
This commit is contained in:
9 files changed
+389
-31
No files matched your search
+28
-1
@@ -332,7 +332,15 @@ impl Vault {
|
||||
}
|
||||
|
||||
if cli.list_secrets {
|
||||
vault.list_secrets(true)?;
|
||||
// Listing is an inspection readout: report sandbox unavailability
|
||||
// instead of failing like the mutating vault flags do.
|
||||
if vault.sandbox_mode {
|
||||
println!(
|
||||
"The vault is unavailable in sandbox mode. Use `coyote --list-secrets` on your host."
|
||||
);
|
||||
} else {
|
||||
vault.list_secrets(true)?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@@ -410,4 +418,23 @@ mod tests {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_secrets_flag_ok_in_sandbox() {
|
||||
use clap::Parser;
|
||||
|
||||
// Built directly rather than via IS_SANDBOX so this test cannot race
|
||||
// the env juggling in vault_disabled_in_sandbox.
|
||||
let vault = Vault {
|
||||
sandbox_mode: true,
|
||||
..Vault::default()
|
||||
};
|
||||
let cli = Cli::try_parse_from(["coyote", "--list-secrets"]).unwrap();
|
||||
|
||||
// Pins the --list-secrets sandbox contract: rc=0 with an informational
|
||||
// readout instead of the hard failure the mutating flags keep. The
|
||||
// message goes straight to stdout, so only Ok is asserted here.
|
||||
Vault::handle_vault_flags(cli, &vault)
|
||||
.expect("--list-secrets must succeed in sandbox mode");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user