Repository navigation
fix(review): docs and results PRs stop paying for a money reader; reported costs aren't money (GST-961, GST-962) - #3942
Merged
Merged
Conversation
…1, GST-962) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…e money (GST-961, GST-962) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ing tables money (GST-961, GST-962 review) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…-962 round-2 grant) 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>
…e exemption Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…e 19 grant): per-file review pins for GST-961+962 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…e 19 grant) Option 1: config _usd price or rate keys are money outside a results tree, on top of #3920's path-only rule; per-file pins repinned. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…review-exclude fixture) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…-paths Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # lib/review-depth.ts # lib/review-risk.ts # test/fixtures/review-pins/files/lib/review-depth.ts.json # test/fixtures/review-pins/files/lib/review-risk.ts.json
…gst-961-money-paths
…replays were not rerun (GST-961+962) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.
Known loss, fixed next (GST-1215)
The fix-check's targeted reader found one loss against main that this PR does not fix.
usdMoneymatchesMONEY_USD_WORDSas whole words, so inflected forms slip past it.rows.push({ cost_usd: estimatedCost(model, tokens) });andrecord.actual_cost_usd = estimates[model];no longer read as money, and both would show an estimate being stored as an actual cost. Main's/_usd/rule flagged both lines. GST-1215, under GST-961, has the failing test and the fix plan: match word stems, add these lines as positive controls, and rerun the no-loss replay. The same issue covers spend-ledger writes and+=running totals made only of reported-cost names, such asledger.total_cost_usd += call.cost_usd;(targeted#2 and the final-head targeted read). This is a classifier gap, and no live caller depends on it today.Open note: price tables under a results or receipts tree
After #3920, config and data files are judged by their path only. This PR keeps one exception, matching GST-961's data-file rule: outside a
docs/,doc/,wiki/,results/,reports/orreceipts/tree, a price or rate key (input_price_usd,output_price_usd,cost_per_1k_usd,per_token) still counts as money. Inside one of those trees it does not, so HARN-1's results file withlist_price_usdand #3920'sreceipts/r.jsonwithprice_usdstay path-only. The known gap: a price table underdocs/,results/orreceipts/that code really loads gets no money reader.What changed
The #138 results TSV and the #139
cost_usdsum no longer raise the money reader. Spend caps, budget comparisons and SQL<>on a cost still do.Before/after as text: The #138 results TSV and the #139 cost_usd sum no longer raise the money reader; spend caps, budget comparisons and SQL still do
Why
GEVA-2 reported that "/ship's planner classed the PR as docs at depth light. It still planned a second, targeted money reader, because
wiki/.../cost-gstack-full.tsvhascostas a path segment" (gstack-evals#138, about 5M tokens on a docs diff). On gstack-evals#139, an analysis module that only sums and prints per-trialcost_usdraised the money class too. Now a results file no code reads, and a line that only reports a cost, get no money reader. Real spend code still gets one.Blast radius
The change narrows two matchers in
lib/review-risk.tsthatlib/review-targeted.tsand the depth planner (lib/review-depth.ts) consume, so it mostly drops money classes. The one place it adds a reader is a config or data file's price or rate key outside a results tree (input_price_usd,cost_per_1k_usd), which main's #3920 rule (config files judged by path only) no longer read as money; over main's last 100 commits that adds none. The 100-commit no-loss replay against main bf2bcf1, using the real planner, changes 0 of 100 commits' depth, class, risk or targeted classes (script ran). 21 changed lines across those commits no longer read as money. All of them are reported-cost lines, and none of those commits loses its money class.Approvals
Source: gstack-approvals record for gsta249/gst-961-money-paths (display only; not an approval citation).
Documentation
Status: updated. One factual correction in docs/review-policy.md; troubleshooting.md is current.
Scope: branch gsta249/gst-961-money-paths against bf2bcf1 (committed only; no staged, unstaged or new files). The diff changes money-class detection in lib/review-risk.ts, lib/review-targeted.ts and lib/review-depth.ts, plus docs/review-policy.md and a changelog fragment.
Documentation health:
MONEY_USD_WORDS). It also says that an unread data file underdoc/,docs/,wiki/,results/orreports/is never money for any_usd/Usdidentifier or metering word, only for aspend_capor paid-provider line.Coverage debt: the reported-cost and results-tree rules are documented as reference in the review-policy targeted-pass table. They have no how-to for a results-heavy repository, which is a common gap and not blocking.
Diagram drift: none.
Summary
A docs or results PR no longer pays for a money reader because a file name says "cost". The money path rule skips any data file that no code reads (the same consumer scan the depth uses) when it sits under
doc/,docs/,wiki/,results/orreports/. Aspend_capline or a paid-provider call in such a file still counts (GST-961).Summing or printing a
cost_usdfield no longer counts as money code either. A_usdorUsdname is still money when it isn't made only of reported-cost words (cost, total, per, trial, mean, sum…). It is also still money when its line has a cap, budget, limit, spend, price, fee, charge, refund, reservation or estimate word, a<,>or<>comparison, or a number set on it (GST-962). Paid-provider calls count on every path. The "Keyless" half of GST-962 did not reproduce on main bf2bcf1 and was dropped under the real-bugs rule (repro note on GST-962).Proof first: b8f1d13 added the failing tests (the #138 path list and the #139 lines, plus positive controls for every money shape that must keep firing) before the fix.
Test Coverage
New tests in
test/review-targeted.test.tscover both repros, negative cases, and positive controls for each money shape that must keep firing (caps, budgets, comparisons including<>, optional chains, wrapped values, reservations, estimates, refunds, paid calls, pricing data, a spend cap in an unread TSV).test/review-risk-redos.test.tskeeps the new patterns linear.test/review-packets-removed.test.tsrepinslib/review-risk.tsandlib/review-depth.tsto the GST-961+962 no-loss replay.Tests ran: focused 422 (exit 0, 4f5b866, 9 files)
Pre-Landing Review
Depth full (money class). Pass 1 found 3 CRITICAL, all fixed in c3b5e70: optional-chain and wrapped spend comparisons, dynamically loaded pricing tables read as unread data, and reservation and estimate lines. Pass 2 found 1 CRITICAL, fixed in 515a420 under the owner's grant: a
<>inequality on a reported cost no longer read as money. The granted fix-check on that hunk found nothing at the floor. The granted scoped reader on the docs-audit money-row edit (4f5b866) returned NO FINDINGS.REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=0 fixed=0 scope=frozen unrecorded=2 fix_checks=2
About
unrecorded=2: all four blockers were fixed, in c3b5e70 and 515a420. The pass rows logged each outcome in astatusfield instead of theactionfield the summary reads, so the summary counts them as unrecorded. This is a logging slip, and no blocker is open.Review-loop exception: accepted by GStack Minder (GSTA-36) 2026-11-03 via GSTA-36 messages to GSTA-249 (approvals a-0813558af89e, a-6700190d217a, a-1abdb59eb27a and the receipts/ ruling): R51 grants after round 2 (GStack Minder): one scoped fix-check on the <> regex hunk in lib/review-risk.ts with its two positive controls at 515a420 (3 informational notes), one scoped reader on the docs-audit money-row hunk in docs/review-policy.md at 4f5b866 (no findings), then under the rule 19 merge grant one scoped reader on the merge-resolution hunk in lib/review-risk.ts and its tests at 26ba945 (2 informational notes), then the Captain-ruled one-line receipts/ carve-out at 3a2cb6d under the same exception with no new reader; notes ship in the PR body (fix-check at 26ba945, 0 findings)
Gate edits: none detected (6 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: issues_found in pass 2 (openai/gpt-6.1-sol). Its one blocker (
<>) is fixed above.Review notes
These are below the blocking floor and are listed here instead of looped:
_usdnames; see "Known loss" at the top and GST-1215.+=running total named only with reported-cost words, such asledger.total_cost_usd += call.cost_usd;, no longer reads as money, even on a deleted line. No current caller has a cap that reads such a total from outside a money-named path. Covered by GST-1215.ledger.push({ trial, cost_usd: r.cost_usd ?? 0 }),totalCostUsd += trialCostUsd;written twice,row.actual_cost_usd = row.cost_usd;,fs.appendFileSync(ledgerPath, JSON.stringify({ cost_usd: costUsd })), plus method comparisons such astotalCostUsd.lessThan(stopAt). Main's/_usd/rule flagged all of them. Added to GST-1215: keep a reported cost as money when the line writes or accumulates it, and add method comparators.<>also matches a JSX fragment or a Java/C# diamond, so those lines with a cost name get a money reader. That means extra review, never a missed reader.this.total += result.costUsdandacc.costUsd += r.costUsdaccumulators named only with reported-cost words don't read as money (same root as targeted#2).let total_cost_usd = 0;still reads as money (a number set on it), so some summing modules keep a reader. Extra review, not a loss.src/reports/directory counts as a results tree for unread data files, and unrelated angle brackets (generics,<td>tags) on a cost line trip the comparison check.inputPriceUsd,input_per_1m_usd,usd_per_1k, andinput_cost_per_tokenwith nousdin the name. Main's path-only rule (v1.94.30.0 review: risk-scaled review depth, today's panel by default (GSTA-258 build C) #3920) read these as no money too, so nothing regresses against main. Added to GST-1215.PRICE_USD_KEYtakes quadratic time on a config line that repeatsprice_and never reachesusd(about 1.1 s on a 120,000-character line). It's bounded, not catastrophic; a bounded join such as_[a-z0-9_]{0,40}usdcloses it. Added to GST-1215.ledger.append({ run, cost_usd: res.cost_usd })),+=totals androw.cost_usd = r.estimated_cost;made only of reported-cost names don't read as money. It's already covered by GST-1215 (addledger,estimatedand assignment checks).Security read
No network calls, environment or secret reads, permission changes, workflow, setup or install edits, and no new dependencies. The change only narrows regex and word-list matchers in the review planner. GST-850's child_process rule is unchanged.
Issues