Report Migration: Next Phases Checklist
Goal
Move from legacy report storage to canonical report storage safely:
- canonical:
users/{uid}/reports/{sid} - legacy projection:
users/{uid}/strategies/{sid}(+positions/position)
Current State (done)
- FinLab client writes canonical payload (
report+execution) toreports/{sid}. - Web clients (
new_website,backtestWebsite) support fallback to canonical docs. - Canary script exists:
scripts/report_web_canary.py.
Phase 1: Deploy And Stabilize
Actions
- Deploy
report_projectionCloud Function. - Deploy new FinLab package.
- Deploy both website updates (dual-read mode).
- Run canary on sampled real strategies.
Canary command
uv run python scripts/report_web_canary.py \
--uid <uid> \
--sid <sid1> \
--sid <sid2> \
--check-legacy
Use FINLAB_ID_TOKEN env var or pass --id-token.
Exit criteria
- No spike in strategy page failures.
- Canary pass rate is high on production samples.
- Legacy projection docs are present and fresh.
Phase 2: Canonical-First Reads
Actions
- Flip web read order:
- from:
strategiesfirst,reportsfallback - to:
reportsfirst,strategiesfallback - Keep same UI view model (no user-visible schema change).
- Continue canary + error monitoring.
Exit criteria
- Canonical-first reads stable in production.
- No functional regressions in strategy/performance/position pages.
Phase 3: Legacy Decommission
Actions
- Stop using legacy endpoint writes (
write_database) for report payloads. - Announce deprecation window for legacy read paths.
- Remove legacy fallback code from web clients after window.
- Remove projection trigger when no consumer depends on legacy docs.
Exit criteria
- All active clients read canonical docs directly.
- Legacy docs/endpoint no longer required by any production flow.
Rollback Plan
If Phase 1 or 2 has issues:
- Keep projection enabled.
- Keep frontend in dual-read mode.
- Revert canonical-first switch (if applied).
- Re-run canary on affected strategies before re-release.
Ownership
- Backend/FinLab: canonical payload correctness + upload/read behavior.
- Cloud Function: projection health + logs.
- Frontend: render parity and fallback behavior.
- Release: canary execution and rollout gate decisions.