Repository navigation
ship budget: count a Capy /ship helper's calls from the call log (GST-1585) - #4059
Conversation
…tack-ship-* bins write (GST-1585) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…er Step 22 line keeps the capy skill budget (GST-1585) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/red-team#2 reader=red-team Review-Finding: p1/specialist-batched#2 reader=testing Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…asses Review-Finding: p3/outside-voice#2 reader=outside-voice Review-Finding: p3/adversarial-native#1 reader=adversarial-native Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…fixes Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…gment text Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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 |
Draft. /ship writes the final body.
A Capy /ship helper can't read its own transcript, so every helper reported
CALLS: unavailable. On Capy, the gstack-ship-* bins and the review pass loader now append one row each to<state root>/ship-calls.jsonl, andgstack-ship-budget calls --record <rec>rebuilds the helper's calls from those rows (no added call). GSTA-330 H1.What changed
Before: a Capy /ship helper had no way to count its calls. After:
calls --recordrebuilds them from the call log the ship bins write.Before/after as text: Before: a Capy /ship helper had no way to count its calls. After: calls --record rebuilds them from the call log the ship bins write.
CALLS: unavailable(it can't read its own transcript)CALLS: source=log calls= phase= pass= section= other= keepalive_est= total_est= ...<state root>/ship-calls.jsonlwhen it exits, on Capy onlygstack-ship-budget calls--events <file>only--run <id>or--record <path>(with--log,--since,--until)CALLS: unavailable source=log reason=no rows in the run window log=<file>, never zerosfinishthat runs for minutesWhy
"Every Capy /ship helper reported
CALLS: unavailable", so nobody could tell how many calls a helper spends or whether a 240 s keep-alive would pay off (GSTA-330 plan item H1). Now each helper gets a real call count and a keep-alive estimate from the commands it already runs, at no extra call.Blast radius
Seven bins (gstack-ship-budget, parts, policy, preflight, queue, release and gstack-review-dispatch) gain one
logShipCallline, andgstack-ship-budget callsgains the log mode. The logger runs only underGSTACK_CAPY=1, writes at process exit inside a try/catch, and a child bin writes nothing, so a failed write can't change any command's output or exit code. That is tested:test/ship-call-log.test.tscompares the stdout, stderr and exit of a run whose log write fails against a normal run (script ran).bin/gstack-ship-receiptis untouched.Approvals
Approved: yes (record r-aa3ca219ddad). The full approval record stays private: this repository is public or its visibility is unknown.
Summary
A Capy /ship helper runs as a subagent, and a subagent can't read its own transcript, so every helper reported
CALLS: unavailableand we had no data on how many calls a run spends. The ship bins now log one row per command on Capy, andgstack-ship-budget calls --record <rec>turns those rows into a call count with phase, pass and section splits plus a keep-alive estimate. Review found that a long background command, an early-settled pass and back-to-back pass loaders could each skew the count (one case printedInfinity); those are fixed and pinned by tests, and an empty window now saysunavailableinstead of printing zeros.Test Coverage
Step 7 ran audit-only (no generation allowance, unattended): 8 of 15 changed paths have a test (53%), 7 of 15 a strong one (47%). Gaps with no test: rotation past 8 MiB is now covered; still uncovered are malformed-line skipping,
calls --run <id>, and the row write for gstack-ship-policy, preflight, queue and release (gstack-ship-parts, budget and review-dispatch are tested).Tests: 4 → 7 in test/ship-call-log.test.ts (+3 new: long background row, non-rerun loaders, early-settled pass), and 1 existing test extended (rotated log, empty window).
Regression proof: the two granted-fix tests failed before commit 0029bbe (5 pass, 2 fail) and pass after; probes 002 and 003 failed at ec01ae7 and pass on the fix.
Tests ran: free 1602 files (carried from CI run 42187969619/1 at tree 28fbeabd8f61, 35856 tests; 6 files skipped here, 5 not owed)
Pre-Landing Review
Pre-Landing Review: 4 issues — 2 auto-fixed, 2 asked (1 fixed, 1 skipped), 0 deferred, 0 noted.
REVIEW_LOOP: passes=1 blocking_found=2 deferred=0 noted=7 fixed=4 scope=frozen unrecorded=1 unbound=5 ledgers_read=5 fix_checks=2 dispatches=4
Review-loop exception: accepted by GStack Minder 2026-11-06 via GSTA-333 parent message 2026-11-06 (approval a-d3519c3ba452): one scoped fix-check after round 2 for outside-voice#2 and adversarial-native#1; outside-voice#1 ruled below the floor as a disclosed note (fix-check at 0029bbe, 3 findings)
Gate edits: none detected (1 listed, 0 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 (host subagent) completed with 2 findings. outside-voice#2 (loaders under 200 s apart made the keep-alive cycle 0 and the totals
Infinity) is fixed under GStack Minder's grant of one scoped fix-check (approval a-d3519c3ba452). outside-voice#1 (concurrent helpers on one state root count in each other's window) was ruled below the floor by GStack Minder on 2026-11-06 as a disclosed note; the follow-up is a run id from the launch file, tracked on GST-1585.Native adversarial: completed, 5 findings (Blocks: no); #1 (an early-settled pass swallowed the next phase call) is fixed under the same grant. Targeted (money): NO FINDINGS on every pass.
Review notes
step,readingandcreditsare logged but not read yet;--eventswins over--record;--loghas no~expansion.Exploratory QA
Functional smoke on the CLI, report in the run dir (verdict pass): 001 a bin writes one row on Capy (pass); 002 a 20-minute background row absorbed three later calls (failed at ec01ae7, replayed as 004 on the fix: calls=3, pass); 003 a missing log printed zeros (failed at ec01ae7, replayed as 005:
CALLS: unavailable, pass). Not probed live: rotation, sibling-run rows and the other six bins.Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed (gstack-diff-scope SCOPE_PROMPTS=false) — 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/specialist-batched#2
Refs p3/adversarial-native#1
Refs p3/outside-voice#2
Verification Results
No plan-specific verification items (no plan file). Automatic exploratory QA above: 5 captures, 3 pass on current inputs, 2 superseded.
TODOS
No TODO items completed in this PR.
Documentation
Status: updated. One factual fix in docs/ship-budget.md.
Scope: committed, staged, unstaged and new-file changes from base 12d18a2 to head 818cc6f on capy/gst-1585-helper-calls. The change adds call-log rows written by the gstack-ship-* bins and gstack-review-dispatch, plus
gstack-ship-budget calls --run|--record|--log.Documentation health:
--since/--untilflags.calls --record <rec>.Coverage debt: the call log has reference and explanation coverage in docs/ship-budget.md. It has no how-to or tutorial (a common gap). No diagram drift.
Test plan