# Progress — worker_m1_m2_1

**Last visited:** 2026-09-05T10:50:30Z

## Current Status: Completed Milestones M1 & M2 Implementation & Verification
- [x] Read DISPATCH.md, ORIGINAL_REQUEST.md, PROJECT.md, and explorer handoff/patches
- [x] Created BRIEFING.md and initialized progress.md
- [x] Inspected MVP/config_manager.py, MVP/app.py, MVP/database.py, MVP/static/app.js, and MVP/static/index.html
- [x] Implement M1: Updated `MVP/config_manager.py` (bundle/data directory decoupling, BUNDLE_DIR, DATA_DIR, config.json search order)
- [x] Implement M1: Updated `MVP/app.py`:
  - Static file serving from `get_bundle_dir() / "static"`
  - `POST /api/login` returns `{"ok": True, "message": "Login successful", "user": ...}`
  - `GET /api/whoami` returns HTTP 200 with `{"authenticated": False}` when unauthenticated, or `{"authenticated": True, "user": ...}` when authenticated
  - `POST /api/reports` supports flat payload and multi-symptom dictionary payload, falls back to `user.get("patient_id")`, outputs grades, alerts, guidance
  - `GET /api/timeline` supports patient fallback, type filter, normalized fields
  - `GET /api/patients` and `GET /api/patients/<id>` fixed `cycle_count` column and added patient display name & treatment protocol
  - Server switched to `http.server.ThreadingHTTPServer` for concurrent request handling
- [x] Implement M1: Verified `MVP/database.py` WAL mode, foreign keys, and 5000ms busy timeout
- [x] Implement M2: Updated `MVP/static/app.js`:
  - Login handler accepts `(data && (data.ok || data.user))`
  - Demo credentials updated: `admin / admin123`, `dr.martin / demo123`, `inf.moret / demo123`, `patient.durand / demo123`
  - Normalized `currentUser` across `init()`, `bindLogin()`, `renderShell()`, dashboards, and messaging
  - Replaced duplicate `bindTimeline` with `bindTreatmentPlan` and wired into view router
  - Enhanced timeline rendering to show event titles, descriptions, badges, and timestamps
- [x] Verification:
  - Verified with `proposed_verify.py` (8/8 tests passed)
  - Verified with `pytest 05_Test` (94/94 tests passed across Tiers 1-5)
- [x] Finalize `handoff.md` and report to parent
