5. Assorted laws with scars attached
-
A page's stream subscribes by the ORG IN ITS PATH (
/o/{id}/…), plus the user's own subject, plus the world tables it renders. A page with no org in its path —/start,/admin/*, the landing — re-lands ONLY on the user subject: a verb it fires mustpublishUsertoo, or the 204 lands nothing (gf-317, the territory toggles). Say which subject re-lands the page before writing a 204 for it. THE WIZARD HAS TWO HALVES (gf-363): before the org exists the stations are plain forms + 303s and no stream at all; from Locations on, the page streams on the USER subject (handler/stream.go subscribesbus.UserSubject) and every verb —/start/warehouse, the delete, the territory toggles — is a 204 +publishUser. -
A keystroke lane never shares a limiter with a credential lane (gf-362, found on prod):
/start/where-suggestand/start/picksat on the login limiter (12/min per IP) and the suggest keystrokes spent it — the pick answered 429.startLimit(600/min, routes.go) carries both. -
Select-all (and any bulk write) stays inside SQLite: one
INSERT … SELECTunder the same lens WHERE the roster reads — ids never round-trip through Go (the read-then-insert-per-row loop was 179ms → 62ms end to end at 5k rows). -
One definition per filter: search columns, facet CASEs, and sweep WHEREs read the same compile-time vars — two copies WILL drift.
-
Derive, never copy (the live-SUM doctrine generalized): effective status computes down the chain at read time; a family's supplier derives via its brands. Write-time cascades destroy children's own truth and cannot be undone.
-
The schema is the numbered files under
db/migrations/(gf-416) — an index or a column is the next file, never an edit to a committed one. -
SSE answers must be exempted from generic compression middleware (match on the request's
Accept: text/event-stream); datastar's own writer owns that encoding. -
No no-JS fallback paths, ever — a GET-form fallback under a Datastar app is changing the tires on a car with no engine. One wire.
-
Labs never write into product data paths — the UI lab's toast test once used the real notification producer and chased the operator across production pages. An exerciser is page-local and ephemeral.