refactor(usage): remove USD_PROXY/CREDITS card helpers from usage-sql (ST-074) #82
No reviewers
Labels
No labels
severity/s4
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
janpeter/scrum4me-shared!82
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/st074-drop-usd-proxy-helpers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of ST-074 (ISS-4 part 2): the 11 CLAUDE/USD_PROXY rows in
model_pricescan only be deleted once nothing reads them.What
Removes from
lib/usage-sql.tsthe helpers that read the subscription cards (USD_PROXY / CREDITS):usageRateCardJoinSqlText,usageLineUsdSqlText,usageLineCreditsSqlText,fullyPricedTaskSqlText.The list-price helpers (
listPriceJoinSqlText,listPriceUsdSqlText,fullyListPricedTaskSqlText) andmeasurableTaskSqlTextstay.Tests are converted to list-price cards. The
measurable-v1fixture now carries the real prices on the API/USD cards and keeps the subscription cards as decoys (999), so a reader that wrongly reads a subscription card fails.Consumers (origin/main, checked)
listPrice*— unaffected.lib/usage-sql.tsis anexport *shim; only__tests__/lib/usage-sql.test.tsimportsusageRateCardJoinSqlText(migrated in the web PR).src/tools/get-estimate-history.tsstill uses three of the removed helpers (migrated in the mcp PR). The mcp integration test also readsfixtures/usage-ledger/measurable-v1.jsonthrough its submodule, so the mcp PR must bump to this commit.Merge order
Safe to merge first: every consumer is pinned to
a1e8333until it bumps. After merge: bump in mcp and web (together with their migration PRs) and workers.Verified
npm run verify: typecheck + 790 tests pass (usage-sql: 27, PGlite).🤖 Generated with Claude Code
REQUEST_CHANGES
Findings:
scrum4me-mcporigin/mainimporteert en gebruiktsrc/tools/get-estimate-history.ts:10-13,40-42nogfullyPricedTaskSqlText,usageLineUsdSqlTextenusageRateCardJoinSqlText. T-238 stap 1 eist vooraf geen productiegebruik en schrijft bij bestaand gebruik expliciet stop en meld voor. De PR-beschrijving erkent dit gebruik maar kiest een andere volgorde. De huidige submodulepin voorkomt directe productiebreuk; een bump zonder migratie breekt echter de imports. Rond eerst de consumer-migratie af en herhaal de lezerscheck, of leg de gewijzigde volgorde expliciet vast in het gekoppelde plan.Plan gekoppeld via pr_refs (product scrum4me-workers). Referentie: ST-074 (scrum4me-workers), specifiek T-238. Geen omitted onderdelen. Deze PR claimt alleen de shared-opruiming; overige storytaken (seeds, bumps, rollout, productie-SQL en ISS-4) zijn geen ontbrekende implementatie in deze PR.
Code en architectuur: de resterende helpers blijven pure SQL-tekst met interne ESM-import; schema en meetbaarheidslogica blijven intact. Tests behouden Postgres/PGlite-dekking voor runtime, provider/tier, ontbrekende prijzen en gebruikersscope. Comments en fixture zijn consequent naar API-lijstprijzen bijgewerkt. Geen aanvullende code- of docsfindings.
Verificatie op head
5db6ca908834175ceb519c05cf90186990e8b88b:npm run verifygeslaagd (dependency-gate, typecheck, 44 testbestanden / 790 tests, waaronder 27 usage-sql-tests);git diff --checkschoon. Consumergebruik en submodulepin zelfstandig gecontroleerd op MCP origin/main.