feat minor mcp feat/phase-2g-bundle #75 / 100
AI Agent git-import/068377df · 74 days ago · May 13, 2026 · Diff

feat(mcp): Phase 4.5 — knowtation://prime regenerated from Muse commit graph

Adds _fetchMusePrimeContext() async helper to mcp/resources/register.mjs. When KNOWTATION_MUSE_ENABLED=true, calls `muse log --json --max 100` as a subprocess and extracts last_consolidation and hot_notes from commit records, mirroring the Python prime_context.py module (Phase 4.5, gabriel-muse).

The knowtation://prime resource payload now includes: muse_context: { schema_version: "1.0.0", source: "muse-commit-graph", commits_scanned: N, last_consolidation: { commit_id, committed_at, message, agent_id, model_id }, hot_notes: [{ path, edits }, ...] }

muse_context is null when KNOWTATION_MUSE_ENABLED is unset (default) or when the `muse` CLI is unreachable — non-fatal, falls back gracefully.

Phase 5 upgrade path: replace _fetchMusePrimeContext() subprocess with a JSON-RPC call to the `knowtation/prime-context` Muse MCP tool once Phase 5 ships in gabriel-muse.

Security: subprocess invoked with a fixed argument list; no user input enters the command. Output length bounded by maxBuffer: 2 MiB.

sha256:174a0e6b56914a4972452f9a1e4388243b61699ac766894b125d6ccaa827c109 sha
sha256:c1ecc1efeb5167e059fedb4ae4c9342085c751af9e0804902a000a61ae79fc33 snapshot

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:174a0e6b56914a4972452f9a1e4388243b61699ac766894b125d6ccaa827c109 --body "your comment"