feat(runtime): add live audit timeline to local dashboard#3
Conversation
Expose local takeover activity in the read-only dashboard by combining runtime audit logs with supervisor event-bus history. Persist local supervisor stdout/stderr to .wanman/runtime-audit.log, add a dashboard SSE endpoint, and render raw JSON/raw lines in a unified Event History timeline. Agent scheduling, task execution, and decision logic are unchanged.
c6714d8 to
946a6c5
Compare
guo-yu
left a comment
There was a problem hiding this comment.
Thanks for the detailed implementation and screenshots. I verified the latest head locally: focused runtime/CLI tests, full pnpm test, and pnpm typecheck all pass. I would hold merge for the two dashboard-data issues below.
|
|
||
| for (const candidate of candidates) { | ||
| if (!fs.existsSync(candidate.path)) continue; | ||
| const raw = fs.readFileSync(candidate.path, 'utf-8'); |
There was a problem hiding this comment.
This endpoint now reads and parses the entire runtime-audit.log synchronously on every /dashboard/data request, and the dashboard polls that endpoint every 3 seconds. In a long-running local takeover, supervisor stdout/stderr can grow without bound, so this can block the supervisor HTTP event loop and inflate every response payload. Please cap this path, for example by tailing the last N bytes/lines, and also cap the in-memory dashboardEvents history so the dashboard remains bounded over long runs.
There was a problem hiding this comment.
Certainly, I will test more on presure load and some edge cases.
| const artifacts = this.listDashboardArtifacts(); | ||
| const audit = this.readRuntimeAuditTrail(); | ||
| const live = this.readLiveDashboard(); | ||
| const events = [...audit.entries, ...this.dashboardEvents]; |
There was a problem hiding this comment.
The Event History is described as a unified timeline, but this concatenates all audit-log entries before all event-bus entries. That means a newer runtime-audit line can appear before an older event-bus entry, which breaks the chronological timeline and the pinned-newest behavior in the browser. Please merge by timestamp/sequence, or maintain a single bounded append-only timeline that preserves actual event order.
Problem
The local dashboard can show an empty Event History even while a local takeover is actively running. The supervisor event bus only captures structured runtime events, so agent process stdout/stderr and local supervisor activity can be invisible. In practice this makes a healthy long-running takeover look idle or stale.
Behavior
This PR adds a unified read-only audit timeline to the local dashboard.
.wanman/runtime-audit.log./dashboard/eventsfor live dashboard SSE updates.Agent scheduling, task execution, and decision logic are unchanged.
Screenshots
Live dashboard overview with runtime state and unified Event History:
Browser verification screenshot from the local dashboard:
Tests
Full suite:
pnpm typecheck— 4 package typecheck tasks passed.pnpm test— full Turbo test suite passed.Focused coverage:
@wanman/runtime: dashboard data reads runtime audit logs and keeps raw audit payloads.@wanman/runtime:/dashboard/eventsstreams live dashboard events.@wanman/cli: local supervisor stdout/stderr is persisted to.wanman/runtime-audit.log.Manual verification: