Skip to content

The suite no longer times the origin note or collides with its own fence ids - #269

Merged
Mpdreamz merged 1 commit into
mainfrom
fix/green-main
Nov 16, 2026
Merged

Mpdreamz merged 1 commit into
mainfrom
fix/green-main

Conversation

@Mpdreamz

Copy link
Copy Markdown
Contributor

Main is red: theHookStaysFast fails on every local run (90 ms median even alone, against a 50 ms bound) and displayShowsOnlyText fails when the random fence id contains "200"/"201".

  • The origin-note test checks one book read per call and a book under 512 KB at its limit (386 KB today).
  • Timings move to mise run bench (HEED_BENCH=1, release build, one at a time); AGENTS.md records the rule.
  • displayShowsOnlyText renders with a fixed fence id.

Making the hook itself cheaper (a prefilter before reading the book) is a separate change.

🤖 Generated with Claude Code

…nce ids

`theHookStaysFast` asserted a median under 50 ms and a slowest call under 250 ms inside the parallel debug
suite; on a Mac it takes 90 ms even alone, so it failed every run. The suite now checks what the cost comes
from: the hook reads the book once per call, and the book at its limit stays under 512 KB (386 KB today).
The timing moves to `mise run bench`, a release build that runs `Tests/HeedCoreTests/Bench` one test at a
time, and AGENTS.md says a test in the suite never asserts a duration.

`displayShowsOnlyText` checked that a prompt never contains "200" or "201", but every prompt carries a
random 8-hex fence id, and one CI run drew d2016162. It renders with a fixed id now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the bug Something isn't working label Nov 16, 2026
@Mpdreamz
Mpdreamz merged commit e793c46 into main Nov 16, 2026
5 checks passed
@Mpdreamz
Mpdreamz deleted the fix/green-main branch November 16, 2026 12:17
Mpdreamz added a commit that referenced this pull request Nov 16, 2026
Part of keeping CI free of wall-clock flakes.

- **ACPClientTests** (3 tests): a fixed `Task.sleep` of 50/30/20 ms
followed by an assertion is now a `waitFor` on the condition (the
refusal and cancel written, `session/new` on the wire, `session/cancel`
sent). New shared helper `Tests/HeedCoreTests/WaitFor.swift`: polls,
returns as soon as the condition holds, 30 s deadline that only a broken
behaviour reaches.
- **ApprovalTests** `aSlowAnswerTimesOutAndTheServerHearsTheHookLeft`:
the 200 ms sleep before `gone.ids` is now a wait for the server to hear
the hook left.
- **anAgentThatGoesAway...**: stressed at 200 cases with the pool
starved, it hit the request's own 60 s deadline before the poll resumed;
the request gets an hour, since the agent going away is what ends it.

Not changed: `theHookStaysFast` was already taken out of the suite by
#269 (timings live in `mise run bench`). The three on-thread bounds in
`PermissionRoundTripTests` are timed on the hook's own thread against a
hook ceiling and passed 200/200 each with 6 CPU hogs per core plus
pool-blocking tasks, so they stay as they are.

Verified: 200-case parametrized loops under CPU hogs and pool-blocking
tasks (before: refusal test failed 1-2 of 200; after: 0 of 1000),
mutations (refusal not sent, cancel not sent, wrong close reason,
`permissionGone` not called) each fail their test, `mise run test`,
`lint`, `fmt`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant