FIX: MC /apps dashboards 404 — repoint models.APPS to cloud (PKA-Outputs/dashboards) [LIVE BREAKAGE]
## LIVE BREAKAGE MC's `/apps/<app_id>` page (`models.APPS`) serves the CEO / Portfolio / FinDash / Project-Intelligence dashboards from HARDCODED `~/workspace/PKA/dashboards/*.h...
StateDoneNext ActionClosedOwnerLuciRuntimeClosedAge3d ago
Ticket is done; runtime is closed.·profile claude_opus_1m_medium
Description
MC-4897
## LIVE BREAKAGE
MC's `/apps/<app_id>` page (`models.APPS`) serves the CEO / Portfolio / FinDash / Project-Intelligence dashboards from HARDCODED `~/workspace/PKA/dashboards/*.html` paths. The outputs→cloud migration removed those files from the Luci PKA checkout (git rm --cached + gitignore), so `GET /apps/ceo-dashboard` (and portfolio/findash/project-intelligence) now returns **HTTP 404**. Fresh versions are in the cloud at `PKA-Outputs/dashboards/` but MC was never repointed. Mirror the MC-4867 reports pattern: serve CLOUD-FIRST with the legacy path as fallback.
## Changes — mission-control/app.py
- The `/apps/<app_id>` handler does `content = Path(app_def["path"]).read_text(...)`. Make it resolve CLOUD-FIRST: try `<cloud_dashboards_dir>/<basename(app_def['path'])>` first, then fall back to `app_def["path"]`. Cloud dir on Luci = `/home/lucienne/gdrive/PKA-Outputs/dashboards` (resolve via `python3 ~/workspace/PKA/pka_paths.py outputs-dir dashboards`, or import pka_paths.outputs_dir("dashboards")).
- Apply only to internal apps whose path points under `.../PKA/dashboards/` (ceo-dashboard, portfolio, findash, project-intelligence — check models.APPS for the full list). Leave `external`/`internal_route` apps (smart-money, f1, price-watch, spotify-radio) unchanged.
- Keep it traversal-safe: only swap the directory for the known app_def basename; do not read arbitrary user-supplied paths.
## Constraints
- Non-breaking: cloud-first + legacy fallback. Guarded deploy (live control plane): `mc_orchestrator_deploy.py --apply --reload-mc` — but produce REVIEW-REQUIRED evidence; Lucienne (controller) does the guarded deploy.
## Verification (before review-required)
- `GET /apps/ceo-dashboard`, `/apps/findash`, `/apps/portfolio`, `/apps/project-intelligence` → 200 (served from cloud, fresh size). External apps still redirect. Board `/` loads. app.py parses; tests pass.
## Terminal-state report REQUIRED: STATUS, 1-line, commit SHA, the literal /apps HTTP codes, follow-ups. Don't deploy live.
Activity
done
INTERACTIVE
Luci is working...
Details —
Done
· High
· Luci
▼
SState
Done
Closed
PPeople
TTiming / Details▼
api (human)
Mission Control
3d ago
3d ago
Advanced / Operator evidence
RRouting owner
ROperator console
Ticket is done; runtime is closed.MC is visibility-only. Hermes Luci launches and gates work outside MC, then mirrors evidence/status here.
WWorkflow
Start Dev Review + QA ▾
Select phases to include:
Agents
Review Gates
Decision
WAT routing: choose an agent, review gate, or decision. Buttons use the live runtime when one is attached.
REVIEW (Lucienne): FIXED + DEPLOYED directly. /apps handler now resolves dashboards cloud-first (_cloud_reports_dir sibling /dashboards/<basename>) with legacy fallback. Commit cc87874, guarded deploy mc_orchestrator_deploy --apply --reload-mc, health PASS. Live: /apps/ceo-dashboard 200 (3.5MB), /apps/findash 200, /apps/portfolio 200, /apps/project-intelligence 200, external redirect OK, board 200. Note: cold GDrive fetch of the 3.5MB ceo-dashboard reset once then served (0.6s warm) — minor rclone latency.
luci-board-manager3d ago
CONTROLLER GATE (visibility-only): closing MC-4897 after independent verification. Verified origin/master contains cc878748260f4b5cbaf4e08b1124a9969d2ca04f; live checkout HEAD is that commit and app.py has no uncommitted diff; python3 -m py_compile app.py passed. Live MC/Tailscale-class checks on 100.118.207.3:3001: /api/health 200, / 200, /apps/ceo-dashboard 200 (content-length 3541849), /apps/findash 200 (1968008), /apps/portfolio 200 (462724), /apps/project-intelligence 200 (68686), and external /apps/smart-money redirects/serves 200 at :5051. No MC runtime/pickup/send/claim/harvest endpoints used.