test_docs_current.py¶
tests/test_docs_current.py
The documentation says what 2.0.0 does (round 3, P6; owner: "all documentation up to date before the cut").
test_clew_documents_itself_with_its_own_wiki
None test_docs_current.test_clew_documents_itself_with_its_own_wiki()
clew's own wiki section.
tests/test_docs_current.py:120
Checks
assert problems == []assert all(kinds.values()), {k: v for k, v in kinds.items() if not v}assert kinds["AGENTS.md"] == "agents" and kinds["SKILLS.md"] == "agents"assert {(f.entry, f.file) for f in config.flows} >= {
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-012 | measured | test_clew_documents_itself_with_its_own_wiki → load_wiki_config → _requirements_section → read_requirements_section |
| REQ-DDB-WIKI-031 | measured | test_clew_documents_itself_with_its_own_wiki → doc_kind |
| REQ-DDB-WIKI-054 | inferred | test_clew_documents_itself_with_its_own_wiki → all |
Source · 23 lines
def test_clew_documents_itself_with_its_own_wiki() -> None:
"""DOGFOOD: clew's own `.clew.yaml` builds its wiki — every shipped doc has a kind, the agent
docs are kept apart, and the MCP tool handlers are declared as product flows.
@brief clew's own wiki section.
"""
from clew.wiki.adr import doc_kind
from clew.wiki.config import load_wiki_config
config, problems = load_wiki_config(REPO)
assert problems == []
docs = [*REPO.glob("*.md"), *(REPO / "docs").glob("*.md")]
kinds = {
d.relative_to(REPO).as_posix(): doc_kind(d.relative_to(REPO).as_posix(), config.doc_kinds)
for d in docs
}
assert all(kinds.values()), {k: v for k, v in kinds.items() if not v}
assert kinds["AGENTS.md"] == "agents" and kinds["SKILLS.md"] == "agents"
assert {(f.entry, f.file) for f in config.flows} >= {
("dossier", "clew/mcp_server/tools_query.py"),
("search", "clew/mcp_server/tools_query.py"),
("index", "clew/mcp_server/server.py"),
}1 more lines, not shown
Activity · 9 steps
test_the_tool_clause_names_exactly_what_the_server_serves
None test_docs_current.test_the_tool_clause_names_exactly_what_the_server_serves()
Generated from the description files the server loads: tools, then prompts.
Checks
assert f"`{name}`" in clause, nameassert f"{len(TIER1_TOOLS) + len(TIER0_TOOLS)} tools" in clause.replace("three", "3")
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-MCP-001 | measured | test_the_tool_clause_names_exactly_what_the_server_serves → tools_clause → load_descriptions |
| REQ-DDB-WIKI-054 | inferred | test_the_tool_clause_names_exactly_what_the_server_serves → tools_clause → load_descriptions → _entry → _joined → all |
Source · 14 lines
def test_the_tool_clause_names_exactly_what_the_server_serves() -> None:
"""@brief Generated from the description files the server loads: tools, then prompts."""
sys.path.insert(0, str(REPO / "scripts"))
from sync_metadata import tools_clause
from clew.mcp_server.server import PROMPTS, TIER0_TOOLS
from clew.mcp_server.tools_query import TIER1_TOOLS
clause = tools_clause()
for name in (*TIER1_TOOLS, *TIER0_TOOLS, *PROMPTS):
assert f"`{name}`" in clause, name
assert f"{len(TIER1_TOOLS) + len(TIER0_TOOLS)} tools" in clause.replace("three", "3")