Skip to content

feat(runtime): add live audit timeline to local dashboard#3

Open
XiaokunDuan wants to merge 1 commit into
chekusu:mainfrom
XiaokunDuan:codex/runtime-audit-dashboard
Open

feat(runtime): add live audit timeline to local dashboard#3
XiaokunDuan wants to merge 1 commit into
chekusu:mainfrom
XiaokunDuan:codex/runtime-audit-dashboard

Conversation

@XiaokunDuan
Copy link
Copy Markdown

@XiaokunDuan XiaokunDuan commented Apr 25, 2026

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.

  • Persist local supervisor stdout/stderr to .wanman/runtime-audit.log.
  • Read runtime audit logs alongside supervisor event-bus history.
  • Add /dashboard/events for live dashboard SSE updates.
  • Render runtime audit entries, event-bus entries, and legacy audit lines in one Event History timeline.
  • Preserve raw JSON/raw line content for debugging.
  • Use browser-local 24-hour timestamps and keep the timeline pinned to the newest entry unless the user scrolls up.

Agent scheduling, task execution, and decision logic are unchanged.

Screenshots

Live dashboard overview with runtime state and unified Event History:

Live runtime audit dashboard

Browser verification screenshot from the local dashboard:

Browser-verified dashboard timeline

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/events streams live dashboard events.
  • @wanman/cli: local supervisor stdout/stderr is persisted to .wanman/runtime-audit.log.

Manual verification:

  • Ran a local takeover and verified the dashboard in Chrome / Computer Use.

@XiaokunDuan XiaokunDuan changed the title [codex] Add runtime audit timeline to local dashboard [codex] Add live audit dashboard for local takeover runs Apr 25, 2026
@XiaokunDuan XiaokunDuan marked this pull request as ready for review April 25, 2026 12:44
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.
@XiaokunDuan XiaokunDuan force-pushed the codex/runtime-audit-dashboard branch from c6714d8 to 946a6c5 Compare April 25, 2026 13:35
@XiaokunDuan XiaokunDuan changed the title [codex] Add live audit dashboard for local takeover runs feat(runtime): add live audit timeline to local dashboard Apr 25, 2026
Copy link
Copy Markdown
Contributor

@guo-yu guo-yu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants