Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/interplane-mv/patches/a0bb0dc6eca1ccbd # interplane-mv INTERPLANE: open interoperability protocol between AI models and agent runtimes. Models express intent. Runtimes retain authority. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers ## GitHub aien-dev/interplane-mv#88 (code only) closed derived `a0bb0dc6eca1ccbd` #88 Imported from GitHub aien-dev/interplane-mv#88 (code only) GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed). Base `04a05dc5e292debb2d0763460be710167b788677` · Head `659d0cd85aebfebde086307795ba81d949599a40` ### Apply it ``` git checkout -b patch-a0bb0dc6eca1ccbd 04a05dc5e292debb2d0763460be710167b788677 curl -fsSL https://interplane.io/drakestapleton/interplane-mv/patches/a0bb0dc6eca1ccbd.patch | git am ``` Raw patch (mbox) · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/interplane-mv 88 659d0cd85aebfebde086307795ba81d949599a40 ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"interplane-mv","number":88,"url":"https://github.com/aien-dev/interplane-mv/pull/88","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:40:13Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/adapters/aien/evidence/task-scope-2026-10-08/negative-verdicts.txt b/adapters/aien/evidence/task-scope-2026-10-08/negative-verdicts.txt new file mode 100644 index 0000000..7160a6c --- /dev/null +++ b/adapters/aien/evidence/task-scope-2026-10-08/negative-verdicts.txt @@ -0,0 +1,8 @@ +control PASS_LABELLED_INCOMPLETE missing=link:model_turn effect=aien-ledger-slice/1:strong proposal=scripted_turn +changed_exit_code FAIL test_run_mismatch: exit_code=1 (a fix must pass: exit 0) +swapped_stdout_digest FAIL test_run_mismatch: stdout_sha256 vs retained test_stdout +wrong_target_blob FAIL test_run_mismatch: target_blob_sha256_after vs ledger_ack.disk_sha256 +dropped_test_run FAIL test_run_missing: task/source_pin/test_run_record present but no test_run section +tampered_source_pin FAIL source_pin_mismatch: source_pin.target_blob_sha256 vs ledger_grant.prior_sha256 +write_outside_task_scope FAIL task_scope_mismatch: task.target_path=test/test_clamp.c vs ledger_grant.path=src/clamp.c +forged_native FAIL native_claim_contradicted: claimed native but no compose_recall report with compose_native diff --git a/adapters/aien/evidence/task-scope-2026-10-08/receipt.json b/adapters/aien/evidence/task-scope-2026-10-08/receipt.json new file mode 100644 index 0000000..689481a --- /dev/null +++ b/adapters/aien/evidence/task-scope-2026-10-08/receipt.json @@ -0,0 +1,45 @@ +{ + "kind": "interplane-aien-fix-the-test-receipt", + "adapter_commit": "633ff074546db08812365c3a911b9890607acdfe", + "adapter_dirty": false, + "aien_cli_sha256": "a62a88b4a33b3805c3a95e6b56755a53aeb5cee22c60731a0bd8aef2632ee476", + "verifier_sha256": "1a6dffc2d8861333d35a7701cf04b2ff47bf94109776bb54feca9e4402772ab8", + "sovereign_core_rev": "UNVERIFIED", + "omega_lock": "UNVERIFIED", + "backend": "CPU reference (as printed in the daemon log)", + "task": { + "task_id": "fix-the-test/clamp-1", + "source_commit": "9ef63b953d9d5d3a97e41eca87ca5e846cd07061", + "tree_commit_after": "5211d0f432343f16b4cc4af90c9c85dc11fd348e", + "test_exit_before": 2, + "test_exit_after": 0, + "target_blob_sha256_before": "a13f814d50eb8ab97531f19a22726034ef3347ef233f8385863b397bf236a8f7", + "target_blob_sha256_after": "95bdc0c9571d94ecf70cfbef4ab2e34a499876f1839f0ca084be9941ae6536a2" + }, + "native": { + "claimed": true, + "omega_sha": "6c6180cf378075b61291f4565d226eba38b4decd" + }, + "native_label": "proven: daemon reports compose_native=true and the verifier checked the retained report", + "verdict": "PASS_LABELLED_INCOMPLETE missing=link:model_turn effect=aien-ledger-slice/1:strong proposal=scripted_turn", + "bundle_companion_sha256": "549eee392159d23a8667d35f486219fa3b473d69aeabfe1e28a4a80b206c7ff9", + "negative_checks": [ + "control PASS_LABELLED_INCOMPLETE missing=link:model_turn effect=aien-ledger-slice/1:strong proposal=scripted_turn", + "changed_exit_code FAIL test_run_mismatch: exit_code=1 (a fix must pass: exit 0)", + "swapped_stdout_digest FAIL test_run_mismatch: stdout_sha256 vs retained test_stdout", + "wrong_target_blob FAIL test_run_mismatch: target_blob_sha256_after vs ledger_ack.disk_sha256", + "dropped_test_run FAIL test_run_missing: task/source_pin/test_run_record present but no test_run section", + "tampered_source_pin FAIL source_pin_mismatch: source_pin.target_blob_sha256 vs ledger_grant.prior_sha256", + "write_outside_task_scope FAIL task_scope_mismatch: task.target_path=test/test_clamp.c vs ledger_grant.path=src/clamp.c", + "forged_native FAIL native_claim_contradicted: claimed native but no compose_recall report with compose_native" + ], + "started": "2026-10-08T20:19:08Z", + "finished": "2026-10-08T20:28:26Z", + "limits": [ + "the model turn is scripted: proposal authorship is not claimed", + "the test run is harness evidence, not a daemon effect; the daemon only wrote the file", + "records are unsigned exports; the verifier cannot tell an export from a hand-written file", + "desk MAC for ComposeAuthorize stays default-off (not changed here)", + "make exits 2 (not 1) on a failing recipe: the gate requires non-zero before and 0 after" + ] +} diff --git a/adapters/aien/scripts/demo-verified-fix.sh b/adapters/aien/scripts/demo-verified-fix.sh index 21f6d8e..a85de7f 100755 --- a/adapters/aien/scripts/demo-verified-fix.sh +++ b/adapters/aien/scripts/demo-verified-fix.sh @@ -122,7 +122,7 @@ trace_content_sha="$(jq -j ".[0].payload.arguments.content" "$r/interplane/trace t_before_exit="$(jq -r .task.test_exit_before "$rec")"; t_after_exit="$(jq -r .task.test_exit_after "$rec")" out_before_sha="$(jq -r .before.stdout_sha256 "$r/task/test-run.json")"; out_after_sha="$(jq -r .stdout_sha256 "$r/task/test-run.json")" [ "$out_after_sha" = "$(sha256sum "$r/task/test-stdout.txt" | cut -d' ' -f1)" ] || die "retained stdout digest != test-run record" -neg_n="$(jq '.negative_checks | length' "$rec")"; [ "$neg_n" -eq 7 ] || die "expected 7 negative checks (control + 6), got $neg_n" +neg_n="$(jq '.negative_checks | length' "$rec")"; [ "$neg_n" -eq 8 ] || die "expected 8 negative checks (control + 7), got $neg_n" rustc_v="$(rustc --version)" finished="$(date -u +%FT%TZ)" mf() { jq -r "$1" "$rec"; } @@ -215,7 +215,7 @@ This run: daemon $build_note; AIEN_OMEGA_COMPOSE_DIR/AIEN_PHYSICS_DIR/AIEN_AIENO - The approved write is bound to exact bytes: grant, intent and ack share one content digest, and the ack's on-disk digest equals it [O]. - The write went through the daemon's approved ledger (claim, grant, intent, ack, committed records retained) [O]. - Tests failed before and passed after; their stdout digests are retained and checked by the verifier [O]. -- The source pin matches the grant's prior_sha256; the native claim agrees with the daemon's own report; six tampers are each refused with their specific code [O]. +- The source pin matches the grant's prior_sha256; the native claim agrees with the daemon's own report; seven tampers are each refused with their specific code [O]. - The daemon was native (not a stub) by its own report, and its model/tokenizer hashes equal the files on disk [O]. ## 10. What is not proven diff --git a/adapters/aien/scripts/test-fix-the-test.sh b/adapters/aien/scripts/test-fix-the-test.sh index 3f98184..ca6b04e 100755 --- a/adapters/aien/scripts/test-fix-the-test.sh +++ b/adapters/aien/scripts/test-fix-the-test.sh @@ -104,6 +104,7 @@ fork stdout_digest; editrec "$neg/stdout_digest" test_run_record '.stdout_sha256 fork blob_after; editrec "$neg/blob_after" test_run_record '.target_blob_sha256_after = $o' --arg o "$other"; expect wrong_target_blob "$neg/blob_after" test_run_mismatch fork dropped; manifest "$neg/dropped" 'del(.test_run)'; expect dropped_test_run "$neg/dropped" test_run_missing fork pin; editrec "$neg/pin" source_pin '.target_blob_sha256 = $o' --arg o "$other"; expect tampered_source_pin "$neg/pin" source_pin_mismatch +fork scope; editrec "$neg/scope" task '.target_path = "test/test_clamp.c"'; expect write_outside_task_scope "$neg/scope" task_scope_mismatch fork forged_native if [ "$native_claimed" = "true" ]; then # a native claim whose evidence (the retained ComposeRecall report) is removed diff --git a/adapters/aien/src/fix_the_test.rs b/adapters/aien/src/fix_the_test.rs index 2dc1133..d4e61b9 100644 --- a/adapters/aien/src/fix_the_test.rs +++ b/adapters/aien/src/fix_the_test.rs @@ -78,8 +78,9 @@ fn copy_tree(from: &Path, to: &Path, skip: &[&str]) -> Result<(), String> { Ok(()) } -/// `task_id: x` and `test_command: a b c` lines of `TASK.md`. -fn parse_task(md: &str) -> Result<(String, Vec), String> { +/// `task_id: x`, `test_command: a b c` and `target_file: p` lines of `TASK.md`. `target_file` is the +/// one file the task allows the agent to change; it goes into the task record as `target_path`. +fn parse_task(md: &str) -> Result<(String, Vec, String), String> { let field = |k: &str| { md.lines() .find_map(|l| l.strip_prefix(k).map(|v| v.trim().to_string())) @@ -90,14 +91,21 @@ fn parse_task(md: &str) -> Result<(String, Vec), String> { .split_whitespace() .map(str::to_string) .collect(); - Ok((field("task_id:")?, argv)) + Ok((field("task_id:")?, argv, field("target_file:")?)) } /// Copy `fixture` (without `solution/` and `build/`) into `ws`, `git init` and commit it. pub fn prepare(fixture: &Path, ws: &Path) -> Result { - let (task_id, argv) = parse_task( + let (task_id, argv, target) = parse_task( &std::fs::read_to_string(fixture.join("TASK.md")).map_err(|e| format!("TASK.md: {e}"))?, )?; + // The scripted proposal writes TARGET. A task that allows a different file is refused here, + // before any proposal reaches the daemon. + if target != TARGET { + return Err(format!( + "TASK.md target_file {target} is not the scripted proposal target {TARGET}: refused" + )); + } let solution = std::fs::read_to_string(fixture.join("solution/clamp.c")) .map_err(|e| format!("solution/clamp.c: {e}"))?; copy_tree(fixture, ws, &["solution", "build"])?; @@ -172,7 +180,7 @@ pub fn evidence( let tree_commit_after = git(&p.ws, &["rev-parse", "HEAD"])?; let blob_after = sha256_hex(&std::fs::read(p.ws.join(TARGET)).map_err(|e| e.to_string())?); let task = json!({"kind": "vac-task", "task_id": p.task_id, "repo_commit": p.commit, - "test_cmd": p.argv}); + "test_cmd": p.argv, "target_path": TARGET}); let source_pin = json!({"kind": "vac-source-pin", "repo": "fix_the_test", "commit": p.commit, "target_path": TARGET, "target_blob_sha256": p.target_blob_sha256}); let test_run = json!({"kind": "vac-test-run", "v": 1, "task_id": p.task_id, "argv": p.argv, @@ -204,12 +212,16 @@ mod tests { #[test] fn task_fields_parse() { - let (id, argv) = parse_task("# T\n\ntask_id: a/b-1\ntest_command: make test\n").unwrap(); + let (id, argv, target) = + parse_task("# T\n\ntask_id: a/b-1\ntest_command: make test\ntarget_file: src/x.c\n") + .unwrap(); assert_eq!( - (id.as_str(), argv), - ("a/b-1", vec!["make".into(), "test".into()]) + (id.as_str(), argv, target.as_str()), + ("a/b-1", vec!["make".into(), "test".into()], "src/x.c") ); assert!(parse_task("task_id: x\n").is_err()); + // No target_file: the task does not say which file may change, so it is refused. + assert!(parse_task("task_id: x\ntest_command: make test\n").is_err()); } #[test] diff --git a/provenance/BINDING.md b/provenance/BINDING.md index d62f3f6..43e3d19 100644 --- a/provenance/BINDING.md +++ b/provenance/BINDING.md @@ -198,7 +198,7 @@ Retained records (named in `records`, raw files): | Record | Content | |---|---| -| `task` | `{kind: "vac-task", task_id, repo_commit, test_cmd: [argv...]}` | +| `task` | `{kind: "vac-task", task_id, repo_commit, test_cmd: [argv...], target_path}`; `target_path` is the one file the task allows to change (`target_file` in the fixture's `TASK.md`) | | `source_pin` | `{kind: "vac-source-pin", repo, commit, target_path, target_blob_sha256}`: the task's start commit and the SHA-256 of the target file before the fix | | `test_run_record` | `{kind: "vac-test-run", v: 1, task_id, argv, cwd_rel, exit_code, test_exit_before, stdout_sha256, stderr_sha256, started_unix_ms, duration_ms, tree_commit_after, target_blob_sha256_after}` | | `test_stdout`, `test_stderr` | the test command's output after the fix, byte for byte | @@ -214,15 +214,20 @@ and, when the daemon reports it, `"aien": {..., "native": {"claimed": bool, "ome silence); or the section's record, or `task`, is absent or not retained. 2. **`unsupported_test_run`**: `test_run.binding` is not `vac-test-run/1`, or the record's `kind`/`v` is not `vac-test-run`/`1`. -3. **`source_pin_mismatch`**: `source_pin.kind` is not `vac-source-pin`; `source_pin.target_path` differs +3. **`task_scope_mismatch`**: `task.target_path` is absent, or differs from the grant's `path`. Without + it, a run that rewrote the test file instead of the code would still verify. The task record is + written by the same harness as the bundle, so this binds the declared scope to the write; it does + not prove the declared scope equals the fixture's `TASK.md` (unsigned-export limit above). Bundles + captured before this check (no `target_path`) are refused with this code. +4. **`source_pin_mismatch`**: `source_pin.kind` is not `vac-source-pin`; `source_pin.target_path` differs from the grant's `path`; `source_pin.target_blob_sha256` differs from the grant's `prior_sha256` (null for a new file also fails); `source_pin.commit` differs from `task.repo_commit`. -4. **`test_run_mismatch`**: `task_id` differs between the section, the record and `task`; `argv` differs +5. **`test_run_mismatch`**: `task_id` differs between the section, the record and `task`; `argv` differs from `task.test_cmd`; `exit_code` is not 0 (the slice claims the test passes after the write); `test_exit_before` is 0 (nothing was fixed) or missing; `target_blob_sha256_after` differs from the ack's `disk_sha256` (the daemon's read-back) or the grant's `content_sha256`; `stdout_sha256` or `stderr_sha256` is not hex or differs from the retained `test_stdout`/`test_stderr`. -5. **`native_claim_contradicted`**: see below. +6. **`native_claim_contradicted`**: see below. ### Native claim, and what a missing one means diff --git a/provenance/fixtures/synthetic-fix-the-test/COMPANION.json b/provenance/fixtures/synthetic-fix-the-test/COMPANION.json index cad6f38..151f837 100644 --- a/provenance/fixtures/synthetic-fix-the-test/COMPANION.json +++ b/provenance/fixtures/synthetic-fix-the-test/COMPANION.json @@ -148,9 +148,9 @@ "sha256": "cf0b2d14eeeddf1f51342afd67402ee95212ca5bf41e7a355749cedaaade6ee4" }, "task": { - "bytes": 167, + "bytes": 199, "path": "records/task/task.json", - "sha256": "3ae07e71f1ca1a999de7a23e1e9b5516833258301137cad8aa83b14464d448ce" + "sha256": "b93c08fb41fdb0b9ae4d93df5c4d503549b68f5889c8f618d18432ebb37e2e48" }, "test_run_record": { "bytes": 574, diff --git a/provenance/fixtures/synthetic-fix-the-test/records/task/task.json b/provenance/fixtures/synthetic-fix-the-test/records/task/task.json index 0c9bc41..1e64203 100644 --- a/provenance/fixtures/synthetic-fix-the-test/records/task/task.json +++ b/provenance/fixtures/synthetic-fix-the-test/records/task/task.json @@ -1,6 +1,7 @@ { "kind": "vac-task", "repo_commit": "1111111111111111111111111111111111111111", + "target_path": "src/clamp.c", "task_id": "fix-the-test/clamp-1", "test_cmd": [ "make", diff --git a/provenance/src/synth.rs b/provenance/src/synth.rs index dba70f4..79af384 100644 --- a/provenance/src/synth.rs +++ b/provenance/src/synth.rs @@ -591,7 +591,7 @@ type ExtraFile = (&'static str, &'static str, Vec); fn fix_the_test(o: &Opts) -> (Vec, Value) { let task = pretty( &json!({"kind": "vac-task", "task_id": TASK_ID, "repo_commit": SOURCE_COMMIT, - "test_cmd": ["make", "test"]}), + "test_cmd": ["make", "test"], "target_path": "src/clamp.c"}), ); let pin = pretty( &json!({"kind": "vac-source-pin", "repo": "fix_the_test", "commit": SOURCE_COMMIT, diff --git a/provenance/src/testrun.rs b/provenance/src/testrun.rs index e97ba41..1d0643a 100644 --- a/provenance/src/testrun.rs +++ b/provenance/src/testrun.rs @@ -102,9 +102,27 @@ pub fn check(a: &Archive, m: &Value, ledger_checked: bool) -> Result<(), Fail> { return fail("unsupported_test_run", "record kind/v"); } let task = rec_json(a, "task", "test_run_missing")?; - let pin = rec_json(a, "source_pin", "source_pin_mismatch")?; let facts = ledger::facts(a)?; + // Task scope: the task names the one file it allows to change, and the grant must write that + // file. Without it a run that edited the test instead of the code would still verify. + match s(&task, &["target_path"]) { + Some(t) if t == facts.path => {} + Some(t) => { + return fail( + "task_scope_mismatch", + format!("task.target_path={t} vs ledger_grant.path={}", facts.path), + ) + } + None => { + return fail( + "task_scope_mismatch", + "task.target_path absent: the task does not say which file may change", + ) + } + } + let pin = rec_json(a, "source_pin", "source_pin_mismatch")?; + // Source pin: the commit the task starts from, and the exact target bytes the grant replaced. let pin_bad = |what: &str| -> Result<(), Fail> { fail("source_pin_mismatch", what) }; if s(&pin, &["kind"]) != Some(PIN_KIND) { diff --git a/provenance/tests/fix_the_test.rs b/provenance/tests/fix_the_test.rs index b482345..6a5e5bc 100644 --- a/provenance/tests/fix_the_test.rs +++ b/provenance/tests/fix_the_test.rs @@ -286,3 +286,24 @@ fn verifying_the_slice_changes_nothing() { let _ = verify(&d); assert_eq!(before, std::fs::read(d.join("COMPANION.json")).unwrap()); } + +#[test] +fn write_outside_the_task_target_is_a_task_scope_mismatch() { + // The task allows src/clamp.c; here it names the test file instead, so the grant's write + // (src/clamp.c) is not the file the task allows. The same check refuses a run whose grant + // writes the test file while the task names the code. + let d = scratch(FIX, "ftt-scope"); + edit(&d, "task", |v| { + v["target_path"] = json!("test/test_clamp.c") + }); + refused(&d, "task_scope_mismatch"); +} + +#[test] +fn task_without_a_target_path_is_a_task_scope_mismatch() { + let d = scratch(FIX, "ftt-scope-absent"); + edit(&d, "task", |v| { + v.as_object_mut().unwrap().remove("target_path"); + }); + refused(&d, "task_scope_mismatch"); +} ```