📅 Historical page. This content reflects minia2a as of its publication date and is kept for the record. Current model: x402 pay-per-call in USDC on Base only, 5 free trial calls per signed wallet, no credits and no top-up rail. → See current

Your Numbers Are Read by Machines That Do Not Run Your JavaScript

November 19, 2026

A dashboard number is written twice. Once by your code, into HTML, so that a reader who never runs JavaScript sees it. Once more by your JavaScript, in the browser, from a live endpoint. The second write gets all the attention. The first one is what an LLM indexer ingests, what a crawler caches, what curl prints — and it is the one with no QA loop unless you build one.

On the minia2a site there are 202 such counters outside the blog: catalog size, trials used, wallet users, distinct IPs, on-chain payment count, paid call count. Nine distinct keys, wired by an hourly writer into <span data-stat="…"> elements and re-rendered in the browser by /js/live-stats.js. This morning our freshness guard — the job whose only purpose is to keep the baked half honest — went red with 20 stale slots.

Nothing was stale. The page in front of you was fine, the writer was fine, and the monitor was reading a ledger that did not list four of the keys it was judging. This post is about that failure mode, because it is the same one that makes people turn off their own alarms.

Two ways a baked number can be wrong

The guard distinguishes two shapes, and the difference matters:

ShapeWhat it meansIs it a defect?
STALEThe page holds a value nothing wrote recently — frozen, wrong, or never true.Yes. Somebody reading without JS is being told a false thing.
LAGThe page holds exactly the value the hourly writer last wrote; live has moved since.No. That is the healthy state for all but a few minutes of every hour.

To tell them apart, the guard reads the writer's own log line and asks: is this page holding your number? If yes, and you ran recently, the page is lagging and correct as of your last write. If the page holds a number the writer never wrote, it is stale no matter how recent the writer ran.

What the guard said at 02:45 UTC

Twenty slots across thirteen pages, all on two keys:

STALE: 20 slot(s) hold a value the platform contradicts
  index.html:767          trials: '44,548'  live='44,550'
  index.html:771          users:  '5,457'   live='5,458'
  compare.html:356        trials: '44,548'  live='44,550'
  … 17 more, same two keys

live: services=1888 wallets=300 agents=300 trials=44550 users=5458
      requests=9722748 trialEndpoints=1643

The hourly writer had run minutes earlier, at 02:29:02 UTC, and reported success. So either the pages were not written — or the guard could not recognise that they had been.

The bug: five of nine

The writer records every run as one log line. The guard parses that line into its ledger. The line named five keys:

live: services=1888 wallets=300 agents=300 requests=9722748 trialEndpoints=1643

The writer rewrites every one of the nine keys the pages use, and the line recorded five. trials (19 slots) and users (3 slots) were written every hour and never recorded; so were onchain (2) and calls (1). For those keys the guard had no ledger entry, so it fell back to comparing against live — and live moves between ticks. Every hour in which a couple more trials happened, the slots that had just been written correctly read as STALE.

This is the second time this exact defect has shipped. On 2026-10-02 the same guard was fixed because agents was written but not logged, and every new registration reddened it until the next tick. The class is not "the writer forgot a key". It is "the ledger and the writer are two lists that are supposed to be equal and nothing enforces it".

The fix is one line on each side, and one control that fails without it

The writer now logs all nine keys it writes. LEDGER_FIELDS in the guard maps all nine. That is the whole change — but a change like this is easy to "verify" with a test that proves nothing, so the self-test drives the actual formatter from the writer's raw fields rather than from a hand-written dictionary:

raw_writer = {"services": 1888, "wallets": 300, "agents": 300,
              "trials": 44548, "users": 5457, "calls": 384, "onchain": 416,
              "requests": 9707759, "trialEndpoints": 1643}
logged = ledger_expected(raw_writer)
for k in ("trials", "users", "calls", "onchain"):
    if k not in logged:
        fails.append(f"writer logs {k}= but ledger_expected() drops it")

A control that hand-writes the ledger dictionary passes even if LEDGER_FIELDS loses the key — because it never goes through the mapping that can lose it. Driving the raw fields through the real function is what makes the test fail when the wiring is removed. We checked the reverse direction too: with the old five-key map restored, the same fixture goes red on trials immediately.

After

$ python3 scripts/wire-page-stats.py --audit
live: services=1888 … trials=44550 users=5458 calls=384 onchain=416 …
changed: 18 file(s)

$ python3 tools/span-freshness-guard.py
slots checked against live values: 202
blog/ slots excluded by design: 8
STATUS: clean — every served slot outside blog/ is live and every key is maintained

Today the site reports 1,888 services, 44,550 trial calls used by 5,458 distinct addresses, of which 300 signed a wallet, and 416 payments have settled on-chain. Those numbers are in this page's HTML as you read it, and in /api/stats if you would rather ask for them yourself.

If you publish numbers to machines

An agent does not run your JavaScript. It fetches your page, or your API, or your discovery document, and it believes what comes back. Three things follow, and none of them are specific to this site:

1. The baked value is the published value. Treat the no-JS fallback as a contract, not a placeholder. The client-side rewrite is an enhancement for humans; the crawler never sees it.

2. Your monitor needs to know what "healthy lag" looks like. A freshness check that compares static HTML to a live endpoint will be red constantly, and a monitor that is always red is worse than no monitor — it trains you to skim past its output. Log what you wrote, then let the monitor compare the page to your own ledger first.

3. The ledger must be generated from the same list as the writing. Two hand-maintained lists drift. Ours drifted twice, in the same direction, six weeks apart, and both times the symptom looked like a data problem rather than a reporting problem.

← All posts minia2a.uk — 1,888 x402 endpoints, 5 free trial calls per signed wallet →