Skip to content

test: split the prompt hook's one-second bound from what it shows, and make its hanging origin hang - #1098

Merged
REPPL merged 8 commits into
mainfrom
fix/status-hook-show-once-flake
Oct 18, 2026
Merged

REPPL merged 8 commits into
mainfrom
fix/status-hook-show-once-flake

Conversation

@REPPL

@REPPL REPPL commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

Follows #1093. TestThePromptHookShowsEachAnnouncementOnce asserted two things under the shipped budgets: that the hook returns inside its one second, and what it shows. A loaded queue runner could fail it on either count.

  • TestThePromptHookReturnsInsideItsSecond keeps the shipped bound. It runs three tries, each in a fresh checkout so each one has the announcement to show, and logs each try's time and whether it showed the announcement.
    • Two tries over the second fail the test, and so does any single try over 5 s. One load spike is absorbed, but a usually-slow or hanging hook is not.
    • At least one try must show the announcement, so the shipped budgets still have to be enough to show it.
  • The show-once test and the session-title test ask what is shown, so they run under budgets of their own (ownHookBudgets: 10 s for the hook and for the status read).
  • The no-network claim is decided off the clock. The hanging origin's command leaves a marker file, and the tests fail if it appears, checked after each try and again after the last.
  • The old hanging origin never hung. git-remote-ext's literal space is % , so ext::sh -c sleep\ 30 ran sh -c 'sleep\' 30, and sleep exited at once. The hook test's no-network claim was therefore not checked at all. Both that test and TestThePromptNeverWaitsOnTheNetwork in the claim package now use an origin that really hangs.
  • The claim test's two bare one-second wall-clock bounds now use the package's slack, as its other bounds do.
  • Two test seams sit beside the existing ones: claim.SetPromptReadBudgetForTest (from test: make the status hook deadline test hold under a loaded runner #1093) and claim.WaitPromptReadsForTest. The second lets the cli tests wait for an abandoned read before their directories are removed.

Checked by mutation. A hook that runs git ls-remote origin fails both cli tests on the marker, including a call started after the hook returns. An always-slow hook, and one 6 s try, fail the bound test. A hook slow on one try in three passes. A skipped read fails "no try showed". An untraced network call in the claim read fails the claim test.

An Opus and Sonnet review pair read a frozen copy over three rounds and both stopped. Both agreed with the two-of-three rule, which works like a median of three, once the hard ceiling was added.

Resolves: iss-2610180735158998
Resolves: iss-2610181122454939
Resolves: iss-2610181153278714
Resolves: iss-2610181153288506

Assisted-by: Claude:claude-opus-5-5

REPPL added 8 commits October 18, 2026 12:22
Refs: iss-2610181122454939
Assisted-by: Claude:claude-opus-5-5
git-remote-ext escapes a space only as "% ", so "ext::sh -c sleep\ 30"
handed sleep no argument and failed at once. The claim test's origin now
hangs; the hook tests get theirs from hangOrigin, in the next commit.

Resolves: iss-2610181122454939
Assisted-by: Claude:claude-opus-5-5
The show-once test asserted both what the hook shows and that it returns
inside its second, so a loaded runner could fail it either way.
TestThePromptHookReturnsInsideItsSecond keeps the shipped bound over three
tries, each in a fresh checkout and logged, and fails when two run over;
the show-once test runs under ten-second budgets of its own. Both decide
whether origin was reached from a file the origin's command leaves.

Resolves: iss-2610180735158998
Assisted-by: Claude:claude-opus-5-5
Refs: iss-2610181153278714

Assisted-by: Claude:claude-opus-5-5
Refs: iss-2610181153288506

Assisted-by: Claude:claude-opus-5-5
…udgets

Review of the split found the two-of-three rule forgave one try of any
length and that nothing required the read to happen. Any try over five
seconds now fails, and at least one try must show the announcement under
the shipped budgets. Markers are checked again after the last try, and
claim.WaitPromptReadsForTest lets the tests wait for an abandoned read
before their directories go. The session-title test gets budgets of its
own through the shared ownHookBudgets, and the hollow-origin record now
says the old hook test's no-network claim was not checked at all.

Resolves: iss-2610181153278714
Refs: iss-2610180735158998, iss-2610181122454939
Assisted-by: Claude:claude-opus-5-5
The read runs under the package's stretched budget, so a bare one-second
bound could fail on a loaded runner. Now that the origin really hangs, a
network wait also fails the announcement check and the git trace.

Resolves: iss-2610181153288506
Assisted-by: Claude:claude-opus-5-5
The held read never ends before cleanup, so any finite bound shows the
prompt returned at its deadline; a bare second left about 150 ms over the
read's cutoff. The comment now says a network wait runs the read out of
its budget, and the bound test registers its read wait once.

Refs: iss-2610181153288506
Assisted-by: Claude:claude-opus-5-5
@REPPL
REPPL enabled auto-merge October 18, 2026 13:47
@REPPL
REPPL added this pull request to the merge queue Oct 18, 2026
Merged via the queue into main with commit 5f8126e Oct 18, 2026
14 checks passed
@REPPL
REPPL deleted the fix/status-hook-show-once-flake branch October 18, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant