Skip to content

feat: Command Center dashboard + SDLC gap-fill (16 units)#1683

Open
gsxdsm wants to merge 21 commits into
mainfrom
feature/factory-view
Open

feat: Command Center dashboard + SDLC gap-fill (16 units)#1683
gsxdsm wants to merge 21 commits into
mainfrom
feature/factory-view

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Command Center dashboard + software-delivery-loop gap-fill

Implements the 16-unit plan in docs/plans/2026-06-15-001-feat-command-center-and-sdlc-gaps-plan.md (twice doc-reviewed). Adds an observability/analytics Command Center dashboard plus the SDLC stages Fusion didn't cover.

What's included

  • Telemetry & analytics (U1–U3): queryable usage_events table + emitUsageEvent capture seam; reusable core date-range aggregators (tokens, tools + autonomy ratio, activity/stickiness, productivity); cost derivation via a pricingAsOf-stamped model-pricing map.
  • Command Center view (U4–U10): lazy ARIA-tabbed view with hand-rolled CSS-bar charts, date-range picker, per-area panels, live Mission-Control panel (SSE push + idle-aware polling), SDLC funnel, analytics API (/api/command-center/*, auth + project-scoped), CSV export, and an opt-in OTLP exporter.
  • SDLC gap-fill (U11–U14, U17, U18): external signal ingestion (Sentry/Datadog/PagerDuty/webhook, HMAC + replay + SSRF guards); triage trait (issues + PRs); monitor stage (deployments/incidents/MTTR with a storm-guarded auto-fix loop); persistent knowledge index; Fusion Model Router (session-level, governance-gated, OFF by default); surfaced + gated PR review-comment auto-resolution.

Three db.ts migrations (118→120), all additive with verified SCHEMA_SQL parity. Repo-wide typecheck green; each unit shipped with unit tests.

Verification

  • pnpm typecheck — green across all packages.
  • Per-unit vitest suites pass (analytics, migrations incl. seed-at-previous-version, security 401/scoping, storm-guard burst/absorb, model-router governance, live-poll idle).

Residual Review Findings

Multi-agent code review (10 reviewers) ran in autofix mode. Auto-applied: 2 missing changesets + 1 migration-test-decay pin (commit c1b581e01). Data-migration review returned zero findings. The items below are gated/manual — left for follow-up, not auto-applied:

P1

  • Signal webhooks unreachable when daemon auth is enabled/api/signals is not in EXEMPT_PATHS (auth-middleware.ts), so the global bearer gate 401s HMAC-only external webhooks before ingestSignal runs. Fix: exempt /api/signals (it self-authenticates via HMAC), add a createServer-level test with auth on. (api-contract, conf 80)
  • Concurrent same-groupingKey regressions can create duplicate fix tasks — the ingest→decide→await createTask→attach sequence in monitor-trait.ts is non-atomic; two firings past the gate both see fixTaskId=null. Fix: atomically claim the incident (UPDATE … WHERE fixTaskId IS NULL, act on changes()===1) or wrap in a transaction. (adversarial, conf 80)
  • PagerDuty verify() never calls isWithinReplayWindow (imports it, unused); Sentry/Datadog skip the replay window when the timestamp header is absent. Fix: make timestamp+replay mandatory; persist delivery-id dedup on the monitor incidents path. (adversarial, conf 75)

P2

  • monitor /incidents lacks idempotency/dedup — repeated identical POSTs each bump occurrences and can drive the storm guard to flood triage; no nonce/externalId dedup like /api/signals has. (adversarial, conf 78)
  • Storm-guard circuit-breaker budget leak — absorbed re-firings bump incidents.updatedAt, so one chronically-firing incident permanently counts against maxTasksPerWindow. Count distinct fix-task creations by a creation timestamp instead. (correctness, conf 75)
  • Duplicate rangeClauses — token/tool/productivity-analytics + usage-events each re-implement the inclusive range builder that activity-analytics already exports (~8 copies). Export and reuse the canonical one. (maintainability, conf 80)
  • Missing FNXC requirement-tracing comments across the new feature source files (convention active in 72 existing files). (project-standards, conf 80)
  • Missing 401 test for POST /api/knowledge/refresh — its sibling GET /query has one; the auth file's contract claims "every endpoint". (testing, conf 75)
  • Agent-facing API docs — the analytics/knowledge/monitor GET endpoints are agent-usable but undocumented for agents (only inbound signals are in the README). Add an "Agent-readable APIs" section to README/AGENTS.md. (agent-native)

P3 / lower-confidence observations

  • toolStartedAt keyed by tool name — concurrent/repeated same-named tool calls clobber durationMs telemetry (agent-logger.ts). (correctness, conf 75)
  • GET /api/monitor/metrics skips the resolveRange validation/defaulting the command-center endpoints use. (maintainability + api-contract, conf 75)
  • CSV formula injectionquoteField applies RFC-4180 quoting but doesn't neutralize leading = + - @; an attacker-influenced model/provider/node name becomes a live formula in Excel/Sheets. Prefix such cells with '. (security, conf 50)
  • Router fallback returns the configured default pair without re-checking isPermitted (reachable only if governance is tightened to forbid the default mid-deployment; security review found governance otherwise absolute). (adversarial, conf 70)
  • Signal-ingest dedup does an unbounded full-table scan (includeArchived) on every ingest — latency grows with task count. (adversarial, conf 68)
  • Live-snapshot polling drops an SSE event that fires mid-fetch, then self-stops on an idle result → UI can stick stale. (adversarial, conf 65)
  • In-memory nonce/rate-limit state is per-process (best-effort across restart/multi-worker); getScopedStore trusts caller ?projectId (pre-existing Fusion authz model); prefer toBe(SCHEMA_VERSION) over literal version pins. (residual risks)

Full review artifact: /tmp/compound-engineering/ce-code-review/20260615-210216-b09992ed/

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added the Command Center dashboard with historical analytics (tokens, tools, activity, productivity, ecosystem, signals) and a live Mission Control view
    • Integrated external signal ingestion (Sentry, Datadog, PagerDuty, and webhooks) to automatically create triage tasks
    • Introduced deployment/incident tracking with MTTR metrics and a monitor workflow that can open fix tasks on regression signals
    • Added a persistent knowledge index for searching and incremental indexing
    • Implemented model routing with optional “cheap” tier governance controls
    • Added CSV export and optional OpenTelemetry (OTLP) analytics export (disabled by default)
    • Added an option to auto-resolve PR review comments

gsxdsm added 18 commits June 15, 2026 19:05
…apture

Schema migration 117→118 adds usage_events; events captured via a dedicated
emitUsageEvent seam wired through AgentLogger tool hooks + executor session
context (model/provider/nodeId), not by widening log signatures. meta is
size-capped and carries only non-sensitive descriptors.
…tives

New command-center built-in view (lazy-loaded, ARIA-tabbed) with hand-rolled
CSS-bar chart primitives (Bar/StackedBar/Sparkline/Funnel), DateRangePicker,
and Overview tab. Animations use --duration-* tokens (IACVT-safe).
…uty/webhook)

SignalSource adapter seam with mandatory HMAC verification, replay window +
nonce dedup, SSRF-safe URL handling, body-size/rate-limit/field caps, and a
groupingKey on every normalized Signal for U13's storm guard. Inbound webhooks
create triage tasks via the existing store (no schema change).
…ity/productivity)

Reusable aggregate() over tasks + usage_events with model/provider/node/agent
grouping. Autonomy ratio sources interventions from approval audit events +
user-authored steers (agent steers excluded); fully-autonomous sessions report
tool-calls-per-session, never divide-by-zero. LOC/MTTR seams flagged unavailable.
costFor() derives USD from token counts via a hand-maintained provider:model
rate map with pricingAsOf + staleness flag; unknown models report unavailable
rather than guessing. Cost wired additively into token-analytics per-task so it
is correct for any groupBy.
…t composer

composeLiveSnapshot (core, U6a) feeds GET /api/command-center/live; register-
command-center-routes exposes tokens/tools/activity/productivity/live as thin
adapters over the U2 aggregators + U3 cost. All endpoints inherit session auth
(401 unauth) and apply getScopedStore (no cross-project leak). Vite proxy verified.
Adds autoResolveReviewComments project setting (default on) gating the existing
Review-response loop, a single-sourced summarizePrThreadActivity counter, and
fixed/acted thread counts in the dashboard PR summary. Resolution stays
independent of the auto-merge gate (disabled merge still resolves threads).
routeModel + conservative v0 allowlist (dependabot/lint → cheap tier) wired
into execution/planning/validation lanes in model-resolution.ts; governance
(isPermitted) and column-agent override are absolute, OFF by default. Routing
decisions (with counterfactual) emit via the U1 usage_events seam.
…ltering

Tokens/Tools/Activity/Productivity/Ecosystem/Signals area components fetch the
U9 endpoints and render via the U4 chart primitives, wired into the shell tabs.
SWR reset effects key on a derived signature (not array identity) to survive
revalidation. LOC/plugin gaps show unavailable sentinels; Signals degrades to
empty until U11/U13 data lands.
MissionControlPanel renders the U6a /live snapshot with push+poll convergence
(SSE-triggered refetch + 5s interval armed only while sessions are in-flight,
cleared when idle), stale-node marking, and the live SDLC funnel. Wired into the
shell's Mission Control tab.
?format=csv branch on tokens/tools/activity/productivity serializes the same
scoped aggregator output (RFC-4180 quoting, attachment headers, header-only on
empty). Scoping applied before aggregation — no cross-project leak via export.
Registers a built-in 'triage' onEnter trait (via TraitRegistry +
registerTraitHookImpl) that classifies and decomposes incoming signals/issues
into todo tasks, and routes inbound PRs (dependency-bump vs feature) without
minting issues, with a Fusion-opened-PR self-loop guard. Reuses subtask-breakdown
via a new decomposeForTriage seam.

Follow-up: auto-firing the built-in async onEnter from store.moveTaskInternal
(currently fires plugin: hooks only) — invoked via the registry seam meanwhile.
aggregateSdlcFunnel derives per-stage counts, conversion, completion rate, and
throughput/day from activityLog task:moved transitions, mapping columns to stages
by trait (unknown → Other). Rides additively on the /activity payload; SdlcFunnel
renders it via the U4 Funnel primitive in the Overview Throughput section.
mapAnalyticsToOtlp maps token/cost/activity aggregates to the OTLP/HTTP JSON
envelope (counters + gauges, model/provider/node/agent attributes); a periodic
dashboard exporter is opt-in via FUSION_OTEL_METRICS_ENDPOINT, https-validated,
header-redacted, backs off on failure, and never blocks startup/shutdown.
Minimal exporter (no SDK dep) — real @opentelemetry SDK is a follow-up.
Adds knowledge_pages (db migration 118→119) + a deterministic, model-free
keyword index of task/PR history in packages/dashboard/src, incrementally
refreshed on task completion (task:moved→done listener) and queryable via an
auth-gated, project-scoped API. Complements the LLM-extracted insights/memory
surfaces rather than duplicating them.

Follow-ups: no React view yet; PR-history page population attaches via U18.
…ses the loop

Adds deployments + incidents tables (db migration 119→120), real MTTR/deploy/
incident aggregation replacing the U7 seam, an auth-gated SSRF-safe deploy/
incident ingestion route, and a monitor trait that auto-opens a single fix task
on a regression signal. Storm guard groups by the U11 Signal groupingKey with a
threshold gate, cooldown absorption, per-window circuit breaker, and self-loop
guard. Also completes the otel test ActivityAnalytics fixture.
- 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
@greptile-apps

greptile-apps Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review. (119 files found, 100 file limit)

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@gsxdsm, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 8 minutes and 44 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2d0c34e3-7f36-493c-a93e-2b49beccaa6e

📥 Commits

Reviewing files that changed from the base of the PR and between 61f389e and 0d85426.

📒 Files selected for processing (4)
  • packages/dashboard/src/__tests__/monitor-store.test.ts
  • packages/dashboard/src/__tests__/monitor-trait.test.ts
  • packages/dashboard/src/monitor-store.ts
  • packages/dashboard/src/monitor-trait.ts
📝 Walkthrough

Walkthrough

This PR adds a Command Center dashboard with analytics and live views, telemetry capture and exports, new database tables and migrations, external signal ingestion, triage and monitor workflows, knowledge indexing, model-routing support, review-thread summaries, and extensive tests and documentation.

Changes

Command Center and SDLC platform additions

Layer / File(s) Summary
Schema, telemetry, and analytics core
packages/core/src/db.ts, packages/core/src/usage-events.ts, packages/core/src/model-pricing.ts, packages/core/src/activity-analytics.ts, packages/core/src/token-analytics.ts, packages/core/src/tool-analytics.ts, packages/core/src/productivity-analytics.ts, packages/core/src/command-center-live.ts, packages/core/src/otel-metrics.ts, packages/engine/src/agent-logger.ts, packages/engine/src/executor.ts, packages/core/src/__tests__/*, packages/engine/src/__tests__/agent-logger.test.ts
Adds the new schema tables and migrations, usage-event persistence, pricing and aggregation helpers, live snapshot composition, OTLP mapping, telemetry context emission, and the corresponding test coverage.
Command Center shell and shared UI primitives
packages/dashboard/app/App.tsx, packages/dashboard/app/components/{Header.tsx,MobileNavBar.tsx}, packages/dashboard/app/components/command-center/*, packages/dashboard/app/hooks/useViewState.ts, packages/i18n/locales/en/app.json, AGENTS.md, packages/dashboard/app/__tests__/*
Adds the lazy-loaded command-center view, navigation entries, translations, the tabbed shell, date-range picker, chart primitives, shared area state wrappers, and UI interaction/accessibility tests.
Historical areas, live Mission Control, and analytics routes
packages/dashboard/app/components/command-center/{MissionControlPanel.tsx,SdlcFunnel.tsx,areas/*}, packages/dashboard/src/routes/register-command-center-routes.ts, packages/dashboard/src/command-center-csv.ts, packages/dashboard/src/otel-exporter.ts, packages/dashboard/src/server.ts, packages/dashboard/src/__tests__/{command-center-csv.test.ts,otel-exporter.test.ts,register-command-center-routes*.test.ts}
Builds analytics area components, the SSE-plus-polling live panel, CSV serializers, authenticated command-center endpoints, and optional OTLP exporter startup/shutdown wiring with tests.
External signal ingestion
packages/dashboard/src/signal-source.ts, packages/dashboard/src/signal-sources/*, packages/dashboard/src/routes/register-signal-routes.ts, packages/dashboard/src/__tests__/{signal-source.test.ts,register-signal-routes.test.ts}, packages/dashboard/README.md
Adds shared signal verification and normalization helpers, provider adapters for webhook/Sentry/Datadog/PagerDuty, authenticated ingestion routes with dedup and rate limiting, related tests, and docs.
Triage and monitor workflows
packages/dashboard/src/{triage-trait.ts,subtask-breakdown.ts,monitor-store.ts,monitor-trait.ts}, packages/dashboard/src/routes/monitor-routes.ts, packages/dashboard/src/__tests__/{triage-trait.test.ts,monitor-store.test.ts,monitor-trait.test.ts,monitor-routes.test.ts}
Adds triage classification and decomposition flow, monitor incident/deployment persistence, storm-guarded fix-task opening, monitor ingestion/metrics routes, and related tests.
Knowledge index and incremental refresh
packages/dashboard/src/{knowledge-index.ts,knowledge-index-refresh.ts}, packages/dashboard/src/routes/register-knowledge-routes.ts, packages/dashboard/src/routes/register-git-github.ts, packages/dashboard/src/__tests__/{knowledge-index.test.ts,register-knowledge-routes*.test.ts}
Adds persistent knowledge-page storage, keyword query and refresh logic, task-moved refresh wiring for done, authenticated knowledge routes, and tests.
Model routing and PR review activity updates
packages/core/src/{model-router.ts,model-resolution.ts,settings-schema.ts,types.ts,pr-entity.ts,index.ts}, packages/dashboard/src/routes/register-pull-requests-routes.ts, packages/dashboard/src/routes-pull-requests.test.ts, packages/engine/src/pr-nodes.ts, packages/engine/src/__tests__/pr-nodes.test.ts, packages/core/src/__tests__/{model-router.test.ts,pr-entity.test.ts}
Adds router-aware model selection APIs and settings, emits router telemetry, summarizes PR thread outcomes including fixed and acted counts, and gates review auto-resolution when autoResolveReviewComments is explicitly disabled.
Release notes and implementation plan
.changeset/*, docs/plans/2026-06-15-001-feat-command-center-and-sdlc-gaps-plan.md
Adds release-note entries and a plan document covering Command Center, OTLP export, external signals, monitor stage, and knowledge indexing work.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

  • Runfusion/Fusion#1445: Both PRs modify packages/core/src/db.ts schema and migration logic by extending SCHEMA_SQL, migration blocks, and SCHEMA_VERSION.
  • Runfusion/Fusion#1461: Both PRs extend PR-thread summarization and review-response behavior around the shared PR entity model.

Poem

🐇 I hopped through charts and tables bright,
And wired new signals in the night.
With routes and metrics, ears held high,
I watched live sessions flicker by.
Now burrows hum with data sweet—
A Command Center carrot treat.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/factory-view

…l source

Lint failure (@typescript-eslint/no-unused-vars). The pagerduty replay-window
check itself is tracked as a residual review finding (P1) for follow-up.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

Note

Due to the large number of review comments, Critical severity comments were prioritized as inline comments.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
packages/core/src/__tests__/db-migrate.test.ts (1)

1-7: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add the required FNXC_LOG change annotation comment.

This changed TypeScript file is missing a FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> comment near the module header.

As per coding guidelines: packages/**/*.{ts,tsx,js,mjs}: Add FNXC_LOG comments whenever working on the codebase. Format: FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description>.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/core/src/__tests__/db-migrate.test.ts` around lines 1 - 7, The test
file db-migrate.test.ts is missing the required FNXC_LOG change annotation
comment at the module header. Add a comment in the format FNXC:<Area-of-product>
<yyyy-MM-dd-hh:mm>: <description> after the import statements to document the
change. Replace Area-of-product with the relevant product area, use the current
date and time in the specified format, and provide a brief description of the
changes made to this file.

Source: Coding guidelines

packages/core/src/__tests__/insight-store.test.ts (1)

13-18: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add the required FNXC_LOG change annotation comment.

This changed TypeScript file is missing a FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> comment near the module header.

As per coding guidelines: packages/**/*.{ts,tsx,js,mjs}: Add FNXC_LOG comments whenever working on the codebase. Format: FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description>.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/core/src/__tests__/insight-store.test.ts` around lines 13 - 18, Add
a FNXC_LOG change annotation comment near the top of the insight-store.test.ts
file following the required format FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>:
<description>. Place this comment in the module header area, either at the very
beginning of the file or after the import statements, and ensure it includes the
appropriate product area and a brief description of the changes made to this
test file.

Source: Coding guidelines

packages/dashboard/app/__tests__/lazy-loaded-views-docs.test.ts (1)

81-81: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update stale test description to match the 21-view contract.

Line 81 still says “curated 20-view list” while this test now enforces 21. That wording is now misleading for future maintainers.

Suggested patch
-  it("documents the App-level lazy views accurately and keeps the curated 20-view list in sync", () => {
+  it("documents the App-level lazy views accurately and keeps the curated 21-view list in sync", () => {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/dashboard/app/__tests__/lazy-loaded-views-docs.test.ts` at line 81,
The test description for the test "documents the App-level lazy views accurately
and keeps the curated 20-view list in sync" is outdated and references a 20-view
list while the test now enforces a 21-view contract. Update the test description
string to replace "20-view list" with "21-view list" to accurately reflect the
current enforcement and prevent confusion for future maintainers.
🧹 Nitpick comments (14)
packages/core/src/db.ts (1)

1230-1232: ⚡ Quick win

Add a composite index for the dashboard’s kind + date filters.

aggregateToolAnalytics() filters usage_events by kind and optional ts bounds for every tool/session count, but the schema only indexes ts, taskId, and agentId. A (kind, ts) index keeps the Command Center analytics path from scanning unrelated event kinds as telemetry grows.

Proposed index addition
 CREATE INDEX IF NOT EXISTS idxUsageEventsTs ON usage_events(ts);
+CREATE INDEX IF NOT EXISTS idxUsageEventsKindTs ON usage_events(kind, ts);
 CREATE INDEX IF NOT EXISTS idxUsageEventsTaskId ON usage_events(taskId);
 CREATE INDEX IF NOT EXISTS idxUsageEventsAgentId ON usage_events(agentId);
         this.db.exec(`
           CREATE INDEX IF NOT EXISTS idxUsageEventsTs ON usage_events(ts)
         `);
+        this.db.exec(`
+          CREATE INDEX IF NOT EXISTS idxUsageEventsKindTs ON usage_events(kind, ts)
+        `);
         this.db.exec(`
           CREATE INDEX IF NOT EXISTS idxUsageEventsTaskId ON usage_events(taskId)
         `);

Also applies to: 4830-4838

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/core/src/db.ts` around lines 1230 - 1232, Add a composite index on
the (kind, ts) columns for the usage_events table to optimize the filtering
pattern used by aggregateToolAnalytics(), which queries by kind and optional ts
bounds. After the existing individual indexes (idxUsageEventsTs,
idxUsageEventsTaskId, idxUsageEventsAgentId), add a new CREATE INDEX statement
for the composite (kind, ts) index. This will prevent full table scans of
unrelated event kinds as telemetry data grows.
packages/core/src/__tests__/db.test.ts (1)

2947-2978: ⚡ Quick win

Add index assertions to the v119→v120 migration-path test.

This test currently validates table creation and row retention, but not the indexes introduced with v120. A migration could regress index creation while this still passes.

Suggested patch
       expect(tables.has("deployments")).toBe(true);
       expect(tables.has("incidents")).toBe(true);
+      const indexes = new Set(
+        (
+          migrated
+            .prepare(
+              "SELECT name FROM sqlite_master WHERE type='index' AND (tbl_name='deployments' OR tbl_name='incidents')",
+            )
+            .all() as Array<{ name: string }>
+        ).map((i) => i.name),
+      );
+      expect(indexes.has("idxDeploymentsDeployedAt")).toBe(true);
+      expect(indexes.has("idxIncidentsGroupingKey")).toBe(true);
       const task = migrated.prepare("SELECT id FROM tasks WHERE id = ?").get("FN-V119") as { id: string } | undefined;
       expect(task?.id).toBe("FN-V119");
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/core/src/__tests__/db.test.ts` around lines 2947 - 2978, The test
"from v119 → init() adds deployments + incidents without dropping existing rows"
validates table creation and row retention during the v119→v120 migration but
does not verify that indexes are properly created. Add assertions after the
existing table and row checks that verify the indexes created as part of v120
exist on the deployments and incidents tables. Use SQLite queries to check the
sqlite_master table for the index entries on these tables to ensure the
migration's index creation did not regress.
packages/dashboard/app/components/command-center/areas/SignalsArea.tsx (1)

1-8: ⚡ Quick win

Add required FNXC_LOG change annotation in this TS module.

This new package TS file is missing the required FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> change comment.

As per coding guidelines, packages/**/*.{ts,tsx,js,mjs} must include FNXC_LOG comments documenting date/requirement changes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/dashboard/app/components/command-center/areas/SignalsArea.tsx`
around lines 1 - 8, The SignalsArea.tsx file is missing the required FNXC_LOG
change annotation comment at the top of the module. Add a comment with the
format FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> before or after
the existing import statements to document this new file addition according to
the coding guidelines that mandate FNXC_LOG comments for all TypeScript files
under the packages directory.

Source: Coding guidelines

packages/dashboard/app/components/command-center/areas/areaShared.ts (1)

1-3: ⚡ Quick win

Add required FNXC_LOG change annotation in this TS module.

This new package TS file is missing the required FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> change comment.

As per coding guidelines, packages/**/*.{ts,tsx,js,mjs} must include FNXC_LOG comments documenting date/requirement changes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/dashboard/app/components/command-center/areas/areaShared.ts` around
lines 1 - 3, The file areaShared.ts is missing the required FNXC_LOG change
annotation comment that must be present in all TypeScript files under the
packages directory. Add a FNXC_LOG comment at the top of the file after the
import statements (after the DateRange import) following the format
FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> where Area-of-product
should reflect the component area (e.g., command-center), the date-time should
be the current timestamp in yyyy-MM-dd-hh:mm format, and the description should
briefly explain what change or new functionality is being introduced in this
module.

Source: Coding guidelines

packages/dashboard/src/routes.ts (1)

1996-2011: ⚡ Quick win

Add the required FNXC_LOG annotation for this registrar change block.

This packages/**/*.ts change adds/updates behavior comments but does not include the required FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> change annotation.

As per coding guidelines, packages/**/*.{ts,tsx,js,mjs} changes must include an FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> comment.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/dashboard/src/routes.ts` around lines 1996 - 2011, The registrar
change block in packages/dashboard/src/routes.ts is missing the required FNXC
annotation. Add an FNXC comment with the format FNXC:<Area-of-product>
<yyyy-MM-dd-hh:mm>: <description> before the block of
registerCommandCenterRoutes, registerKnowledgeRoutes, registerSignalRoutes, and
registerMonitorRoutes calls. Use an appropriate area descriptor (such as
Dashboard-Routes or API-Routes) and provide a brief description of the registrar
changes being made.

Source: Coding guidelines

packages/dashboard/src/otel-exporter.ts (1)

1-17: ⚡ Quick win

Apply the required FNXC: change-log comment format across all touched package files.
The shared issue is missing FNXC-formatted change comments in newly touched packages/**/*.{ts,tsx,js,mjs} files, which your repo guideline marks as required.

  • packages/dashboard/src/otel-exporter.ts#L1-L17: add a FNXC:<Area> <yyyy-MM-dd-hh:mm>: <description> comment documenting the U10 exporter requirements/change.
  • packages/dashboard/src/server.ts#L1711-L1714: add an FNXC comment describing server lifecycle wiring for OTEL start/stop.
  • packages/dashboard/app/__tests__/lazy-loaded-views-docs.test.ts#L1-L3: add an FNXC comment noting the lazy-view inventory contract update.
  • packages/dashboard/src/__tests__/monitor-routes.test.ts#L3-L8: add an FNXC comment for monitor ingest auth-layer assertions.
  • packages/dashboard/src/__tests__/otel-exporter.test.ts#L1-L6: add an FNXC comment for exporter config/redaction/backoff test coverage.
  • packages/dashboard/src/__tests__/register-command-center-routes.auth.test.ts#L3-L9: add an FNXC comment for command-center auth integration coverage.
  • packages/dashboard/src/__tests__/register-knowledge-routes.auth.test.ts#L3-L9: add an FNXC comment for knowledge-route auth integration coverage.
  • packages/dashboard/src/__tests__/routes-pull-requests.test.ts#L73-L79: add an FNXC comment for fixed/acted thread summary assertion expansion.

As per coding guidelines: packages/**/*.{ts,tsx,js,mjs} requires FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> comments when working on code segments.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/dashboard/src/otel-exporter.ts` around lines 1 - 17, Add
FNXC-formatted change-log comments to all touched package files following the
format FNXC:<Area> <yyyy-MM-dd-hh:mm>: <description>. At
packages/dashboard/src/otel-exporter.ts lines 1-17, add an FNXC comment
documenting the U10 exporter requirements and changes. At
packages/dashboard/src/server.ts lines 1711-1714, add an FNXC comment describing
server lifecycle wiring for OTEL start/stop hooks. At
packages/dashboard/app/__tests__/lazy-loaded-views-docs.test.ts lines 1-3, add
an FNXC comment noting the lazy-view inventory contract update. At
packages/dashboard/src/__tests__/monitor-routes.test.ts lines 3-8, add an FNXC
comment for monitor ingest auth-layer assertions. At
packages/dashboard/src/__tests__/otel-exporter.test.ts lines 1-6, add an FNXC
comment for exporter configuration, redaction, and backoff test coverage. At
packages/dashboard/src/__tests__/register-command-center-routes.auth.test.ts
lines 3-9, add an FNXC comment for command-center auth integration test
coverage. At
packages/dashboard/src/__tests__/register-knowledge-routes.auth.test.ts lines
3-9, add an FNXC comment for knowledge-route auth integration test coverage. At
packages/dashboard/src/__tests__/routes-pull-requests.test.ts lines 73-79, add
an FNXC comment documenting the fixed or acted thread summary assertion
expansion. Each comment should be placed at the beginning of the respective file
or code block and follow the established FNXC convention with area, timestamp,
and descriptive message.

Source: Coding guidelines

packages/engine/src/__tests__/agent-logger.test.ts (2)

500-501: ⚡ Quick win

Add the required FNXC_LOG annotation in this changed test file.

This package-scoped changed file is missing the required FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> comment.

As per coding guidelines, packages/**/*.{ts,tsx,js,mjs} must include FNXC_LOG comments with the specified format.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/engine/src/__tests__/agent-logger.test.ts` around lines 500 - 501,
Add the required FNXC_LOG annotation comment to the agent-logger.test.ts file
following the format FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description>.
Place this annotation near the top of the file (typically after any license
headers or imports) to comply with the coding guidelines for all files in the
packages directory. The annotation should clearly describe the changes made to
this test file in the usage_events emission test suite.

Source: Coding guidelines


572-589: ⚡ Quick win

Add a test for emitUsageEvent throw behavior (fail-soft contract).

Telemetry emission is documented as fail-soft; this suite should assert onToolStart/onToolEnd do not throw if emitUsageEvent throws.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/engine/src/__tests__/agent-logger.test.ts` around lines 572 - 589,
Add a new test in the agent-logger.test.ts file that verifies the fail-soft
contract for telemetry emission. Create a test that mocks the store's
emitUsageEvent method to throw an error, then calls onToolStart and onToolEnd on
the logger instance, and asserts that these methods complete without throwing
exceptions. This ensures that failures in telemetry emission do not disrupt the
agent logging functionality.
packages/dashboard/app/components/command-center/areas/ProductivityArea.tsx (1)

10-16: ⚡ Quick win

Add the required FNXC_LOG annotation in this changed file.

This new area implementation doesn’t include a guideline-required FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> comment.

As per coding guidelines, packages/**/*.{ts,tsx,js,mjs} must include FNXC_LOG comments with the specified format.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/dashboard/app/components/command-center/areas/ProductivityArea.tsx`
around lines 10 - 16, The ProductivityArea function in the ProductivityArea.tsx
file is missing the required FNXC_LOG annotation comment that must be included
according to coding guidelines. Add a FNXC_LOG comment with the format
FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> before the export
statement of the ProductivityArea function. The comment should reference the
ProductivityArea as the area and include a brief description of what this
component does, along with the current date and time in the specified format.

Source: Coding guidelines

packages/dashboard/app/components/command-center/areas/TokensArea.tsx (1)

39-43: ⚡ Quick win

Add the required FNXC_LOG annotation in this changed file.

This new area implementation doesn’t include a guideline-required FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> comment.

As per coding guidelines, packages/**/*.{ts,tsx,js,mjs} must include FNXC_LOG comments with the specified format.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/dashboard/app/components/command-center/areas/TokensArea.tsx` around
lines 39 - 43, The TokensArea function is missing the required FNXC_LOG
annotation comment that must be present in all files under
packages/**/*.{ts,tsx,js,mjs}. Add a comment above the TokensArea function
export with the format FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description>,
where Area-of-product describes the relevant product area, the timestamp is in
the specified format, and the description briefly explains what this tokens area
component does.

Source: Coding guidelines

packages/dashboard/app/components/command-center/areas/ToolsArea.tsx (1)

10-16: ⚡ Quick win

Add the required FNXC_LOG annotation in this changed file.

This file adds new behavior but is missing the required FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> change log comment.

As per coding guidelines, packages/**/*.{ts,tsx,js,mjs} must include FNXC_LOG comments with the specified format.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/dashboard/app/components/command-center/areas/ToolsArea.tsx` around
lines 10 - 16, The file ToolsArea.tsx is missing the required FNXC_LOG
annotation. Add a change log comment at the top of the file (before or after
existing comments) following the format FNXC:<Area-of-product>
<yyyy-MM-dd-hh:mm>: <description>, where Area-of-product describes the relevant
product area, the timestamp is in the specified format, and the description
briefly explains what changed in this file. This annotation is required for all
TypeScript and JavaScript files under the packages directory.

Source: Coding guidelines

packages/engine/src/agent-logger.ts (1)

5-11: ⚡ Quick win

Add the required FNXC_LOG annotation in this changed file.

This package-scoped changed file is missing the required FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> comment.

As per coding guidelines, packages/**/*.{ts,tsx,js,mjs} must include FNXC_LOG comments with the specified format.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/engine/src/agent-logger.ts` around lines 5 - 11, The file
packages/engine/src/agent-logger.ts is missing the required FNXC_LOG annotation
that must be present in all package-scoped TypeScript files according to coding
guidelines. Add an FNXC_LOG comment at the top of the file using the format
FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description>, where the area should
reflect the relevant product area, the timestamp should be the current date and
time, and the description should briefly explain the changes made to the file
(in this case, the addition or modification of the AgentLoggerUsageContext
interface).

Source: Coding guidelines

packages/dashboard/app/components/command-center/areas/__tests__/areas.test.tsx (1)

1-8: ⚡ Quick win

Add the required FNXC_LOG annotation in this changed test file.

The test changes are fine functionally, but this package-scoped file still needs the required FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> comment.

As per coding guidelines, packages/**/*.{ts,tsx,js,mjs} must include FNXC_LOG comments with the specified format.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/dashboard/app/components/command-center/areas/__tests__/areas.test.tsx`
around lines 1 - 8, Add the required FNXC_LOG annotation to the top of the
areas.test.tsx file in the packages/dashboard package. Insert a comment before
the existing imports with the format FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>:
<description>, where the Area-of-product should reflect the command-center area
based on the file path, the timestamp should be the current date and time, and
the description should briefly explain the test changes being made (such as
updating test fixtures or mocking improvements). This annotation is required for
all changed files matching the packages/**/*.{ts,tsx,js,mjs} pattern according
to the coding guidelines.

Source: Coding guidelines

packages/dashboard/src/__tests__/monitor-store.test.ts (1)

1-3: ⚡ Quick win

Add the required FNXC_LOG annotation in this changed test file.

This package-scoped changed file is missing the required FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description> comment.

As per coding guidelines, packages/**/*.{ts,tsx,js,mjs} must include FNXC_LOG comments with the specified format.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/dashboard/src/__tests__/monitor-store.test.ts` around lines 1 - 3,
Add the required FNXC_LOG annotation comment at the top of the test file. Insert
a comment line in the format FNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>:
<description> before the existing vitest-environment directive. This annotation
is mandatory for all TypeScript and JavaScript files in the packages directory
according to the coding guidelines, and should document the change made in this
test file with an appropriate product area identifier, timestamp, and brief
description of what was modified.

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d3a7af98-373c-41a4-98c0-befd578aa388

📥 Commits

Reviewing files that changed from the base of the PR and between 799e590 and 4119dc4.

📒 Files selected for processing (119)
  • .changeset/command-center-dashboard.md
  • .changeset/monitor-stage.md
  • .changeset/u10-otel-export.md
  • .changeset/u11-external-signal-ingestion.md
  • .changeset/u14-knowledge-index.md
  • AGENTS.md
  • docs/plans/2026-06-15-001-feat-command-center-and-sdlc-gaps-plan.md
  • packages/core/src/__tests__/activity-analytics.test.ts
  • packages/core/src/__tests__/command-center-live.test.ts
  • packages/core/src/__tests__/db-migrate.test.ts
  • packages/core/src/__tests__/db.test.ts
  • packages/core/src/__tests__/goals-schema.test.ts
  • packages/core/src/__tests__/insight-store.test.ts
  • packages/core/src/__tests__/merge-request-record.test.ts
  • packages/core/src/__tests__/mission-store.test.ts
  • packages/core/src/__tests__/model-pricing.test.ts
  • packages/core/src/__tests__/model-router.test.ts
  • packages/core/src/__tests__/otel-metrics.test.ts
  • packages/core/src/__tests__/pr-entity.test.ts
  • packages/core/src/__tests__/productivity-analytics.test.ts
  • packages/core/src/__tests__/run-audit.test.ts
  • packages/core/src/__tests__/store-merge-queue.test.ts
  • packages/core/src/__tests__/task-documents.test.ts
  • packages/core/src/__tests__/token-analytics.test.ts
  • packages/core/src/__tests__/tool-analytics.test.ts
  • packages/core/src/__tests__/usage-events.test.ts
  • packages/core/src/activity-analytics.ts
  • packages/core/src/command-center-live.ts
  • packages/core/src/db.ts
  • packages/core/src/index.ts
  • packages/core/src/model-pricing.ts
  • packages/core/src/model-resolution.ts
  • packages/core/src/model-router.ts
  • packages/core/src/otel-metrics.ts
  • packages/core/src/pr-entity.ts
  • packages/core/src/productivity-analytics.ts
  • packages/core/src/settings-schema.ts
  • packages/core/src/store.ts
  • packages/core/src/token-analytics.ts
  • packages/core/src/tool-analytics.ts
  • packages/core/src/types.ts
  • packages/core/src/usage-events.ts
  • packages/dashboard/README.md
  • packages/dashboard/app/App.tsx
  • packages/dashboard/app/__tests__/lazy-loaded-views-docs.test.ts
  • packages/dashboard/app/components/Header.tsx
  • packages/dashboard/app/components/MobileNavBar.tsx
  • packages/dashboard/app/components/command-center/CommandCenter.css
  • packages/dashboard/app/components/command-center/CommandCenter.tsx
  • packages/dashboard/app/components/command-center/DateRangePicker.css
  • packages/dashboard/app/components/command-center/DateRangePicker.tsx
  • packages/dashboard/app/components/command-center/MissionControlPanel.css
  • packages/dashboard/app/components/command-center/MissionControlPanel.tsx
  • packages/dashboard/app/components/command-center/SdlcFunnel.css
  • packages/dashboard/app/components/command-center/SdlcFunnel.tsx
  • packages/dashboard/app/components/command-center/__tests__/CommandCenter.test.tsx
  • packages/dashboard/app/components/command-center/__tests__/MissionControlPanel.test.tsx
  • packages/dashboard/app/components/command-center/__tests__/SdlcFunnel.test.tsx
  • packages/dashboard/app/components/command-center/__tests__/charts.test.tsx
  • packages/dashboard/app/components/command-center/areas/ActivityArea.tsx
  • packages/dashboard/app/components/command-center/areas/AreaShell.tsx
  • packages/dashboard/app/components/command-center/areas/EcosystemArea.tsx
  • packages/dashboard/app/components/command-center/areas/ProductivityArea.tsx
  • packages/dashboard/app/components/command-center/areas/SignalsArea.tsx
  • packages/dashboard/app/components/command-center/areas/TokensArea.tsx
  • packages/dashboard/app/components/command-center/areas/ToolsArea.tsx
  • packages/dashboard/app/components/command-center/areas/__tests__/areas.test.tsx
  • packages/dashboard/app/components/command-center/areas/areaShared.ts
  • packages/dashboard/app/components/command-center/areas/areas.css
  • packages/dashboard/app/components/command-center/areas/useAnalyticsArea.ts
  • packages/dashboard/app/components/command-center/charts/Bar.tsx
  • packages/dashboard/app/components/command-center/charts/Funnel.tsx
  • packages/dashboard/app/components/command-center/charts/Sparkline.tsx
  • packages/dashboard/app/components/command-center/charts/StackedBar.tsx
  • packages/dashboard/app/components/command-center/charts/charts.css
  • packages/dashboard/app/hooks/useViewState.ts
  • packages/dashboard/src/__tests__/command-center-csv.test.ts
  • packages/dashboard/src/__tests__/knowledge-index.test.ts
  • packages/dashboard/src/__tests__/monitor-routes.test.ts
  • packages/dashboard/src/__tests__/monitor-store.test.ts
  • packages/dashboard/src/__tests__/monitor-trait.test.ts
  • packages/dashboard/src/__tests__/otel-exporter.test.ts
  • packages/dashboard/src/__tests__/register-command-center-routes.auth.test.ts
  • packages/dashboard/src/__tests__/register-command-center-routes.test.ts
  • packages/dashboard/src/__tests__/register-knowledge-routes.auth.test.ts
  • packages/dashboard/src/__tests__/register-knowledge-routes.test.ts
  • packages/dashboard/src/__tests__/register-signal-routes.test.ts
  • packages/dashboard/src/__tests__/routes-pull-requests.test.ts
  • packages/dashboard/src/__tests__/signal-source.test.ts
  • packages/dashboard/src/__tests__/triage-trait.test.ts
  • packages/dashboard/src/command-center-csv.ts
  • packages/dashboard/src/index.ts
  • packages/dashboard/src/knowledge-index-refresh.ts
  • packages/dashboard/src/knowledge-index.ts
  • packages/dashboard/src/monitor-store.ts
  • packages/dashboard/src/monitor-trait.ts
  • packages/dashboard/src/otel-exporter.ts
  • packages/dashboard/src/routes.ts
  • packages/dashboard/src/routes/monitor-routes.ts
  • packages/dashboard/src/routes/register-command-center-routes.ts
  • packages/dashboard/src/routes/register-git-github.ts
  • packages/dashboard/src/routes/register-knowledge-routes.ts
  • packages/dashboard/src/routes/register-pull-requests-routes.ts
  • packages/dashboard/src/routes/register-signal-routes.ts
  • packages/dashboard/src/server.ts
  • packages/dashboard/src/signal-source.ts
  • packages/dashboard/src/signal-sources/datadog.ts
  • packages/dashboard/src/signal-sources/pagerduty.ts
  • packages/dashboard/src/signal-sources/sentry.ts
  • packages/dashboard/src/signal-sources/webhook.ts
  • packages/dashboard/src/subtask-breakdown.ts
  • packages/dashboard/src/triage-trait.ts
  • packages/engine/src/__tests__/agent-logger.test.ts
  • packages/engine/src/__tests__/pr-nodes.test.ts
  • packages/engine/src/agent-logger.ts
  • packages/engine/src/executor.ts
  • packages/engine/src/pr-nodes.ts
  • packages/i18n/locales/en/app.json
  • plugins/fusion-plugin-roadmap/src/store/__tests__/roadmap-store.test.ts

Comment thread packages/dashboard/src/monitor-trait.ts Outdated
Comment thread packages/dashboard/src/routes/register-git-github.ts
- monitor-trait: atomic incident-level claim (conditional UPDATE) so concurrent
  regression ingests can't open duplicate fix tasks; loser absorbs (+ tests)
- register-git-github: attach/detach KnowledgeIndexRefreshService per project
  store so task:moved→done refreshes the index for non-primary projects
- agent-logger: make usage-event emission genuinely fail-soft (try/catch +
  absorb async rejection) so a throwing emitUsageEvent can't break tool logging
  (+ sync-throw and rejected-promise tests)
- db: add composite (kind, ts) index on usage_events backing Command Center
  tool analytics; folded into migration 118 (unreleased) — no SCHEMA_VERSION bump
- db.test: assert the six v120 deployments/incidents indexes survive migration
- lazy-loaded-views-docs.test: fix stale "20-view" → "21-view" description
- add FNXC_LOG change-log annotations across the touched package files per AGENTS.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gsxdsm

gsxdsm commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed CodeRabbit review-body findings (commit 61f389e):

Outside-diff / nitpicks fixed:

  • "Add a composite index for the dashboard's kind + date filters" — added CREATE INDEX IF NOT EXISTS idxUsageEventsKindTs ON usage_events(kind, ts) in both SCHEMA_SQL and migration 118 (folded into the unreleased migration; no SCHEMA_VERSION bump since 118–120 ship together with the table, so no migrated DB can exist without it, and a bump would needlessly break ~25 hardcoded version pins).
  • "Add index assertions to the v119→v120 migration-path test" — the test now asserts all six deployments/incidents indexes (idxDeploymentsDeployedAt, idxDeploymentsService, idxIncidentsGroupingKey, idxIncidentsStatus, idxIncidentsOpenedAt, idxIncidentsResolvedAt) survive migration.
  • "Add a test for emitUsageEvent throw behavior (fail-soft contract)" — good catch: the code was not actually fail-soft (the emit had no try/catch despite the docstring). Made emitToolUsageEvent genuinely fail-soft (try/catch + absorb async rejection, log via warn) and added sync-throw and rejected-promise tests proving onToolStart/onToolEnd never throw.
  • "Update stale test description to match the 21-view contract" — fixed "20-view""21-view" in lazy-loaded-views-docs.test.ts (assertions already enforced 21).

FNXC_LOG annotations — added the required FNXC:<Area> <yyyy-MM-dd-hh:mm>: change-log comments (per AGENTS.md) to the touched package files flagged across the review body (areas, otel-exporter + test, routes.ts, server.ts, monitor/knowledge/command-center route tests, db/db-migrate/insight-store tests, agent-logger + test).

Validation: typecheck clean across @fusion/core / @fusion/engine / @fusion/dashboard; core 269/269, engine 39/39, dashboard API/src suites 118/118 passing for the touched files.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/dashboard/src/__tests__/monitor-trait.test.ts (1)

143-202: ⚡ Quick win

Add an FNXC_LOG annotation for the new concurrency harness.

The forced-interleaving gate logic is a complex new test path and should carry the required FNXC:Area-of-product yyyy-MM-dd-hh:mm comment format for package code changes.
As per coding guidelines, packages/**/*.{ts,tsx,js,mjs} changes should include FNXC_LOG comments for important/complex code paths with the FNXC:Area-of-product prefix and timestamp.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/dashboard/src/__tests__/monitor-trait.test.ts` around lines 143 -
202, The complex concurrency harness in the test "two CONCURRENT regression
ingests for the same open incident open exactly ONE fix task" is missing the
required FNXC_LOG annotation. Add a comment with the format FNXC:Area-of-product
yyyy-MM-dd-hh:mm above the gate-related code (before the releaseGate and gate
variable declarations) to document this complex test path that forces
interleaving of concurrent callers. This comment should explain the purpose of
the forced-interleaving gate mechanism and help future maintainers understand
this advanced testing pattern.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/dashboard/src/monitor-store.ts`:
- Around line 321-333: The claimIncidentForFixTask function writes a sentinel
value to fixTaskId but has no corresponding cleanup if task creation fails after
the claim succeeds, leaving stranded sentinels that block future auto-fix tasks.
After invoking claimIncidentForFixTask successfully, if the subsequent
createTask call fails, ensure that releaseIncidentFixTaskClaim is called to
clean up the stranded sentinel claim so the incident can be properly retried in
future regression detection cycles.

---

Nitpick comments:
In `@packages/dashboard/src/__tests__/monitor-trait.test.ts`:
- Around line 143-202: The complex concurrency harness in the test "two
CONCURRENT regression ingests for the same open incident open exactly ONE fix
task" is missing the required FNXC_LOG annotation. Add a comment with the format
FNXC:Area-of-product yyyy-MM-dd-hh:mm above the gate-related code (before the
releaseGate and gate variable declarations) to document this complex test path
that forces interleaving of concurrent callers. This comment should explain the
purpose of the forced-interleaving gate mechanism and help future maintainers
understand this advanced testing pattern.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cf81c5ab-4f4c-40d9-8a56-7d4dc6b53e21

📥 Commits

Reviewing files that changed from the base of the PR and between 4119dc4 and 61f389e.

📒 Files selected for processing (26)
  • packages/core/src/__tests__/db-migrate.test.ts
  • packages/core/src/__tests__/db.test.ts
  • packages/core/src/__tests__/insight-store.test.ts
  • packages/core/src/db.ts
  • packages/dashboard/app/__tests__/lazy-loaded-views-docs.test.ts
  • packages/dashboard/app/components/command-center/areas/ProductivityArea.tsx
  • packages/dashboard/app/components/command-center/areas/SignalsArea.tsx
  • packages/dashboard/app/components/command-center/areas/TokensArea.tsx
  • packages/dashboard/app/components/command-center/areas/ToolsArea.tsx
  • packages/dashboard/app/components/command-center/areas/__tests__/areas.test.tsx
  • packages/dashboard/app/components/command-center/areas/areaShared.ts
  • packages/dashboard/src/__tests__/monitor-routes.test.ts
  • packages/dashboard/src/__tests__/monitor-store.test.ts
  • packages/dashboard/src/__tests__/monitor-trait.test.ts
  • packages/dashboard/src/__tests__/otel-exporter.test.ts
  • packages/dashboard/src/__tests__/register-command-center-routes.auth.test.ts
  • packages/dashboard/src/__tests__/register-knowledge-routes.auth.test.ts
  • packages/dashboard/src/__tests__/routes-pull-requests.test.ts
  • packages/dashboard/src/monitor-store.ts
  • packages/dashboard/src/monitor-trait.ts
  • packages/dashboard/src/otel-exporter.ts
  • packages/dashboard/src/routes.ts
  • packages/dashboard/src/routes/register-git-github.ts
  • packages/dashboard/src/server.ts
  • packages/engine/src/__tests__/agent-logger.test.ts
  • packages/engine/src/agent-logger.ts
🚧 Files skipped from review as they are similar to previous changes (22)
  • packages/dashboard/src/tests/routes-pull-requests.test.ts
  • packages/dashboard/src/tests/register-knowledge-routes.auth.test.ts
  • packages/core/src/tests/insight-store.test.ts
  • packages/dashboard/src/tests/register-command-center-routes.auth.test.ts
  • packages/dashboard/app/tests/lazy-loaded-views-docs.test.ts
  • packages/dashboard/src/server.ts
  • packages/dashboard/src/routes.ts
  • packages/dashboard/src/tests/monitor-routes.test.ts
  • packages/dashboard/app/components/command-center/areas/SignalsArea.tsx
  • packages/dashboard/app/components/command-center/areas/ToolsArea.tsx
  • packages/dashboard/src/tests/monitor-store.test.ts
  • packages/engine/src/agent-logger.ts
  • packages/dashboard/app/components/command-center/areas/areaShared.ts
  • packages/core/src/db.ts
  • packages/dashboard/app/components/command-center/areas/TokensArea.tsx
  • packages/dashboard/src/tests/otel-exporter.test.ts
  • packages/dashboard/src/monitor-trait.ts
  • packages/core/src/tests/db.test.ts
  • packages/dashboard/app/components/command-center/areas/ProductivityArea.tsx
  • packages/dashboard/app/components/command-center/areas/tests/areas.test.tsx
  • packages/dashboard/src/otel-exporter.ts
  • packages/core/src/tests/db-migrate.test.ts

Comment thread packages/dashboard/src/monitor-store.ts
- monitor-store: add releaseIncidentFixTaskClaim (guarded UPDATE that only
  clears an in-flight sentinel, never a real attached task id) and make
  countRecentAutoFixTasks ignore sentinel placeholders, so a claim stranded by
  a failed createTask can't permanently absorb/suppress future regressions
- monitor-trait: release the claim if createTask throws after a successful
  claim, returning an error outcome instead of stranding the sentinel
- tests: release-vs-real-id, sentinel-excluded count, createTask-failure-then-reopen
- fix a type-unsound narrowing in the concurrency test (cast to the full union
  exposed the error variant's missing incidentId); use a discriminated guard
- add FNXC annotations on the new release/count paths and the concurrency harness

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gsxdsm

gsxdsm commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed CodeRabbit nitpick (commit 0d85426):

Add an FNXC_LOG annotation for the new concurrency harness (monitor-trait.test.ts ~143-202)

Done — added an FNXC:Monitor comment above the gate/releaseGate declarations explaining the forced-interleaving mechanism (both concurrent callers are parked at the createTask await to deterministically reproduce the claim race and prove exactly one fix task opens). While there, also fixed a type-unsound narrowing in that test ((rb as typeof ra) cast to the full outcome union, exposing the error variant's missing incidentId) — replaced with a discriminated kind guard.

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.

1 participant