fix(fermata): a bad glob costs only itself; commands read what is there, behind a wrapper or a shell

- A glob in [files] or [policy] that does not compile costs only that pattern while open,
  with a note by name beside text output. A [files] list with none left leaves the built-in
  list. Under deny the refusal stays, and the channel filter stays strict.
- A file named `credentials` is on the default list, at any depth.
- A word with a separator counts only if the path is there, the shell may expand it, or a
  redirect names it: packages, branches and hosts' paths are not denied.
- timeout, nice, ionice, stdbuf, xargs and busybox are prefixes; `2>&1` stays in its segment.
- `bash|sh|zsh -c` and `eval` arguments are read as command lines.
- A `<<` with no closing line is no heredoc. A commented line's own comment is dropped.
  Text holding NUL fails to parse. The unknown-field message says so. Durations are bound
  to under 6 characters. More source extensions pass the gate.
- Removed: HarnessAdapter::post_tool_op (dead since 3C was dropped), tool_op back inline.
This commit is contained in:
2026-11-07 02:00:45 +01:00
parent 999ed6ba4e
commit 6bf602aa6a
20 changed files with 579 additions and 140 deletions
+3 -3
View File
@@ -17,12 +17,12 @@ fn rule_one_words_hold_also_when_explicit() {
#[test]
fn rule_two_numbers_and_durations_hold_also_when_explicit() {
for value in ["3600", "42", "-1", "+5", "1.5", "99999", "15m", "500ms", "30s", "2h", "7d", "1w", "123456789d"] {
for value in ["3600", "42", "-1", "+5", "1.5", "99999", "15m", "500ms", "30s", "2h", "7d", "1w", "9999s"] {
assert!(is_plain_setting("API_TOKEN", value, false), "{value}");
assert!(is_plain_setting("API_TOKEN", value, true), "{value} explicit");
}
// Six or more characters of number is long enough to be a secret.
for value in ["123456", "1234567890", "12.3456", "15x", "m15"] {
// Six or more characters of number or duration is long enough to be a secret.
for value in ["123456", "1234567890", "12.3456", "15x", "m15", "123456789d", "1000ms"] {
assert!(!is_plain_setting("API_TOKEN", value, false), "{value}");
}
}