Skip to content

Commit 3646c6e

Browse files
committed
test(lib): repoint the reasoning-replay-scope oracle at the bridge leaves
tests/lib/reasoning-replay-scope-source.test.ts reads bridge source as text and pins two declarations of `const replayCacheScope = options?.replayCacheScope;`. After the facade split one lives in src/bridge/sse.ts and the other in src/bridge/response-json.ts, so reading the facade matched nothing and the assertion failed on null. Read both leaves and keep the count at 2. This oracle was missed when the split was planned. The audit searched tests/ for the literal `src/bridge.ts`, but this test composes the path from a relative fragment: `repoPath("src", ...relative.split("/"))` called with `"bridge.ts"`. A literal search cannot see that. The replacement check resolves every string literal in a test that reads files, against the real src tree, which finds the composed form too.
1 parent 3c6cf21 commit 3646c6e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎tests/lib/reasoning-replay-scope-source.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ describe("reasoning replay scope propagation", () => {
2929
});
3030

3131
test("bridge, adapter, and cache contain no process-wide fallback", () => {
32-
const bridge = source("bridge.ts");
32+
// src/bridge.ts is a facade now. The two declarations this pins moved into different
33+
// leaves -- one into the SSE path, one into the JSON builder -- so reading the facade
34+
// alone matches nothing and toHaveLength(2) fails on null. Read both leaves and keep
35+
// the count at 2, which is what the invariant has always been: each bridge entry point
36+
// binds the caller scope holder and neither falls back to a process-wide scope.
37+
const bridge = `${source("bridge/sse.ts")}\n${source("bridge/response-json.ts")}`;
3338
const adapter = source("adapters/openai-chat/messages.ts");
3439
const cache = source("responses/reasoning-replay-cache.ts");
3540
expect(bridge.match(/const replayCacheScope = options\?\.replayCacheScope;/g)).toHaveLength(2);

0 commit comments

Comments
 (0)