interplane.Get Omega
Read in your language

aien-sovereign-core-mv

AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.

Brought by drakestapleton

GitHub aien-dev/aien-sovereign-core-mv#907 (code only)

closed derived b6b0396690c5321a #907

Imported from GitHub aien-dev/aien-sovereign-core-mv#907 (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 2ef3e06c2a7b6c7498d7550cb0de6133129ed49a · Head e9e36e24f0bd939d62f2476c3777ccfce221adf3

Apply it

git checkout -b patch-b6b0396690c5321a 2ef3e06c2a7b6c7498d7550cb0de6133129ed49a
curl -fsSL https://interplane.io/drakestapleton/aien-sovereign-core-mv/patches/b6b0396690c5321a.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/aien-sovereign-core-mv
907
e9e36e24f0bd939d62f2476c3777ccfce221adf3
{"kind":"github-import","owner":"aien-dev","repo":"aien-sovereign-core-mv","number":907,"url":"https://github.com/aien-dev/aien-sovereign-core-mv/pull/907","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:38:15Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/tools/aien-test/src/judge_once_tests.rs b/tools/aien-test/src/judge_once_tests.rs
index 3525df85..c8783de2 100644
--- a/tools/aien-test/src/judge_once_tests.rs
+++ b/tools/aien-test/src/judge_once_tests.rs
@@ -501,3 +501,43 @@ fn a_listed_directory_puts_its_names_in_the_key_not_its_bytes() {
     fx.commit("crates/b/tests/two.rs", "z\n");
     assert_ne!(digest(), d0, "a new test target");
 }
+
+// ---- direct runs (#517) -------------------------------------------------
+
+/// The options a direct `aien-test run` gives the checkout: one evidence
+/// store for every commit (`default_evidence_dir`), no cross-head store.
+fn direct(fx: &Fx, pins: Value) -> Outcome {
+    let mut o = fx.opts();
+    o.evidence_dir = fx.ev.path().join("direct");
+    o.shared_cache = None;
+    o.pins = pins;
+    runner::run_gate(fx.repo.path(), &fx.repo.path().join("tests/a.gate"), &o).unwrap()
+}
+
+#[test]
+fn a_direct_run_reuses_only_a_receipt_made_for_the_same_tree() {
+    let fx = Fx::new(PASS, 1, "");
+    direct(&fx, runner::direct_pins(fx.repo.path()).unwrap());
+    assert_eq!(fx.runs(), 1);
+    // An undeclared file changes (SC-TEST reads the root README.md): it runs again.
+    fx.commit("README", "other head\n");
+    let second = direct(&fx, runner::direct_pins(fx.repo.path()).unwrap());
+    assert_eq!((fx.runs(), reused(&second)), (2, None));
+    // The same tree under a new commit (a re-push) reuses.
+    let h2 = fx.head();
+    fx.same_tree_commit();
+    let third = direct(&fx, runner::direct_pins(fx.repo.path()).unwrap());
+    assert_eq!(fx.runs(), 2);
+    assert_eq!(reused(&third).map(|r| r.1), Some(h2.as_str()));
+}
+
+#[test]
+fn without_the_tree_a_direct_run_would_reuse_an_older_commit() {
+    // The red half: the key alone (no tree) lets the README change through.
+    let fx = Fx::new(PASS, 1, "");
+    direct(&fx, Value::Array(vec![]));
+    fx.commit("README", "other head\n");
+    let second = direct(&fx, Value::Array(vec![]));
+    assert_eq!(fx.runs(), 1);
+    assert!(reused(&second).is_some());
+}
diff --git a/tools/aien-test/src/main.rs b/tools/aien-test/src/main.rs
index 6135dfa0..eba64193 100644
--- a/tools/aien-test/src/main.rs
+++ b/tools/aien-test/src/main.rs
@@ -108,6 +108,15 @@ fn options(cli: &Cli, root: &Path) -> Result<Options, i32> {
     // plain `run` never lifts an operator gate.
     opts.operator = cli.operator;
     opts.cargo_target_dir = std::env::var_os("CARGO_TARGET_DIR").map(PathBuf::from);
+    // One evidence store serves every commit of this checkout, so the tree is
+    // in every cache key (#517). Without it, no reuse at all.
+    match runner::direct_pins(root) {
+        Ok(p) => opts.pins = p,
+        Err(e) => {
+            eprintln!("aien-test: cache off, cannot read the tree id ({e})");
+            opts.no_cache = true;
+        }
+    }
     Ok(opts)
 }
 
diff --git a/tools/aien-test/src/runner.rs b/tools/aien-test/src/runner.rs
index 9ba5746c..527f605c 100644
--- a/tools/aien-test/src/runner.rs
+++ b/tools/aien-test/src/runner.rs
@@ -226,6 +226,19 @@ pub fn head_tree(root: &Path) -> Result<String, String> {
     }
 }
 
+/// The cache pins of a direct run (`aien-test run`, `test`, `plan`, `why`
+/// from a checkout). Its evidence store is one per repository
+/// (`default_evidence_dir`), shared by every commit, and a gate may read
+/// files it does not declare (SC-TEST reads the root README.md). So the
+/// checkout's tree is part of every key: a receipt is reused only by a head
+/// whose files are all identical, a re-push or a squash merge of an
+/// up-to-date PR (#517). The worker keeps evidence per head and sets its own
+/// pins; reuse by declared inputs alone is its cross-head store's job
+/// (`cache::cross_head`).
+pub fn direct_pins(root: &Path) -> Result<Value, String> {
+    Ok(json!([{ "name": "head-tree", "tree": head_tree(root)? }]))
+}
+
 fn porcelain(root: &Path) -> Result<String, String> {
     git_out(root, &["status", "--porcelain"])
 }