patch feat/kd-5b #1 / 1
aaronrene · 12 days ago · Jul 10, 2026 · Diff

KD-5b: implement knowtation MCP domain surface (9 tools, 8 resources, 4 prompts)

Mechanical build against frozen §KD-5a contract: muse/mcp/ server with repo.json activation gate, bootstrap_knowtation_mcp attest/ICP registration, search lexical+vector fan-out, hub propose, resource serializers, vault prompts, and seven-tier tests (36 green) + stdio E2E on knowtation-vault-smoke. Governance rotated to KD-6a.

sha256:f458bbfa659d5cbb759ad098a14076ccbadfcf2bba1fc11538706e4d8d689dad sha
+344 ~15 −19 symbols
sha256:71dc03d6dc1b97c2fffc7e3ca25c8f7f3e9b93a747e7c1389a9346ff5ea716f0 snapshot
+344
symbols added
~15
symbols modified
−19
symbols removed
0
dead code introduced
Semantic Changes 378 symbols
~ muse/mcp/__init__.py .py 3 symbols added
+ __all__ variable variable __all__ L10–10
+ MuseMCPServer import import MuseMCPServer L8–8
+ bootstrap_knowtation_mcp import import bootstrap_knowtation_mcp L7–7
~ muse/mcp/bootstrap.py .py 11 symbols added
+ _DOMAIN_IGNORE_BLOCK variable variable _DOMAIN_IGNORE_BLOCK L16–22
+ __all__ variable variable __all__ L58–58
+ bootstrap_knowtation_mcp function function bootstrap_knowtation_mcp L42–55
+ ensure_knowtation_museignore function function ensure_knowtation_museignore L25–39
+ annotations import import annotations L3–3
+ load_air_config import import load_air_config L8–8
+ logging import import logging L5–5
+ pathlib import import pathlib L6–6
+ register_knowtation_attestation_provider import import register_knowtation_attestation_provider L8–8
+ register_knowtation_icp_push_hook import import register_knowtation_icp_push_hook L12–12
+ logger variable variable logger L14–14
~ muse/mcp/errors.py .py 14 symbols added
+ INTERNAL_ERROR variable variable INTERNAL_ERROR L14–14
+ INVALID_PARAMS variable variable INVALID_PARAMS L13–13
+ INVALID_REQUEST variable variable INVALID_REQUEST L11–11
+ MCPApplicationError class class MCPApplicationError L20–39
+ __init__ method method __init__ L23–33
+ to_data method method to_data L35–39
+ METHOD_NOT_FOUND method variable METHOD_NOT_FOUND L12–12
+ PARSE_ERROR variable variable PARSE_ERROR L10–10
+ TOOL_ERROR variable variable TOOL_ERROR L17–17
+ error_response function function error_response L42–60
+ Any import import Any L5–5
+ annotations import import annotations L3–3
+ sanitize_display import import sanitize_display L7–7
+ success_response function function success_response L63–65
~ muse/mcp/namespaces/__init__.py .py 2 symbols added
+ __all__ variable variable __all__ L5–5
+ KnowtationNamespace import import KnowtationNamespace L3–3
~ muse/mcp/namespaces/knowtation.py .py 65 symbols added
+ KnowtationNamespace class class KnowtationNamespace L79–461
+ __init__ method method __init__ L82–83
+ _prompt_daily_brief method method _prompt_daily_brief L405–425
+ _prompt_knowledge_gaps method method _prompt_knowledge_gaps L451–461
+ _prompt_memory_session method method _prompt_memory_session L440–449
+ _prompt_search_synthesis method method _prompt_search_synthesis L427–438
+ _tool_attest method method _tool_attest L344–399
+ _tool_consolidate method method _tool_consolidate L252–253
+ _tool_dead method method _tool_dead L288–307
+ _tool_get_note method method _tool_get_note L206–224
+ _tool_history method method _tool_history L226–250
+ _tool_impact method method _tool_impact L255–286
+ _tool_prime method method _tool_prime L309–316
+ _tool_propose method method _tool_propose L318–342
+ _tool_search method method _tool_search L183–204
+ call_tool method method call_tool L117–132
+ get_prompt method method get_prompt L167–177
+ list_prompts method method list_prompts L110–111
+ list_resources method method list_resources L95–108
+ list_tools method method list_tools L89–93
+ read_resource method method read_resource L134–165
+ PROMPT_NAMES variable variable PROMPT_NAMES L61–66
+ RESOURCE_URIS variable variable RESOURCE_URIS L52–59
+ TOOL_NAMES variable variable TOOL_NAMES L40–50
+ _VAULT_PATH_RE variable variable _VAULT_PATH_RE L68–68
+ __all__ variable variable __all__ L464–469
+ _parse_path_error function function _parse_path_error L75–76
+ _tool_error function function _tool_error L71–72
+ Any import import Any L9–9
+ AttestationRequiredError import import AttestationRequiredError L11–11
+ Callable import import Callable L9–9
+ MCPApplicationError import import MCPApplicationError L17–17
+ PathValidationError import import PathValidationError L21–21
+ SymbolEvent import import SymbolEvent L38–38
+ _attestation_path_for_commit import import _attestation_path_for_commit L37–37
+ _find_events_in_commit import import _find_events_in_commit L38–38
+ annotations import import annotations L3–3
+ build_link_index import import build_link_index L20–20
+ clamp_tool_int import import clamp_tool_int L21–21
+ consolidate_receipt import import consolidate_receipt L21–21
+ create_hub_proposal import import create_hub_proposal L21–21
+ datetime import import datetime L8–8
+ enrich_prime import import enrich_prime L21–21
+ get_attestation_provider import import get_attestation_provider L11–11
+ get_commit_snapshot_manifest import import get_commit_snapshot_manifest L15–15
+ hybrid_search import import hybrid_search L36–36
+ json import import json L5–5
+ link_index_to_json import import link_index_to_json L21–21
+ list_vault_notes import import list_vault_notes L21–21
+ make_snapshot_loader import import make_snapshot_loader L35–35
+ note_dead import import note_dead L35–35
+ note_hotspots import import note_hotspots L35–35
+ note_impact import import note_impact L19–19
+ pathlib import import pathlib L6–6
+ projects_summary import import projects_summary L21–21
+ re import import re L7–7
+ read_commit import import read_commit L15–15
+ read_note_at_ref import import read_note_at_ref L21–21
+ recent_memory_events import import recent_memory_events L21–21
+ resolve_ref import import resolve_ref L21–21
+ sanitize_display import import sanitize_display L16–16
+ timedelta import import timedelta L8–8
+ timezone import import timezone L8–8
+ validate_note_path import import validate_note_path L21–21
+ walk_commits_bfs import import walk_commits_bfs L18–18
~ muse/mcp/server.py .py 32 symbols added
+ MuseMCPServer class class MuseMCPServer L37–169
+ __init__ method method __init__ L40–47
+ _dispatch method method _dispatch L99–169
+ capabilities method method capabilities L50–57
+ handle_request method method handle_request L59–97
+ _PROTOCOL_VERSION variable variable _PROTOCOL_VERSION L32–32
+ _SERVER_NAME variable variable _SERVER_NAME L33–33
+ _SERVER_VERSION variable variable _SERVER_VERSION L34–34
+ __all__ variable variable __all__ L181–185
+ expected_prompt_count function function expected_prompt_count L177–178
+ expected_tool_count function function expected_tool_count L172–174
+ Any import import Any L8–8
+ INTERNAL_ERROR import import INTERNAL_ERROR L12–12
+ INVALID_PARAMS import import INVALID_PARAMS L12–12
+ INVALID_REQUEST import import INVALID_REQUEST L12–12
+ KnowtationNamespace import import KnowtationNamespace L22–22
+ MCPApplicationError import import MCPApplicationError L12–12
+ METHOD_NOT_FOUND method import METHOD_NOT_FOUND L12–12
+ PROMPT_NAMES import import PROMPT_NAMES L22–22
+ TOOL_ERROR import import TOOL_ERROR L12–12
+ TOOL_NAMES import import TOOL_NAMES L22–22
+ annotations import import annotations L3–3
+ bootstrap_knowtation_mcp import import bootstrap_knowtation_mcp L11–11
+ classify_repo class import classify_repo L27–27
+ error_response import import error_response L12–12
+ find_repo_root import import find_repo_root L10–10
+ json import import json L5–5
+ logging import import logging L6–6
+ pathlib import import pathlib L7–7
+ read_domain import import read_domain L28–28
+ success_response import import success_response L12–12
+ logger variable variable logger L30–30
~ muse/mcp/stdio_server.py .py 8 symbols added
+ MuseMCPServer import import MuseMCPServer L17–17
+ annotations import import annotations L11–11
+ json import import json L13–13
+ logging import import logging L14–14
+ sys import import sys L15–15
+ logger variable variable logger L19–19
+ main function function main L55–61
+ run_stdio function function run_stdio L22–52
+ PathValidationError class class PathValidationError L53–58
+ __init__ method method __init__ L56–58
+ _IGNORE_DIRS variable variable _IGNORE_DIRS L36–36
+ _MAX_HUB_RESPONSE_BYTES variable variable _MAX_HUB_RESPONSE_BYTES L34–34
+ _STRUCTURAL_DIRS variable variable _STRUCTURAL_DIRS L35–35
+ __all__ variable variable __all__ L364–377
+ _note_body_and_frontmatter function function _note_body_and_frontmatter L39–50
+ clamp_tool_int function function clamp_tool_int L356–361
+ consolidate_receipt function function consolidate_receipt L332–353
+ create_hub_proposal function function create_hub_proposal L258–329
+ enrich_prime function function enrich_prime L238–255
+ Any import import Any L11–11
+ DEFAULT_PORT import import DEFAULT_PORT L26–26
+ LinkIndex import import LinkIndex L27–27
+ MemoryEventKind import import MemoryEventKind L25–25
+ NOTE_EXTENSIONS import import NOTE_EXTENSIONS L23–23
+ _ALWAYS_IGNORE_DIRS import import _ALWAYS_IGNORE_DIRS L29–29
+ _normalise_rel_path import import _normalise_rel_path L27–27
+ _resolve_port import import _resolve_port L26–26
+ annotations import import annotations L3–3
+ build_link_index import import build_link_index L27–27
+ build_prime_context import import build_prime_context L30–30
+ clamp_int import import clamp_int L21–21
+ collect_vault_stats import import collect_vault_stats L31–31
+ datetime import import datetime L10–10
+ describe_link import import describe_link L24–24
+ extract_symbols import import extract_symbols L32–32
+ get_commit_snapshot_manifest import import get_commit_snapshot_manifest L15–15
+ group_by_project import import group_by_project L23–23
+ is_note import import is_note L23–23
+ is_valid_event_kind import import is_valid_event_kind L25–25
+ json import import json L5–5
+ parse_frontmatter import import parse_frontmatter L28–28
+ pathlib import import pathlib L6–6
+ read_commit import import read_commit L15–15
+ read_current_branch import import read_current_branch L15–15
+ read_object import import read_object L13–13
+ read_repo_id import import read_repo_id L14–14
+ resolve_commit_ref import import resolve_commit_ref L15–15
+ sanitize_display import import sanitize_display L21–21
+ timezone import import timezone L10–10
+ error import import urllib.error L7–7
+ parse import import urllib.parse L8–8
+ request import import urllib.request L9–9
+ walk_commits_bfs import import walk_commits_bfs L22–22
+ link_index_to_json function function link_index_to_json L129–146
+ list_vault_notes function function list_vault_notes L149–178
+ projects_summary function function projects_summary L208–235
+ read_note_at_ref function function read_note_at_ref L88–126
+ recent_memory_events function function recent_memory_events L181–205
+ resolve_ref function function resolve_ref L78–85
+ validate_note_path function function validate_note_path L61–75
~ muse/plugins/knowtation/search.py .py 36 symbols added
+ LexicalHit class class LexicalHit L33–37
+ VECTOR_TIMEOUT_SECONDS variable variable VECTOR_TIMEOUT_SECONDS L26–26
+ W_LEX variable variable W_LEX L24–24
+ W_VEC variable variable W_VEC L25–25
+ _IGNORE_DIRS variable variable _IGNORE_DIRS L30–30
+ _MARKDOWN_EXTS variable variable _MARKDOWN_EXTS L29–29
+ _MAX_HUB_RESPONSE_BYTES variable variable _MAX_HUB_RESPONSE_BYTES L27–27
+ __all__ variable variable __all__ L332–339
+ _head_mtime function function _head_mtime L182–186
+ _note_ext function function _note_ext L40–42
+ _query_tokens function function _query_tokens L45–46
+ _score_text function function _score_text L49–54
+ hybrid_search function function hybrid_search L189–329
+ Any import import Any L13–13
+ DEFAULT_PORT import import DEFAULT_PORT L15–15
+ ENV_PORT import import ENV_PORT L15–15
+ TypedDict import import TypedDict L13–13
+ _ALWAYS_IGNORE_DIRS import import _ALWAYS_IGNORE_DIRS L19–19
+ _MAX_NOTE_BYTES import import _MAX_NOTE_BYTES L16–16
+ _note_body_and_frontmatter import import _note_body_and_frontmatter L17–17
+ _resolve_port import import _resolve_port L15–15
+ annotations import import annotations L3–3
+ build_link_index import import build_link_index L16–16
+ collect_vault_stats import import collect_vault_stats L20–20
+ json import import json L5–5
+ logging import import logging L6–6
+ os import import os L7–7
+ parse_frontmatter import import parse_frontmatter L18–18
+ pathlib import import pathlib L8–8
+ re import import re L9–9
+ error import import urllib.error L10–10
+ parse import import urllib.parse L11–11
+ request import import urllib.request L12–12
+ lexical_search function function lexical_search L57–125
+ logger variable variable logger L22–22
+ vector_search function function vector_search L128–179
+ SMOKE_OVERVIEW variable variable SMOKE_OVERVIEW L17–17
+ EVENTS_SCHEMA_HASH import import EVENTS_SCHEMA_HASH L13–13
+ KnowtationNamespace import import KnowtationNamespace L10–10
+ annotations import import annotations L3–3
+ build_link_index import import build_link_index L14–14
+ compute_attestation_id import import compute_attestation_id L11–11
+ describe_link import import describe_link L12–12
+ json import import json L5–5
+ link_index_to_json import import link_index_to_json L15–15
+ pathlib import import pathlib L6–6
+ pytest import import pytest L8–8
+ smoke_root function function smoke_root L21–22
+ test_attest_id_determinism function function test_attest_id_determinism L47–50
+ test_get_note_content_hash_matches_store function function test_get_note_content_hash_matches_store L33–36
+ test_graph_edges_match_describe_link function function test_graph_edges_match_describe_link L25–30
+ test_memory_recent_event_types_valid function function test_memory_recent_event_types_valid L39–44
+ test_prompt_cites_real_paths_only function function test_prompt_cites_real_paths_only L53–61
~ tests/test_knowtation_mcp_e2e.py .py 15 symbols added
+ SMOKE variable variable SMOKE L15–15
+ TestClaudeDesktopIntegration class class TestClaudeDesktopIntegration L66–136
+ test_stdio_subprocess_list_and_roundtrip method method test_stdio_subprocess_list_and_roundtrip L69–136
+ TestJsonRpcE2E class class TestJsonRpcE2E L27–63
+ server method method server L29–30
+ test_initialize method method test_initialize L32–34
+ test_tools_call_search_and_resource_prime method method test_tools_call_search_and_resource_prime L36–63
+ _rpc function function _rpc L18–24
+ MuseMCPServer import import MuseMCPServer L12–12
+ annotations import import annotations L3–3
+ json import import json L5–5
+ pathlib import import pathlib L6–6
+ pytest import import pytest L10–10
+ subprocess import import subprocess L7–7
+ sys import import sys L8–8
+ SMOKE_OVERVIEW variable variable SMOKE_OVERVIEW L14–14
+ TestPromptIntegration class class TestPromptIntegration L101–109
+ test_memory_session method method test_memory_session L107–109
+ test_search_synthesis method method test_search_synthesis L102–105
+ TestResourceIntegration class class TestResourceIntegration L83–98
+ test_memory_and_projects method method test_memory_and_projects L92–98
+ test_vault_graph_prime method method test_vault_graph_prime L84–90
+ TestToolIntegration class class TestToolIntegration L27–80
+ test_consolidate_receipt method method test_consolidate_receipt L46–49
+ test_get_note_overview method method test_get_note_overview L28–32
+ test_impact_and_dead method method test_impact_and_dead L40–44
+ test_prime_enriched method method test_prime_enriched L34–38
+ test_propose_hub_stub method method test_propose_hub_stub L63–80
+ test_search_hybrid_fanout method method test_search_hybrid_fanout L52–60
+ KnowtationNamespace import import KnowtationNamespace L12–12
+ MuseMCPServer import import MuseMCPServer L11–11
+ annotations import import annotations L3–3
+ json import import json L5–5
+ patch import import patch L7–7
+ pathlib import import pathlib L6–6
+ pytest import import pytest L9–9
+ ns function function ns L23–24
+ smoke_root function function smoke_root L18–19
+ KnowtationNamespace import import KnowtationNamespace L10–10
+ annotations import import annotations L3–3
+ hybrid_search import import hybrid_search L11–11
+ pathlib import import pathlib L5–5
+ pytest import import pytest L8–8
+ time import import time L6–6
+ smoke_root function function smoke_root L15–16
+ test_prime_under_budget function function test_prime_under_budget L25–29
+ test_prompt_assembly_fast function function test_prompt_assembly_fast L32–36
+ test_search_lexical_under_budget function function test_search_lexical_under_budget L19–22
~ tests/test_knowtation_mcp_security.py .py 15 symbols added
+ KnowtationNamespace import import KnowtationNamespace L12–12
+ MCPApplicationError import import MCPApplicationError L10–10
+ MuseMCPServer import import MuseMCPServer L11–11
+ annotations import import annotations L3–3
+ get_attestation_provider import import get_attestation_provider L9–9
+ pathlib import import pathlib L5–5
+ pytest import import pytest L7–7
+ unregister_attestation_provider import import unregister_attestation_provider L9–9
+ validate_note_path import import validate_note_path L13–13
+ smoke_root function function smoke_root L17–18
+ test_activation_gate_blocks_tools function function test_activation_gate_blocks_tools L27–40
+ test_no_secrets_in_search_error function function test_no_secrets_in_search_error L57–62
+ test_path_traversal_rejected function function test_path_traversal_rejected L21–24
+ test_provider_unregistered_attest function function test_provider_unregistered_attest L43–54
+ test_resource_path_escape_rejected function function test_resource_path_escape_rejected L65–68
~ tests/test_knowtation_mcp_stress.py .py 10 symbols added
+ KnowtationNamespace import import KnowtationNamespace L10–10
+ annotations import import annotations L3–3
+ hybrid_search import import hybrid_search L11–11
+ pathlib import import pathlib L5–5
+ pytest import import pytest L8–8
+ time import import time L6–6
+ smoke_root function function smoke_root L15–16
+ test_daily_brief_prompt_large_window function function test_daily_brief_prompt_large_window L33–36
+ test_graph_on_smoke_vault function function test_graph_on_smoke_vault L24–30
+ test_search_respects_top_k_clamp function function test_search_respects_top_k_clamp L19–21
~ tests/test_knowtation_mcp_unit.py .py 21 symbols added
+ TestActivationGate class class TestActivationGate L44–62
+ test_knowtation_domain_lists_nine_tools method method test_knowtation_domain_lists_nine_tools L56–62
+ test_non_knowtation_domain_empty_tools method method test_non_knowtation_domain_empty_tools L45–54
+ TestPathValidation class class TestPathValidation L15–27
+ test_accepts_note method method test_accepts_note L26–27
+ test_rejects_non_note method method test_rejects_non_note L21–24
+ test_rejects_traversal method method test_rejects_traversal L16–19
+ TestSearchUnit class class TestSearchUnit L30–41
+ test_hybrid_shape method method test_hybrid_shape L34–41
+ test_lexical_empty_query method method test_lexical_empty_query L31–32
+ MCPApplicationError import import MCPApplicationError L9–9
+ MuseMCPServer import import MuseMCPServer L10–10
+ annotations import import annotations L3–3
+ expected_prompt_count import import expected_prompt_count L10–10
+ expected_tool_count import import expected_tool_count L10–10
+ hybrid_search import import hybrid_search L12–12
+ lexical_search import import lexical_search L12–12
+ pathlib import import pathlib L5–5
+ pytest import import pytest L7–7
+ validate_note_path import import validate_note_path L11–11
+ smoke_root function function smoke_root L66–67
~ docs/MUSEHUB-OVERSEER-HANDOVER.md .md 9 symbols added, 18 symbols removed, 8 symbols modified
Hard stops section Hard stops L209–216
NEXT SESSION — KD-5b: MCP domain surface implementation section NEXT SESSION — KD-5b: MCP domain surface implementation L11–143
Alternative tracks (operator choice) section Alternative tracks (operator choice) L69–79
table section table L71–78
KD-5a frozen contract (build against this — do not redesign) section KD-5a frozen contract (build against this — do not redesign) L38–52
table section table L40–51
KD-OQ decisions (frozen — do not reopen during KD-5b) section KD-OQ decisions (frozen — do not reopen during KD-5b) L28–38
table section table L30–37
Paste-ready prompt — KD-5b (recommended) section Paste-ready prompt — KD-5b (recommended) L79–143
code variable variable code L84–140
THE ONE NEXT STEP — Model: Auto section THE ONE NEXT STEP — Model: Auto L52–69
table section table L56–64
What just landed (context from prior sessions) section What just landed (context from prior sessions) L17–28
table section table L19–27
KD-ACTIVATE smoke matrix (2026-07-10, vault: knowtation-vault-smoke) section KD-ACTIVATE smoke matrix (2026-07-10, vault: knowtation-vault-smoke) L171–186
table section table L173–183
KD-OQ resolution basis (source-backed, 2026-07-10) section KD-OQ resolution basis (source-backed, 2026-07-10) L186–196
table section table L188–195
+ NEXT SESSION — KD-6a: MuseHub vault UI contract + test matrix section NEXT SESSION — KD-6a: MuseHub vault UI contract + test matrix L11–82
+ KD-5b evidence matrix (2026-07-10, vault: knowtation-vault-smoke) section KD-5b evidence matrix (2026-07-10, vault: knowtation-vault-smoke) L26–38
+ table section table L28–37
+ Paste-ready prompt — KD-6a (recommended) section Paste-ready prompt — KD-6a (recommended) L50–82
+ code variable variable code L54–79
+ THE ONE NEXT STEP — Model: Thinking section THE ONE NEXT STEP — Model: Thinking L38–50
+ table section table L42–49
+ What just landed (KD-5b) section What just landed (KD-5b) L17–26
+ table section table L19–25
~ table
~ table
~ table
~ docs/MUSEHUB-ROADMAP.md .md 1 symbol added, 1 symbol removed, 7 symbols modified
KD-5 — MCP Domain Surface (not started) section KD-5 — MCP Domain Surface (not started) L133–148
+ KD-5 — MCP Domain Surface (KD-5a contract frozen; KD-5b implementation DONE) section KD-5 — MCP Domain Surface (KD-5a contract frozen; KD-5b implementation DONE) L133–150
~ table
~ table
← Older Oldest on feat/kd-5b
All commits
Newer → Latest on feat/kd-5b

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:f458bbfa659d5cbb759ad098a14076ccbadfcf2bba1fc11538706e4d8d689dad --body "your comment"