From 8bd997a0cb03bb0e3ba5348d6652992dd9bf84a9 Mon Sep 17 00:00:00 2001 From: aien Date: Sun, 11 Oct 2026 00:21:53 -0500 Subject: [PATCH 1/4] REGRESSION-sc402-dotslash: pre-registered plan for the leading ./ path rule (R6, #402) Co-Authored-By: Claude Opus 5.5 --- .../REGRESSION-sc402-dotslash.md | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 docs/campaigns/whole-system-e2e/REGRESSION-sc402-dotslash.md diff --git a/docs/campaigns/whole-system-e2e/REGRESSION-sc402-dotslash.md b/docs/campaigns/whole-system-e2e/REGRESSION-sc402-dotslash.md new file mode 100644 index 00000000..9abde1a8 --- /dev/null +++ b/docs/campaigns/whole-system-e2e/REGRESSION-sc402-dotslash.md @@ -0,0 +1,44 @@ +# Regression evidence, sc#402 (a leading `./` names the same workspace file), Lane A2, 2026-10-11 + +Pre-registered before the code change. Results are filled in below the plan after the checks; the plan is not edited. + +## The failing scenario (RUN-3-GB10-20261011T045450Z, row E4) + +After `remember` succeeded, the daemon was killed (SIGKILL) and restarted, and the second objective asked the model to +edit `report.md`. Attempts 2 and 3 answered `filename: ./report.md` and were refused by the daemon's proposal reader: +`path "./report.md" is not a plain relative path` (`RESULT-RUN-3-GB10.md`, E4 and CTRL-E4b rows). `./report.md` and +`report.md` name the same file in the workspace, so this is a product defect, not a safety refusal. + +## The rule (coordinator ruling, 2026-10-11) + +One shared function, `destination::strip_leading_curdir`, removes leading `./` segments, and nothing else, where a path +enters the daemon from text: + +1. the model's proposal (`spine::check_file_proposal`, the `filename:` line, which every reader of a reply uses: the + skill, the AEGIS contract, the authorization and the write), and +2. the words of a goal (`destination` word cleaning, which feeds the named destination and named inputs that + `classify_named` and the input collector then check). + +The existing strict checks then run unchanged on the stripped path: `spine::check_relative_path` (no absolute path, +no `~`, no `..`, no empty or `.` segment, letters, digits and `._-/` only, at most 255 bytes) and, for grants, +`effects::confine_shape`. So absolute paths, any `..` segment (also `./../x`), empty segments, `~`, backslashes, NUL +and anything that escapes the workspace stay refused exactly as before. + +Decisions recorded with the rule: + +- Inner `./` segments are NOT normalised: `a/./b` stays refused by the spine. `.` and `./` (empty after stripping) stay + refused. `.//x` strips to `/x`, which is absolute and stays refused. +- The grant and effect layer (`effects::confine_shape`, `confine_target`, `open_confined`) is left strict: it is a + backstop that accepts only the one canonical spelling, so an authorization record never holds two spellings of one + file. Its existing test that refuses a grant for `./N.md` stays as it is. Grants are built from the proposal's path, + which is now already canonical, so the backstop is never reached with `./` from a model reply. + +## Plan + +| check | how | expected | +|---|---|---| +| new tests red on main | the new unit tests in `spine.rs` and `destination.rs`, built against main 8c09217 with the test commit only | `./report.md` proposal refused (test fails) | +| new tests green | `cargo test -p aien-runtime -p aien-cli` (linked compose archive) | all pass, including: `./report.md` -> `report.md`; `././a/b.md` -> `a/b.md`; refused: `../x`, `./../x`, `/x`, `a/../b`, `a/./b`, `.`, `./`, empty, `~/x`, `.//x`; an edit reply naming `./report.md` merges into `report.md`; a goal naming `./report.md` names `report.md` | +| grant backstop unchanged | existing `grants_are_confined_and_the_approved_kind_is_reserved` | passes unchanged (`./N.md` grant refused) | +| lint | `cargo clippy -p aien-runtime -p aien-cli --all-targets -- -D warnings`, `cargo fmt --check` | clean | +| RUN-1 verdict unchanged | `tools/aien-verify` on a scratch copy of `runs/RUN-1-20261010T154724Z` | `verdict_id` as recorded in its `VERIFIER_RECEIPT.json` | From 9f82f62cc83c3a05752033f7d2cd538888cacc02 Mon Sep 17 00:00:00 2001 From: aien Date: Sun, 11 Oct 2026 00:22:21 -0500 Subject: [PATCH 2/4] aien-runtime: tests for the leading ./ path rule, red on main (R6, #402) Co-Authored-By: Claude Opus 5.5 --- crates/aien-runtime/src/destination.rs | 29 +++++++++++++++++ crates/aien-runtime/src/spine.rs | 45 ++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/crates/aien-runtime/src/destination.rs b/crates/aien-runtime/src/destination.rs index 660882e9..6934c60f 100644 --- a/crates/aien-runtime/src/destination.rs +++ b/crates/aien-runtime/src/destination.rs @@ -892,3 +892,32 @@ mod tests { assert_eq!(d("Edit ~/secret.txt"), Ok(Some("~/secret.txt".into()))); } } + +/// sc#402: a goal that writes `./report.md` names `report.md`; unsafe forms +/// keep their old reading (and are refused downstream as before). +#[cfg(test)] +mod dotslash_tests { + use super::*; + + #[test] + fn strip_leading_curdir_removes_only_leading_dot_slash() { + assert_eq!(strip_leading_curdir("./report.md"), "report.md"); + assert_eq!(strip_leading_curdir("././a/b.md"), "a/b.md"); + assert_eq!(strip_leading_curdir("a/./b"), "a/./b"); + assert_eq!(strip_leading_curdir("./../x"), "../x"); + assert_eq!(strip_leading_curdir(".//x"), "/x"); + assert_eq!(strip_leading_curdir("./"), ""); + assert_eq!(strip_leading_curdir("."), "."); + assert_eq!(strip_leading_curdir(""), ""); + assert_eq!(strip_leading_curdir("../x"), "../x"); + assert_eq!(strip_leading_curdir(".hidden"), ".hidden"); + } + + #[test] + fn a_goal_naming_dot_slash_names_the_bare_path() { + let d = |g: &str| named_destination(g, &|_| false); + assert_eq!(d("Edit ./report.md"), Ok(Some("report.md".into()))); + assert_eq!(d("Write ././docs/a.md"), Ok(Some("docs/a.md".into()))); + assert_eq!(d("Edit ./../x.md"), Ok(Some("../x.md".into()))); + } +} diff --git a/crates/aien-runtime/src/spine.rs b/crates/aien-runtime/src/spine.rs index 4bbfc376..92d9befc 100644 --- a/crates/aien-runtime/src/spine.rs +++ b/crates/aien-runtime/src/spine.rs @@ -3452,3 +3452,48 @@ mod append_placement_tests { assert!(!at_end("The appended line")); } } + +/// sc#402 (RUN-3-GB10 E4): a leading `./` names the same workspace file as +/// the bare relative path; every other unsafe or non-plain form stays refused. +#[cfg(test)] +mod dotslash_tests { + use super::*; + + fn path_of(name: &str) -> Result { + check_file_proposal(&format!("filename: {name}\n# Report\nbody\n")).map(|p| p.path) + } + + #[test] + fn leading_dot_slash_names_the_bare_path() { + assert_eq!(path_of("./report.md"), Ok("report.md".into())); + assert_eq!(path_of("././a/b.md"), Ok("a/b.md".into())); + assert_eq!(path_of("`./report.md`"), Ok("report.md".into())); + assert_eq!(path_of("report.md"), Ok("report.md".into())); + } + + #[test] + fn every_other_form_is_refused_as_before() { + for bad in [ + "../x", "./../x", "/x", "a/../b", "a/./b", ".", "./", "~/x", ".//x", "a//b", "a\\b", + ] { + assert!(path_of(bad).is_err(), "{bad:?} must stay refused"); + } + assert!(check_file_proposal("filename: \n# R\nbody\n").is_err()); + assert!(check_relative_path("./report.md").is_err(), "the strict check stays strict"); + } + + #[test] + fn an_edit_reply_naming_dot_slash_merges_into_the_named_file() { + let prior = "# Report\n\nOne.\n"; + let out = edit_proposal_placed( + "filename: ./report.md\n# Report\n\nOne.\nThe topic is harbours.\n", + Some(("report.md", prior)), + EditPlacement::for_goal("Append one line to report.md naming the topic."), + ) + .unwrap(); + assert_eq!( + out, + "filename: report.md\n# Report\n\nOne.\nThe topic is harbours.\n" + ); + } +} From ea6feabae1b0bf78462b08b343b773b9e56d055e Mon Sep 17 00:00:00 2001 From: aien Date: Sun, 11 Oct 2026 00:27:42 -0500 Subject: [PATCH 3/4] aien-runtime: a leading ./ names the same workspace file (one shared strip, strict checks unchanged) (R6, #402) The proposal reader and goal-word cleaning drop leading ./ segments via destination::strip_leading_curdir before the existing strict rule. RUN-3-GB10 E4 was refused on filename: ./report.md. Absolute, .., ~, empty, inner ./ and every other form stay refused; the grant layer stays canonical-only. Co-Authored-By: Claude Opus 5.5 --- crates/aien-runtime/src/destination.rs | 24 ++++++++++++++++--- crates/aien-runtime/src/spine.rs | 11 ++++++--- .../REGRESSION-sc402-dotslash.md | 16 +++++++++++++ 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/crates/aien-runtime/src/destination.rs b/crates/aien-runtime/src/destination.rs index 6934c60f..b62415b9 100644 --- a/crates/aien-runtime/src/destination.rs +++ b/crates/aien-runtime/src/destination.rs @@ -291,11 +291,29 @@ impl std::fmt::Display for DestinationError { } } +/// A path with its leading `./` segments removed, and nothing else changed +/// (sc#402): `./report.md` and `report.md` name the same workspace file, so a +/// path that enters from text (a goal word, a reply's `filename:` line) is +/// read in its bare form. Inner `./` segments, `..`, absolute paths, `~`, +/// empty results and every other form are left exactly as written, so the +/// strict checks that follow (`spine::check_relative_path`, +/// `effects::confine_shape`) refuse them as before. The one shared reading. +pub fn strip_leading_curdir(path: &str) -> &str { + let mut p = path; + while let Some(rest) = p.strip_prefix("./") { + p = rest; + } + p +} + fn clean(w: &str) -> &str { const Q: fn(char) -> bool = |c| matches!(c, '"' | '\'' | '`' | '(' | ')' | '[' | ']'); - w.trim_matches(Q) - .trim_end_matches(['.', ',', ';', ':', '!', '?']) - .trim_matches(Q) + // sc#402: a leading `./` is dropped once quotes and punctuation are gone. + strip_leading_curdir( + w.trim_matches(Q) + .trim_end_matches(['.', ',', ';', ':', '!', '?']) + .trim_matches(Q), + ) } fn has_extension(w: &str) -> bool { diff --git a/crates/aien-runtime/src/spine.rs b/crates/aien-runtime/src/spine.rs index 92d9befc..5f8bb245 100644 --- a/crates/aien-runtime/src/spine.rs +++ b/crates/aien-runtime/src/spine.rs @@ -810,7 +810,8 @@ fn outer_fence_close(body: &[&str], open_len: usize) -> Option { /// The model's answer in the fixed proposal template: the first nonempty /// line is `filename: ` (case-insensitive key; quotes, -/// backticks and asterisks around it or the path are ignored), everything +/// backticks and asterisks around it or the path are ignored, and so are leading +/// `./` segments of the path, sc#402), everything /// after it is the complete content (blank lines around it and one /// surrounding code fence are dropped; it ends with one newline). /// Err names why the reply is refused. Deterministic: the Skill, the AEGIS @@ -826,7 +827,8 @@ pub fn check_file_proposal(text: &str) -> Result { if first.len() < KEY.len() || !first[..KEY.len()].eq_ignore_ascii_case(KEY) { return Err("no filename line: the first line must be 'filename: '".into()); } - let path = bare(&first[KEY.len()..]).to_string(); + // sc#402: `./report.md` is `report.md`; the strict check then runs as before. + let path = crate::destination::strip_leading_curdir(bare(&first[KEY.len()..])).to_string(); check_relative_path(&path)?; let mut body: Vec<&str> = lines[at + 1..].to_vec(); while body.first().is_some_and(|l| l.trim().is_empty()) { @@ -3479,7 +3481,10 @@ mod dotslash_tests { assert!(path_of(bad).is_err(), "{bad:?} must stay refused"); } assert!(check_file_proposal("filename: \n# R\nbody\n").is_err()); - assert!(check_relative_path("./report.md").is_err(), "the strict check stays strict"); + assert!( + check_relative_path("./report.md").is_err(), + "the strict check stays strict" + ); } #[test] diff --git a/docs/campaigns/whole-system-e2e/REGRESSION-sc402-dotslash.md b/docs/campaigns/whole-system-e2e/REGRESSION-sc402-dotslash.md index 9abde1a8..3a559b69 100644 --- a/docs/campaigns/whole-system-e2e/REGRESSION-sc402-dotslash.md +++ b/docs/campaigns/whole-system-e2e/REGRESSION-sc402-dotslash.md @@ -42,3 +42,19 @@ Decisions recorded with the rule: | grant backstop unchanged | existing `grants_are_confined_and_the_approved_kind_is_reserved` | passes unchanged (`./N.md` grant refused) | | lint | `cargo clippy -p aien-runtime -p aien-cli --all-targets -- -D warnings`, `cargo fmt --check` | clean | | RUN-1 verdict unchanged | `tools/aien-verify` on a scratch copy of `runs/RUN-1-20261010T154724Z` | `verdict_id` as recorded in its `VERIFIER_RECEIPT.json` | + +## Results (2026-10-11, branch e2e/r6-run5) + +| check | result | +|---|---| +| new tests red on main | main 8c09217 plus the test commit only: does not compile (`strip_leading_curdir` missing, 10 errors). With an identity stand-in for that function (the behaviour of main): 4 of the 5 new tests FAIL (`leading_dot_slash_names_the_bare_path`, `an_edit_reply_naming_dot_slash_merges_into_the_named_file`, `strip_leading_curdir_removes_only_leading_dot_slash`, `a_goal_naming_dot_slash_names_the_bare_path`); `every_other_form_is_refused_as_before` passes, as it must on main | +| new tests green | the 5 new tests pass | +| `cargo test -p aien-runtime -p aien-cli -- --test-threads=1` (linked compose archive sha256 3eb20f5e...) | 617 passed, 0 failed, 23 ignored | +| grant backstop unchanged | `grants_are_confined_and_the_approved_kind_is_reserved` passes unchanged (`./N.md` grant still refused) | +| lint | `cargo clippy -p aien-runtime -p aien-cli --all-targets -- -D warnings` clean; `cargo fmt --check` clean | +| RUN-1 verdict unchanged | `tools/aien-verify` on a scratch copy of `runs/RUN-1-20261010T154724Z`: `verdict_id a50fccb63363ef9224a19bd8bf4f249754abf5d88667ba0fd6ce93dfb8d63d80`, chain_unbroken true (as recorded) | + +Limits: unit level only; the chip path is exercised by the next declared attempt (RUN-5-GB10). The model may still answer +in other forms that stay refused (for example an absolute path); this repair covers only a leading `./`. Attempt 1 of +RUN-3 E4 was refused for another reason ("edit reply changes nothing in the file"), which this change does not touch. +`runs/` was not edited. From 27c2fd1bc0e9f9be2c235eb91ae107b38aad5159 Mon Sep 17 00:00:00 2001 From: aien Date: Sun, 11 Oct 2026 00:27:42 -0500 Subject: [PATCH 4/4] crumb compile (#402) Co-Authored-By: Claude Opus 5.5 --- .crumb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.crumb b/.crumb index 45de4c00..411b78dd 100644 --- a/.crumb +++ b/.crumb @@ -77,14 +77,14 @@ } ], "children_root": "sha256:0c69c37ec527d2183340aa639635588d47acef703c467df22a0c42b2c22d4740", - "compiled_at": "2026-10-11T05:01:16Z", + "compiled_at": "2026-10-11T05:27:42Z", "compiler": "crumb-compile/1", - "digest": "sha256:c74ef6c1eea2fbe001b24f653717d3e567b2420ddc8bbf02bbf80b37bb701452", + "digest": "sha256:b1ec1ec007377d5ee3f51a5646b034ff97f2898a778a5e7719b62196b2c1a666", "evidence_files": 187, "evidence_root": "sha256:27ee0353cb4d4aae2b7dbce2bfe0d9f4ef2a94cd7a4555b84684d59372503280", - "files": 3193, - "generated_at_commit": "aa3ad59f93c8d4c9649d23a2348fc097bf2e07d2", - "source_tree": "sha256:319b77cc03ac6eadab506fe359aa1f15c039e72faf61e59da0a4e97998783546" + "files": 3194, + "generated_at_commit": "ea6feabae1b0bf78462b08b343b773b9e56d055e", + "source_tree": "sha256:bd7e7958ec533b17633799280788af5279b9c955d815d490ec213c77780a40cf" } }, "history": [],