`origin/main` does not typecheck — 11 errors in the runs surface, red for every open PR
The defect
tsc --noEmit -p tsconfig.json fails on origin/main at e2f08aeb1 — feat(runs): MOTIR-1789 — agent runs, the shared record and the live run surface (#2480), merged 2026-08-31 ~12:34Z.
11 errors, all in files that PR added:
app/(authed)/items/[key]/_components/RunSection.tsx(178,18) TS7053 DispatchEventKind can't index …
app/(authed)/items/[key]/_components/RunSection.tsx(186,29) TS7053 DispatchRunStatus …
app/(authed)/items/[key]/_components/RunSection.tsx(187,25) TS7053 DispatchCardDisposition …
app/(authed)/items/[key]/_components/RunSection.tsx(201,28) TS7053
app/(authed)/items/[key]/_components/RunSection.tsx(264,34) TS7053 DispatchRunStatus …
app/(authed)/runs/_components/RunCanvasPane.tsx(64,29) TS7053
app/(authed)/runs/_components/RunCanvasPane.tsx(66,39) TS7053 DispatchCardDisposition …
app/(authed)/runs/_components/RunCanvasPane.tsx(135,6) TS2322 Property 'searchLabel' is missing
but required in ProjectRoadmapCanvasProps
app/(authed)/runs/_components/RunModal.tsx(269,28) TS7053 DispatchRunStatus …
app/(authed)/runs/_components/RunsIndex.tsx(320,16) TS7053 DispatchRunStatus …
app/(authed)/runs/_components/RunsIndex.tsx(364,16) TS18048 'run.legs.implemented' is possibly undefined
Two distinct shapes: ten are a lookup table that is not total over its key union (TS7053 / TS18048 — the maps are missing members, or the index type is wider than the map), and one is a required prop not passed (ProjectRoadmapCanvas needs searchLabel whenever searchable is true).
Reproduction — on a CLEAN main, with nothing of anybody's branch in it
git worktree add /tmp/main-tscheck origin/main
ln -s <a-built-worktree>/node_modules /tmp/main-tscheck/node_modules
cp .env /tmp/main-tscheck/ && cp -r generated/prisma /tmp/main-tscheck/generated/
cd /tmp/main-tscheck && ./node_modules/.bin/tsc --noEmit -p tsconfig.json
→ the 11 errors above, verbatim. No branch, no merge, no local edit.
Why it matters more than one red check
PR CI checks out the branch merged with main, so this reds the TypeScript check on every open pull request until it is fixed — the same tax the flaky-spec rule in CLAUDE.md describes, arriving through a different door and deterministically rather than intermittently.
How it got in is the part to look at. #2480's own TypeScript check must have been green on its branch — the merge with main is where it breaks, or the check did not run on the final head. Whichever it is, that is worth one look before the fix, because it is the mechanism that will do it again. ([[main-is-never-tested]] is the standing shape.)
How it was found
By a motir run on MOTIR-3908, whose own PR (#2487) went from green TypeScript to red across a single git merge origin/main, with zero overlap between its diff and the failing files (git diff origin/main -- <those paths> is empty). Filed rather than repaired in that PR: a base branch that is red on its own is repaired in its OWN pull request, never folded into a feature PR.
Parent
Filed under the discovery epic per the bug-parent ladder — "the epic carrying the in-flight Subtask, NOT the epic that owns the code surface the bug lives in". The surface belongs to the agent-runs work; re-parent it there deliberately if that is preferred, but not by momentum.
Acceptance criteria
tsc --noEmit -p tsconfig.jsonis clean onmain.- Each
TS7053is fixed by making the lookup TOTAL over its key union (or by narrowing the index), not by widening the map's type toRecord<string, …>or casting the key — a partial map that compiles is the same defect one layer down. RunsIndex.tsx:364'srun.legs.implementedis handled forundefinedrather than asserted non-null.RunCanvasPane.tsx:135passessearchLabel, and the label is real copy from the i18n catalogue rather than a placeholder.- The PR body says how a merge-only breakage reached
main, and whether anything changes so the next one does not.
Context refs
motir-coreorigin/maine2f08aeb1— the failing treemotir-corePR #2480 — the change that introduced itapp/(authed)/runs/_components/{RunsIndex,RunModal,RunCanvasPane}.tsx·app/(authed)/items/[key]/_components/RunSection.tsx