Repository navigation
v1.91.324.0 fix(ship-budget): project steps and reviewers from the run's own spend, settle reviewers when they return (GST-101) - #3614
Merged
Conversation
…tle dispatch reservations when reviewers return (GST-101) The /ship budget projected every step and dispatch from fixed constants (7.43M per dispatch, 2.25M per default step) plus a fixed 4.48M reserve, so real caps refused work that cost 3-20x less (GSTA-152 PR B, GSTA-2). Each settled reservation is now measured on the next reading, and the run projects with its own factor (max actual/prior of its last three measurements x 1.5), the prior only before the first measurement. The default tail reserve scales with the step factor; the stop overhead keeps its fit. Reservations of reviewers admitted one at a time no longer pile up: check --returned settles named dispatches, --finish settles the pass's dispatches of that step, and a step change settles consumed dispatches. DRIFT and BUDGET_DRIFT lines print projected against actual. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Unseen charges (settle --unknown, a Claude-metered outside voice) are booked at their reservation and never measured, so they cannot shrink the dispatch factor. The handoff holds back the same calibrated reserve as check, so a delegate verdict is one the handoff admits. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…calibrated reserve 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>
|
😎 This pull request was merged. |
…eout It spawns about 100 CLI processes; on windows-latest it ran past the shard runner's 30s per-test timeout (windows-free-shard 5, run 40917695070), and on 2 cores it sat at bare bun test's 5s default. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
4 tasks done
…alibration Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
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
An 8M /ship budget now projects steps from the run's own measured cost (0.47M) instead of the 2.25M prior, so it reaches Step 6.5 instead of stopping at Step 6.
Before/after as text: An 8M /ship budget now projects steps from the run's own measured cost (0.47M) instead of the 2.25M prior, so it reaches Step 6.5 instead of stopping at Step 6
Why
GST-101: "7.43M projected vs 0.23-1.02M actual" per reviewer on GSTA-152, and about 2.25M projected per step against roughly 0.27M spent on GSTA-2, so real token caps refused work that cost a small fraction of the guess. Once a run has measured a step or a reviewer, it now projects the next one from its own spend, with the same 1.5x headroom the committed fit uses, and it still stops with room to stop.
Blast radius
Only
gstack-ship-budget,gstack-review-log --finishand the handoff read the new fields, and every run starts at the calibrated prior until its first measurement, so a run with no reading behaves as before. Old ledgers parse unchanged because the newsamplesandunseenfields are optional; this was walked in review and is covered by the existing ship-budget suites (114 tests across 15 files pass locally).Approvals
No approvals recorded for branch gst-101-ship-budget-calibration.
Summary
The /ship budget projected every step and dispatch from fixed constants, so caps refused cheap work (GSTA-152 refused its third reviewer at 29.28M; GSTA-2 stopped before Step 6 at 8M). Each settled reservation is now measured on the next reading and the run projects with its own factor, the largest actual/prior ratio of its last three measurements times 1.5. Reviewers admitted one at a time are settled when they return (
check --returned,--finishfor the whole pass, or a step change), andDRIFT:/BUDGET_DRIFT:lines print projected against actual. Review found two gate defects in the first cut, and both are fixed here. Charges the meter cannot see were being measured, and handoff held back a different reserve than check.Test Coverage
Tests: 11 new in test/ship-budget-projection.test.ts (8 from the fix, 3 from review); 2 existing tests in test/ship-budget.test.ts re-pinned to the calibrated behaviour.
Coverage: 79% value-weighted (11 of 14 paths; 1 weakly covered path: the 3-sample window slide is exercised only inside the PR B replay).
Test value: 3 tests written by review fixes, 0 rejected by the authoring gate, 0 existing tests extended, 1 path weakly covered.
Regression proof — fails at HEAD: yes (8 at ad8e12d; the 3 review-fix tests at f30c33f) · passes at base: unavailable (new behaviour, no base control run) · passes after fix: yes
Gaps, not filled (audit-only): the meter-epoch filter in measuredFactor, measureSettled's no-reading guards, and freshReading under the Claude meter.
Pre-Landing Review
Pre-Landing Review: 9 issues — 2 fixed (blocking), 7 noted. Pass 2 on the fix range: no issues at the floor, 1 noted.
REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=8 fixed=2 scope=frozen dispatches=2
Gate edits: 5 listed, 3 read, 0 findings — the three untagged hunks in test/ship-budget.test.ts re-pin the tests to the calibrated behaviour (dead STEP2 removed; the exact-at-cap boundary now uses an unmeasured dispatch; the spend test expects the measured factor). None relaxes an assertion.
Outside review: completed by openai/gpt-6.1-sol (Capy subagent, cross-family); it found both blocking defects fixed here. Codex CLI not installed, so the Codex passes were unavailable.
Review notes
Below the blocking floor, listed rather than looped (CREW rule 23):
lib/ship-budget.tsmeasuredFactor has no floor of 1, so one cheap early step lowers every later projection and the tail reserve. That is the intended calibration (trail rows 4-5); the stop overhead is never scaled.--finishsettles sibling dispatch reservations of the same step that are still running.--returnedsettles a reservation that never started instead of releasing it.--unknownsettle could still be sampled once.l.tail, and handoff reads the reserve without measuring first (it agrees with the delegate check at the same reading).bun test's 5s default;bun run testuses 30s.segmentEstimate.Exploratory QA
CLI replay of GSTA-2 through the real
gstack-ship-budgetat ad8e12d and at this branch (the image above): the base stops before Step 6 with 6.5M unspent; the branch admits Steps 6 and 6.5 and stops at Step 7 with the stop reserve intact.Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related eval selected: the only skill prose change is two sentences in ship/sections/budget-handoff.md(.tmpl); gen:skill-docs is fresh and the parity suite passes.
Plan Completion
6 of 6 plan items done (the 4 design rows of the decision trail plus the two ledger notes in the GSTA-152 PR B evidence).
TODOS
No TODO items completed in this PR.
Documentation
Status: updated — one factual fix in docs/ship-budget.md.
Scope: base ad8e12d..HEAD (2 commits, 11 files: ship-budget CLI/lib, handoff, review-log, tests) plus unstaged CHANGELOG.md; docs referencing gstack-ship-budget (docs/ship-budget.md, ship/sections/budget-handoff.md.tmpl, docs/troubleshooting.md, docs/unattended.md).
Documentation health
Coverage debt:
--returned,settle --reading,DRIFT:/BUDGET_DRIFT:and thecalibration=field have reference coverage in docs/ship-budget.md only (no how-to or troubleshooting entries); common gaps, not filled. No diagram drift (no diagrams reference these modules).Test plan
gstack-pregate --stage tests --remote --spend-cap 2 --timeout 2700 --allow-repo-commandsat ac8cd2a: remote gate 18575 tests, 0 failed (tree c1ce761bb4dd, $0.09); preflight regen, secrets, strays, literals, timing and guards passbun test --timeout=30000on the ship-budget suites, claude-usage, parity-suite, module-size-ratchet, spawnsync tripwire and bun-entry-isolation: 114 pass, 0 failbun run typecheck: clean;bun run typecheck:test: none newbun run gen:skill-docs: freshDecision trail: reports/GSTA-166-decisions.tsv in the GStack Minder drive.
🤖 Generated with Claude Code