Summary

Inspected the existing Next.js app architecture for Sam's Operations Center in /Users/samaguiar/Documents/Projects/Repos/sail-command-center. This was a read-only sidecar pass. No files were edited or reverted.

Work Done

Confirmed the app currently renders from src/components/command-center.tsx, which imports static arrays directly from src/lib/mock-data.ts. The current source metadata contract lives in src/lib/types.ts, with validation and presentation helpers in src/lib/source-helpers.ts. Connector inventory is separate in src/lib/connectors.ts, and already identifies Litify / Salesforce as a P0 read-only connector using LITIFY_ORG plus Salesforce REST.

Identified the mock data owners: dashboardMetrics, needsAttention, connectorHealth, commandCenterModules, projectMemory, firmSnapshotBars, and attorneyTeams all live in src/lib/mock-data.ts. The source metadata factory is also local to that file. The /api/sources and /api/health routes currently read connector and mock health data from the same static module.

Recommended lowest-risk implementation path: add a typed dashboard data bundle and read-only provider boundary in src/lib/dashboard-data.ts, keep src/lib/mock-data.ts as the fallback provider, add a Litify/Salesforce adapter under src/lib/adapters/litify-salesforce.ts, expose a server route such as src/app/api/dashboard-data/route.ts, and then update the UI to accept a data prop or consume that route after the contract is tested. This avoids a broad UI rewrite and keeps mock mode intact.

QA

Ran npm test in the repo. Result: 2 test files passed, 8 tests passed.

Suggested Next Steps

Implement the provider boundary first with mock data only, then add the live Litify adapter behind an environment flag such as COMMAND_CENTER_DATA_MODE=mock|live. Keep the adapter read-only and make failures return mock data with source metadata marked stale or failed rather than crashing the dashboard. Add unit tests for provider fallback, source metadata preservation, and Litify adapter mapping, plus a route test for API shape.

Handoff Notes

The next agent can work safely without changing visible UI first. Start by preserving the existing SourceMetadata contract and all arrays currently consumed by CommandCenter. Avoid importing Salesforce code into client components. Keep live reads server-side only. The current UI has hard dependencies on static imports in src/components/command-center.tsx, especially metrics, module filter options, connector drawer, firm snapshot, project memory, and attorney team rows.

Reason Session Ended

The requested sidecar exploration was completed, current baseline tests passed, and findings were returned as file-path-specific recommendations.