Files
museion/docs/adr/0006-fix-cards-travel-as-typed-mcp-tool-calls.md
T
AlexKucera 4d33676a08
CI / ci (push) Canceled after 0s
feat(mentor): apply/skip fix cards (#25)
Fix Cards become actionable. Mechanical cards offer Apply behind a
blocking ask-before sheet showing the exact edit (anchored quote ->
replacement, occurrence + context; empty fix cuts); the sheet is the
only path to a write, one card at a time, no apply-all. The edit
lands through the editing session (pending edits flush first, the
editor re-seeds via adoptText, the card closes applied); Skip and
Done close the card in place, recording nothing; demonstration
cards close Done/Skip only (ADR-0006). Cards arrive ranked
(store-stamped, scan-ordered, open-first palette) and capped at ten
per submit — the app keeps the ranked head and the wire reply
discloses the drop. Stale anchors re-validate at apply: no text
selected or changed, the card flags itself. Includes the
finish-audit round (11 fixes, 2 flip-verified pins); 316 tests
green.

Closes #25
2026-10-20 16:46:43 +02:00

1.2 KiB

0006 — Fix cards travel as typed MCP tool calls

Mentor findings reach the app as typed tool calls — the fix-card schema is the tool's argument schema — rendered from ACP tool-call events, never parsed out of streamed prose. Anchors are quote-based (exact substring + occurrence + context), so edits between issue and accept degrade to a loud no-match, never a wrong-span patch. One schema serves the card UI, the apply-write, and learning promotion; M0's round-trip test exercises exactly this rail. Every fix declares a lane — mechanical (the whole fix is a pure function of the anchor plus fixed tables: cut, move, mapping, case) or demonstration (any generation) — and only a mechanical fix is ever applied. Every card declares an emitter — lint or engine — so the engine never re-cards a live lint finding; provenance keeps skill attribution. Rejected: prose parsing (fragile, untyped) and file-watching spools (cards are conversation events, not artifacts). A mechanical card's fix is the exact replacement for its anchored span (empty = cut) — the only edit Apply ever writes; submits are capped at ten cards, the app keeping the ranked head as backstop.