Tower Log: Narrative Event Feed #7

Closed
opened 2026-03-20 22:22:51 +00:00 by replit · 1 comment
Owner

What & Why

Replace the raw technical event stream with a prose narrative panel — the 'Tower Log' — that tells the story of the Workshop in plain English. Instead of 'JOB_COMPLETE event for uuid-1234', visitors read 'Timmy helped a visitor craft a Lightning payment integration guide (4 sats).'

Done looks like

  • Slide-out 'Tower Log' panel shows last 20 narrative entries
  • Each entry is 1-2 sentence prose generated by Haiku when the triggering event occurs (job complete, visitor enters, agent state change)
  • Entries persisted in tower_log DB table — survives page refreshes
  • New entries stream in via WebSocket in real-time; panel auto-scrolls
  • Narrative has Timmy's personality: wizardly, warm, slightly epic
  • Toggle button in Workshop header opens/closes the panel

Out of scope

  • Full activity feed with filtering/search
  • Storing the full job output in the log (just a summary)

Tasks

  1. DB table + API — Create tower_log table; service that generates a narrative entry on key events and stores it; GET endpoint returning last 20 entries.
  2. Narrative generation — Haiku-based narrative generation per event type (job complete, visitor enter/leave, agent state change); under 100 characters.
  3. WebSocket broadcast — Emit tower_log_entry events for connected clients.
  4. Tower Log UI panel — Slide-out panel; fetch history on open, append live entries, auto-scroll, styled to match Workshop aesthetic.

Relevant files

  • artifacts/api-server/src/lib/agent.ts
  • artifacts/api-server/src/routes/events.ts
  • artifacts/api-server/src/lib/event-bus.ts
  • the-matrix/js/ui.js
  • the-matrix/js/websocket.js
## What & Why Replace the raw technical event stream with a prose narrative panel — the 'Tower Log' — that tells the story of the Workshop in plain English. Instead of 'JOB_COMPLETE event for uuid-1234', visitors read 'Timmy helped a visitor craft a Lightning payment integration guide (4 sats).' ## Done looks like - Slide-out 'Tower Log' panel shows last 20 narrative entries - Each entry is 1-2 sentence prose generated by Haiku when the triggering event occurs (job complete, visitor enters, agent state change) - Entries persisted in `tower_log` DB table — survives page refreshes - New entries stream in via WebSocket in real-time; panel auto-scrolls - Narrative has Timmy's personality: wizardly, warm, slightly epic - Toggle button in Workshop header opens/closes the panel ## Out of scope - Full activity feed with filtering/search - Storing the full job output in the log (just a summary) ## Tasks 1. **DB table + API** — Create `tower_log` table; service that generates a narrative entry on key events and stores it; GET endpoint returning last 20 entries. 2. **Narrative generation** — Haiku-based narrative generation per event type (job complete, visitor enter/leave, agent state change); under 100 characters. 3. **WebSocket broadcast** — Emit `tower_log_entry` events for connected clients. 4. **Tower Log UI panel** — Slide-out panel; fetch history on open, append live entries, auto-scroll, styled to match Workshop aesthetic. ## Relevant files - `artifacts/api-server/src/lib/agent.ts` - `artifacts/api-server/src/routes/events.ts` - `artifacts/api-server/src/lib/event-bus.ts` - `the-matrix/js/ui.js` - `the-matrix/js/websocket.js`
replit added the backendworkshopfrontendai labels 2026-03-20 22:22:51 +00:00
claude was assigned by Rockachopa 2026-03-22 23:37:46 +00:00
Collaborator

PR created: http://143.198.27.163:3000/replit/timmy-tower/pulls/112

Summary of changes:

  • New tower_log DB table + migration (0010_tower_log.sql)
  • narrateEvent() method on AgentService (Haiku, <100 chars, stub-mode safe)
  • addTowerLogEntry() service — generates narrative, persists to DB, broadcasts via EventBus
  • GET /api/tower-log endpoint returning last 20 entries
  • WebSocket: tower_log_entry real-time events + tower_log_history bootstrap on connect
  • Tower Log triggers on: job complete/rejected/failed, payments, visitor enter
  • UI: 📜 TOWER LOG header button + slide-out bottom-sheet panel with auto-scroll, new-entry highlight, and empty-state message
PR created: http://143.198.27.163:3000/replit/timmy-tower/pulls/112 **Summary of changes:** - New `tower_log` DB table + migration (`0010_tower_log.sql`) - `narrateEvent()` method on AgentService (Haiku, <100 chars, stub-mode safe) - `addTowerLogEntry()` service — generates narrative, persists to DB, broadcasts via EventBus - `GET /api/tower-log` endpoint returning last 20 entries - WebSocket: `tower_log_entry` real-time events + `tower_log_history` bootstrap on connect - Tower Log triggers on: job complete/rejected/failed, payments, visitor enter - UI: `📜 TOWER LOG` header button + slide-out bottom-sheet panel with auto-scroll, new-entry highlight, and empty-state message
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: replit/timmy-tower#7