test_knowtation_mcp_performance.py python
36 lines 1.0 KB
Raw
sha256:cf6265cea8c21d9228d90dec13ef6ec2dab5103d466db9cc4590681832de4bf8 docs(KD-STAGING): sync governance after KD-6b DONE Human 12 days ago
1 """Tier 6 — performance budgets for knowtation MCP."""
2
3 from __future__ import annotations
4
5 import pathlib
6 import time
7
8 import pytest
9
10 from muse.mcp.namespaces.knowtation import KnowtationNamespace
11 from muse.plugins.knowtation.search import hybrid_search
12
13
14 @pytest.fixture
15 def smoke_root() -> pathlib.Path:
16 return pathlib.Path("/Users/aaronrenecarvajal/MUSE_HUB/knowtation-vault-smoke")
17
18
19 def test_search_lexical_under_budget(smoke_root: pathlib.Path) -> None:
20 start = time.monotonic()
21 hybrid_search(smoke_root, "overview", mode="lexical", top_k=10)
22 assert time.monotonic() - start < 2.0
23
24
25 def test_prime_under_budget(smoke_root: pathlib.Path) -> None:
26 ns = KnowtationNamespace(smoke_root)
27 start = time.monotonic()
28 ns.call_tool("knowtation/prime", {"max_commits": 100})
29 assert time.monotonic() - start < 1.0
30
31
32 def test_prompt_assembly_fast(smoke_root: pathlib.Path) -> None:
33 ns = KnowtationNamespace(smoke_root)
34 start = time.monotonic()
35 ns.get_prompt("vault/memory-session", {})
36 assert time.monotonic() - start < 0.5
File History 1 commit
sha256:cf6265cea8c21d9228d90dec13ef6ec2dab5103d466db9cc4590681832de4bf8 docs(KD-STAGING): sync governance after KD-6b DONE Human 12 days ago