Repository navigation
Conversation
…d-sentence Claude Code can journal prose between tool calls as a paraphrased narration summary. A report with a preface sentence then reads "... Phase 1 is complete with 9 issues ...", which the guard rightly does not count, but it said publication_missing, which looked like dropped text. - phase-close step 6: the report message opens with the Phase N complete line. - New corrective denial publication_buried when a completion appears only mid-sentence after the close Read; same gate, clearer fix. - Troubleshooting anchor and tests (detector unit cases from a real journal, hook replay with controls). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Merging to
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 |
|
Thanks for the journal replay and the clear write-up. This is on the crew's pick-up list: a crew lane will rebuild it on current main and credit you as co-author when it lands, then close this PR. |
…GST-1916) (#4171) * Count an autoplan phase report that starts after a preface sentence (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> * Reject an autoplan phase report that follows a same-line example introduction (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> * Mention same-line example introductions in the autoplan changelog entry (GST-1916) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: Marius Storm-Olsen <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
Thanks @mstormo. Your diagnosis landed as #4171 (merged in 23f9d07), rewritten on current main, with you credited as co-author. Rather than adding a new denial code, the publication guard now counts a phase declaration that starts a sentence inside a line, so the narration summary you captured ("I checked the packet... Phase 1 is complete with 9 native issues and no outside review, ...") counts as the Phase 1 report. Quoted, inline-code, negated, future, other-phase and example-introduced mentions still don't count. Closing this in favor of #4171. |
Problem
On Claude Code 2.1.319 (Opus 5.5),
/autoplanstopped after Phase 1 twice in one day withpublication_missing, even though a filled Phase 1 report had been sent in its own messagewith only the
true autoplan-published ceono-op.What happened in the session journal:
The report was not saved as a
textblock. Claude Code journaled the prose between toolcalls as a
thinkingblock whose signature is taggednarration, holding a paraphrasedsummary of the prose, not the prose itself.
The guard already reads narration blocks (
lib/claude-journal-records.ts,publicNarrationText), so this part works as designed.The report message opened with a verification sentence before
**Phase 1 complete.**. Thesummary merged the two:
phaseDeclarationaccepts a declaration only at the start of a line, so this does not count,and the guard said
publication_missing. That reads like "the report is not there", whichsent the agent (and the user) looking for dropped text, and the run was abandoned.
Re-sending the report with no preface worked: the summaries became
"Phase 1 is complete: the outside review was unavailable…" and
"Phase 1 is done: outside review was unavailable…", and both count.
I ran the guard's own
recordEvents+autoplanPhaseCompletionsover the journal to confirm.The first message gives no hit; both re-sends give a Phase 1 hit.
Change 1: the phase-close procedure says the report must open the message
autoplan/sections/phase-close.md.tmpl, step 6, adds:phase-close.mdis regenerated withbun run gen:skill-docs. No other generated file changed.Change 2: a specific denial,
publication_buriedWhen no report counts but a message after the close Read mentions the phase's completion
somewhere other than the start of a line, the guard denies with
publication_buriedinstead ofpublication_missing. The text names the fix.to show, and it never counts a buried mention as a report.
lib/autoplan-phase-publication.ts: newburiedPhaseDeclaration(text, phase). It matchesPhase N [(name)] [is] complete|completed|done|finished|wrapped upat a position > 0 on a line,skips fenced code, ignores negations ("is not complete"), and keeps
2and2.5apart.autoplan/bin/phase-publication-hook.ts: picks between the two codes wherepublication_missingused to fail.autoplan/bin/guard-reasons.ts: new corrective reason. It doesn't advise a retry, and itincludes the publish-separately instruction.
docs/autoplan-guard-troubleshooting.md:#publication-buriedanchor (the reason-inventorytest requires one per code).
Why not count paraphrased or thinking text more loosely
complete, …" or a quoted plan line pass.
the "visible parent text" rule.
survive summarizing: open the message with it.
Tests
test/autoplan-publication-buried.test.ts:buried; the opening one is counted and not flagged.
2vs2.5.publication_buriedwith the fix in the text. Controls: no report stays
publication_missing, and a normalpublish()is allowed.test/autoplan-guard-reasons.test.tsstill passes (code inventory, no-retry rule, anchors).Verification
bun test test/autoplan-publication-buried.test.ts test/autoplan-guard-reasons.test.ts: 9 pass, 0 fail.test/autoplan-*.test.ts,test/*publication*.test.tsandtest/skill-docs*.test.tson Windows 11, before and after this change: 51 failures each, and 50 of them are the same tests. The two that differ are timing flakes.autoplan-review-discovery"canonical global path in copy installations" passed 2 of 3 isolated runs on this branch, andautoplan-token-efficiency"below the cap" failed before this change and passes after. The 50 shared failures are Windows environment issues unrelated to this change (paths, spawning bun by PATH name).🤖 Generated with Claude Code