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-3866

One pack PER TYPE, and containers get their packs at `deepen` — eight types have no authoring bar, and `deepen/epic` and `deepen/story` compose byte-identically

Done
Description

Follow-on to MOTIR-3853, which made the type map total but left the packs behind it shared. Two holes, both the same shape: an axis that resolves without failing while adding nothing.

Hole 1 — the per-type bar is missing for EIGHT of fourteen types

Probing each type's authoring bar against the shipped corpus, by its distinctive wording:

typebar present in motir-ai?
manualin kind-leaf/PLAN_ALL_SUBTASK_TYPES_AND_COMPOSITION
decisionin core/DECISION_AUTHORITY_LADDER
researchin type-bars (added by MOTIR-3853)
content, review, deploy, copy, translate, legal, verification, choreABSENT

All eight exist in motir-meta prompts/plan-rules/type-bars.md and have never been mirrored. A card of one of those types is deepened with no statement of what it owes.

Where a bar does exist it sits in a SHARED constant, so a manual card and a copy card receive the same undifferentiated text — each type is under-served and simultaneously pays for the others. The residual-pack shape is the cause, not the symptom: types were fused because each was individually small, and being small is exactly why none of them accumulated rules.

Hole 2 — containers get NO kind pack at deepen

resolvePlanningRulePacks adds kind-container / kind-story only when phase === 'skeleton', on the reasoning that "an epic or story being deepened is writing prose, which phase-deepen and core already govern". Measured:

  • plan/deepen/epic and plan/deepen/story both compose 110,392 chars — byte-identical. The kind axis does nothing at deepen.
  • kind-story (7,218 chars) reaches 2 of 104 cells, both skeleton. So STORY_IS_A_VERTICAL_SLICE, A_STORY_MAY_SPAN_REPOSITORIES, COUNT_THE_VERIFICATION_RECIPE and STORY_LEVEL_JOURNEY_AUDIT never reach a story being deepened.

Deepening a container IS writing its descriptionMd and explanationMd, and those four rules are precisely what that prose is judged against. This is the same defect as the type axis one card back: the cell resolves, nothing errors, and the rules that should fire are absent.

Acceptance criteria

  • Every one of the 14 types resolves to a pack carrying THAT type's authoring bar. No pack is declared empty — the invariant in the module header stands, so a pack is created only once it has content.
  • The eight absent bars are mirrored from motir-meta prompts/plan-rules/type-bars.md, each into its own type pack, each stating what a card of that type must name.
  • type-bars no longer exists as a residual pack, or the PR states what still legitimately belongs in a shared pack and why. type-migration stays shared — it is a cross-type concern (code, chore, deploy), not one type's bar.
  • kind-container and kind-story load at deepen as well as skeleton; deepen/epic and deepen/story no longer compose identically, and a test asserts that.
  • planningRuleRouting.test.ts proves no rule stopped firing: for every clause moved, the set of cells carrying it is a SUPERSET of the cells where its situation occurs.
  • A guard asserts each type's cell composition DIFFERS from the type-less cell — the check MOTIR-3853 added, now meaningful for all 14 rather than 7.
  • Routing, conservation and register baselines refreshed in the same commit, each diff reviewed; the cautionary count does not rise.

Context refs

  • motir-ai src/llm/planningRulePacks.tsresolvePlanningRulePacks (the phase === 'skeleton' container branch), PACKS_BY_TYPE, CORPUS_ORDER.
  • motir-ai tests/planningRulePacks.test.ts — TOTAL RESOLUTION and DISJOINT COVER; the type-axis suite MOTIR-3853 added.
  • motir-meta prompts/plan-rules/type-bars.md — the eight absent bars, verbatim.
  • MOTIR-3853 / motir-ai#325 — the total type map and the per-cell measurement harness.
  • MOTIR-3856 — the VERIFY_EVERY_PRECONDITION split, independent of this.

⚠️ Small is not a reason to fuse. The recorded partition decision put a 40-line floor under the type axis, reasoning that "an axis kept for symmetry is a file set nobody maintains". That trade is being reversed on purpose: a to-do list is coming to manual/human and review is next, so the types are about to stop being small — and the structure should be right before the content arrives, not after.