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

Captured planning-mistake bugs

To Do
Description

The home auto-filed planner bugs land under — the inward self-improving loop (MOTIR-965). When the planner catches itself making a mistake, that mistake becomes a kind: bug here, so captured mistakes are organised and triageable rather than dumped at the project root.

A container, not a build deliverable: no code, no design, no acceptance of its own. Its children arrive at runtime, filed by the loop. (The one authored child is MOTIR-2201, the fix described below.)

⚠️ This story's TITLE is load-bearing. After MOTIR-2201 the @planner-bug-home marker resolves by matching this exact title, project-wide. It is deliberately the plain Captured planning-mistake bugs — matching PLANNER_BUG_HOME_STORY_TITLE and the ensure_planner_bug_home migration's SQL literal (the (the 7.6.8 inward loop) suffix was dropped 2026-08-05 for this reason). Renaming it breaks filing — loudly, but it breaks it. Re-parenting it is free: the lookup ignores tree position.

How the filer reaches it

motir-ai's lessonService reads MOTIR_META_BUG_PARENT_KEY and passes it as parentKey to the service-auth route MOTIR-1450.

  • In production today that value is the literal MOTIR-1465 — a direct identifier lookup, parentage-independent, which is why filing has worked continuously.
  • MOTIR-1466 introduced the drift-proof @planner-bug-home marker to replace that numeric key (which dangles whenever the tenant is rebuilt), and motir-core resolves it — but motir-ai was never re-pointed to send it. That unfinished half is still open, and is not MOTIR-2201's scope (it ships in the other repo).
  • Either way the target is this story. MOTIR-2201 makes the marker resolve here by title, so the two paths agree and the re-point becomes a no-op change of mechanism.

Why MOTIR-2201 exists

The marker used to resolve as "the home epic's first story child" — a positional read of mutable plan structure. On 2026-08-05 this story was re-parented, the epic was left with only bug/task children, and that path stopped resolving. It caused no outage only because production wasn't using it. MOTIR-2201 replaces the hop with a project-wide title lookup no move_to_parent can void, and makes an unresolvable home loud (a 500 plus an error log) instead of a swallowed 404.

Context refs

  • lib/ai/plannerBugHome.ts — the marker, the title constants, and the cross-repo config contract.
  • lib/services/aiWorkItemsService.tsfileBug; where the marker is resolved.
  • motir-ai fly.toml [env] + src/services/lessonService.ts — the consumer, still on the numeric key.
  • MOTIR-1466 — introduced the marker + its provisioning migration · MOTIR-1450 — the route · MOTIR-965 — the inward loop · MOTIR-967 — the outward loop · MOTIR-1438 — the engine's log_planning_bug tool.
Child work items