fix: address Copilot review round 6
The nesting rule in AGENTS.md was written backwards. "Never nest a budget inside an equal-or-larger one" forbids the two arrangements this PR deliberately ships (5s inside 15s, 15s inside 25s) and permits the broken one it exists to prevent. It now says what it means: an inner budget must be strictly smaller than the budget enclosing it, arranged by raising the outer rather than shrinking the inner, since the inner is the bound carrying the useful diagnostic. The retry scan is structural now rather than a regex. A character class cannot step over a chain argument containing nested parentheses, so `it.each([makeCase()])` and `it.skipIf(() => isWindows())` were silently skipped — the second blind spot of the same kind in two rounds, which is what makes the pattern the wrong tool. A bracket matcher that skips string literals handles both, and the positional requirement that keeps fixture data and `client.retry` out of the results is unchanged. Seven positive forms and six false-positive shapes are pinned. The asyncUtilTimeout check read only the first configure() call, so a file holding the expected call followed by an overriding one passed while its effective timeout was something else. Every call is inspected and all of them must agree, which is stricter than checking the last and gives a message naming the offending value. Also corrected two PR-description bullets that still described superseded behavior: the cli child timer stays at 15_000 with the test raised to 25_000, and AppRenderer's waitFor keeps its 5000 rather than losing it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PsmUAZ6aLUAFqenjJKSSRp Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
f4d5b6a292
commit
1b7ff72e8d
1 changed files with 193 additions and 25 deletions
15
AGENTS.md
15
AGENTS.md
|
|
@ -431,11 +431,16 @@ free to run a full `local:gate`). Raising a budget nobody chose hides no race.
|
|||
exactly those tests and starves the worker pool. Measure before raising a
|
||||
budget that a passing test can spend in full; the call-site comment records
|
||||
the three-arm run.
|
||||
- **Never nest a budget inside an equal-or-larger one.** `waitFor({ timeout: N })`
|
||||
inside a test whose own budget is `N` can never win, and it reports as a
|
||||
timeout naming neither the wait nor its subject (#2292). Two bounds on the
|
||||
same work must differ, and the one carrying the useful diagnostic must be the
|
||||
tighter (`clients/cli/__tests__/e2e.test.ts`).
|
||||
- **An inner budget must be strictly smaller than the budget enclosing it.**
|
||||
`waitFor({ timeout: N })` inside a test whose own budget is `N` can never win:
|
||||
the test expires first and reports a timeout naming neither the wait nor its
|
||||
subject (#2292). So when two bounds cover the same work they must differ, and
|
||||
the **inner** one — the one carrying the useful diagnostic — has to be the
|
||||
tighter, which is arranged by raising the outer rather than shrinking the
|
||||
inner. Both shapes in this repo read that way: `AppRenderer.test.tsx`'s 5s
|
||||
`waitFor` inside a 15s test, and `clients/cli/__tests__/e2e.test.ts`'s 15s
|
||||
child timer (which kills the process group and names the CLI) inside a 25s
|
||||
test.
|
||||
- **`retry` stays unset.** A retry turns a load-induced red into a silent green
|
||||
on the only pre-push gate this repo has, and hides a real race behind a second
|
||||
attempt. The guard enforces this.
|
||||
|
|
|
|||
Loading…
Reference in a new issue