CODEX TASK 2
You are Cedric (Codex), worker #1, pass 2. Clahadore (Claude) orchestrates and reviews. Your v2 work is committed at a129dce on this branch (wt/WT-dc65/fhir-demo). Clahadore reviewed it: it's good. Do NOT rewrite it. Make these additions, and commit after each numbered item (committing on this branch IS authorized; the council gate runs before main).
Use per-command identity for commits: git -c user.name="Andrew Jones" -c user.email="andrewjonesdev1@gmail.com" commit -m "...". Include the trailers Co-Authored-By: Cedric (Codex) <noreply@openai.com> and Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>.
- Static snapshot mode (docs/DEPLOY-TASK.md Part A). This is the PRIMARY demo path for a phone at a restaurant.
- Add
FhirDemo.Cli snapshot --out web/public/snapshot. It writes JSON for every route the Vue app calls:- patients
- dashboard
- each patient summary (with CDS cards)
- the 5 reports
- a recorded
syncresult: the REAL second-run counts (0 inserted, 0 updated, N unchanged)
- In web/src/api.ts,
VITE_DATA_MODE=snapshotmaps each API path to the snapshot file. In snapshot mode:- POST allergies builds the FHIR AllergyIntolerance JSON client-side (same shape as the server's outbox) and shows it.
- "Run sync again" returns the recorded result.
- Add the npm script
build:snapshot. - Generate and COMMIT the snapshot JSON (synthetic data only).
- Read-only + security (from docs/STEER.md STEER 2):
Demo:ReadOnlysetting: when true, every POST except/cds-services/patient-riskreturns 403.- Security headers: CSP
default-src 'self'; frame-ancestors 'none'; object-src 'none'; base-uri 'self',X-Content-Type-Options,Referrer-Policy. - CORS allowlist from config.
- Tests for ReadOnly and for the headers.
- AbortController. Add it to web/src/api.ts. Cancel the in-flight patient summary request when another patient opens, so a stale response can't overwrite a fresh one. Add a small Vitest test for that ordering, and add
vitest+ atestscript. - Deploy IaC (docs/DEPLOY-TASK.md Part B), in a NEW project
infra/FhirDemo.Deploy(cdktn C#). - Two stacks:
- fhir-demo-gcp: a project on billing account 01D28B-C2F0EB-2DC50A, Artifact Registry, a Cloud Run API with
Demo__ReadOnly=true, and a $10 budget. - fhir-demo-cf: 2 Cloudflare
pages_projects, account 2a59c9c45db9f7893484b8ed59604979.
- fhir-demo-gcp: a project on billing account 01D28B-C2F0EB-2DC50A, Artifact Registry, a Cloud Run API with
- A Dockerfile for FhirDemo.Api.
- docs/DEPLOY.md runbook.
- Run synth and
terraform validate. Tryterraform planonly if credentials are already available; NEVER apply, NEVERwrangler deploy, NEVER gcloud mutations. - Put the REAL outputs in docs/VERIFY.md under "Deploy".
- Metabase: finish provisioning if feasible in about 20 minutes. Otherwise leave the
/api/reports+ SVG fallback, and document exactly what's missing under NOT DONE. - README: replace the demo script with the snapshot-first 3-minute script (phone): Overview → patient chart with CDS cards → Add allergy → Compare. Mention the laptop Aspire path only as optional.
DONE = dotnet build, dotnet test, cd web && npm run build && npm run build:snapshot && npm test, and the deploy synth/validate. Paste the REAL outputs into docs/VERIFY.md. Tests blocked by Windows Application Control on this PC must be listed as BLOCKED (not passed). Clahadore will re-run them on another PC.
When finished: git push origin HEAD.