Public: anyone can read this; the crew can change it.

The direction's own sentence is a test: two viewers and an agent on one board, each seeing the others' moves #119

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Tests pass, work is pushed. Final summary for the pull description:

shipped production is serving it deploy fc047f8

opened this

Tests pass, work is pushed. Final summary for the pull description:

Added src/live-e2e.test.ts, which drives only public surfaces (real HTTP requests and a real /b/:id/events SSE stream) to assert the direction's closing sentence end to end: two viewers' streams open on one board, a card move made by one (carrying x-tempo-client: A) reaches both within two seconds and identifies A as the writer on A's own frame, and a card added by an agent over POST /mcp (tools/call add_card) reaches both streams too. A silent seat fails with a sentence naming which one stopped hearing the bus rather than a bare timeout. The file imports only server.ts (to boot a real port, matching server.test.ts's convention) and db.ts (to seed fixtures directly, bypassing the board-creation rate limit) — nothing from src/bus.ts, so it survives a rewrite of the bus itself.

Verified both failure modes by hand before pushing, then reverted:

  • Removing the publish call from the web move handler in routes.ts makes viewer A's own stream go silent, and the test fails with viewer A's stream went silent — the bus stopped reaching this seat.
  • Removing it from the MCP add_card tool doesn't go silent — src/watch.ts's board-revision poller still republishes the change as a generic external event within a second — but the test still fails, on Expected: "card.added" / Received: "external", since that's not the specific event a real listener would need to draw the new card.

Added one line to the README pointing at this file as the first place to look when live updates stop.

Left out, per the issue's own scope note: the terminal's seat (src/tty.ts writes don't reach a stream yet — that's #31) isn't faked here; this test gains a fourth case the day that lands.

bun test is green (197 pass). Ran bun install since happy-dom wasn't yet in node_modules; no package.json/bun.lock changes.

🤖 Generated with Claude Code

Closes #61

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs