Kid mode 🧒

This page is Kid-Mode Backfill. It is a report about putting a Kid mode button on every page of Brandon's website, and how the pages were rescued after the computer ran out of room to save them.

drwu-htmls · site-wide audit

Kid-Mode Backfill

Every published page now carries the kid-mode toggle. This is the record of the audit, a disk-space incident and its full recovery, and two root-cause fixes to the house injector. 2026-06-20.

314
pages audited
49
already had it
265
backfilled this pass
17
zeroed, all recovered
100%
live coverage

Counts are honest about the false positive: a raw grep for the word toggleKid matched 50 pages, but one of them (fix-plan) only mentioned the word in prose and had no real button, so the true split is 49 had it / 265 needed it. A 315th page appeared mid-run when the boards generator rebuilt; it already shipped with the button.

What ran

Phase 1, Audit. Enumerated every public/*/index.html and grepped for the marker. 264 had no marker at all, plus 1 prose false positive.

Phase 2, Inject. Ran the idempotent house injector scripts/add_kid_mode.py per file. It writes a tailored kid explainer from each page's <h1> or <title>.

Phase 3, Deploy & verify. Pushed with the canonical lean REST deployer, then curled a 15-page sample for HTTP 200 and a single working button.

The incident, and the recovery

Mid-run, the data volume hit no space left on device. Python's write_text truncates a file to zero before writing, so a failed write left 17 pages at 0 bytes. Here is the whole arc, start to finish.

Two root-cause fixes to the injector

1. Body-less HTML is now handled

One page (buried-treasures, 690 KB) is minimal HTML5 tag-soup with no <body>, <html>, or </head>. The injector used to hard-error there. It now anchors the button and panel after the head-ish prefix (</style>, </title>, <meta>, <!doctype>) and appends the script at the end.

2. The idempotency key is precise now

The skip check was the bare word toggleKid, which any page could carry in prose. The fix-plan page did exactly that and was wrongly treated as already-done. The key is now the real injected markers, id="mode-btn" and id="kidmode-js", so prose can no longer cause a false skip. Verified safe: every other page already carries id="mode-btn", so only fix-plan re-injected.

A miscount I caught, and corrected

A loose grep for id="mode-btn" first flagged 46 pages as having two buttons. On inspection that was a false alarm. Every page has exactly one real button element. The second match was always inert: a documentation comment, a CSS selector, a getElementById call, or prose like this report. An element-aware regex confirmed zero pages carry two real buttons. The pages that already had kid-mode use a richer generator-built toggle, the backfilled pages use the injector's simpler one, and both satisfy the gate.

Verification proof

Live sample from drwu-htmls.vercel.app, covering a normal patch, restored-then-patched pages, the body-less fix, and the false-positive fix.

PageKindHTTPButton
believeyoumenormal patch2001
phish-tweezer-jam-ixirestored + patched2001
the-mutiny-midi-fixrestored + patched2001
straykids-key-matchrestored + patched2001
reddit-parallel-researchrestored + patched (2.3 MB)2001
buried-treasuresbody-less, root-cause fix2001
fix-planfalse-positive fix2001

14 of 14 patched pages in the sample returned 200 with exactly one working button (function present, panel present).

drwu-htmls.vercel.app · kid-mode backfill · 2026-06-20