Data health
Keeping itself current
Nothing here needs a button. Each job decides it is behind by reading the data — is the newest bar older than the last trading session, is the newest published SEC quarter actually in the table — so a deploy that lands late, or a stretch where the service was down, catches up on its own at the next check rather than waiting for the next scheduled time. filings sweeps SEC's XBRL frames every few hours, so a 10-Q shows up here within a day of being filed; the bulk quarterly datasets follow months later as the fuller record. SEC publishes those on no announced date, so waiting is a normal state, not a failure.
Visitors
Every reader-facing page request, stored one row per view and counted live — no sampling, and nothing held in memory that a restart would lose. Addresses are not people: an office shares one and a phone moving from wifi to cellular makes two, so the unique figure is a count of distinct addresses and is labelled as one. Crawler traffic is kept and shown separately rather than dropped, so these numbers reconcile against the server log. /admin, static files and health probes are never counted.
Balance sheet
Reads the five verification companies straight out of the fundamentals table and checks that assets equal liabilities plus equity. Also reports per-concept coverage across every ticker that has any fundamentals at all.
Verify five companies
JPM, MSFT, WMT, FCX, AAL against their known figures. JPM's are exact — read off a real num.txt dump. The rest are order-of-magnitude, enough to catch a parser reading the wrong fact. Anything off by more than 10% is a failure.
Whole-universe check
Five companies is an anecdote. This runs A = L + E over every ticker with enough data, buckets the drift, names the worst 50, flags assets moving more than 10× between quarters, and breaks it down by sector — a sector failing systematically is a tag problem for that filer class, not noise.
Raw num.txt facts
Every row carrying a tag, which columns differ across them, and what the consolidated-instant filter selects. This is the check that settled the JPM bug. A reference figure is only ever corrected against this — never against the parser's own output, which is how a wrong number gets blessed.
Each preset runs its own dump immediately — it does not touch the form below, which is there for anything else.
Reload fundamentals
Replaces every fundamentals row from seven quarters of SEC data. The old rows cannot be repaired in place — once the tag and its dimensions are discarded, a wrong number looks exactly like a right one.
Nothing is deleted until every quarter has downloaded, and the delete and the reload run in one transaction. If a download 429s or a quarter fails to parse, the existing table is left exactly as it was. A quarter SEC hasn't published yet (404) is skipped — the newest one usually is — and loading the rest counts as a full reload. Takes several minutes; progress appears below and the page auto-refreshes while it runs.
SEC download cache
Quarterly ZIPs already on disk. The reload and the raw-facts dump share this one cache — two independent downloaders of the same 100MB file is what earned the 429s. A cached quarter is never re-fetched.
Question box
The model behind the ask box on /company. Its id is resolved against OpenRouter's live model list at startup — if it does not resolve, the box is off and the reason is here rather than surfacing as a 404 to one reader at a time. Per-token price comes from that same call, so the cost below is the provider's number, not a stale table.
XBRL extraction
From the last fundamentals load. Structural drops are expected and large — num.txt carries each tag many times per period at different dimensional levels, and only the consolidated one is kept. Validation rejections should be rare.
Config
Presence only — secret values are never shown.
Recent logs
Backfill — one data source at a time
Each button loads only its own kind. Tapping a kind shows what that load last wrote (rows / error / when), so you can tell fundamentals from bars instead of guessing.