[Story-1007] Create matters from template snapshots

Story 1007Epic 995๐Ÿ“œ The Evidentiary RecordMatter Intelligence15 files ยท +800/โˆ’213

PR #215 ยท pramaan-io/pramaan-app ยท merged 2026-06-03

How it flows

sequenceDiagram
  autonumber
  participant ui as Live UI
  participant act as Server Action
  participant gw as Gateway
  participant be as Backend
  ui->>ui: Pick template
  ui->>act: Submit with template
  act->>gw: create template snapshot
  gw->>be: Freeze vocab + type
  be->>be: Add participant rows

Failure cases โ€” why the order and contract matter

Snapshot pehle, phir participants โ€” fixed order
Contract-backed gateway โ€” frontend and backend agree
Template mandatory at creation โ€” by design
Template live-link without snapshot
Vocab drift after participants exist
Type identifier missing on submit

Files changed (15)

Fileยฑ
docs/visual-verification/story-1007/live-matter-core-fields.png+0
docs/walkthroughs/story-1007-walkthrough.html+185
src/app/[locale]/(app)/matters/actions.ts+14 โˆ’2
src/components/matters/live-matter-core-fields-view.tsx โ˜…+224
src/components/matters/live-matter-fields.stories.tsx โ˜…+126
src/components/matters/live-matter-fields.tsx โ˜…+21 โˆ’183
src/components/matters/live-matter-frame-fields.stories.tsx+1
src/components/matters/live-matter-sheet.tsx+2
src/components/matters/live-types.ts+1
src/lib/matters/gateway.ts+20
tests/unit/live-matter-fields.test.tsx+59 โˆ’23
tests/unit/live-participant-panel.test.tsx+1
tests/unit/matter-actions.test.ts+41 โˆ’5
tests/unit/matter-create-navigation.test.tsx+2
tests/unit/matters-contract.test.ts+103