smcraft

78 — Forgewright renders episode state-machines (PLAN)

Plan only (HANDOFF v2, Phase 2 deliverable 3). No forgewright deployment, no ilex changes happen from this document. It exists so the forgewright lane can lift it into forgewright/rispecs/ (natural slot: spec 12, after 11-chronicle-narrative-beats) and act on it deliberately.

Desired outcome

Forgewright’s chronicle section (/workspace/repos/miadisabelle/forgewright, runs on ilex port 8031) shows which miadi-chronicle episodes carry designed state-machines and renders them — read-only first, live canvas hosting later.

Current reality (verified 2026-07-26)

Phase A — read-only rendering (first motion)

  1. Discovery. A chronicle episode view asks one question: does <episode>/diagrams/*.smdf.json exist? Two candidate answers, choose ONE:
    • Filesystem route — a forgewright API route (/api/chronicle/diagrams?episode=…) globs the episode folder on the host that serves 8031. Cheapest; couples forgewright to a chronicle working tree on ilex.
    • Wheel route — register each committed diagram as a medicine-wheel artifact (miadi.artifact-ref.v1, new kind state_machine_diagram) the way src/lib/chronicle/client.ts already lists artifact kinds. Keeps forgewright’s “read only what the wheel serves” purity; needs a small registration step (inquiry-weave register is the precedent). Recommendation: start filesystem (prove the render), migrate to wheel artifacts when the registration ceremony exists.
  2. Render. A read-only SmdfDiagram component: parse the SMDF (smcraft / @miadi/stateloom-protocol types are already installed), lay out states and transitions. No editing, no sockets — the file is the truth. Slot it into src/components/chronicle/ beside NarrativeBeats.tsx.
  3. Tests. Vitest over the SMDF→view derivation (pure, like beats.ts), fixture: the ep103 film-preprod machine.

Phase B — live canvas hosting (later, explicitly not now)

The long arc — absorb or depend

William’s framing: forgewright either absorbs smcraft or uses it as dependencies. Current reality has already chosen the near-term answer: consume @miadi/stateloom-* as published packages (forgewright does this today). Absorption into miadi proper remains open and is Guillaume’s call; nothing in Phase A/B forecloses it, because every touchpoint goes through the published package surfaces, not smcraft internals.

Hard boundary restated

Nothing in this plan deploys to forgewright or ilex. Rendering work happens in the forgewright repo by its own lane, on its own consent, with this plan as input.