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#92 (code only)
Apply it
git checkout -b patch-8e046dec4f17f7e7 97a37ee7fba60836d78a4f4e5320b51ee85c820e curl -fsSL https://interplane.io/drakestapleton/interplane-mv/patches/8e046dec4f17f7e7.patch | git am
Provenance
github-import 1
aien-dev/interplane-mv
92
ee6501884a34b2e9cbee8a580f183470f92387b7
{"kind":"github-import","owner":"aien-dev","repo":"interplane-mv","number":92,"url":"https://github.com/aien-dev/interplane-mv/pull/92","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:40:14Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/provenance/tests/common/mod.rs b/provenance/tests/common/mod.rs index 9161d4a..dc30ef1 100644 --- a/provenance/tests/common/mod.rs +++ b/provenance/tests/common/mod.rs @@ -4,7 +4,9 @@ use interplane_provenance::gojson::{sha256_hex, waldo_sha256}; use serde_json::{json, Value}; +use std::collections::BTreeSet; use std::path::{Path, PathBuf}; +use std::sync::Mutex; pub fn copy_dir(from: &Path, to: &Path) { std::fs::create_dir_all(to).unwrap(); @@ -19,7 +21,16 @@ pub fn copy_dir(from: &Path, to: &Path) { } } +/// A fresh copy of `fixture` under its own scratch directory. Tests in one binary run on parallel +/// threads, so two tests sharing a name would delete and refill each other's copy mid-check +/// (interplane main run 37932804024: a stray `missing_record`). A name may be claimed once per +/// test binary; a second claim panics, so a clash fails every run instead of some runs. pub fn scratch(fixture: &str, name: &str) -> PathBuf { + static CLAIMED: Mutex<BTreeSet<String>> = Mutex::new(BTreeSet::new()); + assert!( + CLAIMED.lock().unwrap().insert(name.to_string()), + "scratch name {name} is already used by another test in this binary" + ); let d = Path::new(env!("CARGO_TARGET_TMPDIR")) .join("verdicts") .join(name); diff --git a/provenance/tests/recovery_verdicts.rs b/provenance/tests/recovery_verdicts.rs index a3b746a..616cfb6 100644 --- a/provenance/tests/recovery_verdicts.rs +++ b/provenance/tests/recovery_verdicts.rs @@ -118,7 +118,7 @@ fn test_records_without_a_section_on_an_unlanded_effect_are_still_refused_as_suc #[test] fn an_unknown_ack_state_is_still_a_generic_mismatch() { for s in ["OPEN", "done", "WRITTEN"] { - let d = scratch(REAL, &format!("m4d-real-{s}")); + let d = scratch(REAL, &format!("m4d-real-unknown-{s}")); set_state(&d, s); let v = verify(&d); assert_eq!(v, format!("FAIL binding_mismatch: ledger_ack.state={s}")); diff --git a/provenance/tests/review_hardening.rs b/provenance/tests/review_hardening.rs index 01f1105..238c41f 100644 --- a/provenance/tests/review_hardening.rs +++ b/provenance/tests/review_hardening.rs @@ -69,7 +69,7 @@ fn a_duplicate_key_inside_a_ledger_note_is_refused() { #[test] fn test_material_never_verifies_as_complete() { - for (class, want) in [ + for (i, (class, want)) in [ ( json!("synthetic"), "FAIL synthetic_complete: fixture.class=synthetic", @@ -79,8 +79,11 @@ fn test_material_never_verifies_as_complete() { "FAIL synthetic_complete: fixture.class=staged", ), (json!(null), "FAIL malformed_companion: fixture.class"), - ] { - let d = scratch(REAL, "fixture_class"); + ] + .into_iter() + .enumerate() + { + let d = scratch(REAL, &format!("fixture_class_{i}")); let mut c = companion(&d); c["fixture"]["class"] = class; write_companion(&d, &c);