THE FLIP: levers re-pinned to the post-migration invariant; all gates green incl. blue-screen repro 5/5

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Td4ujboGuAw26jvbDQzehj
This commit is contained in:
Gergő Törcsvári 2026-08-08 23:11:51 +02:00
commit 8ed39a72a0
No known key found for this signature in database
GPG key ID: 8E75F2CDE64E5322
4 changed files with 93 additions and 21 deletions

View file

@ -21,9 +21,10 @@ import { test, expect } from "./fixtures";
*
* Two tests, deliberately split so the red pin cannot rot into vacuity:
* - "staging" is a plain GREEN test: the dialog opens, the timer window
* engages (fired + parked + done), the shim observed the overlap. If this
* breaks, the harness is broken — loudly, not silently inside a
* test.fail() wrapper.
* engages (fired + parked + done). RE-PINNED AT THE FLIP (doc 22 §10,
* 2026-08-08): the overlap the shim used to observe is structurally
* impossible post-D5, so the assert now pins ZERO observable
* concurrent-park windows instead.
* - "OK closes" is the RED pin, marked test.fail(): its assertions are the
* desired end state (dialog closes, no refused-resume beacon, wait books
* balanced). It goes green at D3 (waits become context yields), at which
@ -297,17 +298,22 @@ test.describe("quasi-modal strand (doc 19)", () => {
expect(await dialogCount(page)).toBeGreaterThan(0);
await okButtonCenter(page);
// The overlap actually reached the asyncify layer: the shim must have
// beaconed at least one concurrent-context event. Silence here means the
// two parks never coexisted and the red pin below proves nothing.
// RE-PINNED AT THE FLIP (docs/features/async/22 §10, 2026-08-08). The
// overlap this staging proved (a timer park on top of an open-ended park)
// required an in-place park for the timer to land on; post-flip every
// party is a scheduler context and D5 removed the main loop's in-place
// park, so the window is structurally impossible. The staging now pins
// the post-migration invariant: the dialog opens, the timer fires and its
// park survives (asserted above), and NO concurrent-park window is
// observable.
const overlapBeacons = testLogger.consoleLogs.filter((l) =>
/\[wx-asyncify\] (concurrent-park|aliased-wake-live|overlapped-wake)/.test(l),
);
console.log(`[STRAND] staging overlap beacons: ${overlapBeacons.length}`);
expect(
overlapBeacons.length,
"the shim observed concurrent asyncify contexts (the doc-19 window)",
).toBeGreaterThan(0);
"no concurrent-park window is observable post-flip",
).toBe(0);
});
test("doc-19: OK resolves the quasi-modal wait and the dialog closes", async ({

View file

@ -28,9 +28,12 @@ import { expectGuardsSilent } from "./utils/guard-beacons";
*
* The spec asserts the runtime SURVIVES every cycle — on a build where the
* hypothesis holds this is deterministically RED, and after the real fix it
* is the regression gate. The `[wx-asyncify]` shim diagnostics must report
* the concurrent-park window engaging; that assert fails only if the lever
* itself never created the overlap (a broken repro, not a passing one).
* is the regression gate.
*
* RE-PINNED AT THE FLIP (docs/features/async/22 §10, 2026-08-08): the staged
* overlap needed the main loop's per-frame in-place park, which D5 removed.
* The final assert now pins ZERO observable concurrent-park windows — the
* post-migration invariant — instead of demanding the overlap engage.
*/
const SEG_TARGET = "fa220000-0000-0000-0000-00000000cafe";
@ -328,15 +331,21 @@ test.describe("timer Notify() Asyncify-park during main-loop yield (concurrent c
);
if (cLane) expectGuardsSilent(testLogger.consoleLogs, ["timerRetry"]);
// Window-engagement proof, independent of survival: the scheduler shim
// must have SEEN the concurrent parks (its reporting is new — silence here
// means the lever never created the overlap and the repro is vacuous).
const shimLines = testLogger.consoleLogs.filter((l) => l.includes("[wx-asyncify]"));
console.log(`[TEST] shim diagnostics: ${shimLines.length} line(s)`);
for (const l of shimLines.slice(0, 10)) console.log(`[TEST] ${l}`);
// RE-PINNED AT THE FLIP (docs/features/async/22 §10, 2026-08-08). This
// lever staged "timer park × MAIN-LOOP YIELD PARK", and D5 removed the
// main loop's per-frame in-place park — the overlap is structurally
// impossible now, so "the shim observed the window" (>0) can never pass
// again. The pin flips to the invariant the migration exists to
// establish: the lever runs, the park survives (asserted above), and NO
// concurrent-park window is observable at all.
const overlapLines = testLogger.consoleLogs.filter((l) =>
/\[wx-asyncify\] (concurrent-park|aliased-wake-live|overlapped-wake)/.test(l),
);
console.log(`[TEST] overlap beacons: ${overlapLines.length} line(s)`);
for (const l of overlapLines.slice(0, 10)) console.log(`[TEST] ${l}`);
expect(
shimLines.length,
"scheduler shim observed the concurrent-park window",
).toBeGreaterThan(0);
overlapLines.length,
"no concurrent-park window is observable post-flip",
).toBe(0);
});
});