You're offline — showing cached data

MC-4873

MC /reports listing perf — cache or manifest (slow rclone scan) [non-breaking]
2026-06-13 07:35:03 SAST
Home Board MC-4873

MC /reports listing perf — cache or manifest (slow rclone scan) [non-breaking]

## Goal Fix the slow MC `/reports` LISTING page. After MC-4867 (reports now cloud-first on the rclone GDrive mount), the listing takes ~21s cold AND warm because it scans + read...
State Done Next Action Closed Owner Luci Runtime Closed Age 4d ago
MC-4873
Ticket is done; runtime is closed. · profile claude_opus_1m_medium

Description

MC-4873
## Goal Fix the slow MC `/reports` LISTING page. After MC-4867 (reports now cloud-first on the rclone GDrive mount), the listing takes ~21s cold AND warm because it scans + reads metadata (title/date) from ~340 report files over the cloud mount on EVERY request. Individual report serving is fast — only the index is slow. Make `/reports` render in <2s warm with NO dropped reports. ## Context Live MC = `~/workspace/mission-control/app.py` @ master (deployed f307977). Listing is built in app.py's report-listing functions (glob the report bases for *.html/*.md, read each file head for title/date). `_report_bases()` returns `[cloud_reports, ~/workspace/reports]`. ## Fix (prefer A — the quick win) - **Option A (recommended, smallest):** server-side short-TTL cache of the rendered reports listing (~90s TTL, in-process). Bounds the expensive scan to once per TTL. Leave a TODO pointing at B. - **Option B (proper):** a `_state/reports-index.json` manifest in the cloud reports dir ({filename,title,date,type,mtime}); listing READS the manifest instead of scanning+reading 340 files; update the manifest when reports are added or on a periodic refresh. ## Constraints - Non-breaking: full report set still listed; links still resolve. Do NOT change report SERVING (correct + fast) — only the listing build. No new traversal surface. - Do NOT deploy live yourself — produce review-required evidence; Lucienne (controller) does the guarded deploy (`mc_orchestrator_deploy.py --apply --reload-mc`). ## Verification (before marking review-required) - `/reports` warm response < 2s (was ~21s); report count unchanged - A report still opens 200; `/md-view` 200; board `/` loads - `python3 -c "import ast; ast.parse(open('app.py').read())"`; run report tests ## Terminal-state report REQUIRED: STATUS, 1-line, commit SHA, literal timing(seconds) + counts before/after, follow-ups. On error: root cause + safe-retry + stop condition. Commit incrementally; don't deploy live.

Activity

done
Luci is working...
Live
No activity yet
Help