MotirBuilding in public
MOTIR · moooon
onMotir
You’re viewing a public project. Anyone can view it — no account needed. Sign in to submit, upvote, or comment on requests.View-only — you can’t edit work items
MOTIR-145

2.7.5 Seed loader — map PlanItem.type/executor to the structured fields (stop emitting prose)

Done
Description

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.typework_item.type and PlanItem.executorwork_item.executor (both written through workItemsService, the create authority — the loader already uses it). When a leaf omits executor but has a type, SEED it from 2.7.3’s defaultExecutorForType (single source) so the seeded tree matches what the picker would default. Epics + stories get type = 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.type is a free string on the plan side (types.ts), so the loader must map it to the WorkItemType enum 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 carry work_item.type + work_item.executor as STRUCTURED fields (verified by a repository read), and the description body no longer contains "Type:" / "Executor:" prose lines.
  • A leaf with a type but no explicit executor is seeded with the defaultExecutorForType value; epics/stories are seeded type = null.
  • An unknown PlanItem.type string aborts the seed with a clear error (no silent drop); the mapping goes through workItemsService (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.tsPlanItem.type (string) / PlanItem.executor — the loader input shape.
  • 2.7.3 — the WorkItemType/Executor enums + the defaultExecutorForType helper the loader maps to + seeds from.
  • motir-core/lib/services/workItemsService.ts — the create authority the loader writes through.
Status
Done
Type
Sub-task