FORGE STUDIO TASK
You are Cedric (Codex), worker #2. Clahadore (Claude) orchestrates. Another Codex worker is building the main demo (src/, web/, infra/, bi/) on a different branch. You touch ONLY forge-studio/, tools/FhirDemo.CodeGraph/, architecture/ and docs/forge-studio.md. Never edit src/, web/, tests/, infra/ or bi/.
GOAL: a prototype of "Forge Studio", the deep-dive zoom path from Forge's design (fleet-docs-hub/docs_src/forge-specs/forge-updated-design.md, lines ~51-70 and ~112-116), applied to THIS repo's FHIR pipeline demo. Andrew shows it at an Innovare interview tomorrow as "how I'd make a system like yours understandable to everyone from the doctor to the developer". Read docs/SPEC.md and docs/REQUIREMENTS-TRACE.md for the domain.
Zoom path (each level is a page in one app, with breadcrumbs, plus "zoom in" and "zoom out" buttons):
1. Live Mockup (/mockup): a GrapesJS OSS editor (BSD-3, inside a sandboxed iframe, sandbox="allow-scripts") preloaded with HTML mockups of the demo's patient chart (CDS risk cards, allergies table, "Add allergy" form). Plus a Puck (MIT, React) page (/mockup/puck) showing the same screen as typed components (RiskCard, AllergyTable, AllergyForm). Explain the promote step: "GrapesJS sketch → typed Puck components → production Vue/Vuetify". Puck is React, so isolate it in its own Vite entry/page. Don't mix React into the Vue pages.
2. C4 Architecture (/architecture):
- architecture/workspace.dsl (Structurizr DSL). It holds the System Context, Containers and Deployment views: Ottehr/Oystehr FHIR, Sandbox FHIR, sync worker, SQL Server, DuckDB lakehouse, API, Vue app, Metabase, Azure deployment (Container Apps, Azure SQL, Key Vault, Service Bus).
- Also emit the same model as LikeC4 (architecture/model.c4) and render it interactively with the LikeC4 viewer. If LikeC4 tooling fails, render with Mermaid C4 instead and note it.
- Use 5–9 plain-language boxes with verb arrows, plus a "what happens when the doctor opens the chart" guided tour (step highlights).
3. Rete.js v2 Blueprint (/blueprint): Rete.js v2 with the Vue 3 render plugin, area, minimap and auto-arrange (ELK) plugins, read-only mode.
- Nodes are real C# types and methods from the demo, with wires for calls and dependencies.
- Data comes from forge-studio/public/codegraph.json, produced by tools/FhirDemo.CodeGraph: a small C# .NET 10 console using Roslyn (Microsoft.CodeAnalysis.CSharp.Workspaces + MSBuildWorkspace, or plain syntax trees if MSBuild loading fails).
- It scans ../src/**/*.cs on whatever branch is checked out and outputs classes, public methods and call edges.
- If src/ doesn't exist yet on your branch, run it against ../../fhir-pipeline-demo-wt-WT-dc65/src (the other worker's worktree, read-only) via a CLI arg. Otherwise, as a last resort, use a hand-written stub graph clearly labelled "STUB".
- Clicking a node shows its file path and source snippet.
4. Blockly Method Blocks (/blocks): Google Blockly (no fork). Define custom blocks for the predictive-medicine risk rules:
- "latest lab [LOINC] value"
- "count of last N BP readings ≥ [sys]/[dia]"
- "trend rising over last N"
- compare / and / or
- "flag [name] severity [info/warning/critical] cite [resources]"
Preload the A1c-trend rule and the uncontrolled-BP rule. A live code generator emits C# for the rule (matching the style of a RiskRule method), shown side by side. Banner: "Generated code is a proposal; the C# source stays the source of truth."
5. C# Source (/source): a read-only code view (Shiki or Prism) of the actual C# for the selected node or rule, loaded from codegraph.json snippets.
Tech:
- forge-studio/ = Vite + Vue 3 + TypeScript + Vuetify 3 (Andrew's preferred UI) for the shell and nav.
- Puck in an isolated React entry.
- Mobile-friendly: Andrew may show it from a phone. At minimum, it degrades gracefully, with a "best on laptop" note on the Rete/GrapesJS pages.
- Pin all package versions.
- Synthetic-data banner.
- No secrets.
- No backend needed. Everything reads static JSON from public/.
DONE = npm ci && npm run build in forge-studio succeeds, dotnet run --project tools/FhirDemo.CodeGraph produces codegraph.json, and npm run preview serves all 5 pages. Paste the REAL outputs (build tail, codegraph node/edge counts, curl of each route returning 200) into docs/forge-studio.md, along with a 90-second demo script and the plain / middle / complex explanation of each level. Anything not working goes under "NOT DONE" with the error. Commit after each level. Finish with git push origin HEAD.