Skip to content

feat(WP5): facilities-manager ops dashboard - CO2 first, live fields, urgency control, hourly ledger - #13

Merged
Neal006 merged 1 commit into
mainfrom
worktree-wp5-ops-dashboard
Sep 13, 2026
Merged

Neal006 merged 1 commit into
mainfrom
worktree-wp5-ops-dashboard

Conversation

@Neal006

@Neal006 Neal006 commented Sep 13, 2026

Copy link
Copy Markdown
Owner

What

The ops app is now the facilities manager's console, built on live fields only.

Backend (additive, contract regenerated):

  • StatusOut +contracted_peak_kw, n_connectors, p_max_kw, package, employee_rate_usd_per_kwh, driver_share, noonshift_share, signal_kind, signal_source, tariff_name, ladder
  • ImpactOut +renewable_share (metrics.md §3), health_usd
  • GET /sites/{id}/impact.csv — 24-row hourly ledger day,hour,kwh,gco2_per_kwh,kgco2,signal_kind,signal_source (business.md §12), served as an attachment
  • scripts/smoke.py asserts the new status fields, the CSV header/row count, and that the ledger carries today's kWh

Web (web/, no new deps):

  • Overview: load vs contracted peak, ports on feed, charged / at-risk, CO₂ first with $ small, renewable-hour ring, feed/contracted/block lines on the chart
  • Live charging (Gantt): urgent / ASAP / move-by marks, side panel with need confidence + plan cap; Pause and driver PII removed (never pause a car)
  • Sessions: urgency / need / idle columns, high-risk highlight, UrgencyControl (Leaving now · Leaving soon <input type=time> · Prioritise) → POST /sessions/{id}/urgency
  • Chargers: plan cap with "meter" tag when the cap was observed, static share, ASAP filter
  • Plan: planned vs metered kW per hour with MOER shading (the Re-optimize button and Math.random are gone)
  • Energy & Impact: KPIs incl. renewable share and health $, hourly kWh bars coloured by MOER bucket, EPA equivalents, Export ledger CSV
  • Tariffs & Package: §7b split with α/β, package copy, TOU periods derived from /grid/signal
  • Fail-safe banner names the rung in plain words + which rungs are down; offline banner gives the exact uvicorn command
  • Helpers moved to src/lib/ui.js (keeps react-refresh lint clean)

Assumptions confirmed

  • A2 contracted_peak_kw = feed (150 kW) in data/site.json — no separate contract figure exists for site-1.
  • A3 package: "pilot"; Tariffs page renders capacity / clean-hours / pilot copy from the field.
  • Mobile pass = responsive layout (rail → top bar under md, grids stack). Not checked by eye — no browser in this session.

Checks

  • pytest: 70 passed
  • scripts/smoke.py against a live uvicorn: SMOKE OK, /impact.csv 24 hourly rows, renewable-hour share 62 %
  • web: oxlint clean (1 pre-existing fast-refresh notice on useGlobalState), vite build ✓
  • hardcoded-price grep over noonshift/ → empty
  • wattwise/ untouched

🤖 Generated with Claude Code

https://claude.ai/code/session_017thvbGo7rTVnG2f46cLMzU

…only, urgency control, hourly ledger CSV

Backend (additive): StatusOut carries the FM site card (contracted_peak_kw, package,
employee_rate, driver/noonshift share, signal kind/source, tariff name, ladder);
ImpactOut adds renewable_share + health_usd; GET /sites/{id}/impact.csv is the
24-row hourly ledger (business.md section 12). Smoke asserts all of it.

Web: every page reads live fields (Math.random and the fake pause/reoptimize
buttons are gone), CO2 leads the money everywhere, UrgencyControl is the one
driver-side action (now / soon / priority -> POST /sessions/{id}/urgency),
fail-safe banner names the rung in plain words, offline banner tells you the
uvicorn command. Layout is responsive (rail -> top bar under md); not checked by eye.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017thvbGo7rTVnG2f46cLMzU
Copilot AI lite review requested due to automatic review settings September 13, 2026 01:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Neal006
Neal006 merged commit 4a48a60 into main Sep 13, 2026
3 checks passed
@Neal006
Neal006 deleted the worktree-wp5-ops-dashboard branch September 13, 2026 01:44
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.

2 participants