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

requirementlinkedpath to the implementer
REQ-DDB-GUARD-012measuredtest_clew_documents_itself_with_its_own_wiki → load_wiki_config → _requirements_section → read_requirements_section
REQ-DDB-WIKI-031measuredtest_clew_documents_itself_with_its_own_wiki → doc_kind
REQ-DDB-WIKI-054inferredtest_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
lines 126–126from clew.wiki.adr import doc_kindlines 127–127from clew.wiki.config import load_wiki_configlines 129–129config, problems = load_wiki_config(REPO)lines 130–130assert problems == []lines 131–131docs = [*REPO.glob("*.md"), *(REPO / "docs").glob("*.md")]lines 132–135kinds = { d.relative_to(REPO).as_posix(): doc_kind(d.relative_to(REPO).as_posix(), config.doc_kinds) for d in docs }lines 136–136assert all(kinds.values()), {k: v for k, v in kinds.items() if not v}lines 137–137assert kinds["AGENTS.md"] == "agents" and kinds["SKILLS.md"] == "agents"lines 138–142assert {(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"), }

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.

tests/test_docs_current.py:25

Checks

  • assert f"`{name}`" in clause, name
  • assert f"{len(TIER1_TOOLS) + len(TIER0_TOOLS)} tools" in clause.replace("three", "3")

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-MCP-001measuredtest_the_tool_clause_names_exactly_what_the_server_serves → tools_clause → load_descriptions
REQ-DDB-WIKI-054inferredtest_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")

Activity · 8 steps
lines 27–27sys.path.insert(0, str(REPO / "scripts"))lines 28–28from sync_metadata import tools_clauselines 30–30from clew.mcp_server.server import PROMPTS, TIER0_TOOLSlines 31–31from clew.mcp_server.tools_query import TIER1_TOOLSlines 33–33clause = tools_clause()lines 34–34◇ for name in (*TIER1_TOOLS, *TIER0_TOOLS, *PROMPTS)lines 35–35assert f"`{name}`" in clause, namelines 36–36assert f"{len(TIER1_TOOLS) + len(TIER0_TOOLS)} tools" in clause.replace("three", "3")