Files
garmin-coach-to-cal-sync/docs/phase3-gate.md
2026-06-16 15:14:37 +02:00

100 lines
2.9 KiB
Markdown

# Phase 3 Gate
Do not build the Dockerized web app until these checks are complete.
## Local Evidence
Run:
```sh
uv run python scripts/local_check.py
```
Required result:
- All local checks pass.
- `debug/local_checks.json` is written.
This proves only that the checkout is internally consistent. It does not prove Garmin account, Garmin Connect, or Edge 1030 behavior.
## Garmin Account Evidence
Run:
```sh
uv run python scripts/probe_garmin.py report --dump-json
```
Required result:
- Garmin login succeeds, including MFA if required.
- `debug/probe_report.json` is written.
- Normal workouts are visible or the report clearly records why they are not.
- Coach/adaptive plan discovery either finds a matched workout for today/tomorrow or clearly shows that step extraction is missing.
Optional offline analysis:
```sh
uv run python scripts/analyze_dump.py debug/coach_workout_today.json --date today --clone-dry-run
```
If Coach tasks are visible but no step arrays are found, run:
```sh
uv run python scripts/probe_garmin.py coach-endpoints --date today --dump-json
```
Required result for exact cloning:
- At least one response contains `workoutSegments` or `workoutSteps`.
Current account evidence from June 16, 2026:
- The active `FBT_ADAPTIVE` cycling Coach plan is visible.
- The `Sprint` workout is visible as a dated Coach task and calendar item.
- Browser network analysis found `/gc-api/workout-service/fbt-adaptive/<workoutUuid>`, which returns `workoutSegments` and `workoutSteps`.
- CLI access works through the equivalent Connect API route `/workout-service/fbt-adaptive/<workoutUuid>`.
- `clone_today_workout.py --dry-run` succeeds from the CLI and preserves the visible step structure.
## Edge 1030 Evidence
Run:
```sh
uv run python scripts/probe_garmin.py dummy --date tomorrow --schedule
```
Then sync and test on the Edge 1030.
Required result:
- Dummy workout appears in Garmin Connect.
- Dummy workout appears under `Training > Workouts`.
- Dummy workout appears under `Training > Training Plan > calendar icon > scheduled date`.
- Dummy workout can start while normal Edge navigation is active.
## Clone Evidence
Only run if Coach/adaptive inspection shows plausible steps:
```sh
uv run python scripts/clone_today_workout.py --date today --dry-run --dump-json
uv run python scripts/clone_today_workout.py --date today --schedule
```
Required result:
- Dry-run payload passes local validation.
- Scheduled clone appears in Garmin Connect.
- Scheduled clone appears on the Edge 1030.
- Clone can start while normal Edge navigation is active.
## Decision
Build Phase 3 only if either:
- Dummy scheduling and Coach clone scheduling both work, or
- Dummy scheduling works and we explicitly choose a fallback architecture because Coach extraction is unavailable.
If dummy scheduling fails, fix or replace the Garmin Connect scheduling path before building the web app.