test_the_pending_count_is_a_file_the_hook_can_read¶
Tests › tests/test_wiki_comments.py
What this test is for
Why it exists
THE HOOK READS ONE INTEGER: it may only emit literals, ints and safe tokens (clew_hook's bounded codomain), so it never sees comment text — only how many are waiting.
Given
store = _store(tmp_path)store.add(page="a.html", anchor="", quote="", body="one")store.add(page="b.html", anchor="", quote="", body="two")
When
pending = tmp_path / "state" / "comments-pending" / pending_key(str(tmp_path / "repo"))store.mark_read([c["id"] for c in store.unread()])
Then
- ✓ pending.read_text() equals "2"
- ✓ pending.read_text() equals "0"
- ✓ store.unread() equals []
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.
thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 3 of 142 steps
… 105 earlier steps
… 30 later steps
4 more
- Build this wiki from the index · 3 of 400 steps
- Look up one name: everything the index holds about it · 3 of 226 steps
- clew — `main` (clew/cli.py) · 3 of 400 steps
- `main` (clew/guard/main.py) · 3 of 357 steps
tests/test_wiki_comments.py:37 · its file's page
What it checks (2)
assert pending.read_text() == "2"observespending_keyviapendingassert pending.read_text() == "0" and store.unread() == []observespending_keyviapending
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 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-WIKI-054 measured