Skip to content

Accept a verbatim phase declaration and read numbered severity headings - #4231

Closed
larsonthune wants to merge 1 commit into
garrytan:mainfrom
larsonthune:fix/autoplan-publication-verbatim-and-numbered-severity
Closed

larsonthune wants to merge 1 commit into
garrytan:mainfrom
larsonthune:fix/autoplan-publication-verbatim-and-numbered-severity

Conversation

@larsonthune

Copy link
Copy Markdown
Contributor

Two /autoplan failures from one real run, both fixed here. The publication guard refused a correctly published phase report, and the outside-review checker could not read Codex's severity labels.

1. publication_missing after a correct report

Cause. With Claude Code's thinking-display "updates" mode (tengu_thinking_display_updates: true, Claude Code 2.1.319), text written before a tool call is journaled only as a paraphrased thinking block, not the literal text. In one run the Phase 2 report began "Phase 2 complete.", but the journal held "...Two judgment calls go to the gate, and I'm passing to Phase 2.5 DX Review next." The declaration was gone, so requirePublication() found no report and refused DX entry twice, including a resend in the exact template. Phase 1 passed only because its paraphrase happened to start "Phase 1 is done:". #4155 handles a paraphrase that keeps the declaration mid-sentence; this is the case where it is dropped.

Fix. Bash commands are journaled verbatim, so the publication no-op may carry the declaration, quoted:

true autoplan-published design 'Phase 2 complete.'
  • autoplan/bin/phase-publication-hook.ts: a declaring no-op after the close read counts as the report. It must name this phase and declare this phase, checked with autoplanPhaseCompletions, so negated, future-tense and other-phase declarations do not count.
  • lib/autoplan-stop-gate.ts: PUBLISHED accepts the optional quoted declaration, and a declaring no-op satisfies the "report before it" check through the same parser.
  • phase-close.md.tmpl step 6, the guard's reason text and the troubleshooting doc now show the declaring form.
  • The bare no-op after a literal report still works.

2. untagged_review for completed Codex reviews

Cause. lib/outside-review-result.ts allowed one prefix before a severity label: a heading, a bullet or a number. Codex writes findings as ### 1. High plus a title (a heading and a number), so no severity was read. Three completed reviews in the run came back VERDICT: unverified, REASON: untagged_review, and under the review gate the same shape classified as clean.

Fix. LABEL_START, the severity-word label pattern, CODE_LABEL_BEFORE and NUMBERED_ITEM allow an optional heading followed by an optional bullet or number. Re-running the checker on the run's three real outputs now gives P0, P1 and P1.

Tests

  • test/autoplan-publication-mid-sentence.test.ts: a paraphrase that dropped the declaration plus a declaring no-op is allowed (single and double quotes). Bare no-op, wrong phase, wrong phase name, negated, future-tense, echo-wrapped and chained commands stay publication_missing.
  • test/autoplan-stop-gate.test.ts: the same cases through checkRun.
  • test/outside-review-severity.test.ts: numbered headings with High, Critical, Medium and [P1], plus a "high-level" prose negative control.
  • test/autoplan-publication-payload.test.ts: the reason text expectation now includes the declaration.
step check result
1 bun test on stop gate, guard reasons, skill gates, all autoplan-publication-*, all outside-review-*, gen-skill-docs (3 files) 1183 pass, 6 skip, 0 fail
2 bun run typecheck exit 0, 0 errors
3 bun run gen:skill-docs only autoplan/sections/phase-close.md changed

Not addressed here: the plan-eng-review outside voice gives Codex 300 s, while autoplan's phase voices give 540 s. The eng prompt is larger, and in this run it timed out with no output. That may be worth aligning separately.

🤖 Generated with Claude Code

https://claude.ai/code/session_01H886FStSt7rh5zqsxAVVmK

Claude Code's thinking-display "updates" mode journals narration before a
tool call only as a paraphrased thinking summary. When the paraphrase drops
"Phase N complete", the publication guard refused the next phase with
publication_missing. The publication no-op may now carry the declaration,
quoted; commands are journaled verbatim. The guard and the stop gate both
accept it through the same parser, and the bare no-op still works after a
literal report.

lib/outside-review-result.ts allowed one prefix before a severity label, so
a heading such as "### 1. High: title" read as no severity (untagged_review,
or clean under some gates). A heading may now be followed by a bullet or
number.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H886FStSt7rh5zqsxAVVmK
@trunk-io

trunk-io Bot commented Nov 9, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@capy-ai

capy-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Thanks for tracing both failures to one real run. On main, the publication no-op only matches true autoplan-published <phase> with nothing after it, so a dropped declaration can't be recovered, as you describe. We're considering this. If we take it, we'll rewrite it on current main, with a review of the publication guard change, and credit you as co-author.

@capy-ai

capy-ai Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Following up: we're taking this. A correctly published phase report that the guard refuses blocks /autoplan, and outside-review findings whose severity can't be read are a wrong review result. It will be rebuilt on current main with you credited as co-author, with a careful read of the guard change, and this PR will be closed with a link when it lands, after November 21.

@capy-ai

capy-ai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Thank you for this. We're picking up the idea. A maintainer agent working through a batch of fixes (our tracking thread GSTA-802) will first reproduce the problem on current main. If it reproduces, the agent rebuilds the fix on main with you credited as co-author, because we don't merge outside branches directly, and we'll close this PR with a link when it lands. If it no longer reproduces, we'll close this and say what changed.

@capy-ai

capy-ai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Thank you, @larsonthune. Part 2 (Codex findings written as numbered headings like ### 1. High keep their severity) was rebuilt on current main and landed in #4681 (merged as b3323f4), with credit in the changelog.

We didn't take part 1, which lets a quoted declaration inside the publication no-op stand in for the phase report. That check exists to prove the report was actually written, so loosening it needs its own decision. It isn't a judgment on your change. If you'd like to make the case for it, please open an issue with the session that hit it, and we'll look at it on its own. Closing this PR since part 2 has landed.

@capy-ai capy-ai Bot closed this Nov 22, 2026
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