fix(review-risk): a <> inequality on a reported cost stays money (GST-962 round-2 grant)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
garrytanandcapy-ai[bot] committed 2026-11-03 11:46:31 +00:00
1 parent c3b5e7040d
commit 515a420cc3
3 files changed
+5 -3

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ export const REPORTED_COST_WORDS = ['cost', 'costs', 'total', 'totals', 'usd', '
/** A reported cost is still money on a line naming a cap, limit, budget, price, charge, reservation or estimate. */
export const MONEY_USD_WORDS = ['cap', 'caps', 'limit', 'limits', 'max', 'maximum', 'min', 'budget', 'budgets', 'ceiling', 'allowance', 'threshold', 'spend', 'spent', 'spending', 'price', 'prices', 'pricing', 'fee', 'fees', 'bill', 'billing', 'paid', 'payment', 'charge', 'refund', 'amount', 'invoice', 'reserve', 'reservation', 'estimate'];
/** A reported cost compared with `<` or `>` (never an arrow or a shift), or set to a number. */
export const USD_COMPARE = [/(?<![=\-<>])[<>](?![<>])/, /(?:_usd|Usd)\b["']?\s{0,20}[:=]\s{0,20}-?\d/i];
export const USD_COMPARE = [/<>|(?<![=\-<>])[<>](?![<>])/, /(?:_usd|Usd)\b["']?\s{0,20}[:=]\s{0,20}-?\d/i];
/** Docs and results trees: an unread data file there names no money by its path or a reported cost (GST-961). */
export const RESULTS_TREE = /(^|\/)(?:docs?|wiki|results|reports)\//i;
/** Any spend_cap spelling and paid-provider call sites (the providers lib/pricing.ts prices). */
+2 -2
View File
@@ -74,7 +74,7 @@ const NO_LOSS_REPLAYS = {
'GST-967': "GST-967 dispatch-superset no-loss check (test/review-depth.test.ts, 'GST-967 dispatch-superset no-loss check'): over 1,440 planReview cases the branch plans exactly what main planned at 1022f4f except the 71 gate-class stops before Step 11, which add only Step 11's adversarial, outside and targeted voices, so no reviewer main dispatches is dropped or re-efforted; the brief bodies lib/review-brief.ts cuts from the ship sections hash to main's; only the lead's repeat-decision and Step 11 instructions changed; reviewer text is unchanged",
'GST-508+GST-464+GST-967': "wave review-53cfb5bfe011 merge of main 68410828f into #3852: ship/sections/review-army.md and adversarial.md are main's GST-967 bytes plus exactly the GST-508+GST-464 lines (the merged file minus main equals the wave minus fc292e22f, line for line), so GST-967's dispatch-superset no-loss check and GST-508's no-loss replay both hold; merged-head checks in GStack Minder drive handoffs/GSTA-202/merge-6841-checks.md",
'GST-508+R51+GST-911+GST-967': "wave review-53cfb5bfe011 merge of main 68410828f into #3852: lib/review-depth.ts is main's GST-967 bytes plus exactly the GST-508+R51+GST-911 lines (the merged file minus main equals the wave minus fc292e22f, line for line); GST-967's dispatch-superset no-loss check (test/review-depth.test.ts) passes on the merged file, and the GST-508+R51+GST-911 checks are rerun at the merged head (GStack Minder drive handoffs/GSTA-202/merge-6841-checks.md)",
'GST-961+962': "GST-961+962 verdict no-loss replay: a data file no code reads (the depth's consumer scan) names no money by its path or rows, under docs/, wiki/, results/ or reports/ (a spend cap or paid call there still does), and a _usd or Usd name is not money only when every such name is a reported cost on a line with no cap, budget, price, charge, reservation or estimate word, no < or > comparison and no number set; over the last 100 first-parent main commits to bf2bcf14b, main's code against this branch, gate scan fixed at 0, no commit changes depth, class, risk classes or targeted classes (~/.capy/work/gst898/replay961.ts on GSTA-249's machine); the 21 changed lines that no longer read as money lines are cost sums and reports (scripts/lib/paid-report.ts, two eval-plan per-item means), tests and docs; lib/review-depth.ts only exports unconsumedData; reviewer text is unchanged",
'GST-961+962': "GST-961+962 verdict no-loss replay: a data file no code reads (the depth's consumer scan) names no money by its path or rows, under docs/, wiki/, results/ or reports/ (a spend cap or paid call there still does), and a _usd or Usd name is not money only when every such name is a reported cost on a line with no cap, budget, price, charge, reservation or estimate word, no <, > or <> comparison and no number set; over the last 100 first-parent main commits to bf2bcf14b, main's code against this branch, gate scan fixed at 0, no commit changes depth, class, risk classes or targeted classes (~/.capy/work/gst898/replay961.ts on GSTA-249's machine); the 21 changed lines that no longer read as money lines are cost sums and reports (scripts/lib/paid-report.ts, two eval-plan per-item means), tests and docs; lib/review-depth.ts only exports unconsumedData; reviewer text is unchanged",
'GST-940': "GST-940 verdict no-loss check: svgDrawing reads a style element's opening tag as quoted pairs with ASCII whitespace, walks its body over the raw text, refuses any & in it, reads comments as CSS and refuses a non-ASCII element or attribute name; on 62,805 unique SVG files (21,658 with a style element) it gives the same verdict as main at 4bbad2422 on every file, and the planner over the last 100 first-parent main commits to 4bbad2422 changes no commit's depth, class or risk classes; the only verdicts it changes are the GST-940 cases in test/review-planner-misreads.test.ts; rerun on the merge with main at 8f08cb76a (GST-967 merged), with the same results; rerun on the merge with main at 5f705f367 (#3852 and #3864 merged), with the same results",
} as const;
type Replay = keyof typeof NO_LOSS_REPLAYS;
@@ -98,7 +98,7 @@ const REVIEWER_BRIEFS: Record<string, { sha: string; replay: Replay }> = {
'review/specialists/targeted.md': { sha: '7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5', replay: 'GST-257' },
'scripts/resolvers/fix-check.ts': { sha: '712bf5b0c439e96bac32f19cbe25394dabb4c94aa66600100bfde9b100e15a08', replay: '#3638' },
'lib/review-depth.ts': { sha: '894ef79782232ae8e2b13a25d57d87264125ff6ae5aeb70813c4b11c8cd59a4d', replay: 'GST-961+962' },
'lib/review-risk.ts': { sha: 'aafbf5dfa3c4cdcb3d047178d5cc485216228aff50a3ba98528d4bea67c6bb8b', replay: 'GST-961+962' },
'lib/review-risk.ts': { sha: '30bd70cd56ed6df6536a830120e863c79593701c5af19d6c111183bd91516c71', replay: 'GST-961+962' },
};
/**
+2
View File
@@ -480,6 +480,8 @@ describe('incidental money signals (GST-961, GST-962)', () => {
' a.estimate_usd = usd;',
' ship_measure_ask_per_trial_usd) echo "200" ;;',
" trial_reservation_usd: v => (typeof v === 'number' && v > 0 && v <= 100000 ? null : 'x'),",
'if ($cost_usd <> 0) return;',
'SELECT id FROM runs WHERE cost_usd <> 0;',
]) expect(at(line), line).toEqual(['money']);
});