Repository navigation
Delete openrouter_pricing and the snapshot machinery it alone required - #11
Merged
Merged
Conversation
Net -12,293 lines. The feed rendered on no panel, and the subsystem built to keep it alive had just destroyed six days of it. WHY THE DATA WAS NOT WORTH KEEPING /api/v1/models reports one host's price per model, chosen by an unstated rule, out of a distribution that is enormously wide. Measured live on 2026-10-04 across 8 multi-hosted models: the per-host spread had a median of 20.7x and reached 150x (deepseek-v4.1-flash, 31 providers, $0.0030 to $0.4500 per Mtok), and the reported figure was the cheapest host in only 3 of 8 -- in 2 of 8 it matched neither min, median, mode nor max. So a "price change" in the series was usually a change in which host got selected that morning. That is not a price index. It also measured one factor of a product. Inference revenue is tokens x price, and no credible free token-volume series exists, so the price half answers nothing alone. Recorded in sources/__init__.py so it is not rebuilt. And the premise was false. `backfillable=False` asserted the history could never be recovered, which justified the committed CSVs, the cron, and the gap test. kj-9/openrouter-models-json has committed the same endpoint daily since 2024-10 (654 commits, pushed 2026-10-03) and the Wayback Machine has ~191 days of it back to 2023-07-26. The data was archived in two other places the whole time. WHY THE MACHINERY WENT WITH IT `backfillable` had no other use: the snapshot write, the --snapshot-only target selection, the --list column and one always-true guard in the row-count floor. With the only False source gone the flag could only ever be True, so it is deleted rather than left as a config value that never varies. The redistribution rule SURVIVES and is now stated more strongly. It used to be "a restricted source has no directory under data/snapshots/", which stopped meaning anything once snapshots were gone. It is now "nothing under data/ is tracked at all" (asked of `git ls-files`), plus the existing assertions that no path a `--db` run can write to is committable. That is a wider net than the one it replaces: it catches a CSV export or a debug dump, not just one known directory. Verified non-vacuous -- 0 tracked files under data/ now, 27 at HEAD. The daily cron is gone and its failure mode is recorded in .github/workflows/ feeds.yml, because it is easy to rebuild by accident: the commit step sat AFTER the test step, so a dropped scheduled run left a one-day gap, the gap-detection test went red, and the commit was skipped from then on. Six days were destroyed by the guard that existed to protect them. What remains is the `feeds` job -- one live call to verify_spec to catch CFTC field-map drift -- moved to its own file, committing nothing, with contents:read instead of contents:write. The 27 committed CSVs are deleted from the tree and remain in git history. 356 tests pass (from 371: 21 snapshot-specific tests removed, 10 added back). Verified end to end: `scripts.ingest --list` shows 9 sources, `scripts.build` against a fixture copy still produces 14,079 positioning and 584 inflation rows and reports `journal_mode now delete`, `scripts.status` drops the snapshots section, and both workflow files parse. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.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.
Net −12,293 lines. The feed rendered on no panel, and the subsystem built to keep it
alive had just destroyed six days of it.
Why the data wasn't worth keeping
/api/v1/modelsreports one host's price per model, by an unstated rule, out of avery wide distribution. Measured live on 2026-10-04 across 8 multi-hosted models:
So a "price change" in the series was usually a change in which host got selected that
morning. It also measured one factor of a product — inference revenue is tokens × price,
and no credible free token-volume series exists, so the price half answers nothing alone.
Both recorded in
sources/__init__.pyso this isn't rebuilt.And the premise was false.
backfillable=Falseasserted the history could never berecovered, which justified the committed CSVs, the cron and the gap test.
kj-9/openrouter-models-jsonhas committed the same endpoint daily since 2024-10 (654commits, pushed 2026-10-03), and the Wayback Machine has ~191 days of it back to
2023-07-26. It was archived in two other places the whole time.
Why the machinery went too
backfillablehad no other use — the snapshot write,--snapshot-only, a--listcolumn,and one always-true guard in the row-count floor. With the only
Falsesource gone itcould only ever be
True, so it is deleted rather than kept as a config value that nevervaries.
The redistribution rule survives and is now stronger. It used to be "a restricted
source has no directory under
data/snapshots/", which stopped meaning anything oncesnapshots were gone. It is now "nothing under
data/is tracked at all" (asked ofls-files), plus the existing assertions that no path a--dbrun can write to iscommittable. Wider net than what it replaces: it catches a CSV export or a debug dump, not
just one known directory. Verified non-vacuous — 0 tracked files under
data/now, 27 atHEAD.
What is left automated
The
feedsjob — one liveverify_speccall to catch CFTC field-map drift — moved to itsown file, committing nothing,
contents: readinstead ofcontents: write. Its headerrecords the failure mode that killed the old workflow, because it is easy to rebuild by
accident: the commit step sat after the test step, so a dropped cron left a one-day gap,
the gap test went red, and the commit was skipped from then on.
The 27 committed CSVs are deleted from the tree and remain in history.
Verification
scripts.ingest --list→ 9 sources, no openrouter;--snapshot-onlynow rejectedscripts.buildagainst a fixture copy still yields 14,079 positioning + 584inflation rows and reports
journal_mode now deletescripts.statusdrops the snapshots sectionKnown follow-up
tests/fixtures/fixture.sqlitestill carries a vestigialopenrouter_pricingtable. It issimply not loaded (noted in
conftest.py); the nextmake fixturesdrops it. I did notregenerate it here because that needs a fresh store and would churn the committed CFTC
slice the identity tests depend on.
🤖 Generated with Claude Code