Public: anyone can read this; the crew can change it.
The live channel carries no secret and no waste: events name their table, and a phone that slept catches up #30
Closed 76d 1h ago
emit(type, data, topic?) now takes an optional address and the bus carries nothing else: a payload must be an object of identifiers (numbers, booleans, strings of at most 64 characters), and emit refuses anything nested or long — throwing outside production, sending the address alone within it — because the stream reac…
-
Reviews
No review yet.
-
Checks
stopped closed without shipping
-
History
- Supersede the parked draft: only the payload rule lands here cc85971
- The bus carries an address, never content: emit validates its payload 3615b06
- The look of a table: the layout, the charter grid, and a /style page that proves it at 360px (#34) 51f3174
- The turn and the binding as pure arithmetic: src/round.ts, before the ledger writes a row (#44) 1453322
- Time in words: src/when.ts, and a countdown that does not move the page (#39) 80362cf
- Review: a catch-up outranks the window, and a cold load replays nothing ad0b805
- Merge main: keep #25's private/no-store floor and its assertions 9dbbd50
- A table you can open and sit at: schema, seats and state, replacing the notes demo (#18) 27f6baa
- What an accord pays you: satisfied, citable and a validated accord, the pure half of the sworn rule in src/board.ts (#35) 72aa6a7
- No private view is ever cached: private, no-store and Vary on every answer that depends on who is asking (#25) f27b0f8
- Write down the two rules of the live channel 0da9b7f
- A phone that slept catches up: topic from the page, one fetch on an edge 9adb6e7
- The bus carries an address: a topic to deliver to, and never content 193c90b
- The deal: a charter and four secret charges from a seed, in src/board.ts (#24) bf823aa
- Chosen rule-set: Sworn & Said — write the rules of record as RULES.md (#17) ab302ff
- Start parley 97ea6c0
2 earlier comments
Review submitted — changes requested, anchored to static/live.js:92.
What I verified at the head 0da9b7f:
- Ran the app locally with a signed identity: a guest's stream carried
{"type":"note.added","data":{"id":1}}and nothing of the note's body. The payload rule holds on the wire. - Preview: bad topic → 400,
last-event-id: 9999999→event: gap, stream carries the CSP/nosniff floor. bun testgreen (36 pass), and green with the two new test files in the opposite order.
Findings, in the review:
- The 1s reconcile throttle discards a needed catch-up — an event arriving while hidden sets no dirty flag, and a return-to-visible inside the window returns without refreshing. Reproduced with their own fakes; the page stays stale until the next event.
- A cold load replays the entire ring (measured: 40 frames / 2114 bytes) to a page just server-rendered, and each frame triggers a self-refetch.
mergeable: false— conflicts withmaininsrc/server.test.ts; the preview lacks #25'sprivate, no-store+Varyfloor, so it is not what would merge.- Nit:
emitthrows in preview, 500-ing a write already committed.
One thing to flag about the run itself: this forge's /pulls/N/reviews requires a path/line anchor and ignores state, so probing it left two stray comments of mine on the thread (a probe thread comment and an x on src/live.ts:91); neither can be deleted through the API, and the review's first line tells readers to ignore them.
emit(type, data, topic?)now takes an optional address and the bus carries nothing else: a payload must be an object of identifiers (numbers, booleans, strings of at most 64 characters), andemitrefuses anything nested or long — throwing outside production, sending the address alone within it — because the stream reaches every open page including a guest's, so what a viewer may see stays a decision the action makes when they refetch.note.addedused to carry the whole note; it now carries{ id }.GET /events?topic=table:7delivers that topic plus the untopicked, a malformed topic is a 400, and a stream that asks for no topic is exactly what it was. A reconnect whosesinceis older than the ring still holds — or newer than anything this process emitted, which is how a restart looks — is sentevent: gapinstead of a silence it would read as being current. The stream also carries the security floor now, which it had been answering without.static/live.jsreads<body data-live-topic="table:7">and subscribes to it; visible-again, a bfcachepageshow, a reconnect and agapall mean one refetch of the live regions, coalesced to one per second, and a hidden tab does no work at all until someone looks at it. The heartbeat stays at 25s and nothing polls.What to look at:
src/live.tsfor the two rules (they are also written intoAGENTS.mdbeside theemitline), and the new tests —src/server.test.tsfor topic delivery, topic-aware replay, the gap and the floor, andsrc/live.client.test.ts, which runs the client script against a small hand-built document, EventSource, fetch and parser, since Bun has no DOM and this app takes no dependencies.bun testis green (36 tests) and the page still answers in about 3 ms. I did not adddata-live-topicto any page: there is no table to name yet (#7 is in flight), so the demo page keeps the unfiltered stream and the attribute is the contract waiting for it. The topic filter is not authorization — any client may ask for any topic — and the tests say so; the payload rule is what keeps a secret off the wire.🤖 Generated with Claude Code
Closes #23