Skip to content

Delete openrouter_pricing and the snapshot machinery it alone required - #11

Merged
IngTian merged 1 commit into
mainfrom
drop-openrouter-snapshots
Oct 4, 2026
Merged

IngTian merged 1 commit into
mainfrom
drop-openrouter-snapshots

Conversation

@IngTian

@IngTian IngTian commented Oct 4, 2026

Copy link
Copy Markdown
Owner

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/models reports one host's price per model, by an unstated rule, out of a
very wide distribution. Measured live on 2026-10-04 across 8 multi-hosted models:

model                        hosts      min   median      max  reported
deepseek/deepseek-v4.1-flash    31   0.0030   0.2000   0.4500   0.3000   (150x)
z-ai/glm-5.3                    40   0.0750   1.3300   2.8000   1.4000   ( 37x)
qwen/qwen3.8-27b                17   0.0240   0.2025   0.9900   0.4200   ( 41x)
deepseek/deepseek-v4-pro-0813   20   0.1760   1.2110   1.6500   0.2200   (9.4x)

median spread 20.7x · reported == 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
. 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__.py so this isn't 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. It was archived in two other places the whole time.

Why the machinery went too

backfillable had no other use — the snapshot write, --snapshot-only, a --list column,
and one always-true guard in the row-count floor. With the only False source gone it
could only ever be True, so it is deleted rather than kept as a config value that never
varies.

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 once
snapshots were gone. It is now "nothing under data/ is tracked at all" (asked of
ls-files), plus the existing assertions that no path a --db run can write to is
committable. 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 at
HEAD
.

What is left automated

The feeds job — one live verify_spec call to catch CFTC field-map drift — moved to its
own file, committing nothing, contents: read instead of contents: write. Its header
records 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

  • 356 tests pass (from 371: 21 snapshot-specific tests removed, 10 added back)
  • scripts.ingest --list → 9 sources, no openrouter; --snapshot-only now rejected
  • scripts.build against a fixture copy still yields 14,079 positioning + 584
    inflation rows and reports journal_mode now delete
  • scripts.status drops the snapshots section
  • Both workflow files parse; no orphaned imports

Known follow-up

tests/fixtures/fixture.sqlite still carries a vestigial openrouter_pricing table. It is
simply not loaded (noted in conftest.py); the next make fixtures drops it. I did not
regenerate it here because that needs a fresh store and would churn the committed CFTC
slice the identity tests depend on.

🤖 Generated with Claude Code

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>
@IngTian
IngTian merged commit 4ae4229 into main Oct 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant