test_evidence_is_withheld_unless_the_index_is_at_the_pin¶
Tests › tests/test_wiki_composite.py
What this test is for
Why it exists
THE PIN RULE, each refusal named: no index -> absent; checkout moved past the pin, or uncommitted changes, or a stale index -> unknown with the reason; all clear -> indexed.
Given
_, pins = _fixture(tmp_path)lib = tmp_path / "lib"
3 more
db = tmp_path / "lib.db"db.write_text("")pin = pins["lib"]
When
def probe(locate, stale): return probe_index(lib, pin, pin, locate=locate, is_stale=stale)state, note, _ = probe(lambda _p: db, lambda *_: True)(lib / "requirements.yaml").write_text("requirements: {}\n")
3 more
state, note, _ = probe(lambda _p: db, lambda *_: False)_git(lib, "commit", "-qam", "moved")state, note, _ = probe(lambda _p: db, lambda *_: False)
Then
- ✓ probe(lambda _p: None, lambda *_: False)[0] equals "absent"
- ✓ probe(lambda _p: db, lambda *_: False)[0] equals "indexed"
- ✓ state equals "unknown"
- ✓ note contains "older than"
- ✓ state equals "unknown"
- ✓ note contains "uncommitted"
- ✓ state equals "unknown"
- ✓ note contains pin[:12]
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.
`main` (clew/guard/main.py) · 3 of 357 steps
… 64 earlier steps
… 286 later steps
4 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 2 of 142 steps
- Build this wiki from the index · 2 of 400 steps
- Build, refresh and check the index · 2 of 153 steps
- clew — `main` (clew/cli.py) · 2 of 400 steps
tests/test_wiki_composite.py:160 · its file's page
What it checks (5)
assert probe(lambda _p: None, lambda *_: False)[0] == "absent"not attributedassert probe(lambda _p: db, lambda *_: False)[0] == "indexed"not attributedassert state == "unknown" and "older than" in notenot attributedassert state == "unknown" and "uncommitted" in notenot attributedassert state == "unknown" and pin[:12] in notenot attributed
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
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.
Also reaches 3 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-GUARD-027 measured
- REQ-DDB-WIKI-040 measured