Repository navigation
Let the docs audit repair a badly shaped final line without using an attempt - #4205
Merged
Merged
Conversation
…attempt Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
A missing audit id or a missing or unknown status is now a content failure, a --repair-of that names a non-repairable output no longer uses up the audit's one repair, and the re-ask goes to a fresh agent with no tools instead of the writer child. Review-Finding: p1/specialist-batched#1 reader=testing Review-Finding: p1/specialist-batched#2 reader=testing Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/red-team#2 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…cs audits A repeated audit_id or status key, and a files_updated or blockers list that is present but malformed, are now content failures, so a format repair can no longer erase a reported blocker or choose the outcome. A missing list stays repairable. Review-Finding: v1/outside-voice#1 reader=outside-voice Review-Finding: v1/outside-voice#2 reader=outside-voice 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.
The /ship docs audit now tells a badly shaped final line apart from a failed audit, so a formatting slip no longer uses up its one re-audit. A repair can fill in a missing or misnamed field, but it can never supply the audit's identity or its outcome.
What changed
/ship Step 14.5's docs audit now separates a shape-only fault in the audit child's last line from a real failure. When the last line is one JSON object whose only faults are its keys, types or the documentation section (a missing field, or a misnamed field holding
"x"),gstack-docs-candidate resultprintsFORMAT_REPAIR:instead ofRETRY_NOTE:. The step then asks once for just that line, using no attempt:gstack-docs-candidate repair-prompt <output> --audit-id <id>prints the request: the schema, the problems, and the child's own output as data. It goes to one fresh agent with no tools, never the writer child.gstack-docs-candidate result <reply> ... --repair-of <output>checks the reply. It passes only when every value the first line already gave correctly is unchanged, and each audit gets one repair. A failed or second repair printsRETRY_NOTE:and goes to Blocked recovery as before.These still count as a failed attempt and get no repair: a missing, wrong or repeated audit id; a missing, unknown or repeated status; a
files_updatedorblockerslist that is present but malformed; a status that contradicts the file lists; and a last line that is not JSON at all. A--repair-ofthat names an output with no repair is refused without using up the audit's repair.Why
gbrain-evals #356 (2026-11-03): both allowed docs-audit attempts returned an invalid last line, the first missing
documentation_section, the second a misnamed key set to"x". The second audit had found the docs current, but the run had spent both attempts on formatting, so an unattended /ship stopped and needed an owner-named risk or a fresh /ship.Blast radius
Only Step 14.5's result check:
lib/ship-docs-result.ts, theresultandrepair-promptcommands inbin/gstack-docs-candidate, the section's Collect step, and theDOCS_RESULT_INVALIDfix text in the result-code registry and the troubleshooting doc. A valid line produces exactly the same output and files as before. No other /ship step changed, and neither did the review-army or pr-body sections.Test Coverage
test/docs-audit-result.test.tswas written first on main and failed there (9 failures), then passed. Each review fix also got its tests first, and they failed at the previous head: 4 at b8aad9a and 5 at 4b4fe32. The file now covers both reported shapes repairing without an attempt, a valid line passing unchanged, nine content failures that still count (no repair offered,repair-promptrefuses), a missing blocker list staying repairable, a repair that changesstatusorfiles_updatedbeing refused, one repair per audit, and a--repair-ofthat names a content failure not using up the repair: 41 pass, 0 fail. Step 7 coverage audit (read-only): 10 of 14 changed paths have a test; the gaps are a wrong-type status or schema_version row, the 24,000-character truncation, and whether a real child follows the repair prompt (eval).Pre-Landing Review
REVIEW_LOOP: passes=1 blocking_found=2 deferred=0 noted=3 fixed=6 scope=frozen ledgers_read=5 fix_checks=2 dispatches=3
Pre-Landing Review: 14 issues — 6 auto-fixed (plus 1 duplicate folded into a fixed one), 0 asked, 0 deferred, 7 noted.
Gate edits: none detected (gate scan tagged 0 hunks at 8b56a50).
The full pass (testing, security and state-machine checklists, then the Red Team) raised 4 findings, all fixed: a missing or unknown status was repairable, a missing audit id was repairable,
--repair-ofused up the repair before checking the original, and the re-ask went to the writer child. Step 11's outside voice (openai/gpt-6.1-sol) found two blocking holes: a malformed blocker list could be repaired into an empty one, and a repeated status key let the repair choose the outcome. The owner granted one scoped fix-check for those, and both are fixed. The fix-checks found nothing blocking.Exploratory QA
Inconclusive. The success probe passed (a valid line gives
DOCS_RESULT: ok). The riskiest-edge probe failed: a line with no audit id was offered a format repair. It was replayed, fixed in 4b4fe32 and covered by a regression test, but the post-fix capture did not run because the 300-second smoke clock had expired.Eval Results
Not run in this /ship.
scripts/eval-select.tsselects 113 behavioral probes throughlib/ship-docs-result.ts, including theship-docsync-*cases. That is well over the lane's $10 paid-eval cap, so it is left to the READY screen.Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
lib/ship-docs-result.ts:64Same root as outside-voice#1: a wrong-type blockers or files_updated skips the status invariants.bin/gstack-docs-candidate:332The one-repair limit and kept-value check apply only when the parent passes --repair-of with the record dir.lib/ship-docs-result.ts:91Child output containing the AUDIT_OUTPUT>>> marker can close the repair prompt's data fence early.bin/gstack-docs-candidate:340A crash between the marker write and the result write uses up the repair.lib/ship-docs-result.ts:41A repeatedblockersorfiles_updatedkey (as opposed to a malformed one) is still repairable. So a line like"blockers":["X"]," blockers":[]with status current could be repaired toblockers: [], which loses a reported blocker: the same kind of loss this PR closes, reached a rarer way. The follow-up is to count any repeated outcome-field key as a content failure; the Captain will decide on it after this lands.docs/troubleshooting.md:6855The entry's parenthetical "keys, types or the section" is broader than the tool now is: a malformed outcome list or a repeated id or status getsRETRY_NOTE:(fix-check after the granted fix; the docs audit judged the sentence still correct).lib/ship-docs-result.ts:38A repeated status key (fix-check after the first fix round; closed by the granted fix).Documentation
Status: current. No documentation changes were needed for the docs-audit format-repair change.
Scope: the 3 commits on docs-audit-repairs-bad-final-line from 350d419 (9 committed files; nothing staged, unstaged or untracked), checked against docs/troubleshooting.md, ship/sections/documentation.md(.tmpl), lib/result-codes-release.ts, the changelog fragment, AGENTS.md, CLAUDE.md and README.md.
Documentation health
Coverage debt: the repair-prompt subcommand and the --repair-of flag have reference and how-to coverage (usage header, troubleshooting, /ship Step 14.5). There are no critical gaps. Diagram drift: none.
Test plan
bun test test/docs-audit-result.test.ts: 41 pass, 0 fail.bun run typecheckclean.Agent notes
Bug fix, no plan review (R65); failing-first tests on main and before each review fix. The second fix round ran on the owner's grant a-5920389d13c2 (scope: the two outside-voice findings at 4b4fe32). The ship size ledger records +336 bytes for the section text.
Approvals
Approved: yes (record r-306d83a73b56). The full approval record stays private: this repository is public or its visibility is unknown.
Plan: exempt: bug fix
REVIEW_LOOP: passes=1 blocking_found=2 deferred=0 noted=3 fixed=6 scope=frozen ledgers_read=5 fix_checks=2 dispatches=3
Agent notes