Repository navigation
Capy session: defer the upgrade while a /ship or review run is open; upgrade-path fixes (GST-1677, GST-1658) - #4095
Conversation
…upgrade-path fixes (GST-1677, GST-1658) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
The pin override releases .setup-lock before an older gstack-upgrade on the local default branch runs, so that copy takes the lock itself instead of refusing against the session's own pid; the no-flock eval-lock test skips visibly instead of returning. Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/specialist-batched#1 reader=testing Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
Flaky rerun (standing approval, Captain ruling 2026-11-06): Free Tests run 42286115843 attempt 1 failed in quick-bun-default shard 4/8 on |
…_BUSY cause 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>
|
Flaky rerun (standing approval): Free Tests workflow_dispatch run 42290640070 at head af9ca2c failed in quick-bun-default shard 4/8 on |
What changed
bin/gstack-capy-session: an open /ship ledger or review start now defers the install-mode upgrade. Before, only a workflow lease (which counts for 120 minutes) or a live eval run held the upgrade back.
Before/after as text: bin/gstack-capy-session: an open /ship ledger or review start now defers the install-mode upgrade
Why
During a /ship on gstack-evals #252, the docs audit's session check ran
install.sh --for <skill>and moved gstack from 1.96.0.0 to 1.97.0.0 in the middle of the run, because the workflow lease that should have stopped it only counts for 120 minutes. Now any install on a machine with an open /ship ledger or an unconsumed review start keeps the installed gstack, saysSELF_UPGRADE: deferred (...)and still endsgstack: ok; the next install after the run closes upgrades as before.Blast radius
Only the Capy install-mode session start changes (bin/gstack-capy-session, plus the lock handover it shares with bin/gstack-upgrade and one fix-note string in bin/gstack-capy-install); below the supported minimum the bootstrapper's floor rules run first and nothing here applies. The deferral reads only the state root's ship-budget ledgers (no
closed_at, written in the last 6 hours) and review starts (under 120 minutes), so an abandoned run cannot hold the upgrade back for good; this was walked through in 121 passing fixture tests across test/capy-skill-wrapper.test.ts and test/gstack-capy-install.test.ts, including a failing-first repro of the older-gstack-upgrade lock case.Tests
Failing-first: against the original bins, 9 of the 11 new or changed wrapper cases failed, and so did the installer fix-note case. The below-floor guard and the reseated restore test passed on both, as they should. New cases are in
test/capy-skill-wrapper.test.ts(an open ledger defers and a closed one upgrades; an idle ledger doesn't defer and an open one stops the pin override; review starts; below-floor refusal; the eval lock without flock; the lock handoff; upstream; the failed restore; BSDdate; a reason with nothing pinned) andtest/gstack-capy-install.test.ts. The existing restore test moved to a stubgstack-upgradethat refuses, because a held setup lock now refuses before the switch. The sanitizer expectation now asserts that nofix:survives.Approvals
Approved: yes (record r-4ad541aef4f9). The full approval record stays private: this repository is public or its visibility is unknown.
Summary
A long /ship could have gstack upgraded under it when a docs or review subagent ran the Capy install check. The session now treats an open /ship or review run on the state root as a workflow boundary and defers the upgrade until it closes (GST-1677). The same upgrade path gets smaller fixes (GST-1658): the eval-lock probe works without
flock, the unreasoned-pin override switches branches under the setup lock and hands it togstack-upgrade(except when the local default branch'sgstack-upgradepredates the handover: then the lock is released for that copy, the ruled note below and GST-1680), a created default branch tracks origin, a failed restore is reported as such, and a pin reason can no longer inject its own trailer note. The pre-landing review found that a local default branch whosegstack-upgradepredates the lock handover would refuse against the session's own lock; the session now releases the lock for such a copy so it still upgrades.Test Coverage
Each of the 3 changed runtime files has a changed test naming it (Step 7 coverage map). Not covered: the perl fallback of the eval-lock probe and the no-probe (fail-closed) branch; the tests exercise python3 only.
Regression proof for
a local main whose gstack-upgrade predates the handover still upgrades: fails at 69a1bb5 (SELF_UPGRADE: skipped (another gstack updater holds .../.setup-lock (pid <session pid>) ...)), passes after 6a64639.Tests ran: test (bun run test) carried from CI, count in the receipt.
Pre-Landing Review
Pass 1 (whole diff, specialist + red team): 2 findings, both fixed in 6a64639. red-team#1 (raised to CRITICAL by the lead): an older
gstack-upgradeon the local default branch refused against the session's own.setup-lock, so an unreasoned pin was never overridden; the session now releases the lock before such a copy runs. specialist-batched#1 (INFORMATIONAL): the no-flock eval-lock test returned early and read as a pass; it now usestest.skipIf.Pass 2 (fix range, specialist + red team) and Step 11 (adversarial, outside voice openai/gpt-6.1-sol, targeted auth reader on the fix range): no fixes; one CRITICAL ruled a disclosed note by the Captain (below), the rest noted.
REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=1 fixed=2 scope=frozen unrecorded=1 ledgers_read=3 dispatches=8
Ruled note: bin/gstack-capy-session:309:race at 6a64639 ruled by Captain GStack Minder (GSTA-36), 2026-11-06 at 2026-11-06T20:31:35.082Z: Old-local-main lock gap: needs an old main plus a concurrent updater in a seconds-long window; pre-PR the whole switch and restore ran unlocked; follow-up GST-1680 (approval a-5ec072a3810c)
Gate edits: none detected (5 listed, 3 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: completed (openai/gpt-6.1-sol via host subagent): request changes on the legacy lock-release path; ruled a disclosed note with follow-up GST-1680. Coverage limit: the Step 11 voices read only the pass-2 fix range (69a1bb5..6a64639), not the original diff.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
bin/gstack-capy-session:309On the old-copy fallback the session releases .setup-lock after switching to the default branch, so a concurrent gstack-session-update can take the lock in the gap, and a refused old copy's rollback checkout runs unlocked. This is the pre-diff behavior for old copies (before this PR no lock covered the switch at all), so not a regression; the comment's invariant holds only for copies that accept the handover.bin/gstack-capy-session:309Handover support is detected by grepping for GSTACK_SETUP_LOCK_OWNER, which a comment would also match; it fails safe (refusal, pin restored).bin/gstack-capy-session:309(fingerprintbin/gstack-capy-session:309:race, outside-voice#1, adversarial-native#1 folded): on the fallback for a local default branch whosegstack-upgradepredates the lock handover, the session releases.setup-lockafter the pin switch. A concurrentgstack-session-updatecan take it in that gap; the old copy then refuses and the pin restore runs unlocked under that updater's setup. The unlocked switch and restore predate this PR (a7585d0 held no lock across them).Exploratory QA
Functional surface, fixture harness only (no live pinned machine): 2 probes, verdict pass. 001: an open ship ledger defers the upgrade and a closed one upgrades. 002: the setup-lock handover, including the older-copy case (failing-first at 69a1bb5, passing after the fix), the held-lock refusal and both pin-restore paths. Test output goes to stderr, so the captures hold exit codes only.
Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Review bot comments
No review bot comments.
Scope Drift
Scope Check: CLEAN
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.
Issues
Refs p1/red-team#1
Refs p1/specialist-batched#1
Verification Results
No plan-specific verification items (bug fix, no plan file): VERIFY_RESULT skipped.
TODOS
No TODO items completed in this PR.
Documentation
Status: updated. The docs for the deferred Capy upgrade (GST-1677/GST-1658) are accurate after two small factual fixes.
Scope: diff a7585d0..6a64639 plus the unstaged changelog fragment: bin/gstack-capy-session, bin/gstack-upgrade, bin/gstack-capy-install, docs/capy-install.md, docs/troubleshooting.md and tests. Cross-doc grep covered UPGRADE_BUSY, the setup lock, the deferral and the pin text.
upgrade-skippedandpin-unreasonedsections now name an open /ship or review run as an UPGRADE_BUSY causeCoverage debt: the
SELF_UPGRADE: deferredandpin not restoredoutputs and theGSTACK_SETUP_LOCK_OWNERhandoff have reference coverage (capy-install.md, troubleshooting.md, the gstack-upgrade header) but no how-to.pin not restoredhas no troubleshooting anchor of its own; it is a common gap. Diagram drift: none.Test plan
🤖 Generated with Claude Code