Skip to content

chore(routes): delete the route baseline nothing has ever read - #531

Merged
oddharsh merged 1 commit into
mainfrom
claude/verify-baseline-unread
Aug 24, 2026
Merged

oddharsh merged 1 commit into
mainfrom
claude/verify-baseline-unread

Conversation

@oddharsh

Copy link
Copy Markdown
Owner

The third of the three judgment calls flagged in #525. tools/verify-baseline.aadhar.sh.json is 480 committed lines written by verify-routes.mjs on a production run and read by nothing — not in this repo, not in CI, from the day it was added. A file named "baseline" that nothing compares against is worse than no file, because the name reads as a check somebody is running.

Deleted on evidence, not on the name

I regenerated it against production before deciding. After eight months the diff was 52 new rows, 0 removed, and exactly one differing row:

/coffee/availability.json   503  ->  200

That is the calendar fail-closed path, and the ROUTES table already declares it status: [200, 503], flaky: true. So the entire recorded lifetime of this file produced one difference, on the one row the oracle itself calls transient by design.

The table is the expectation, and it is strictly richer

Parsed with a brace-balanced scan rather than a regex (my first regex attempt claimed 36 routes had no content-type assertion, and it was wrong — nested headers: {} objects broke it, which is the same naive-scanner failure this repo keeps catching):

  • every row asserts a status
  • the only four rows with no ct are 301s, where content-type is meaningless
  • rows carry things a recording cannot: status unions like [200, 503], flaky, body markers, byte caps

The deeper reason

A recording of observed production blesses whatever production did at capture time, an upstream outage included. That is the opposite of what an assertion does, and the 503 above is exactly that case caught in amber. The right move when a route needs covering is a row in ROUTES.

Also removed

  • the write, so a production run no longer dirties the tree. Verified: bun run routes:check (142 routes) and a real https://aadhar.sh sweep (147 routes) both run clean afterwards and leave nothing behind.
  • the now-unused writeFileSync import.
  • the .gitignore rule for scripts/verify-baseline.localhost_*.json, which was doubly dead: it names scripts/, merged into tools/ on 2026-08-18, and the ephemeral local write it guarded had already been fenced behind if (isProd).

design/PORTING.md still mentions the file. Left alone on purpose: design/README.md marks that doc as a design pass the site did not converge on, and this repo deliberately does not rewrite historical mentions.

Verification

353 tests, typecheck, lint, build, pages:check, and both oracle runs green.

tools/verify-baseline.aadhar.sh.json is 480 committed lines written by
verify-routes.mjs on a production run and read by nothing, in this repo or in
CI, from the day it was added. It is a file named "baseline" that nothing
compares against, which is worse than no file, because the name reads as a
check somebody is running.

Deleted on evidence rather than on the name. Regenerating it against production
after eight months found 52 new rows, 0 removed, and exactly ONE differing row:

  /coffee/availability.json  503 -> 200

which is the calendar fail-closed path that the ROUTES table itself already
declares as `status: [200, 503], flaky: true`. So the whole recorded lifetime
of this file produced one difference, on the one row the oracle calls transient
by design.

The ROUTES table is the expectation and is strictly richer. Parsed with a
brace-balanced scan rather than a regex, every row asserts a status and the only
four with no content-type are 301s where it is meaningless. Rows also carry
things a recording cannot: status unions, `flaky`, body markers, byte caps.

The deeper reason not to keep it: a recording of observed production BLESSES
whatever production did at capture time, an upstream outage included, which is
the opposite of what an assertion does. The 503 above is exactly that. Add a row
to ROUTES instead.

Also gone with it:

- the write, so a production run no longer dirties the tree. `bun run
  routes:check` and a real https://aadhar.sh sweep both run clean afterwards and
  leave nothing behind.
- the now-unused writeFileSync import.
- the .gitignore rule for scripts/verify-baseline.localhost_*.json. It was doubly
  dead: it names scripts/, which merged into tools/ on 2026-08-18, and the
  ephemeral local write it guarded had already been fenced behind `if (isProd)`.

design/PORTING.md still mentions the file. That is left alone on purpose;
design/README.md marks PORTING.md as a design pass the site did not converge on,
and this repo deliberately does not rewrite historical mentions.

353 tests, typecheck, lint, build, pages and both oracle runs (142 in-process,
147 against production) green.
@github-actions

Copy link
Copy Markdown
Contributor

Wire-size diff vs merge base

c27025f → 4ff1f8a

Brotli q11, the quality the edge serves. Every number here is deterministic:
an unchanged file produces no row. Advisory — this check fails on nothing.

Client assets

No change. 22 files, 77.74 KiB Brotli total.

Pages

No change. 50 files, 531.29 KiB Brotli total.

Worker bundle

No change. 237.85 KiB gzip.

Dictionary deltas (pd/)

No change. 146 deltas, 492.24 KiB total.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
aadhar-sh 6c3a941 Aug 24 2026, 01:27 AM

@oddharsh
oddharsh merged commit e2284df into main Aug 24, 2026
7 checks passed
@oddharsh
oddharsh deleted the claude/verify-baseline-unread branch August 24, 2026 01:36
oddharsh added a commit that referenced this pull request Aug 24, 2026
Second tier, and the seventh program to declare the flag. #530's ratchet test
asserts every program setting strictNullChecks appears in its declared list;
this adds tools/ to it.

RATCHETED RATHER THAN CLEAN, which is the difference from tier 1. tools/ carried
395 diagnostics under strictNullChecks; 101 are fixed here and the remaining 292
are seeded into config/ts-tools-baseline.json, where check-tool-types.mjs has
held a per-file count since it was written. That ratchet fails on a new file, on
a file that got worse, and on a file that got BETTER without the baseline being
updated, so the number is monotone. The alternative was leaving the flag off
until all 395 were done, which protects nothing in the meantime.

The seeded number is 292 rather than 294 because #531 landed while this was in
flight and removed two of them. The ratchet caught that on the rebase, by its
third arm: a file that got BETTER without the baseline being updated fails too,
which is what keeps the number honest in both directions.

Three files cleared outright:

  tools/lib/html-to-md.ts        45 → 0
  talks/…/build-deck.mjs         30 → 0
  tools/deploy-promote.mjs       26 → 0

THE .mjs AND .ts RULES ARE EXACT INVERSES, and getting this backwards costs a
compile. A .ts file ignores JSDoc types; a .mjs file rejects a TypeScript
annotation outright with TS8010. tools/ is 88 .mjs files, so nearly everything
in this tier is JSDoc, and the three .ts files under tools/lib take annotations.
Worth knowing before the next tier, since the same directory holds both.

TYPING `die` AS `never` CLEARED A CLUSTER, and it is the more general lesson.
deploy-promote.mjs uses `die()` as control flow throughout ("bail unless X"), and
without `@returns {never}` TypeScript keeps the impossible branch alive and
reports the value the caller just refused as still nullable. One annotation took
that file from 11 remaining to 9, and the same shape is waiting in every other
script with a bail helper.

html-to-md.ts gained real types rather than annotations of convenience: `Token`
as a discriminated union whose raw-text arm carries `raw` and `owner` together
(they are one fact, and pairing them is what lets the tree builder drop a
<script> body without proving the field is there), and `TextNode | ElementNode`
with the stack declared as elements only, which is the invariant that makes
`top().children` total.

VERIFIED, because this converter publishes every Markdown twin. Built the twins
with this branch's converter and with origin/main's, hashing all 58: identical
at 568b28e024de910a957c6bc382e0a3e241764fd91e068297b68a1b1ede0ecbc9. And
`deploy:promote --dry-run` runs end to end, resolves a target, and prints its
freshness guard, which is the release path exercised rather than assumed.

One behavioural addition, in deploy-promote: the sampling loop's result is read
after the loop, so a zero SAMPLE_ATTEMPTS would have ramped to the next step
having verified nothing. That now dies by name. It is a guard on a constant
rather than on the network, and it is the one outcome the script exists to
prevent.

typecheck (10 programs), lint, 354 contract tests, build, and the site bundle at
237.34 KiB gzip.
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