Repository navigation
Conversation
…overs after an unreadable init (#3651) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…oter; an init with no text block no longer locks the session) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…) does Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…-reset line (#3651) 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>
|
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 |
E2E Evals: ✅ PASS0 executed, 0 reused rule/judge records | 0 manual accepted (unscored; no score-cache credit) | $0 rule/judge cost | reconcile exit: 0 Profile: pr / mode Rule and judge shards
Fail-closed reconciliationSliced lane: planner → duration-packed executors → fail-closed report. Behavior cases run a pre-registered 3-trial panel (PASS at 2/3 with no contract violation); a PASS 2/3 is shown with its failed trial, never as a clean pass. Reused results retain their original provenance and expiry. Dispatched narrow screen (gstack-ship-queue ready --screen) of merge commit |
|
Frozen in wave |
* fix(eval-plan): per-arm pilot projection and --seat-metered arms (#3653) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(autoplan): guard tolerates Claude Code's cwd-reset footer and recovers after an unreadable init (#3651) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes (journal reader strips the cwd-reset footer; an init with no text block no longer locks the session) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: journal reader skips a failed or unreadable init, as invocation() does Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * feat(autoplan): --ceo-only runs the CEO review alone with zero questions (GST-537) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(eval-plan): all-seat pilot, single-attempt arm and --seat-metered CLI wiring Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(eval-plan): summed deviation adds arm deviations, matching the summed band (arms share rows) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes (test pins an unpriced seat-metered arm) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes (seat-metered declaration fixed per --out, price row still required, a real charge settles as spent) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: classify autoplan-ceo-only in the Codex host metadata Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: a seat-metered arm that settles a charge is projected as a priced arm Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: select autoplan-ceo-only on the skills it runs; say it needs Claude Code Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(skills): /eval-plan --seat-metered and per-arm projection Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(eval-plan): skill prose stays under its context budget and carries no $N token Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: run autoplan-ceo-only in the marathon lane Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(skills): a seat-metered arm leaves the seat set once it settles a charge Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: changelog entry for /autoplan --ceo-only Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(autoplan): init_failed covers unreadable init output and the cwd-reset line (#3651) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: count the autoplan-ceo-only paid file in the shard inventory Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(autoplan): #3651 tests pass the test-code type ratchet Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(dx): CAP finding titles carry a one-line description (GBRA-223 claim 2) The DX error contract told both autoplan DX voices to title capped findings exactly CAP4:<path>:<item>, so gates, tasks and reconcile saw a bare code. The title is now CAP4:<path>:<item> <what fails>; the grader already parses that shape. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(autoplan): reconcile pairs same-file findings that carry no line (GBRA-223 claim 1) Plan reviews name files, rarely lines, and reconcile associated by location only when both findings had a line, so findings both voices raised on one file were filed new and native-only. A same-file pair with a missing line is now associated as unverified (basis file), never confirmed; a CAP code no longer counts in title comparison. DRIVER.md names submit --reconcile. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(autoplan): open Critical and High findings reach the gate as apply items (GBRA-223 claim 3) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(autoplan): a spend cap binds on every unattended host; --estimate-usd persists; DRIVER names --usage-usd (GBRA-223 claim 4) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(autoplan): run binds complete api results, names a truncated response, --max-tokens; DRIVER documents run (GBRA-223 claim 6) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * feat(autoplan): carry an item-by-item answer when the later gate asks nothing new (GBRA-223 claim 7) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(dx): trim the compact error contract so plan-devex-review stays under its size pin Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes (p1b applies finding fixes, api attempts reserve no host default, cross-file title pairing, paired severity counted) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: review fixes (priced api reservations, no file-only twins, two-pass pairing, partial replies keep p1-dependent defaults open, outside refusal degrades) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * P7: record whose words answered a gate (--words-by agent:<id>), never carry an agent's own words, import each row under its own answerer (GEVA-2) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: review pass 2 (p1b needs --rec-hash after recommend; api calls send the output limit they reserve for) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * changelog: fragment for the /autoplan field-report wave (GST-672) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: captain record notes --words-by agent attribution Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: follow finding apply items in approval-class and Captain flow tests; bind run-api limit to DEFAULT_MAX_TOKENS Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * wave autoplan: lower the gemini plan-devex-review pin to its exact size after #3781's DX trim Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(autoplan): CAP titles on different paths never match by title in reconcile or confirm rounds (wave review) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(autoplan): a truncated api call settles its cost and a retry is admitted afresh against the cap Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(autoplan): an applied finding stays open until the revised plan is reviewed; a shared location alone never twins two findings Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(approval): a plan gate answered in an agent's own words is not owner approval Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(gate): a new answer replaces the earlier answer's authorship and words Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(autoplan): a failed api call with no usage keeps its attempt open; reservations price the bound prompt (wave fix-check) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(autoplan): a spend cap fails closed: only a call refused before sending keeps its attempt; a sent call with unknown usage settles at its reservation Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(autoplan): the 16384 output default applies to both providers; changelog for the wave's integrator fixes Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(autoplan): how run settles a failed api call; changelog scopes it to the native voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(autoplan): a spend cap fails closed on every exit of run; an unpriced model reserves the default once a cap is set Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(autoplan): every sent call settles; an unpriced model under a cap reserves the default Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(autoplan): DRIVER and help say a cap reserves in any session kind and how run settles a sent call 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>
What changed
The eight #3651 tests run against main's guard code (this branch's test file copied onto main 3bfe566) and against this branch at 0d53a5f: 8 fail on main, 8 pass here.
Before/after as text: the 8 #3651 tests on main's guard code and on this branch: main locks the session after a cd-style init; this branch binds, recovers and keeps the first binding
Why
#3651: running the /autoplan snapshot init as
cd <dir> && …locked the Claude Code session, and every later phase read was denied with codeevidenceuntil a new session. When a command'scdleaves the session's folder, Claude Code 2.1.316 appendsShell cwd was reset to <dir>to the Bash result, so the guard could no longer read the init's JSON. Now the guard removes exactly that line before reading, and an init it still can't read is a failed, recoverable init with a re-run hint.Blast radius
The change touches only the publication guard's reading of Bash results: the hook (
autoplan/bin/phase-publication-hook.ts) and the journal reader (autoplan/bin/guard-journal.ts), which now share one footer-strip helper and skip the same failed or unreadable inits. A forged footer can't widen trust, because the init command still has to match the literal argv check and checkpoint JSON is still compared with the manifest on disk (walked failure path in adversarial review; 672 guard tests pass at 0d53a5f).Approvals
No approvals recorded for branch gst-566-autoplan-cwd-footer.
Summary
"The guard locks the session after a cd-style init" was the report. The guard now strips one final
Shell cwd was reset to <dir>line from init and checkpoint results, and anything else after the JSON still fails closed. An unreadable init, including one with no single text block, is recorded asinit_failedwith a "re-run without a leading cd" hint instead of locking the session, so a later clean init binds again. The journal reader skips the same inits the hook does, so both agree on where a session's window starts. Theinit_failedentry in docs/autoplan-guard-troubleshooting.md says so.Security read: nothing here makes network calls, reads environment variables or secrets, widens permissions, edits workflows or install scripts, or adds a dependency.
Test Coverage
8 new tests in
test/autoplan-publication-guard.test.ts(63 lines, an existing file): an init with the footer binds; other trailing text, two footers, or a footer that isn't the last line giveinit_failedwith the re-run hint; a later clean init recovers after an unparseable init and after one with no single text block; the first binding survives a re-run after a typed user message; a rerun checkpoint whose result carries the footer still retires the old close.Tests: 1571 test files in the repo, 0 new files; 8 tests added to an existing file.
Regression proof — fails at main: 8 of 8 fail with this branch's test file copied onto main 3bfe566 · passes after fix: 8 of 8 at 0d53a5f.
Tests ran: guard 672
Tests ran: guards 19
Tests ran: typecheck count unavailable (product typecheck and the test-code type ratchet, both clean)
Pre-Landing Review
Pass 1 (specialists) found nothing. The adversarial pass found two problems, both fixed in bdac971. First, the journal reader didn't strip the footer, so the real hook still denied
phase_orderafter a cd-style re-init. Second, an init with no single text block still locked the session. The fix-check on those fixes found a blocker: the journal reader and the hook disagreed on which init starts a session. Fixed in 532c0f3. A second fix-check at 532c0f3, granted by GStack Minder under crew rule 23, found nothing, and the native adversarial pass re-run at the final code tree (efe1cd5) found two Low items, noted below. ffa0f97 after it is a docs-only commit. Then CI's test-code type ratchet (bun run typecheck:test, run 41239771336) refused 2 new type diagnostics in the new tests; 0d53a5f fixes them with two casts, and one more fix-check on that hunk, granted by GStack Minder under rule 23, found nothing (tree b56b005).REVIEW_LOOP: passes=1 blocking_found=1 deferred=0 noted=0 fixed=1 scope=frozen fix_checks=3 dispatches=1
Gate edits: one test file extended (
test/autoplan-publication-guard.test.ts, additions only); no test, threshold or CI gate relaxed.Outside review: not run. The cross-family voice is kept for PRs that publish numbers (crew rule 30a), and this one doesn't; that is missing coverage, not a pass.
Review notes
Non-blocking findings, listed and not looped (crew rule 23 floor):
init_unbindablein docs/autoplan-guard-troubleshooting.md and autoplan/SKILL.md.tmpl say chaining can't bind, while the hook accepts one literal leadingcd <dir> &&. The wording steers agents toward the safer shape, so it was left alone.Exploratory QA
Ran at 98f31e9, before the review fixes. The guard lane re-ran the whole guard suite at 0d53a5f: 672 pass, 6 skip, 0 fail. One local run of test/autoplan-publication-guard.test.ts at 0d53a5f showed 3 failures whose names weren't captured; 15 reruns at the same tree passed.
Contract outcomes
Findings
None.
Discoveries and permanent tests
No new tests proposed; the diff already adds them.
Coverage limits and cleanup
No live Claude Code session was driven; the footer text comes from the #3651 report, not an observed host. Capture 001 is the first capture and has no checkpoint. Owned state: only the report dir; nothing else created. Later source changes would invalidate this evidence. Overall status: pass (evidence.json).
Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Plan Completion
Plan: GSTA-218 (approved). D3 (recover after any unparseable init output) and the #3651 footer fix are done here; #3653 ships as its own PR.
Issues
Fixes #3651
Verification Results
The plan's checks: failing tests first (8 fail at main, 8 pass here) and the footer shape taken from a real Claude Code 2.1.316 run (
~/.capy/work/cc-a/out.jsonl): PASS. Remote pregate on Ubicloud: 4218 selected tests, 0 failed, at tree b56b005 (commit 0d53a5f). The two remote-only lanes (macos-named-regressions, windows-free-shard) clear from this PR's Actions runs.TODOS
No TODO items completed in this PR.
Documentation
Status: blocked, shipped under the owner's named exception below. Audit docs-b2 updated
docs/autoplan-guard-troubleshooting.md(ffa0f97); the later commit 0d53a5f changed only test code, which made the audit's snapshot stale, and /ship allows no third audit.Documentation exception: accepted by GStack Minder 2026-10-31 via GSTA-218 rule-23 thread: docs audit docs-b2 is current except for test-only type casts in 0d53a5f, which no doc describes
Scope: docs/, README.md, AGENTS.md, CONTRIBUTING.md against base 3bfe566. docs-b2's result:
Status: updated. One factual edit, no blockers.
Scope: branch
gst-566-autoplan-cwd-footeragainst base3bfe5667(head532c0f37, 3 commits). The selected changes areautoplan/bin/guard-journal.ts,autoplan/bin/phase-publication-hook.ts,test/autoplan-publication-guard.test.tsandchangelog.d/gst-566-autoplan-cwd-footer.md. Nothing is staged, unstaged or new. Revieweddocs/autoplan-guard-troubleshooting.md,autoplan/SKILL.md.tmpl, and the autoplan entries indocs/troubleshooting.mdanddocs/skills.md.Documentation health:
docs/autoplan-guard-troubleshooting.md Updated (
init_failednow says that an init whose output is not its JSON result counts as a failed, recoverable init with the "without a leading cd" hint, and that the guard removes exactly one finalShell cwd was reset to <dir>line, #3651)autoplan/SKILL.md.tmpl Current (the init step's "own Bash call, no chaining" guidance matches the new hint)
docs/troubleshooting.md Current (no autoplan guard code entries affected)
docs/skills.md Current (no guard details)
README.md Current (not affected)
CHANGELOG.md Skipped (entry is the changelog.d fragment, owned by the parent)
TODOS.md Skipped (outside the ship-owned scope)
Coverage debt: the changed public surface is guard behavior. The
init_failedreference is now current, and no how-to or tutorial is needed for an internal recovery path. Separate from this change,init_unbindablesays chaining cannot bind, but the hook accepts one literal leadingcd. That gap was left for the author.Diagram drift: none (no diagrams cover the guard).
Test plan
bun test test/autoplan-publication-hook.test.ts test/autoplan-publication-guard.test.ts test/autoplan-guard-reasons.test.ts test/autoplan-publication-payload.test.ts test/autoplan-guard-log.test.ts test/autoplan-publication-generation.test.ts test/autoplan-bounded-journal.test.ts test/troubleshooting-anchors.test.ts: 672 pass, 6 skip, 0 fail at 0d53a5fbun test test/module-size-ratchet.test.ts test/spawnsync-timeout-tripwire.test.ts test/bun-entry-isolation.test.ts: 19 pass, 0 fail at 0d53a5fbun run typecheck && bun run typecheck:test: exit 0, "none new" at 0d53a5fUBI_OWNER=gsta218 gstack-pregate --stage tests --remote --spend-cap 2 --timeout 2700 --allow-repo-commands --base main: 4218 tests, 0 failed (tree b56b005)🤖 Generated with Claude Code