feat(mentor): museion-tools MCP server (#23)
CI / ci (push) Canceled after 0s

Headless --serve-mcp role in the app binary: NDJSON JSON-RPC on stdio
exposing query_learnings and submit_fix_cards (ADR-0006 cards,
anchor-validated; stale lands flagged, never rejected), registered
into the museion profile at provisioning. Cards persist per piece
under <piece>/cards/ and surface in a floating Fix Cards palette
with pass-stamped provenance.

Live dogfood drove the shape: session/prompt waits pass length (the
15 s request default abandoned working turns), a liveness row and a
persisted Debug checkbox (off) split writing sessions from debug
chatter, the verdict references findings by title only while the
cards carry the detail (persona v1.3 — tools work in silence), and
the #24 pass rails (pass bar, TurnOutcome seam, snapshots) ride in.

Three-reviewer audit round: piece-path shape guard closes the
JSON-drop and substring-oracle holes, nested submit rawInput parsing
(the flat parser never matched the live rail), missing stopReason
never advances a pass, 1 MB stdin cap, card scan off MainActor.
296 tests green; every behavioral fix flip-verified.

Closes #23
This commit is contained in:
AlexKucera committed 2026-10-20 12:20:54 +02:00
1 parent c2e94fd825
commit 683ddf8426
29 files changed
+2626 -169

No files matched your search

+11 -1
View File
@@ -58,7 +58,8 @@ final class AppGateState {
.appendingPathComponent("Documents/Museion", isDirectory: true)
}
@main
/// #23: no `@main` here — MuseionLauncher (MCPServer.swift) branches
/// between the app and the headless `--serve-mcp` tool server.
struct MuseionApp: App {
@State private var gate = AppGateState()
@@ -79,6 +80,15 @@ struct MuseionApp: App {
AboutEngineView()
}
.windowResizability(.contentSize)
// #23 follow-up (dogfood): the Fix Cards palette — a floating
// window for the open piece's stored cards, opened from the
// mentor pass bar. Stays visible while the verdict is worked
// through in the editor.
Window("Fix Cards", id: "fix-cards") {
FixCardsPalette()
.environment(gate)
}
.defaultSize(width: 340, height: 540)
.commands {
// SwiftUI has no About scene on macOS; replace the stock panel with our window.
CommandGroup(replacing: .appInfo) {