feat: Command Center dashboard + SDLC gap-fill (16 units)#1683
Conversation
…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
|
Too many files changed for review. ( |
|
Warning Review limit reached
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis 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. ChangesCommand Center and SDLC platform additions
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
|
…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.
There was a problem hiding this comment.
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 winAdd the required
FNXC_LOGchange 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 winAdd the required
FNXC_LOGchange 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 winUpdate 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 winAdd a composite index for the dashboard’s
kind+ date filters.
aggregateToolAnalytics()filtersusage_eventsbykindand optionaltsbounds for every tool/session count, but the schema only indexests,taskId, andagentId. 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 winAdd 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 winAdd required
FNXC_LOGchange 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 includeFNXC_LOGcomments 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 winAdd required
FNXC_LOGchange 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 includeFNXC_LOGcomments 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 winAdd the required FNXC_LOG annotation for this registrar change block.
This
packages/**/*.tschange adds/updates behavior comments but does not include the requiredFNXC:<Area-of-product> <yyyy-MM-dd-hh:mm>: <description>change annotation.As per coding guidelines,
packages/**/*.{ts,tsx,js,mjs}changes must include anFNXC:<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 winApply the required
FNXC:change-log comment format across all touched package files.
The shared issue is missing FNXC-formatted change comments in newly touchedpackages/**/*.{ts,tsx,js,mjs}files, which your repo guideline marks as required.
packages/dashboard/src/otel-exporter.ts#L1-L17: add aFNXC:<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}requiresFNXC:<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 winAdd the required
FNXC_LOGannotation 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 includeFNXC_LOGcomments 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 winAdd a test for
emitUsageEventthrow behavior (fail-soft contract).Telemetry emission is documented as fail-soft; this suite should assert
onToolStart/onToolEnddo not throw ifemitUsageEventthrows.🤖 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 winAdd the required
FNXC_LOGannotation 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 includeFNXC_LOGcomments 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 winAdd the required
FNXC_LOGannotation 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 includeFNXC_LOGcomments 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 winAdd the required
FNXC_LOGannotation 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 includeFNXC_LOGcomments 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 winAdd the required
FNXC_LOGannotation 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 includeFNXC_LOGcomments 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 winAdd the required
FNXC_LOGannotation 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 includeFNXC_LOGcomments 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 winAdd the required
FNXC_LOGannotation 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 includeFNXC_LOGcomments 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
📒 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.mdAGENTS.mddocs/plans/2026-06-15-001-feat-command-center-and-sdlc-gaps-plan.mdpackages/core/src/__tests__/activity-analytics.test.tspackages/core/src/__tests__/command-center-live.test.tspackages/core/src/__tests__/db-migrate.test.tspackages/core/src/__tests__/db.test.tspackages/core/src/__tests__/goals-schema.test.tspackages/core/src/__tests__/insight-store.test.tspackages/core/src/__tests__/merge-request-record.test.tspackages/core/src/__tests__/mission-store.test.tspackages/core/src/__tests__/model-pricing.test.tspackages/core/src/__tests__/model-router.test.tspackages/core/src/__tests__/otel-metrics.test.tspackages/core/src/__tests__/pr-entity.test.tspackages/core/src/__tests__/productivity-analytics.test.tspackages/core/src/__tests__/run-audit.test.tspackages/core/src/__tests__/store-merge-queue.test.tspackages/core/src/__tests__/task-documents.test.tspackages/core/src/__tests__/token-analytics.test.tspackages/core/src/__tests__/tool-analytics.test.tspackages/core/src/__tests__/usage-events.test.tspackages/core/src/activity-analytics.tspackages/core/src/command-center-live.tspackages/core/src/db.tspackages/core/src/index.tspackages/core/src/model-pricing.tspackages/core/src/model-resolution.tspackages/core/src/model-router.tspackages/core/src/otel-metrics.tspackages/core/src/pr-entity.tspackages/core/src/productivity-analytics.tspackages/core/src/settings-schema.tspackages/core/src/store.tspackages/core/src/token-analytics.tspackages/core/src/tool-analytics.tspackages/core/src/types.tspackages/core/src/usage-events.tspackages/dashboard/README.mdpackages/dashboard/app/App.tsxpackages/dashboard/app/__tests__/lazy-loaded-views-docs.test.tspackages/dashboard/app/components/Header.tsxpackages/dashboard/app/components/MobileNavBar.tsxpackages/dashboard/app/components/command-center/CommandCenter.csspackages/dashboard/app/components/command-center/CommandCenter.tsxpackages/dashboard/app/components/command-center/DateRangePicker.csspackages/dashboard/app/components/command-center/DateRangePicker.tsxpackages/dashboard/app/components/command-center/MissionControlPanel.csspackages/dashboard/app/components/command-center/MissionControlPanel.tsxpackages/dashboard/app/components/command-center/SdlcFunnel.csspackages/dashboard/app/components/command-center/SdlcFunnel.tsxpackages/dashboard/app/components/command-center/__tests__/CommandCenter.test.tsxpackages/dashboard/app/components/command-center/__tests__/MissionControlPanel.test.tsxpackages/dashboard/app/components/command-center/__tests__/SdlcFunnel.test.tsxpackages/dashboard/app/components/command-center/__tests__/charts.test.tsxpackages/dashboard/app/components/command-center/areas/ActivityArea.tsxpackages/dashboard/app/components/command-center/areas/AreaShell.tsxpackages/dashboard/app/components/command-center/areas/EcosystemArea.tsxpackages/dashboard/app/components/command-center/areas/ProductivityArea.tsxpackages/dashboard/app/components/command-center/areas/SignalsArea.tsxpackages/dashboard/app/components/command-center/areas/TokensArea.tsxpackages/dashboard/app/components/command-center/areas/ToolsArea.tsxpackages/dashboard/app/components/command-center/areas/__tests__/areas.test.tsxpackages/dashboard/app/components/command-center/areas/areaShared.tspackages/dashboard/app/components/command-center/areas/areas.csspackages/dashboard/app/components/command-center/areas/useAnalyticsArea.tspackages/dashboard/app/components/command-center/charts/Bar.tsxpackages/dashboard/app/components/command-center/charts/Funnel.tsxpackages/dashboard/app/components/command-center/charts/Sparkline.tsxpackages/dashboard/app/components/command-center/charts/StackedBar.tsxpackages/dashboard/app/components/command-center/charts/charts.csspackages/dashboard/app/hooks/useViewState.tspackages/dashboard/src/__tests__/command-center-csv.test.tspackages/dashboard/src/__tests__/knowledge-index.test.tspackages/dashboard/src/__tests__/monitor-routes.test.tspackages/dashboard/src/__tests__/monitor-store.test.tspackages/dashboard/src/__tests__/monitor-trait.test.tspackages/dashboard/src/__tests__/otel-exporter.test.tspackages/dashboard/src/__tests__/register-command-center-routes.auth.test.tspackages/dashboard/src/__tests__/register-command-center-routes.test.tspackages/dashboard/src/__tests__/register-knowledge-routes.auth.test.tspackages/dashboard/src/__tests__/register-knowledge-routes.test.tspackages/dashboard/src/__tests__/register-signal-routes.test.tspackages/dashboard/src/__tests__/routes-pull-requests.test.tspackages/dashboard/src/__tests__/signal-source.test.tspackages/dashboard/src/__tests__/triage-trait.test.tspackages/dashboard/src/command-center-csv.tspackages/dashboard/src/index.tspackages/dashboard/src/knowledge-index-refresh.tspackages/dashboard/src/knowledge-index.tspackages/dashboard/src/monitor-store.tspackages/dashboard/src/monitor-trait.tspackages/dashboard/src/otel-exporter.tspackages/dashboard/src/routes.tspackages/dashboard/src/routes/monitor-routes.tspackages/dashboard/src/routes/register-command-center-routes.tspackages/dashboard/src/routes/register-git-github.tspackages/dashboard/src/routes/register-knowledge-routes.tspackages/dashboard/src/routes/register-pull-requests-routes.tspackages/dashboard/src/routes/register-signal-routes.tspackages/dashboard/src/server.tspackages/dashboard/src/signal-source.tspackages/dashboard/src/signal-sources/datadog.tspackages/dashboard/src/signal-sources/pagerduty.tspackages/dashboard/src/signal-sources/sentry.tspackages/dashboard/src/signal-sources/webhook.tspackages/dashboard/src/subtask-breakdown.tspackages/dashboard/src/triage-trait.tspackages/engine/src/__tests__/agent-logger.test.tspackages/engine/src/__tests__/pr-nodes.test.tspackages/engine/src/agent-logger.tspackages/engine/src/executor.tspackages/engine/src/pr-nodes.tspackages/i18n/locales/en/app.jsonplugins/fusion-plugin-roadmap/src/store/__tests__/roadmap-store.test.ts
|
Ready to review this PR? Stage has broken it down into 15 individual chapters for you: Chapters generated by Stage for commit 0d85426 on Jun 16, 2026 10:13pm UTC. |
- 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>
|
Addressed CodeRabbit review-body findings (commit 61f389e): Outside-diff / nitpicks fixed:
FNXC_LOG annotations — added the required Validation: typecheck clean across |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/dashboard/src/__tests__/monitor-trait.test.ts (1)
143-202: ⚡ Quick winAdd 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:mmcomment 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 theFNXC:Area-of-productprefix 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
📒 Files selected for processing (26)
packages/core/src/__tests__/db-migrate.test.tspackages/core/src/__tests__/db.test.tspackages/core/src/__tests__/insight-store.test.tspackages/core/src/db.tspackages/dashboard/app/__tests__/lazy-loaded-views-docs.test.tspackages/dashboard/app/components/command-center/areas/ProductivityArea.tsxpackages/dashboard/app/components/command-center/areas/SignalsArea.tsxpackages/dashboard/app/components/command-center/areas/TokensArea.tsxpackages/dashboard/app/components/command-center/areas/ToolsArea.tsxpackages/dashboard/app/components/command-center/areas/__tests__/areas.test.tsxpackages/dashboard/app/components/command-center/areas/areaShared.tspackages/dashboard/src/__tests__/monitor-routes.test.tspackages/dashboard/src/__tests__/monitor-store.test.tspackages/dashboard/src/__tests__/monitor-trait.test.tspackages/dashboard/src/__tests__/otel-exporter.test.tspackages/dashboard/src/__tests__/register-command-center-routes.auth.test.tspackages/dashboard/src/__tests__/register-knowledge-routes.auth.test.tspackages/dashboard/src/__tests__/routes-pull-requests.test.tspackages/dashboard/src/monitor-store.tspackages/dashboard/src/monitor-trait.tspackages/dashboard/src/otel-exporter.tspackages/dashboard/src/routes.tspackages/dashboard/src/routes/register-git-github.tspackages/dashboard/src/server.tspackages/engine/src/__tests__/agent-logger.test.tspackages/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
- 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>
|
Addressed CodeRabbit nitpick (commit 0d85426):
Done — added an |
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
usage_eventstable +emitUsageEventcapture seam; reusable core date-range aggregators (tokens, tools + autonomy ratio, activity/stickiness, productivity); cost derivation via apricingAsOf-stamped model-pricing map./api/command-center/*, auth + project-scoped), CSV export, and an opt-in OTLP exporter.Three
db.tsmigrations (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.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
/api/signalsis not inEXEMPT_PATHS(auth-middleware.ts), so the global bearer gate 401s HMAC-only external webhooks beforeingestSignalruns. Fix: exempt/api/signals(it self-authenticates via HMAC), add a createServer-level test with auth on. (api-contract, conf 80)groupingKeyregressions can create duplicate fix tasks — the ingest→decide→await createTask→attach sequence inmonitor-trait.tsis non-atomic; two firings past the gate both seefixTaskId=null. Fix: atomically claim the incident (UPDATE … WHERE fixTaskId IS NULL, act onchanges()===1) or wrap in a transaction. (adversarial, conf 80)verify()never callsisWithinReplayWindow(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
/incidentslacks idempotency/dedup — repeated identical POSTs each bumpoccurrencesand can drive the storm guard to flood triage; no nonce/externalId dedup like/api/signalshas. (adversarial, conf 78)incidents.updatedAt, so one chronically-firing incident permanently counts againstmaxTasksPerWindow. Count distinct fix-task creations by a creation timestamp instead. (correctness, conf 75)rangeClauses— token/tool/productivity-analytics + usage-events each re-implement the inclusive range builder thatactivity-analyticsalready exports (~8 copies). Export and reuse the canonical one. (maintainability, conf 80)POST /api/knowledge/refresh— its siblingGET /queryhas one; the auth file's contract claims "every endpoint". (testing, conf 75)P3 / lower-confidence observations
toolStartedAtkeyed by tool name — concurrent/repeated same-named tool calls clobberdurationMstelemetry (agent-logger.ts). (correctness, conf 75)GET /api/monitor/metricsskips theresolveRangevalidation/defaulting the command-center endpoints use. (maintainability + api-contract, conf 75)quoteFieldapplies 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)isPermitted(reachable only if governance is tightened to forbid the default mid-deployment; security review found governance otherwise absolute). (adversarial, conf 70)includeArchived) on every ingest — latency grows with task count. (adversarial, conf 68)getScopedStoretrusts caller?projectId(pre-existing Fusion authz model); prefertoBe(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