Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test: the in-pass confirm and narrowing suites start each pass without a kept cross-pass read

garrytane0f6ad3a3e19
diff --git a/test/sync-pass-confirm-6712.test.ts b/test/sync-pass-confirm-6712.test.ts
index 1ca5f53f32..aac58df416 100644
--- a/test/sync-pass-confirm-6712.test.ts
+++ b/test/sync-pass-confirm-6712.test.ts
@@ -26,6 +26,7 @@ import { installFaultHook } from '../src/core/persistence/fault-points.ts';
import { submitPageMutation } from '../src/core/persistence/page-mutations.ts';
import { readGitHold, SYNC_IMPORT_PROVENANCE_OP, writeGitHold } from '../src/core/persistence/sync-holds.ts';
import { performManagedSync } from '../src/core/persistence/sync-run.ts';
+import { __resetTreeReuseForTests } from '../src/core/persistence/sync-tree-reuse.ts';
import { RECOVERY_VERSION } from '../src/core/markdown.ts';
import { managedBrain } from './helpers/managed-brain.ts';
import { testBackends } from './helpers/test-backends.ts';
@@ -63,6 +64,8 @@ async function pass(engine: BrainEngine, between: () => Promise<void> = async ()
if (point === 'sync:level_read') verdicts.push({ round: detail.round!, confirm: detail.level?.confirm ?? null });
});
try {
+ // These are one pass's own rounds: round 1 reads whole, as in a new process (GBRA-133 cross-pass reuse is test/sync-level-reuse-across-gbra133.test.ts).
+ __resetTreeReuseForTests();
const result = await performManagedSync(engine, OPTS);
return { status: result.status, held: (result.held ?? []).map(hold => [hold.path, hold.code]), verdicts };
} finally { installFaultHook(undefined); }
diff --git a/test/sync-pass-narrow-6712.test.ts b/test/sync-pass-narrow-6712.test.ts
index f425c9857a..d120928026 100644
--- a/test/sync-pass-narrow-6712.test.ts
+++ b/test/sync-pass-narrow-6712.test.ts
@@ -27,6 +27,7 @@ import { writeOriginDeletedMarker } from '../src/core/persistence/sync-markers.t
import { waitFor } from './helpers/wait-for.ts';
import { readShadowLevel, type ShadowLevel } from '../src/core/persistence/sync-pass.ts';
import { performManagedSync } from '../src/core/persistence/sync-run.ts';
+import { __resetTreeReuseForTests } from '../src/core/persistence/sync-tree-reuse.ts';
import { mixSetup, seedMix } from '../scripts/bench/sync-convergence-seeded.ts';
import { rebuildPendingPageProjections } from '../src/core/page-state/projections.ts';
import { dropOriginIndex } from './helpers/origin-index.ts';
@@ -109,6 +110,8 @@ async function compared(engine: BrainEngine, { force = false, also }: { force?:
open: narrowed.paths.filter(entry => entry.state.openWork).map(entry => entry.path) });
};
try {
+ // These are one pass's own rounds: round 1 reads whole, as in a new process (GBRA-133 cross-pass reuse is test/sync-level-reuse-across-gbra133.test.ts).
+ __resetTreeReuseForTests();
const result = await performManagedSync(engine, OPTS);
expect(mismatches).toEqual([]);
return { status: result.status, rounds, confirms };