Repository navigation
v1.92.40.0 ship-budget: a subagent's /ship cost says it is the root counter, an upper bound (GST-467) - #3696
Merged
Merged
Conversation
…ost lines, refuse METER_SCOPE_PARENT (GST-467) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… document the cap on a tree run Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…bels reach the return file, drift and reconcile lines; reading-missing fix names the subagent route Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…only Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…meter-scope Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # ship/DRIVER.md # ship/DRIVER.md.tmpl
4 tasks done
4 tasks done
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
A subagent's /ship close output: every cost line now says it is the root counter, an upper bound.
Before/after as text: A subagent's /ship close output: every cost line now says it is the root counter, an upper bound
Why
A Capy subagent cannot read its own jam counter, so its /ship read
"this", the root thread, and printed that total, sibling lanes included, as its own cost (#3686's ledger baseline 5,769,355,282 was the root counter). The approved rule is "a tree-scoped run can never print an unlabeled cost": a run started with--meter-scope tree, or a subagent reading"this", now printsMETER: tree (root counter, upper bound)under every cost line, and a subagent asking forselfwhile reading"this"is refused withMETER_SCOPE_PARENT.Blast radius
The change touches gstack-ship-budget's start, resume, rebuild, handoff and return paths, the result-code table, the Capy skill's budget line, docs/ship-budget.md, docs/troubleshooting.md and the driver's Step 22. It is safe because the label is added only when the ledger holds
meter_scope: tree; a run started without the new flags prints byte-identical output (test 'a self run is not' labeled, and the 399 existing ship-budget tests pass unchanged).Approvals
No approvals recorded for branch gst-467-meter-scope.
Summary
gstack-ship-budget starttakes--meter-scope self|tree,--reading-from this|ownand--subagent(orGSTACK_SHIP_SUBAGENT=1). A tree-scoped ledger labels BUDGET, NOTE, BUDGET_FINAL, BUDGET_TIMELINE, BUDGET_DRIFT and RECONCILED lines once each, keeps the scope through a re-start, a rebuild from the record and a handoff child, and writes the label into the return file the parent reads. The Capy skill and docs/ship-budget.md tell a subagent to pass--subagent --reading-from this --meter-scope treeand say exact per-run cost comes from a root replay thread; a--token-capon a tree run stops on that upper bound.Trial merges (Rule 25) at a0b2dd2: #3702 (c5036a6) merges cleanly, with DRIVER.md at 12,286 of 12,288 bytes. #3686 (e432553) conflicts in capy/skill/gstack/SKILL.md, ship/DRIVER.md, ship/DRIVER.md.tmpl and test/review-pass.test.ts; it already conflicts with main 83ae96e alone in those files, and per the Captain's Rule 19 grant #3686 merges main once after this PR lands and refits DRIVER.md against these bytes. #3698 (b15b9b2, lib/capy-review-pass.js) and #3703 (799b2d2, docs/review-policy.md and test/review-dispatch.test.ts) conflict with main alone, in files this PR does not touch.
Documentation
Status: current. No documentation edits were needed.
Scope: audited gst-467-meter-scope against base 41a67b9 at HEAD b8e4785 (clean tree). I checked the docs-relevant diff hunks and grepped the tree for stale subagent/root-counter claims. Coverage was diff-hunk and grep based, not every doc read in full.
Documentation health:
docs/ship-budget.md [Current] tree-scope text, METER_SCOPE_PARENT link and replay-thread pointer present
docs/troubleshooting.md [Current] meter-scope-parent anchor and fix present
capy/skill/gstack/SKILL.md [Current] subagent instruction matches the CLI
ship/DRIVER.md(.tmpl) [Current] Step 22 carries the METER: line
changelog.d/gst-467-meter-scope.md [Current] matches the code
ship/sections/budget-handoff.md(.tmpl) [Current, with debt] Capy recipe lacks a --meter-scope tree pointer; it does not contradict the new text
Documentation coverage: --meter-scope and METER_SCOPE_PARENT are covered in the budget doc, troubleshooting, the Capy skill, the changelog fragment and the test. Debt: add an optional one-line pointer in budget-handoff.md.tmpl and regenerate (parent-owned).
Diagram drift: none.
Test Coverage
Coverage: 11 of 14 traced paths have a test at two or three stars (Step 7 audit, audit-only, 0 tests generated); the three gaps are a one-line usage guard, the idempotent re-start (since covered) and the doctor anchor map.
Failing-first: the three original GST-467 tests all failed before the change. Each review fix added a case that failed first: resume and handoff labels, the rebuilt ledger, the re-start upgrade with the return file, and drift/reconcile labels.
Tests ran: typecheck count unavailable
Tests ran: focused 83
Pre-Landing Review
Pass 1 ran against a stale local main, so its diff also held nine merged commits from main. The red team read the PR commit in full. The two specialist findings are about main's code (lib/capy-review-pass.js, bin/gstack-wtree), so they are noted and were not fixed here. The red team found three: the rebuild path dropped the scope (fixed, with a test), a cap on a tree run (documented), and the driver's start line (noted, see below). Step 11's voices read the true merge base. The outside voice (openai/gpt-6.1-sol) flagged two as blocking: a re-start ignored the tree request, and the return file lost the label. The native adversarial pass found the re-start gap again, plus unlabeled drift/reconcile lines and a stale BUDGET_READING_MISSING fix text. All of these were fixed with tests, and they are below the floor: they mislabel a cost but lose no data. Pass 2's specialist found nothing. The targeted reader's docs note was reworded. Both fix-checks were clean. The targeted reader (money class) then re-read the whole final patch at b8e4785 against the origin/main merge base and found nothing.
After the merge of main fd5fcb4 (v1.92.20.0), the Step 22 line conflicted with main's "carry tokens and credits; report both". The merged line reads "(report
BUDGET_FINAL:,BUDGET_TIMELINE:(tokens, credits), anyMETER:line)", and Step 20 says "the metrics row", so DRIVER.md is 12,282 bytes alone and 12,286 bytes with #3670 applied. A second fix-check over those lines was clean (NO FINDINGS), and the targeted (money) reader re-ran at 16e6710 with NO FINDINGS.After the merge of main 83ae96e (v1.92.30.0, train 78), the merge was clean and this PR's own lines are unchanged; DRIVER.md stays at 12,286 of 12,288 bytes. Main edited the paragraph next to this PR's line in capy/skill/gstack/SKILL.md, so one scoped fix-check read that context and was clean, and the receipt carried from 16e6710.
REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=3 fixed=3 scope=frozen fix_checks=2 dispatches=7
Gate edits: none detected.
Noted, not fixed:
--subagent(or the env var) and--reading-from this. The binary cannot detect a subagent by itself.METER: parentand the tree label.Cost
This /ship ran in a subagent and read
"this", so its numbers are the root counter, an upper bound. As of Step 14.5:Test plan