Planning bug: a defect was verified against `origin/main` and filed 47 minutes after the card fixing it went `implemented` — the pre-flight never searched the PLAN
MOTIR-3495 was filed as a 5-point / 60-minute bug describing a defect that a sibling card under the same epic had already fixed. Three of its five acceptance criteria were built before it existed.
The timeline, all on 2026-08-25
| Time (UTC) | Event |
|---|---|
19:09:05 | MOTIR-3459 created — "Event-level IDEMPOTENCY on the engine", under epic MOTIR-3413 |
21:51:56 | its commit f96b61ad lands on parent/MOTIR-3415-event-jobs-cutover — lib/jobs/engine/idempotency.ts, the partial unique index + migration, and a 205-line test |
21:52:09 | MOTIR-3459 → implemented |
22:39:06 | MOTIR-3495 filed — "the engine RECORDS idempotencyKey and never enforces it" |
23:05:20 | a correction comment is added to MOTIR-3495, re-reading the severity and re-affirming "the fix is still 'enforce the option'" — still unaware of MOTIR-3459 |
23:09 | motir run MOTIR-3495 halts at guard #4 before creating a worktree |
Two separate passes, 73 minutes apart, both missed a card sitting in the same epic.
Why every signal was green
The defect was genuinely present on origin/main, because f96b61ad is on a local, unpushed branch: git ls-remote origin 'refs/heads/parent/MOTIR-3415*' returns nothing and no pull request exists. So:
- the code check was correct —
git grep idempotencyKeyonorigin/mainreally does return only writes; validate_work_itemreturnedvalid: truewith two plainadvisoryentries, neither naming MOTIR-3459;readinesswasready: true, openBlockers: [];- the shipped
subsumption/likely-already-shippedadvisory keys offmergedAt, so it is structurally silent here — nothing is merged, and nothing is even open.
Every mechanised prior-art check in the product is keyed on a terminal state (merged), and this duplicate lived entirely in a transient one (implemented-but-unpushed). The only thing that caught it was the by-hand sibling-worktree read in run.md's step 0b pre-flight — which exists for claim safety, not for prior art.
The missing check, stated precisely
The filing pass verified the defect and never verified the fix's absence from the plan. Those are different queries:
- "is this broken on
origin/main?" → agit grep. It was, and it is. - "does a card already deliver this?" →
search_work_itemsfor the FIX, then read its status. One call. MOTIR-3459's title contains the wordIDEMPOTENCYin caps and sat two positions away in the same epic.
The card's own body even asked for it — "Re-grep before designing the fix — a wave card may have added a constraint" — which the run read as an instruction about the CODE, not about the PLAN.
What was already corrected (no work owed here)
Done during the halting run, on MOTIR-3495 itself: blocked_by edges to MOTIR-3459 + MOTIR-3460, an on-the-record amendment disposing of all five criteria with evidence, a re-scope to the genuine 1-point residue (two stale doc/comment sites MOTIR-3459's own change stranded), and status → Blocked.
Acceptance criteria
run.md's guard #4 states that the advisory channel's prior-art family (subsumption/likely-already-shipped) is keyed on merged pull requests and therefore cannot see animplementedsibling card, an open PR, or an unpushed branch — so an empty advisory array is not a prior-art verdict.- It names the cheap check that does reach it: before building,
search_work_itemsthe tree for a card that already DELIVERS this card's fix — querying the remedy, not the symptom — and read the status of what comes back.implementedmeans the work exists. - The existing sibling-worktree pre-flight (step 0b) is cross-referenced as the second half of that check, and is stated as serving prior art as well as claim safety — today it is written only for the latter, which is why its finding here was incidental.
- The rule says what to do on a hit: wire
blocked_by, amend on the record, Blocked, stop — never branch offorigin/mainand rebuild the sibling's half.
Context refs
- MOTIR-3495 — the card this is about
- MOTIR-3459 / MOTIR-3460 — the cards that had already done the work
motir-meta/prompts/run.md— guard #4's advisory block, and step 0b's worktree pre-flight- Global lesson "Before filing a defect, search the PATH as well as the tracker" (
motir-aisrc/seed/lessons.base.ts) — the row this case widens: it covers an open change, and has no arm for a card already marked implemented