interplane.Get Omega
Read in your language

interplane-mv

INTERPLANE: open interoperability protocol between AI models and agent runtimes. Models express intent. Runtimes retain authority.

Brought by drakestapleton

GitHub aien-dev/interplane-mv#90 (code only)

closed derived a1e666612f036f30 #90

Imported from GitHub aien-dev/interplane-mv#90 (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 dc37ca3e5948945bf4619c015b6c817a0c0920a0 · Head d0839c32e81c94cb80c4e97190f4d772e91c6284

Apply it

git checkout -b patch-a1e666612f036f30 dc37ca3e5948945bf4619c015b6c817a0c0920a0
curl -fsSL https://interplane.io/drakestapleton/interplane-mv/patches/a1e666612f036f30.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
90
d0839c32e81c94cb80c4e97190f4d772e91c6284
{"kind":"github-import","owner":"aien-dev","repo":"interplane-mv","number":90,"url":"https://github.com/aien-dev/interplane-mv/pull/90","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:40:13Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/adapters/aien/src/fix_the_test.rs b/adapters/aien/src/fix_the_test.rs
index ebae50b..5b7ff77 100644
--- a/adapters/aien/src/fix_the_test.rs
+++ b/adapters/aien/src/fix_the_test.rs
@@ -221,10 +221,55 @@ pub fn evidence(
     })
 }
 
+/// The `daemon` block of a harness-written row receipt, with no absolute paths: `log` and `home`
+/// are relative to the row's root, and `aien_bin` is the file name only (the binary's digest is
+/// recorded in the exported records). The daemon's own records are digest-bound and are never
+/// rewritten; only this harness-side block is redacted.
+pub fn receipt_daemon(
+    root: &Path,
+    log: &Path,
+    home: &Path,
+    start_ms: u128,
+    aien_bin: Option<&str>,
+) -> Value {
+    let rel = |p: &Path| -> String {
+        match p.strip_prefix(root) {
+            Ok(r) => r.display().to_string(),
+            Err(_) => p
+                .file_name()
+                .map(|n| n.to_string_lossy().into_owned())
+                .unwrap_or_default(),
+        }
+    };
+    json!({"log": rel(log), "home": rel(home), "start_ms": start_ms,
+        "aien_bin": aien_bin.map(|b| Path::new(b).file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_default())})
+}
+
 #[cfg(test)]
 mod tests {
     use super::*;
 
+    #[test]
+    fn receipt_daemon_block_has_no_absolute_paths() {
+        let root = Path::new("/home/someone/out/rows/slice1");
+        let v = receipt_daemon(
+            root,
+            &root.join("daemon.log"),
+            &root.join("compose"),
+            7,
+            Some("/home/someone/bin/aien-cli"),
+        );
+        assert_eq!(v["log"], "daemon.log");
+        assert_eq!(v["home"], "compose");
+        assert_eq!(v["aien_bin"], "aien-cli");
+        assert_eq!(v["start_ms"], 7);
+        // A path outside the root is reduced to its file name, never kept absolute.
+        let o = receipt_daemon(root, Path::new("/var/x/d.log"), root, 0, None);
+        assert_eq!(o["log"], "d.log");
+        assert!(!o.to_string().contains("/home/") && !o.to_string().contains("/var/"));
+        assert!(o["aien_bin"].is_null());
+    }
+
     fn fixture() -> PathBuf {
         Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/fix_the_test")
     }
diff --git a/adapters/aien/tests/compose_ledger.rs b/adapters/aien/tests/compose_ledger.rs
index 4cc0dfb..ea870aa 100644
--- a/adapters/aien/tests/compose_ledger.rs
+++ b/adapters/aien/tests/compose_ledger.rs
@@ -216,8 +216,13 @@ fn records(c: &LedgerClient, ids: &[u64]) -> Vec<Value> {
 fn save(d: &Daemon, row: &str, mut v: Value) {
     v["row"] = json!(row);
     v["boundary"] = json!(LEDGER_BOUNDARY);
-    v["daemon"] = json!({"log": d.log, "home": d.root.join("compose"), "start_ms": d.started_ms,
-        "aien_bin": std::env::var("AIEN_BIN").ok()});
+    v["daemon"] = interplane_adapter_aien::fix_the_test::receipt_daemon(
+        &d.root,
+        &d.log,
+        &d.root.join("compose"),
+        d.started_ms,
+        std::env::var("AIEN_BIN").ok().as_deref(),
+    );
     std::fs::write(
         d.root.join("receipt.json"),
         serde_json::to_vec_pretty(&v).unwrap(),
diff --git a/adapters/aien/tests/compose_ledger_attacks.rs b/adapters/aien/tests/compose_ledger_attacks.rs
index c586e40..16e3c4e 100644
--- a/adapters/aien/tests/compose_ledger_attacks.rs
+++ b/adapters/aien/tests/compose_ledger_attacks.rs
@@ -211,8 +211,13 @@ fn records(c: &LedgerClient, ids: &[u64]) -> Vec<Value> {
 fn save(d: &Daemon, row: &str, mut v: Value) {
     v["row"] = json!(row);
     v["boundary"] = json!(LEDGER_BOUNDARY);
-    v["daemon"] = json!({"log": d.log, "home": d.root.join("compose"), "start_ms": d.started_ms,
-        "aien_bin": std::env::var("AIEN_BIN").ok()});
+    v["daemon"] = interplane_adapter_aien::fix_the_test::receipt_daemon(
+        &d.root,
+        &d.log,
+        &d.root.join("compose"),
+        d.started_ms,
+        std::env::var("AIEN_BIN").ok().as_deref(),
+    );
     std::fs::write(
         d.root.join("receipt.json"),
         serde_json::to_vec_pretty(&v).unwrap(),
diff --git a/provenance/BINDING.md b/provenance/BINDING.md
index 2240e2a..3f0def6 100644
--- a/provenance/BINDING.md
+++ b/provenance/BINDING.md
@@ -226,7 +226,7 @@ and, when the daemon reports it, `"aien": {..., "native": {"claimed": bool, "ome
    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`.
+   `stderr_sha256` is not hex, differs from the retained `test_stdout`/`test_stderr`, or the record is absent or labelled not retained (a claimed digest needs the bytes it names).
 6. **`native_claim_contradicted`**: see below.
 
 ### Native claim, and what a missing one means
diff --git a/provenance/src/testrun.rs b/provenance/src/testrun.rs
index 1d0643a..2414d7d 100644
--- a/provenance/src/testrun.rs
+++ b/provenance/src/testrun.rs
@@ -172,13 +172,17 @@ pub fn check(a: &Archive, m: &Value, ledger_checked: bool) -> Result<(), Fail> {
         let Some(d) = s(&run, &[field]).filter(|d| is_hex64(d)) else {
             return bad(field);
         };
-        // The retained output (when kept) must be the output the digest names.
-        if a.has(record) {
-            if a.bytes(record)?.is_some() && a.sha(record)? != d {
-                return bad(&format!("{field} vs retained {record}"));
-            }
-        } else if field == "stdout_sha256" {
-            return bad("test_stdout record absent");
+        // A claimed digest must be backed by retained bytes that hash to it. A missing entry, or
+        // one labelled not retained, would otherwise let any 64-hex value pass.
+        if !a.has(record) {
+            return bad(&format!(
+                "{record} record absent: {field} has nothing to match"
+            ));
+        }
+        match a.bytes(record)? {
+            None => return bad(&format!("{record} not retained: {field} cannot be checked")),
+            Some(_) if a.sha(record)? != d => return bad(&format!("{field} vs retained {record}")),
+            Some(_) => {}
         }
     }
     check_native(a, m)
diff --git a/provenance/tests/fix_the_test.rs b/provenance/tests/fix_the_test.rs
index 6a5e5bc..23909b8 100644
--- a/provenance/tests/fix_the_test.rs
+++ b/provenance/tests/fix_the_test.rs
@@ -307,3 +307,67 @@ fn task_without_a_target_path_is_a_task_scope_mismatch() {
     });
     refused(&d, "task_scope_mismatch");
 }
+
+#[test]
+fn stderr_digest_claimed_but_stderr_file_missing_is_refused() {
+    let d = scratch(FIX, "ftt-stderr-missing");
+    let p = path_of(&d, "test_stderr");
+    std::fs::remove_file(&p).unwrap();
+    // Drop the record entry too: the digest alone must not pass.
+    let mut c = companion(&d);
+    let recs = c["records"].as_object_mut().expect("records object");
+    recs.remove("test_stderr");
+    write_companion(&d, &c);
+    refused(&d, "test_run_mismatch");
+}
+
+#[test]
+fn stderr_digest_claimed_but_stderr_not_retained_is_refused() {
+    let d = scratch(FIX, "ftt-stderr-unretained");
+    let mut c = companion(&d);
+    let r = &mut c["records"]["test_stderr"];
+    r.as_object_mut().unwrap().remove("path");
+    r["retained"] = json!(false);
+    c["completeness"]["missing"]
+        .as_array_mut()
+        .unwrap()
+        .push(json!("record:test_stderr"));
+    write_companion(&d, &c);
+    refused(&d, "test_run_mismatch");
+}
+
+#[test]
+fn stderr_altered_by_one_byte_is_refused() {
+    let d = scratch(FIX, "ftt-stderr-flip");
+    let p = path_of(&d, "test_stderr");
+    let mut b = std::fs::read(&p).unwrap();
+    if b.is_empty() {
+        b.push(b'x');
+    } else {
+        b[0] ^= 1;
+    }
+    std::fs::write(&p, b).unwrap();
+    restamp(&d, "test_stderr");
+    refused(&d, "test_run_mismatch");
+}
+
+#[test]
+fn intact_stderr_still_passes() {
+    let d = scratch(FIX, "ftt-stderr-ok");
+    assert!(code(&d).starts_with("PASS_LABELLED_INCOMPLETE"));
+}
+
+#[test]
+fn stdout_digest_claimed_but_stdout_not_retained_is_refused() {
+    let d = scratch(FIX, "ftt-stdout-unretained");
+    let mut c = companion(&d);
+    let r = &mut c["records"]["test_stdout"];
+    r.as_object_mut().unwrap().remove("path");
+    r["retained"] = json!(false);
+    c["completeness"]["missing"]
+        .as_array_mut()
+        .unwrap()
+        .push(json!("record:test_stdout"));
+    write_companion(&d, &c);
+    refused(&d, "test_run_mismatch");
+}