Skip to content

feat(api,ui): ForecastOps Control Center — read-only ops slice + /ops page#218

Merged
w7-mgfcode merged 2 commits into
devfrom
feat/ops-control-center
May 19, 2026
Merged

feat(api,ui): ForecastOps Control Center — read-only ops slice + /ops page#218
w7-mgfcode merged 2 commits into
devfrom
feat/ops-control-center

Conversation

@w7-mgfcode
Copy link
Copy Markdown
Owner

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). limit bounded [1, 100]422 outside.
  • No models.py, no Alembic migration — read-only, mirrors the analytics slice.

Frontend — new /ops Control Center page:

  • pages/ops.tsx with 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 (useOpsSummary polls every 15s; useRetrainingCandidates no polling), pure lib/ops-utils.ts helpers (+ vitest), Ops* response types.
  • Reuses existing KPICard / StatusBadge / Card / Table / loading-error-empty components, getStatusVariant, and the existing useProviderHealth hook.

⚠️ Vision tension — cross-slice ORM import (called out per .claude/rules/product-vision.md)

app/features/ops/service.py imports the ORM models of three sibling slices — jobs (Job), registry (ModelRun, DeploymentAlias), and data_platform (SalesDaily) — to run server-side select() 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):

  • The import surface is restricted to ORM models + read-only select() — no sibling service.py or schemas.py is ever imported.
  • data_platform ORM is already a sanctioned cross-slice import (the analytics slice uses it); importing jobs/registry ORM is the new tension.
  • The chosen alternative over an ASGITransport in-process-HTTP approach (the demo slice's pattern) — server-side SQL aggregation is the right tool for a read-only ops view.
  • No CI import-linter enforces slice boundaries, so this does not fail the build — hence this explicit callout.

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 — clean
  • mypy app/ + pyright app/ — clean (--strict)
  • pytest -m "not integration" — 1144 passed
  • pytest -m integration app/features/ops/ — 6 passed
  • frontend tsc --noEmit + lint + test --run — clean, 66 passed
  • Manual: all four endpoints behave per Success Criteria; /ops page 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

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @w7-mgfcode, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 04bf6173-44f1-4fe0-8d24-7ca691c66ebc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ops-control-center

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@w7-mgfcode w7-mgfcode merged commit aac7735 into dev May 19, 2026
8 checks passed
@w7-mgfcode w7-mgfcode deleted the feat/ops-control-center branch May 20, 2026 03:26
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