Repository navigation
feat: crew PRs carry their brief's Plan line; ship-queue ready and land check it (GST-1751) - #4118
Merged
Merged
Conversation
…nd check it (GST-1751) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
finish --plan resolves the brief's Plan line before stage 1; train ready, base-red ready, train land and stamp land read and write the READY note's plan record like direct ready and land. Review fixes: grant and exception rows never pass as plan approvals, render --plan stays short when redacted, no explicit changelog-only exemption, off mode still records a resolved line. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/red-team#2 reader=red-team Review-Finding: p1/red-team#3 reader=red-team Review-Finding: p1/specialist-batched#1 reader=testing Review-Finding: bin/gstack-approvals:56:functional-contract reader=qa Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… and the policy key (GST-1751) Review-Finding: p1/specialist-batched#3 reader=testing Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…re never throws (GST-1751) A row id from an autoplan run resolves to that run's newest gate revision; a run id needs the plan approval answered and no decision left unanswered. readStore skips malformed rows and unreadable files; with the key off the check never throws or prints. Train land rechecks the Plan line before its merge on every path. /ship's Step 19-C renders Approvals with --plan; DRIVER.md back under its size limit. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…T-1751) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Step 8 plan discovery (lib/ship-audit.ts and the plan-completion sections) skips the Plan record line, so a later Plan: <path> binding is still found; render --plan refuses a line it cannot parse. The review skill's pins drop by 4 bytes. Review-Finding: p1/red-team#1 reader=red-team Review-Finding: scripts/resolvers/plan-gates.ts:206:functional-contract reader=qa Review-Finding: p1/red-team#3 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…368a20320) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…rd kinds in any case (GST-1751) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…nk 4 bytes (GST-1751) 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.
What changed
Crew PRs now carry their brief's
Plan:line under## Approvals, and /ship's finish step,gstack-ship-queue readyandlandcheck it.gstack-approvals render --plan "<the brief's Plan line>"printsPlan: approved: <autoplan run id or approval row id>,Plan: exempt: <reason>orPlan: required, with aPlan check:line under it. gstack never infers "feature" from the diff, title or changelog. A missing line reads asrequired, and a diff of changelog fragments only needs no line.lib/plan-record.ts) reads every branch's approval rows on the machine: the state root plus each Drive mirror.crew:<rule>.importAutoplannow records a structuredwords_by.gstack-ship-release finish --plan "<the brief's Plan line>") resolves the line before its first stage and printsPLAN:, so a crew that never runs ship-queue (qm) is still checked.PLAN:and writes the resolved record into the READY note. land (direct, stamp and train) checks that the note carries the PR body's current line and never reads the approval store.plan_recordpolicy key (off|warn|require, tentative key version 1.98.0.0) defaults tooff. A Capy crew session underoffgetswarn.requirecomes only from the repo policy orGSTACK_PLAN_RECORD=require.lib/ship-audit.tsand the plan-completion sections) skips the Plan record line, so a laterPlan: <path>binding still binds, andrender --planrefuses a line it cannot parse.PLAN_RECORD_MISSING,PLAN_UNRESOLVED,PLAN_NOT_APPROVED,PLAN_EXEMPT_UNKNOWN,PLAN_STORE_UNAVAILABLEandQUEUE_PLAN_MISMATCH.gstack-approvals plan-check --plan "<line>"checks a line by hand.Why
In qm, a Captain's brief replaced /autoplan with "Light plan, then build … There's no gate to Garry" for a new UI feature (qm#3186). Nothing noticed (GSTA-380 root cause 1). The brief already has a
Plan:line, but nothing read it. Now the line is visible in every PR, and a repo can make ready and land refuse a PR that lacks an owner-approved plan or a listed exemption.Blast radius
plan_recorddefaults tooff. Capy crew sessions get one extraPLAN:line in ready and land output, and nothing is refused until a repo setsrequireor a crew opts in.planfield, so older notes still load.Plan: exempt: stamp; lanes never stamp undermerge: direct, so this only matters for a hand-made stamp PR.Replay (shipped resolver, last 60 merged gstack PRs)
Each PR carried the line its brief would have had, resolved against today's approval store. Result at 2d19360: 57 pass and 3 refused, all
PLAN_NOT_APPROVED(unchanged since 32c4fa9).All 50 non-feature PRs pass. For comparison, branch-keyed lookup would have refused 7 of the 10 features. In qm (11 crew PRs), the line would have refused #3186; qm's approval store isn't readable here, so that count comes from the planning replay rather than this resolver.
Approvals
Approved: yes (record r-8c06e88fb2db). The full approval record stays private: this repository is public or its visibility is unknown.
Plan: approved: ap-20261107055041
Plan check: approved ap-20261107055041 row=a-b6f3743f2146
Main (fd0e339) was merged into this branch at 1a33c74 under the Captain's rule-19 grant a-7e8368a20320, recorded in this branch's approval store.
Summary
A Captain's brief in qm skipped the plan gate for a new feature and nothing noticed. A crew PR now carries its brief's Plan line, and ready, land and /ship finish resolve it against the owner's approval rows, so a repo can refuse a feature that never had an owner-approved plan.
Test Coverage
Coverage: 73% value-weighted (80% of 15 paths with any test). 1 existing test extended (test/ship-queue-train-land.test.ts, train land refuses a slot with no plan record under require); pass-1 fix added "the Plan record line is never Step 8's plan-file binding" in test/plan-record.test.ts. Remaining gaps: train-land direct path, stamp-commit recheck with a matching record, trainPlan on base-red ready.
Tests ran: test 1626 (files; carried from free-tests run 42356714058 at b5c0443)
Pre-Landing Review
REVIEW_LOOP: passes=2 blocking_found=7 deferred=4 noted=3 fixed=4 scope=frozen ledgers_read=4 dispatches=4 est_input_tokens=63415
Pre-Landing Review (pass 1): 4 issues — 3 auto-fixed, 1 asked (0 fixed, 1 skipped), 0 deferred, 0 noted. Pass 2: 3 noted, 0 open. The owner granted diff-plus-blocking scope for red-team#1 in pass 1; red-team#2 (a row id accepts any approved non-ruling row) is skipped under accepted gate change d5.
Gate edits: none detected (16 listed, 6 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review (openai/gpt-6.1-sol, completed at b5c0443): 2 findings marked blocking. Both are fixed at 6b6e4f6:
lib/ship-audit.ts:41:planBindingdropped plan files whose name starts with a record word (approved-plan.md,required.md). Fixed:parsePlanLine(lib/plan-record.ts:62) now needs:, whitespace or the end of the line after a record kind, and a test covers both names.scripts/resolvers/plan-gates.ts:206: the Step 8 sed matched only spaces afterPlan:, so a tab-separated binding resolved to a path with a leading tab. Fixed: the binding splits with awk on any whitespace and skips record kinds in any case, andplanBindingaccepts tabs; a test covers the tab case.Scoped re-check at 0097a91 (J1 receipt carry from b5c0443): one reader (openai/gpt-6.1-sol) read the range-diff of the reviewed range against the current one, plus the changed product paths and the base context that moved next to reviewed hunks (215 lines after the pregate regen check proved the regenerated outputs). Verdict: NO FINDINGS. Nothing is open.
Docs fix after the review bound (docs/captain.md, commit b5c0443) had only a lead read by the lane model (anthropic/claude-opus-5-5), not an independent reader.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items). All three are fixed at 6b6e4f6 by the outside-voice fixes above.
scripts/resolvers/plan-gates.ts:206Shell discovery filter was case-sensitive while the TS planBinding is case-insensitive. Fixed: the shell filter usesgrep -viE.ship/sections/plan-completion.md:30The sed skipped only spaces after Plan:, so a tab-separated line captured differently from planBinding. Fixed: the awk split takes any whitespace.scripts/resolvers/plan-gates.ts:206The shell filter used (:|$) while parsePlanLine used a word boundary, soapproved-plan.mddisagreed between shell and TS discovery. Fixed: both now need:, whitespace or the end after a record kind.Exploratory QA
Functional smoke at 2d19360 (5 captures): plan-check success, unknown exemption exit 3 and finish's require stop passed; the Plan record line read as Step 8's plan binding failed (captures 002, 005) and was fixed in pass 1. Revalidation after the fix: 5 of 5 pass, including the binding pipeline and the render --plan refusal.
Design Review
No frontend files changed — design review skipped.
Eval Results
Evals not run: the selector picks 118 behavioral probes through lib/plan-record.ts, lib/ship-*.ts and bin/gstack-approvals, over the crew's $10 per-PR paid cap; left to release coverage.
Scope Drift
Scope Check: CLEAN
Plan Completion
Plan ap-20261107055041 (gate_rev 1): 9 DONE, 3 CHANGED, 0 PARTIAL, 0 NOT DONE, 1 UNVERIFIABLE (this body states the replay numbers, below). CHANGED: ready reads the PR body's Plan line instead of a flag; stamp-only diffs need an explicit
Plan: exempt: stamp; the replay stays outside the public repo.Verification Results
The plan lists no executable verification items.
TODOS
No TODO items completed in this PR.
Documentation
Status: updated. One factual correction; no blockers.
Scope: the committed diff from 3742ee9 to 25d6beb on capy/gst-1751-plan-record (44 files; nothing staged, unstaged or untracked). I checked the authored docs and templates touched by the plan_record feature (GST-1751) against lib/plan-record.ts, lib/ship-policy.ts and lib/result-codes-capy.ts.
Documentation health:
PLAN:line.plan_recordrow matches the code: the default is off, the modes are warn and require, and it lists all six codes.Debt: the short version of 'The READY contract' in docs/captain.md doesn't list
PLAN:; it points to the template instead. No diagram drift.Test plan