Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(memory): make the direct-engine ratchet's non-vacuity test satisfiable\n\n`direct_reference_scanner_is_not_vacuous` asserted `found.len() > 20` while\nALLOWED held exactly 20 entries. Because `no_new_files_call_the_engine_directly`\nand `allowlist_has_no_stale_entries` together force `found == allowed`, that\nmade the assertion `20 > 20` — unsatisfiable on main, so the test fails today\nand would keep failing for every migration that shrinks the list further.\n\nThe literal was also the wrong shape for a ratchet whose whole purpose is to\ndrain to zero: every migration would have had to hand-edit it, and the last one\nwould have had to delete it.\n\nPin the assertion to the allowlist instead. The real vacuity risk is `scan()`\nsilently returning nothing — a broken walk, a moved `src/`, a needle that\nstopped matching — which would turn the forward ratchet into a rubber stamp.\nThat is now expressed directly, in both directions, and it stays true as the\nlist drains. The `memory/mod.rs` canary is kept but made conditional on that\nfile still being listed, so the final migration is not a failure.\n\n

Shanu76e3732d8a38
diff --git a/src/openhuman/memory/direct_engine_refs_tests.rs b/src/openhuman/memory/direct_engine_refs_tests.rs
index d5d8d19b85..7a6ad49617 100644
--- a/src/openhuman/memory/direct_engine_refs_tests.rs
+++ b/src/openhuman/memory/direct_engine_refs_tests.rs
@@ -471,15 +471,39 @@ fn render(paths: impl IntoIterator<Item = String>) -> String {
#[test]
fn direct_reference_scanner_is_not_vacuous() {
let found = scan();
+ let allowed = allowed_set();
+
+ // The canary only holds while the allowlist still names it. Asserting it
+ // unconditionally would turn the last migration in this file into a
+ // failure, which is backwards: draining the list is the goal.
+ if allowed.contains("src/openhuman/memory/mod.rs") {
+ assert!(
+ found.contains("src/openhuman/memory/mod.rs"),
+ "scanner found no direct engine reference in memory/mod.rs, which is the re-export \
+ block; the scanner is broken"
+ );
+ }
+
+ // The real vacuity risk is `scan()` silently returning nothing — a broken
+ // walk, a moved `src/`, a needle that stopped matching — which would turn
+ // `no_new_files_call_the_engine_directly` into a rubber stamp. Pin it to
+ // the allowlist rather than to a literal, so the assertion stays true as
+ // the list drains instead of having to be hand-edited on every migration.
+ //
+ // It was a literal (`found.len() > 20`) until 2026-08-31, by which point
+ // ALLOWED itself had shrunk to exactly 20 — and because the two difference
+ // tests below force `found == allowed`, `20 > 20` made this test
+ // unsatisfiable on `main`. A ratchet that cannot pass is not a ratchet.
assert!(
- found.contains("src/openhuman/memory/mod.rs"),
- "scanner found no direct engine reference in memory/mod.rs, which is the re-export block; \
- the scanner is broken"
+ !allowed.is_empty() || found.is_empty(),
+ "the allowlist is empty but the scanner still found {} file(s): {}",
+ found.len(),
+ render(found.iter().cloned())
);
assert!(
- found.len() > 20,
- "scanner found only {} files; expected the full direct-reference surface",
- found.len()
+ allowed.is_empty() || !found.is_empty(),
+ "scanner found nothing while the allowlist still names {} file(s); the scanner is broken",
+ allowed.len()
);
}