id, epic, title, type, status, feature, depends-on, blocks, created
id
epic
title
type
status
feature
depends-on
blocks
created
07-runner-lifecycle-events-and-realtime
walking-skeleton
runner lifecycle — status events, scan event, realtime channel
technical-story
todo
workspaces
03-workspaces-feature-core
05-runner-scan-and-preview-adapter
06-runner-provisioner-port
08-discovery-feature
10-web-next-wiring
2026-07-12T10:24:14Z
Goal
Wire the control-plane side of the runner lifecycle: connectWorkspace provisions via IRunnerProvisioner and drives the protocol session (clone → install → scan → start preview); workspaces publishes runner-status-changed and the scan event on IEventBus; a realtime channel pushes stage progress + adapter-ready to the browser. This wires core-events and core-realtime end to end (PRD In scope).
Why
Staged, honest progress is what keeps a minutes-long operation from looking hung (PRD user story 2, ui-gap §5) — and named error events (bad URL, bad token, install failure) are what make failure states diagnosable instead of a blank board (user story 5). Registry ingestion is a cross-feature reaction, so it must cross the boundary via the event bus, not a direct call (rule E0) — this story publishes; story 08 consumes.
Done when
connectWorkspace kicks off provisioning + the protocol session; the credential is decrypted only server-side and passed to the runner over the authenticated protocol channel (PRD Implementation decisions).
runner-status-changed event contract lives in workspacesevents/, is exported from the feature root barrel (rule E1), and is declared under publishes in feature.manifest.ts; staged events carry stage + elapsed; error events carry named causes.
The scan event contract is likewise public + declared; the lifecycle session publishes it with the scan-result payload when the runner's scan completes.
Realtime channel descriptor is exported from the root barrel (rule R1) and declared in the manifest; it pushes stage progress + adapter-ready to the browser; no direct socket.io import in the feature (rule R2).
getWorkspaceStatus reflects live staged status, including named error states.
Tests use a recording bus + scripted runner double (protocol as the contract — no assertions on runner internals).
Run pnpm turbo gen event for the runner-status-changed contract (public from the workspaces root barrel; manifest publishes declaration) + wire the lifecycle orchestration: connectWorkspace provisions via IRunnerProvisioner, drives the protocol session (clone → install → scan → start preview) with the credential passed only over the authenticated channel, publishes staged status events (stage + elapsed) and named error events (bad URL, bad token, install failure); getWorkspaceStatus reflects live staged status; tests with recording bus + scripted runner double.
Run pnpm turbo gen event for the scan event contract (public + manifest-declared) + publish the scan-result payload from the lifecycle session when the runner's scan completes; test asserts the publish carries the registry payload.
Run pnpm turbo gen realtime for the workspace-status channel: exported channel descriptor + broadcast wiring pushing stage progress + adapter-ready to the browser; manifest declaration; handlers stay private (rule R1); tests.