diff --git a/TODOS.md b/TODOS.md index 553a9724e..9e908ad4d 100644 --- a/TODOS.md +++ b/TODOS.md @@ -2418,6 +2418,22 @@ by shard parallelism; the per-file wall cost remains. **Where:** test/gstack-gbrain-detect-mcp-mode.test.ts. **Effort:** S (human ~2h, CC ~15min). +### P2: plan-design-review scope-gate detector is marginal under CI contention + +**What:** `plan-design-review reaches a terminal outcome outside plan mode` +(test/skill-e2e-plan-mode-no-op.test.ts) intermittently fails ONLY the +`scopeGateQuestionObserved` check on unchanged code — PR #2593 CI: failed +rounds 3/11 + one rerun, passed rounds 5/6, all attempts reaching a terminal +outcome with no plan-mode leak. Hypothesis: the PTY detector anchors on a +render shape that scrolls out or gets rephrased under 40-way in-shard +contention. The assertion now throws WITH the last-2KB evidence tail, so the +next CI failure carries the screen contents; fix the detector (scan full +scrollback, or widen the anchored shape) from that data. + +**Where:** test/helpers/claude-pty-runner.ts (scopeGateQuestionObserved +detector), test/skill-e2e-plan-mode-no-op.test.ts. +**Effort:** S (human ~3h, CC ~20min + one CI round with evidence). + ### P3: Diagnose the browser-manager-unit wedge on windows-latest **What:** The expanded Windows lane wedges to its wall deadline inside diff --git a/test/skill-e2e-plan-mode-no-op.test.ts b/test/skill-e2e-plan-mode-no-op.test.ts index c69428129..bfc18d6f6 100644 --- a/test/skill-e2e-plan-mode-no-op.test.ts +++ b/test/skill-e2e-plan-mode-no-op.test.ts @@ -99,7 +99,21 @@ describeE2E('plan-mode-info no-op outside plan mode (gate regression)', () => { // outcome === 'asked' would let a silent-bypass run that reaches // plan_ready (isPlanReadyVisible also matches common prose) sail // through — the exact regression this test exists to catch. - expect(obs.scopeGateQuestionObserved ?? false).toBe(true); + // + // Throw WITH the evidence tail instead of a bare expect: this member + // (plan-design-review especially) intermittently fails ONLY this + // check on unchanged code (PR #2593 rounds 3/11/rerun, passing + // rounds 5/6), and a bare Expected-true/Received-false in CI logs is + // undiagnosable — we can't tell a detector-sensitivity miss (render + // shape scrolled/rephrased) from a real silent bypass without seeing + // what the screen held. + if (!(obs.scopeGateQuestionObserved ?? false)) { + throw new Error( + `scope-gate question NOT observed (${skillName}): outcome=${obs.outcome}\n` + + `elapsed: ${obs.elapsedMs}ms\n` + + `--- evidence (last 2KB visible) ---\n${obs.evidence}`, + ); + } } }, 360_000); }