Skip to content

Stop hooks: read titled plans, treat a progress sentence as an active Status, find the plan in a Codex rollout - #508

Merged
bompus merged 4 commits into
mainfrom
fix/stop-check-plan-detection
Oct 31, 2026
Merged

bompus merged 4 commits into
mainfrom
fix/stop-check-plan-detection

Conversation

@bompus

@bompus bompus commented Oct 31, 2026

Copy link
Copy Markdown
Owner

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.

  1. A titled plan never counted as strict. stop-ready-work-check.mjs ends the plan header at the first line starting with #, so a plan that opens with # Title had an empty header and a Stop-check: strict line under the title was never seen. The header now runs to the first heading after a title on the first non-blank line.
  2. A Status: that is a sentence skipped the plan. The check ran only when Status: was exactly active; a status like PR 49 landed; release preparation remains open made 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.
  3. A Codex rollout had no plan. Plan discovery parses Claude Code tool calls only, so a transcript with no user or assistant records 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) and bun run check pass. 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.

@bompus bompus added the author:anthropic Pull request written by a anthropic model label Oct 31, 2026

@bompus-ai-review bompus-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bompus AI Review (GPT-6.1 Sol, xhigh reasoning): 2 finding(s).

Comment thread scripts/stop-claim-check.mjs Resolved
Comment thread scripts/stop-claim-check.mjs Resolved
@bompus bompus added author:anthropic Pull request written by a anthropic model and removed author:anthropic Pull request written by a anthropic model labels Oct 31, 2026

@bompus-ai-review bompus-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bompus AI Review (GPT-6.1 Sol, xhigh reasoning): 1 finding(s).

Comment thread scripts/stop-claim-check.mjs Resolved

@bompus-ai-review bompus-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bompus AI Review (GPT-6.1 Sol, xhigh reasoning): 0 finding(s).

Review 3: only high findings and above are posted from here on.

@bompus-ai-review bompus-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bompus AI Review (GPT-6.1 Sol, xhigh reasoning): 0 finding(s).

Review 4: only high findings and above are posted from here on.

@bompus
bompus force-pushed the fix/stop-check-plan-detection branch from 198f1aa to 5ab7936 Compare October 31, 2026 05:33

@bompus-ai-review bompus-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bompus AI Review (GPT-6.1 Sol, xhigh reasoning): 0 finding(s).

Review 5: only high findings and above are posted from here on.

@bompus bompus closed this Oct 31, 2026
@bompus
bompus merged commit 5ab7936 into main Oct 31, 2026
2 checks passed
@bompus
bompus deleted the fix/stop-check-plan-detection branch October 31, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:anthropic Pull request written by a anthropic model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant