From c1b581e01871715825d26235aed9c72826af3ec9 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Mon, 15 Jun 2026 21:09:14 -0700 Subject: [PATCH] fix(review): apply autofix feedback - add missing changesets for the Command Center dashboard and Monitor stage (both ship in published @runfusion/fusion; required by AGENTS.md) - pin the knowledge_pages migration test to literal version 118 (not SCHEMA_VERSION-1) so it keeps exercising migration 119 after later bumps --- .changeset/command-center-dashboard.md | 10 ++++++++++ .changeset/monitor-stage.md | 10 ++++++++++ .../dashboard/src/__tests__/knowledge-index.test.ts | 6 +++++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .changeset/command-center-dashboard.md create mode 100644 .changeset/monitor-stage.md diff --git a/.changeset/command-center-dashboard.md b/.changeset/command-center-dashboard.md new file mode 100644 index 0000000000..571c89a2cd --- /dev/null +++ b/.changeset/command-center-dashboard.md @@ -0,0 +1,10 @@ +--- +"@runfusion/fusion": minor +--- + +Add the **Command Center** dashboard — a combined analytics/observability and live Mission-Control view (`?view=command-center`). + +- **Telemetry** — a queryable `usage_events` SQLite table populated via a dedicated `emitUsageEvent` capture seam (tool calls, messages, session lifecycle), feeding date-range aggregators for tokens, tool usage + autonomy ratio, activity (sessions/messages/active-nodes/stickiness), productivity (files/commits/PRs/LOC), and ecosystem breadth — all in `packages/core` and reusable by CLI/engine. +- **Cost** — derived from token counts via a hand-maintained `model-pricing` map carrying `pricingAsOf` + a staleness flag; unknown models report unavailable rather than guessing. +- **View** — a new lazy-loaded, ARIA-tabbed Command Center with hand-rolled CSS-bar chart primitives, a date-range picker, per-area panels, a live Mission-Control panel (SSE push + idle-aware polling), and an SDLC funnel. +- **API** — `GET /api/command-center/{tokens,tools,activity,productivity,live}` (agent-usable), each under session auth and project scoping, with `?format=csv` export and an opt-in OpenTelemetry (OTLP) metrics exporter. diff --git a/.changeset/monitor-stage.md b/.changeset/monitor-stage.md new file mode 100644 index 0000000000..fe7309e7a4 --- /dev/null +++ b/.changeset/monitor-stage.md @@ -0,0 +1,10 @@ +--- +"@runfusion/fusion": minor +--- + +Add the **Monitor stage** (U13) — deployment and incident tracking that closes the SDLC loop. + +- **Schema** — new `deployments` and `incidents` SQLite tables (`packages/core/src/db.ts`, `SCHEMA_VERSION` 119 → 120, migration added in the same change; fingerprint auto-covers SCHEMA_SQL tables). +- **Metrics** — real MTTR (incident-open → resolved) plus deploy/incident counts in `activity-analytics`, replacing the prior unavailable seam. +- **Ingestion** — `POST /api/monitor/{deployments,incidents}` self-authenticate via a shared ingest secret (constant-time bearer check, fail-closed) with SSRF-untrusted payload links; `GET /api/monitor/metrics` exposes the aggregates. +- **Loop closure** — a `monitor` workflow trait can auto-open a single fix task on a regression signal, guarded by `groupingKey` grouping, a threshold/sustained gate, cooldown absorption, a per-window circuit breaker, and a self-loop guard. diff --git a/packages/dashboard/src/__tests__/knowledge-index.test.ts b/packages/dashboard/src/__tests__/knowledge-index.test.ts index 28fb228fbb..9d8c5cb352 100644 --- a/packages/dashboard/src/__tests__/knowledge-index.test.ts +++ b/packages/dashboard/src/__tests__/knowledge-index.test.ts @@ -138,7 +138,11 @@ describe("knowledge-index store", () => { db.exec("DROP INDEX IF EXISTS idxKnowledgePagesSourceKind"); db.exec("DROP INDEX IF EXISTS idxKnowledgePagesUpdatedAt"); db.exec("DROP TABLE IF EXISTS knowledge_pages"); - db.prepare("UPDATE __meta SET value = ? WHERE key = 'schemaVersion'").run(String(SCHEMA_VERSION - 1)); + // Pinned to the literal pre-migration version (118), NOT SCHEMA_VERSION-1: + // knowledge_pages was created by migration 119, so seeding at 118 keeps this + // test exercising that CREATE block even after later migrations land (mirrors + // the literal-117 pin in usage-events.test.ts). + db.prepare("UPDATE __meta SET value = ? WHERE key = 'schemaVersion'").run("118"); (db as unknown as { migrate: () => void }).migrate();