Status: done (2026-11-10) Priority: 2 Size: S Design ref: docs/gates.md; QUESTIONS.md, VB-261 Goal: VB-261 (docs/gates.md, rows 16, 17 and 19): the cost baseline’s ceilings were allowances written to keep a hard line green (PR 96 added oppAsk, planReview and cookFarm; recordFold was left failing). The lines stay; the ratchet goes. Acceptance criteria:
tests/scaling.js and tests/history.js report each counter’s ratio through tests/lib/targets.js against 1.15 and 1.25, and exit 0 when a ratio is over; their hard asserts (every counter exercised, both fixtures loaded or a notice) stay.tests/cost-baseline.json removed; its ceilings recorded once in docs/bench/targets.jsonl as the first values; tests/cost-rules.js tests the growth arithmetic and the report instead of the ratchet.docs/bench/closure.md names, for each counter out, the task that closes it (Kim’s answer to VB-261, question 3).npm test, node tests/history.js; golden unchanged.Implementation notes:
tests/lib/cost.js: check (ceilings, ratchet, --update) replaced by report(kind, values), which calls target('scaling.NAME' | 'history.NAME', {dir: 'max', target: 1.15 | 1.25}) for each of the 25 counters and returns the records. Its hard asserts stay (every counter covered, a known kind). tests/scaling.js and tests/history.js keep their asserts (every counter exercised, both fixtures or a notice) and print how many counters are out. --update is gone from both.tests/cost-baseline.json removed. Its nine ceilings (scaling: routeExpand 1.184, routeRefresh 1.740, roundPairs 2.0; history: routeExpand 1.257, routeRefresh 1.813, roundPairs 1.326, oppAsk 1.354, planReview 1.342, cookFarm 1.386) are the first records in docs/bench/targets.jsonl, followed by one run of each test (--record) at acb5dcf; docs/bench/targets.md regenerated.tests/cost-rules.js now tests the report (in, out with residual, non-finite is out, coverage and kind still hard) and the growth arithmetic.docs/bench/closure.md: a “Cost growth” table names each counter out and its closing task: VB-236 (routeExpand, routeRefresh), VB-242 (roundPairs, heirRank, roundRank), VB-249 (oppAsk, planReview, cookFarm), VB-268 (recordFold), and VB-269 (walkTies; new, needs-review, since no task owned it).AGENTS.md line 52 (Cost growth: “--update only lowers excesses in tests/cost-baseline.json”); docs/gates.md rows 16, 17 and 19 and its lines 14, 102 and 144 still describe the file as present.Validation (same local fixtures, stale, at acb5dcf):
tests/history.js failed on seven ratios over 1.25 (routeExpand 1.462, routeRefresh 1.856, walkTies 1.436, roundPairs 10.24, heirRank 1.473, recordFold 1.558, roundRank 1.414); oppAsk 1.354, planReview 1.342 and cookFarm 1.386 passed only by ceilings. tests/scaling.js passed with roundPairs at its ceiling 2.00.npm test passes (87 scripts; 1 target out). node tests/golden.js unchanged.