test_the_wiki_is_a_resource¶
Tests › tests/test_surface_2_0.py
What this test is for
Why it exists
A BUILT WIKI IS READ, an unbuilt one SAYS so — never an empty resource.
Given
_repo, target = _indexed(tmp_path)
When
mcp, _state = build_server(st.TargetRegistry(tmp_path / "state"))unbuilt = await mcp.read_resource(f"clew://wiki/{target.slug}/llms.txt")site = wiki_site_dir(target)
6 more
(site / "exports" / "flows").mkdir(parents=True)(site / "llms-full.txt").write_text("# Demo\nREQ-1 [PASS]\n")(site / "exports" / "flows" / "flow-main.mmd").write_text("sequenceDiagram\n")built = await mcp.read_resource(f"clew://wiki/{target.slug}/llms.txt")flow = await mcp.read_resource(f"clew://wiki/{target.slug}/flow/flow-main")try: escape = await mcp.read_resource(f"clew://wiki/{target.slug}/flow/..%2F..%2Fstate") except Exception: # noqa: BLE001, S110 — the SDK refuses it (security check, then not-found) pass else: assert "sequenceDiagram" not in "".join(c.content for c in escape)
Then
- ✓ "".join(c.content for c in unbuilt) contains "not built"
- ✓ "".join(c.content for c in built) contains "REQ-1 [PASS]"
- ✓ "".join(c.content for c in flow) contains "sequenceDiagram"
What it exercises
The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.
clew — `main` (clew/cli.py) · 29 of 400 steps
… 10 earlier steps
… 26 steps between
… 4 steps between
… 23 steps between
… 57 steps between
… 27 steps between
… 190 later steps
6 more
- Build, refresh and check the index · 28 of 153 steps
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 25 of 142 steps
- clew-mcp — `main` (clew/mcp_server/server.py) · 12 of 17 steps
- `main` (clew/guard/main.py) · 9 of 357 steps
- Build this wiki from the index · 6 of 400 steps
- `main` (scripts/incremental_probe.py) · 1 of 3 steps
tests/test_surface_2_0.py:110 · its file's page
What it checks (4)
assert "not built" in "".join(c.content for c in unbuilt)not attributedassert "REQ-1 [PASS]" in "".join(c.content for c in built)not attributedassert "sequenceDiagram" in "".join(c.content for c in flow)not attributedassert "sequenceDiagram" not in "".join(c.content for c in escape)not attributed
Where the product reaches it
Call flow
What it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
and 44 more requirement paths, listed below.
Also reaches 57 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CLI-001 measured
- REQ-DDB-CLI-002 inferred
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-003 inferred
- REQ-DDB-CONFIG-004 measured
- REQ-DDB-CONFIG-005 measured
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-CONFIG-009 measured
- REQ-DDB-GUARD-012 inferred
- REQ-DDB-GUARD-019 measured
- REQ-DDB-GUARD-024 measured
- REQ-DDB-INDEX-001 measured
- REQ-DDB-INDEX-002 measured
- REQ-DDB-INDEX-003 measured
- REQ-DDB-INDEX-004 measured
- REQ-DDB-INDEX-005 measured
- REQ-DDB-INDEX-006 measured
- REQ-DDB-INDEX-007 measured
- REQ-DDB-INDEX-008 measured
- REQ-DDB-INDEX-009 measured
- REQ-DDB-INDEX-010 measured
- REQ-DDB-INDEX-011 measured
- REQ-DDB-MCP-001 measured
- REQ-DDB-MCP-003 measured
- REQ-DDB-MCP-004 measured
- REQ-DDB-PIPE-001 measured
- REQ-DDB-PIPE-003 measured
- REQ-DDB-PIPE-004 measured
- REQ-DDB-PIPE-005 measured
- REQ-DDB-PIPE-006 measured
- REQ-DDB-PIPE-007 measured
- REQ-DDB-PIPE-008 measured
- REQ-DDB-PIPE-009 measured
- REQ-DDB-PIPE-010 measured
- REQ-DDB-PIPE-011 measured
- REQ-DDB-PIPE-012 measured
- REQ-DDB-PIPE-013 measured
- REQ-DDB-PIPE-014 measured
- REQ-DDB-PIPE-015 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-011 measured
- REQ-DDB-SCHEMA-001 measured
- REQ-DDB-SCHEMA-002 measured
- REQ-DDB-SCHEMA-003 measured
- REQ-DDB-SCHEMA-004 measured
- REQ-DDB-SCHEMA-005 measured
- REQ-DDB-SCHEMA-006 measured
- REQ-DDB-SCHEMA-007 measured
- REQ-DDB-SCHEMA-009 measured
- REQ-DDB-SCHEMA-011 measured
- REQ-DDB-SCHEMA-012 measured
- REQ-DDB-SCHEMA-013 measured
- REQ-DDB-SCHEMA-014 measured
- REQ-DDB-SCHEMA-015 measured
- REQ-DDB-WIKI-034 measured
- REQ-DDB-WIKI-054 measured