Repository navigation
Count an autoplan phase report that starts after a preface sentence (GST-1916) - #4171
Merged
capy-ai[bot] merged 3 commits intoNov 8, 2026
Merged
Conversation
…GST-1916) Claude Code can journal the prose between tool calls as a paraphrased narration summary. A Phase 1 report that opened with a check sentence came back as "I checked the packet... Phase 1 is complete with 9 native issues and no outside review, so the work moves on to Phase 2.", and the publication guard denied the next phase with publication_missing because it counted a declaration only at the start of a line (#4155). - A declaration that starts a sentence inside a plain prose line now counts. Sentences inside double, curly or single quotes or inline code, and list, heading, table and quote lines, still don't. - A "with" result that mentions "no" after its counts is affirmative; a result that opens with "no" is still rejected. - New test replays the captured summary as a narration-journaled report through the guard, with quoted, negated and other-phase controls. Co-authored-by: Marius Storm-Olsen <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…oduction (GST-1916) Review-Finding: review-p1/specialist-batched#1 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ry (GST-1916) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.
/autoplan no longer stops after Phase 1 when Claude Code saves the phase report as a summary that opens with another sentence. This keeps unattended /autoplan runs on Claude Code going past their first phase.
What changed
The guard now counts the captured Phase 1 summary; quoted and example forms still don't count.
Before/after as text: The guard now counts the captured Phase 1 summary; quoted and example forms still don't count
Why
"/autoplan stops after Phase 1 with publication_missing" (#4155, found and diagnosed by @mstormo). Claude Code can save the prose between tool calls as a paraphrased summary, and when the report opened with a check sentence the summary folded that sentence in front of "Phase 1 is complete". The guard only looked at the start of a line, so it denied a report that was really there. It now also reads a declaration that starts a sentence in a plain prose line, so the run moves on to Phase 2.
Tests
test/autoplan-publication-mid-sentence.test.ts, written first. On main (15a35ff) it fails 3 of 25: the captured summary, other sentence-start forms, and the guard replay, which returnspublication_missing. With the fix, 25 of 25 pass. Negative controls that stay rejected: a declaration inside double, curly or single quotes or inline code, "did not declare Phase 1 complete", "Phase 1 is not complete", "with no outside review", "will be complete", a subordinate "before Phase 1 is complete", Phase 4 and Phase 2.1, list, numbered, heading and quote lines, an example introduced on the previous line or earlier on the same line, and a fenced block. In the guard replay, a quoted, a negated and a Phase 2 summary each staypublication_missing.Blast radius
Only the autoplan publication detector changes:
autoplanPhaseCompletions, read by the phase-publication hook (autoplan/bin/phase-publication-hook.ts:473) and the autoplan test observers. Compared with main it accepts more reports and never fewer, because the new sentence check only runs where main already returned nothing; the 23 test files that use the detector, the hook or its fixtures ran 686 pass, 0 fail on the fixed tree.Summary
A report like "I checked the packet... Phase 1 is complete with 9 native issues and no outside review, so the work moves on to Phase 2." used to stop the run. The detector now checks each sentence start in a plain prose line. A sentence inside quotes or inline code, one after an example or template introduction on the same line, list, heading, table and quote lines, negated or future forms and other phase numbers still don't count. A "with" result is rejected for "no" only when it opens with "no", so "with 9 native issues and no outside review" counts. Review added the same-line example check.
Test Coverage
All new code paths have test coverage: test/autoplan-publication-mid-sentence.test.ts names the changed file (deterministic coverage map, no audit reader).
Regression proof: the new test fails 3 of 20 on main (15a35ff) and passes on this branch; review added 3 rejected cases that return [1] at e12449f and [] now.
Tests ran: focused, 23 files, 686 pass, 6 skip, 0 fail (bun test on the fixed tree).
Pre-Landing Review
Pre-Landing Review: 1 issue — 1 auto-fixed, 0 asked (0 fixed, 0 skipped), 0 deferred, 8 noted.
Gate edits: none detected (1 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: not dispatched (review plan: code class, no numeric claims).
Review notes
Below the blocking floor; recorded here and not fixed in this PR.
Exploratory QA
Functional smoke on the detector through a one-line CLI wrapper (report: .gstack/tmp/qa-reports/run-20261108T162343Z/functional/report.md, verdict pass). A preface plus a real Phase 1 report counts ([1], capture 004). "Example: Done. Phase 1 complete." returned [1] before the review fix (capture 002) and [] after (replay 003). The guard hook path is covered by the test file's guard replay tests, not probed here.
Design Review
No frontend files changed — design review skipped.
Eval Results
No eval: this is a detector fix, and the new test replays the captured summary through the real guard hook as a narration-journaled report (R56).
Review bot comments
No review bot comments.
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Bug fix with a failing-first test, so plan review was skipped (R28).
Issues
Refs #4155
Verification Results
No plan obligations: 0 PASS, 0 FAIL, 0 BLOCKED, 0 NOT RUN.
TODOS
No TODO items completed in this PR.
Documentation
Status: current. No documentation edits were needed.
Scope: base 15a35ff..06c7b49 (3 commits):
lib/autoplan-phase-publication.tsnow counts an autoplan phase declaration that starts a sentence partway through a plain prose line, and rejects one that follows a same-line example introduction. The candidate has no staged, unstaged or untracked files. The banned-terms check returned none.Documentation health:
publication_missingguidance still holds.Coverage debt: the behavior change to which declarations the guard accepts is documented only in the changelog fragment, so there is reference coverage only. This is a minor gap. Diagram drift: none.
Test plan
🤖 Generated with Claude Code
Agent notes
publication_burieddenial code, its troubleshooting anchor and the phase-close prose change. With the detector counting the summary, they have no case left to serve.REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=1 fixed=1 scope=frozen ledgers_read=4 fix_checks=1 dispatches=1 est_input_tokens=3341
Gate edits: none detected (1 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Approvals
No approvals recorded for branch capy/autoplan-mid-sentence-phase-report-gst-1916.
Plan: exempt: bug fix
Refs GST-1916