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

Split `VERIFY_EVERY_PRECONDITION` into its numbered limbs — one segment of 49,449 chars is 24% of the corpus and cannot be selected off any cell

Cancelled
Description

The second limb of MOTIR-3853, carved out so that card could close on its own PR. MOTIR-3853 wired the type axis; this one attacks the reason the axis can only help so much.

The finding

VERIFY_EVERY_PRECONDITION is a single entry in CORPUS_ORDER of 49,449 chars — 24.6% of the whole corpus — fusing roughly 30 distinct concerns: 12 explicitly numbered limbs plus ~18 unnumbered AND … limbs. Because the partition's unit is the SEGMENT, no selector change can ever keep any part of it off a cell that does not need it.

That is why phase-deepen remains 38.3% of the corpus after MOTIR-3853, and why all 94 deepen cells still load every byte of it — including container deepens, which cannot fire the leaf-scoped limbs at all.

Several limbs are already type- or kind-scoped in their own wording and would route cleanly once separable:

  • limb (11) — the access-scoping / row-security limb, whose situation is a write or a guarding read inside an existing transaction (type: code, type: migration).
  • limb (12) — the expected-results-table limb, explicitly load-bearing "on a test card" (type: test).
  • limb (1)'s test-home half — already partly duplicated by the type-test pack MOTIR-3853 created.
  • the design-allocation sweep (the GIVES / TAKES / re-estimate run) — type: design.
  • the cardinality limb and the population-measurement limb — genuinely cross-cutting, and should STAY in phase-deepen.

Acceptance criteria

  • VERIFY_EVERY_PRECONDITION is split into separate CORPUS_ORDER segments at limb boundaries, cut VERBATIM — no limb is re-worded, re-ordered or re-titled, which is the constraint MOTIR-2639's partition decision imposed and MOTIR-3853 honoured.
  • Each new segment names the pack whose cells its situation can occur in; a segment whose situation is genuinely cross-cutting stays on phase-deepen, and the comment says why rather than leaving it as the default.
  • No rule stops firing: for every clause moved, planningRuleRouting.test.ts proves the set of cells carrying it is a SUPERSET of the cells where its situation can occur. A clause that cannot be shown to satisfy that stays put.
  • phase-deepen's share of the corpus and the worst cell both fall, measured over legalPlanningRuleCells() at the run's own base with the ref quoted, before and after figures in the PR.
  • The routing, conservation and register baselines are refreshed in the same commit, each diff reviewed in the PR; the cautionary count does not rise.
  • SHARED_PLANNING_RULES stays byte-identical apart from segment JOIN boundaries, and the disjoint-cover invariant in planningRulePacks.test.ts still holds — every line in exactly ONE pack.

Context refs

  • motir-ai src/llm/planningRulePacks.tsVERIFY_EVERY_PRECONDITION, CORPUS_ORDER, resolvePlanningRulePacks.
  • motir-ai tests/planningRulePacks.test.ts — the DISJOINT COVER and TOTAL RESOLUTION invariants a split must not break.
  • motir-ai PR #325 — MOTIR-3853's move, and the per-cell measurement harness used there.
  • motir-meta prompts/plan-rules/phase-deepen.md — the runbook's own cut of the same material, 520 lines, for boundary reference.

⚠️ Cut verbatim or not at all. MOTIR-2639 recorded that these rules "divide MID-LINE" in places and forbade a re-wording to fix it. Where a limb genuinely does not divide cleanly, leave it in phase-deepen and say so — a re-worded rule is a worse outcome than an unmoved one.