Skip to content

/ship can finish after a docs audit stopped before saving its snapshot (GST-3502) - #4693

Merged
capy-ai[bot] merged 3 commits into
mainfrom
docs-re-audit-keeps-stopped-audit-edits
Nov 22, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
docs-re-audit-keeps-stopped-audit-edits

Conversation

@garrytan

@garrytan garrytan commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

/ship no longer gets stuck when its docs audit edits a left-out docs file and then stops: the second audit can now include the first audit's edits, so /ship can record its result and finish.
Why: a gbrain release was blocked with no supported way forward.
Nothing to do: gstack-docs-candidate snapshot gains one optional flag for this case, and /ship's Blocked recovery step names it.

What changed
  • gstack-docs-candidate snapshot takes a new flag, named in the Agent notes, that records, in the second audit's after-edit snapshot, the files a stopped audit edited: what changed between the stopped audit's Prepare snapshot and the second audit's Prepare snapshot, at the same commit. It needs --pre and --run, and refuses an after-edit snapshot or one taken at another commit.
  • Run ids that name the same record file by two spellings (a/../b.md and b.md) now count as the same run, in the docs candidate, in the check that keeps an earlier audit's edits, and in the review depth check.
  • ship/sections/documentation.md's Blocked recovery step 2 names the flag.
  • New test test/review-exclude-stopped-audit.test.ts reproduces the stopped-audit case and fails on main.
Agent notes

The new flag is --carry-stopped <stopped audit's Prepare snapshot>.

Reported by GBRA-732 on gbrain at 8e0159ab (audits ship2-docs-1, blocked, and ship2-docs-2): gstack-ship-receipt write refused RECEIPT_INVALID on review_exclude because the re-audit's post snapshot could not carry the stopped audit.

Approvals

Approved: yes (record r-01c2dd1613a2). The full approval record stays private.
Plan: exempt: bug fix with a failing test written first (R65)
Plan check: exempt bug fix

Pre-Landing Review

Pre-Landing Review: 10 issues — 0 auto-fixed, 0 asked (0 fixed, 0 skipped), 0 deferred, 7 noted; 3 second-model findings ruled below the floor
Gate edits: none detected
REVIEW_LOOP: passes=1 blocking_found=3 deferred=0 noted=7 fixed=0 scope=frozen open=3 dispatches=4

Ruled note: ship/sections/documentation.md.tmpl:136:outside-voice at a07f9a9 ruled by GSTA-36 at 2026-11-22T08:03:21.803Z: a recovery commit that moves HEAD makes --carry-stopped refuse, failing closed where main had no path (approval a-f094fffe8f45)
Ruled note: bin/gstack-docs-candidate:198:outside-voice at a07f9a9 ruled by GSTA-36 at 2026-11-22T08:03:22.386Z: a path missing from the second Prepare inventory takes its after-state from the worktree, so a misattributed run makes receipt write refuse, never accept (approval a-88fc8e53e7ea)
Ruled note: lib/ship-receipt-docs.ts:53:outside-voice at a07f9a9 ruled by GSTA-36 at 2026-11-22T08:03:22.662Z: a relative --run resolves against the current directory, so a differently spelled run makes receipt write refuse, never accept (approval a-679a0ed9a0bd)
Ruled note: ship/sections/documentation.md.tmpl:106:outside-voice at a07f9a9 ruled by GSTA-36 at 2026-11-22T08:03:31.008Z: the docs do not say --carry and --carry-stopped are alternatives; following both refuses on the missing post file; wording fix in a later PR (approval a-3ba4cd4270ed)
Ruled note: bin/gstack-docs-candidate:227:outside-voice at a07f9a9 ruled by GSTA-36 (relayed from GSTA-795:01M8149DAHMER7Y6AE3N95RTSM) at 2026-11-22T08:16:51.531Z: a retry that creates a docs file the second Prepare missed is credited to the stopped audit, so receipt write refuses; it never accepts (approval a-c39e6b7a8d48)
Ruled note: ship/sections/documentation.md:108:outside-voice at a07f9a9 ruled by GSTA-36 (relayed from GSTA-795:01M8149DAHMER7Y6AE3N95RTSM) at 2026-11-22T08:16:52.234Z: the post-snapshot step and Blocked recovery do not say --carry and --carry-stopped are alternatives; following both refuses on the missing post file (approval a-83c6b7fd11a1)
Ruled note: bin/gstack-docs-candidate:270:outside-voice at a07f9a9 ruled by GSTA-36 (relayed from GSTA-795:01M8149DAHMER7Y6AE3N95RTSM) at 2026-11-22T08:16:52.510Z: a relative --run stored after chdir to the repository root reads as another run, so the snapshot or receipt write refuses; it never accepts (approval a-46d14bb55894)

  • Open note (native adversarial docs: add README and CLAUDE.md #1, Medium, Blocks: no; no ruling needed): bin/gstack-docs-candidate:227: the stopped audit's window credits any edit made between the two Prepare snapshots to that audit, and receipt write resets files that are excluded or kept because code names them (lib/ship-receipt-depth.ts:446), so a non-audit edit to a code-named doc the reviewers read could still bind.
  • Open note (native refactor: reorganize codebase into modular structure #2, Low): bin/gstack-docs-candidate:197: a path in only the stopped Prepare snapshot is hashed at post time; fails closed.
  • Open note (native Project-local .claude/skills/gstack install breaks /browse and setup can report false success #3, Low): bin/gstack-docs-candidate:222: nothing checks the --carry-stopped snapshot predates the re-audit or that no completed audit ran between; fails closed.
  • Open note (native Fix project-local /browse installs and harden setup #4 and red team): lib/ship-receipt-docs.ts:53: sameRun resolves run ids against the process directory; fails closed.
  • Open note (red team): bin/gstack-docs-candidate:227: a parent repair between the two Prepare snapshots is attributed to the stopped audit (provenance only).
  • Open note (testing): bin/gstack-docs-candidate:275: no test passes --carry and --carry-stopped together.
  • Open note (docs debt, deferred by the lane): docs/ship-policy.md and docs/troubleshooting.md should name --carry-stopped beside --carry; moves to a later PR with the --carry/--carry-stopped wording fix.

Documentation

Scope: a read-only docs audit of docs-re-audit-keeps-stopped-audit-edits against ef72e414. It covered the new gstack-docs-candidate snapshot --carry-stopped flag, the shared same-run path check (sameRun), the /ship Step 14.5 template and its generated copy, the changelog fragment, the tool's usage text, docs/ship-policy.md and docs/troubleshooting.md.

Result: current, with no edits. The usage text, the Step 14.5 instructions and the changelog fragment all describe the new flag correctly.

Documentation debt (deferred by the owner): docs/ship-policy.md (the paragraph on the docs-audit exception to the review exclusion) and docs/troubleshooting.md (the re-audit entry) still mention only --carry. They should also name --carry-stopped. These lines will be fixed in a later PR together with the --carry/--carry-stopped wording fix.

{
  "schema_version": 1,
  "pr": 4693,
  "head": "a07f9a9ead3d27d70ea10a0752179bf901d781ff",
  "version": "1.102.2.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1746,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 45001147411,
      "attempt": 1,
      "tree": "382560f3a126412bb15f3dd4cf00b4ffba443ddf"
    }
  ],
  "calls": 27,
  "session_kind": "unattended",
  "run": "ship-4693-r3",
  "head_tree": "382560f3a126412bb15f3dd4cf00b4ffba443ddf",
  "product_patch_id": "baaf6a52d21ccb27a51709c155c959165dfea2c6",
  "gstack_version": "1.102.2.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 50,
    "rules": "630fd3101899e28e",
    "base": "0b4f0ceeec19fef62480db6c8eb00c4015380a39",
    "registry": "0b4f0ceeec19fef62480db6c8eb00c4015380a39",
    "gate_scan": {
      "tagged": 0,
      "head": "a07f9a9ead3d27d70ea10a0752179bf901d781ff"
    },
    "reasons": [
      "gate-class",
      "runtime=50"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @382560f3a126 (8 checks, current for a07f9a9ead3d)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/45001147411/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44997354272/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=382560f3a126 tests=38835 skipped=104 runs=45001147411/1 profiles=ci-reuse/free-tests heads=a07f9a9ead3d verified=2026-11-22T09:06:01.610Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md, ship/sections, ship/DRIVER.md.tmpl (read-only audit ship-4693-r3-docs-2 at a07f9a9)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 3,
    "deferred": 0,
    "noted": 7,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  },
  "ruled_notes": [
    {
      "finding": "ship/sections/documentation.md.tmpl:136:outside-voice",
      "head": "a07f9a9ead3d27d70ea10a0752179bf901d781ff",
      "by": "GSTA-36",
      "reason": "a recovery commit that moves HEAD makes --carry-stopped refuse, failing closed where main had no path",
      "at": "2026-11-22T08:03:21.803Z",
      "approval": "a-f094fffe8f45"
    },
    {
      "finding": "bin/gstack-docs-candidate:198:outside-voice",
      "head": "a07f9a9ead3d27d70ea10a0752179bf901d781ff",
      "by": "GSTA-36",
      "reason": "a path missing from the second Prepare inventory takes its after-state from the worktree, so a misattributed run makes receipt write refuse, never accept",
      "at": "2026-11-22T08:03:22.386Z",
      "approval": "a-88fc8e53e7ea"
    },
    {
      "finding": "lib/ship-receipt-docs.ts:53:outside-voice",
      "head": "a07f9a9ead3d27d70ea10a0752179bf901d781ff",
      "by": "GSTA-36",
      "reason": "a relative --run resolves against the current directory, so a differently spelled run makes receipt write refuse, never accept",
      "at": "2026-11-22T08:03:22.662Z",
      "approval": "a-679a0ed9a0bd"
    },
    {
      "finding": "ship/sections/documentation.md.tmpl:106:outside-voice",
      "head": "a07f9a9ead3d27d70ea10a0752179bf901d781ff",
      "by": "GSTA-36",
      "reason": "the docs do not say --carry and --carry-stopped are alternatives; following both refuses on the missing post file; wording fix in a later PR",
      "at": "2026-11-22T08:03:31.008Z",
      "approval": "a-3ba4cd4270ed"
    },
    {
      "finding": "bin/gstack-docs-candidate:227:outside-voice",
      "head": "a07f9a9ead3d27d70ea10a0752179bf901d781ff",
      "by": "GSTA-36",
      "reason": "a retry that creates a docs file the second Prepare missed is credited to the stopped audit, so receipt write refuses; it never accepts",
      "at": "2026-11-22T08:16:51.531Z",
      "approval": "a-c39e6b7a8d48",
      "relayed": "GSTA-795:01M8149DAHMER7Y6AE3N95RTSM"
    },
    {
      "finding": "ship/sections/documentation.md:108:outside-voice",
      "head": "a07f9a9ead3d27d70ea10a0752179bf901d781ff",
      "by": "GSTA-36",
      "reason": "the post-snapshot step and Blocked recovery do not say --carry and --carry-stopped are alternatives; following both refuses on the missing post file",
      "at": "2026-11-22T08:16:52.234Z",
      "approval": "a-83c6b7fd11a1",
      "relayed": "GSTA-795:01M8149DAHMER7Y6AE3N95RTSM"
    },
    {
      "finding": "bin/gstack-docs-candidate:270:outside-voice",
      "head": "a07f9a9ead3d27d70ea10a0752179bf901d781ff",
      "by": "GSTA-36",
      "reason": "a relative --run stored after chdir to the repository root reads as another run, so the snapshot or receipt write refuses; it never accepts",
      "at": "2026-11-22T08:16:52.510Z",
      "approval": "a-46d14bb55894",
      "relayed": "GSTA-795:01M8149DAHMER7Y6AE3N95RTSM"
    }
  ],
  "gate_dispositions": []
}
{"head":"a07f9a9ead3d27d70ea10a0752179bf901d781ff","run":"ship-4693","status":"started","review_loop":{"passes":1,"blocking_found":3,"deferred":0,"noted":6,"fixed":1,"scope":"frozen","fix_checks":1,"rounds":1,"dispatches":{"specialist":3,"red-team":1}}}
{"head":"a07f9a9ead3d27d70ea10a0752179bf901d781ff","run":"ship-4693-r2","status":"started","review_loop":{"passes":1,"blocking_found":4,"deferred":0,"noted":8,"fixed":0,"scope":"frozen","rounds":1}}

garrytan and others added 2 commits November 22, 2026 06:42
…ts snapshot, so the receipt can be written (GST-3502)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…angelog fragment (GST-3502)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

Review-Finding: p1/specialist-batched#1 reader=testing
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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