"""Tier 6 — performance budgets for knowtation MCP.""" from __future__ import annotations import pathlib import time import pytest from muse.mcp.namespaces.knowtation import KnowtationNamespace from muse.plugins.knowtation.search import hybrid_search @pytest.fixture def smoke_root() -> pathlib.Path: return pathlib.Path("/Users/aaronrenecarvajal/MUSE_HUB/knowtation-vault-smoke") def test_search_lexical_under_budget(smoke_root: pathlib.Path) -> None: start = time.monotonic() hybrid_search(smoke_root, "overview", mode="lexical", top_k=10) assert time.monotonic() - start < 2.0 def test_prime_under_budget(smoke_root: pathlib.Path) -> None: ns = KnowtationNamespace(smoke_root) start = time.monotonic() ns.call_tool("knowtation/prime", {"max_commits": 100}) assert time.monotonic() - start < 1.0 def test_prompt_assembly_fast(smoke_root: pathlib.Path) -> None: ns = KnowtationNamespace(smoke_root) start = time.monotonic() ns.get_prompt("vault/memory-session", {}) assert time.monotonic() - start < 0.5