price-table re-sync — deepseek-v4.1-flash and 173 price corrections from pi-ai 0.87.1

Costs were rendering '—' for tonight's extraction runs. Root cause: the
pi family bump (df1328e, 0.85.1 -> 0.87.1) added deepseek-v4.1-flash to
the shipped catalogs, but scripts/sync-pricing.ts was never re-run after
it — src/core/prices.ts was still the 2026-09-25 generation. The design
itself is sound and matches the owner's expectation: nothing stores
dollars; records keep tokens + model string; callCost infers at read
time from PRICES[model]. So the re-sync retroactively re-prices every
run the moment the entry lands.

- npx tsx scripts/sync-pricing.ts: 1495 keys (+314/-173 lines);
  openrouter:deepseek/deepseek-v4.1-flash = 0.15/0.6/0.003 (matches the
  catalog the picker serves)
- glm-5.3-flash price drift (0.075/0.25 -> 0.15/0.5, cacheRead 0.015 ->
  0.05): four pinned-cost tests re-derived (usage, cost-summary via
  callCost, activity-dock, stats-bar)
- prices.ts header: dropped the false bare-slug-legacy claim (the table
  has zero bare keys; sync emits provider-qualified only) and noted the
  forgetting-the-sync failure mode
This commit is contained in:
amosblomqvist
2026-09-29 04:30:15 +03:00
parent 5707672a09
commit 82503446c8
4 changed files with 333 additions and 188 deletions
+6 -5
View File
@@ -70,9 +70,9 @@ describe("activity dock pure layer", () => {
},
});
const blob = toBlobs({ jobs: [priced], extractions: [] })[0]!;
// (10000-5000)/1e6*0.075 + 5000/1e6*0.015 + 1000/1e6*0.25 = 0.0007
// (pi-ai catalog prices)
assert.ok(blob.cost !== null && blob.cost > 0.0006 && blob.cost < 0.0008);
// (10000-5000)/1e6*0.15 + 5000/1e6*0.05 + 1000/1e6*0.5 = 0.0015
// (pi-ai catalog prices — glm-5.3-flash drifted in pi-ai 0.87.1)
assert.ok(blob.cost !== null && blob.cost > 0.0014 && blob.cost < 0.0016);
const absent = toBlobs({ jobs: [job()], extractions: [] })[0]!;
assert.equal(absent.cost, null);
});
@@ -243,7 +243,8 @@ describe("activity section render", () => {
}}
/>,
);
// two identical priced jobs → 2 × $0.001 = $0.0020 total (pi prices)
assert.match(html, /activity-total-cost[^>]*>\$0\.0020</);
// two identical priced jobs → 2 × $0.002 = $0.0040 total (pi prices,
// glm-5.3-flash drifted in pi-ai 0.87.1)
assert.match(html, /activity-total-cost[^>]*>\$0\.0040</);
});
});