MOTIR-145Done
2.7.5 Seed loader — map PlanItem.type/executor to the structured fields (stop emitting prose)
Estimate: 40m · Depends on: 2.7.3
Close the loop the whole plan-seed system was waiting on. The plan modules under scripts/plan-seed/data/ ALREADY carry type + executor per leaf (every card in story-7.1.ts / story-7.3.ts / this very module), but the loader (scripts/plan-seed/seed.ts) currently STRINGIFIES them into the work-item description ("Type: code", "Executor: coding_agent"). Now that 2.7.3 gives them real columns, map them STRUCTURALLY and stop emitting the prose.
- Map
PlanItem.type→work_item.typeandPlanItem.executor→work_item.executor(both written throughworkItemsService, the create authority — the loader already uses it). When a leaf omitsexecutorbut has atype, SEED it from 2.7.3’sdefaultExecutorForType(single source) so the seeded tree matches what the picker would default. Epics + stories gettype = null(leaf-only). - Stop emitting the prose. Remove the "Type:" / "Executor:" lines from the description the loader composes — the description stays CLEAN (the card’s real prose: description + acceptance criteria + context refs). The structured fields are now the source of truth; the chips render from them (2.7.4).
- Validate against the loader’s own values.
PlanItem.typeis a freestringon the plan side (types.ts), so the loader must map it to theWorkItemTypeenum and FAIL LOUDLY on an unknown type (a typo in a plan module is a seed-time error, not a silently-dropped field) — this is the structural backstop the prose form never had.
Acceptance criteria
- After
pnpm db:seed, leaves carrywork_item.type+work_item.executoras STRUCTURED fields (verified by a repository read), and the description body no longer contains "Type:" / "Executor:" prose lines. - A leaf with a
typebut no explicitexecutoris seeded with thedefaultExecutorForTypevalue; epics/stories are seededtype = null. - An unknown
PlanItem.typestring aborts the seed with a clear error (no silent drop); the mapping goes throughworkItemsService(not raw Prisma). - Re-seeding is idempotent in the established loader way (no duplicate work items; existing seed behaviour preserved apart from the new fields).
Context refs
motir-core/scripts/plan-seed/seed.ts— the loader that currently emits type/executor as prose (the lines to remove + the mapping to add).motir-core/scripts/plan-seed/types.ts—PlanItem.type(string) /PlanItem.executor— the loader input shape.- 2.7.3 — the
WorkItemType/Executorenums + thedefaultExecutorForTypehelper the loader maps to + seeds from. motir-core/lib/services/workItemsService.ts— the create authority the loader writes through.