feat(api,ui): ForecastOps Control Center — read-only ops slice + /ops page#218
Conversation
There was a problem hiding this comment.
Sorry @w7-mgfcode, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #217. Implements PRP-24 — ForecastOps Control Center (
PRPs/PRP-24-forecastops-control-center.md).What
A new operator-facing dashboard that connects ForecastLabAI's isolated Explorer/Visualize pages into one workflow.
Backend — new read-only vertical slice
app/features/ops/:GET /ops/summary— system health, job/run status histograms, alias health, data freshness, and a "needs attention" list (recent failed jobs/runs + stale aliases).GET /ops/retraining-candidates?limit=—(store, product)queue ranked by a deterministic retraining-priority score (blends staleness + WAPE).limitbounded[1, 100]→422outside.models.py, no Alembic migration — read-only, mirrors theanalyticsslice.Frontend — new
/opsControl Center page:pages/ops.tsxwith 5 sections (System Health, KPI row, Data Freshness, Needs Attention table, Retraining Queue table); wired into the top nav as "Control Center".hooks/use-ops.ts(useOpsSummarypolls every 15s;useRetrainingCandidatesno polling), purelib/ops-utils.tshelpers (+ vitest),Ops*response types.KPICard/StatusBadge/Card/Table/ loading-error-empty components,getStatusVariant, and the existinguseProviderHealthhook..claude/rules/product-vision.md)app/features/ops/service.pyimports the ORM models of three sibling slices —jobs(Job),registry(ModelRun,DeploymentAlias), anddata_platform(SalesDaily) — to run server-sideselect()aggregation. This is a deliberate, accepted tension with the "a slice may NOT import from another slice" rule (AGENTS.md§ Architecture), and was locked during PRP-24 planning (decision #1):select()— no siblingservice.pyorschemas.pyis ever imported.data_platformORM is already a sanctioned cross-slice import (theanalyticsslice uses it); importingjobs/registryORM is the new tension.ASGITransportin-process-HTTP approach (thedemoslice's pattern) — server-side SQL aggregation is the right tool for a read-only ops view.The Control Center operationalises the Measure + Manage functions of the NIST AI RMF; the alias-staleness check follows the MLflow alias-governance pattern.
Validation
ruff check+ruff format --check— cleanmypy app/+pyright app/— clean (--strict)pytest -m "not integration"— 1144 passedpytest -m integration app/features/ops/— 6 passedtsc --noEmit+lint+test --run— clean, 66 passed/opspage dogfooded in a browser (all 5 sections render, nav item present, 0 console errors)No new dependency, no new table, no Alembic migration.
🤖 Generated with Claude Code