Repository navigation
Stop hooks: read titled plans, treat a progress sentence as an active Status, find the plan in a Codex rollout - #508
Merged
Conversation
… Status, find the plan in a Codex rollout
bompus
force-pushed
the
fix/stop-check-plan-detection
branch
from
October 31, 2026 05:33
198f1aa to
5ab7936
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A reply that stopped with ready plan work open passed both Stop hooks in a real session, for three separate reasons. Each is fixed here.
stop-ready-work-check.mjsends the plan header at the first line starting with#, so a plan that opens with# Titlehad an empty header and aStop-check: strictline under the title was never seen. The header now runs to the first heading after a title on the first non-blank line.Status:that is a sentence skipped the plan. The check ran only whenStatus:was exactlyactive; a status likePR 49 landed; release preparation remains openmade it pass silently. Now only a Status that begins with paused, blocked, waiting, on hold, held, complete, completed, done, archived, abandoned, cancelled, superseded or closed stops the check; any other text counts as active.userorassistantrecords found nothing and passed. For such a transcript the plan paths named in its tool-call text now count (read or written; the latest mention wins). Claude Code transcripts are unchanged, and reading a plan there still does not count. The scan looks at most 512 characters back from each/plan.md, so a long run of path characters costs time in proportion to its length.Proof:
bun test test/stop-ready-work-check.test.mjs test/stop-claim-check.test.mjs(68 pass),bun test(full suite) andbun run checkpass. The new tests fail on the previous scripts: a titled strict plan, a sentence Status, a Codex-shaped rollout, a backup file or longer name that must not match, tool output that must not match, a Claude transcript that only reads the plan (still passes), and a two-million-character slash run that must finish in under a second.An independent review (a separate model, read-only) found a quadratic scan on slash runs, a change to Claude read-only behaviour, loose path matching, a title after a blank line, a wording mismatch in the Status list and home-directory paths in a fixture; all are fixed above.
This does not install the hooks for Codex. That is a separate change in the host's installer.