test_reads_inside_the_repository_still_count¶
Tests › tests/test_hook.py
What this test is for
Why it exists
THE CONTROL, and the half a location filter gets wrong. Suppressing too much would make the hook silent for the sessions it exists for, which is worse than the false location it replaced — a nudge nobody hears is indistinguishable from one nobody needs.
Verifies REQ-DDB-WIKI-054
Given
repo = tmp_path / "repo"state = tmp_path / "state"
7 more
state.mkdir()(repo / "src").mkdir(parents=True)source = repo / "src" / "app.c"source.write_text("int add(int a, int b){return a+b;}\n", encoding="utf-8")inside = json.dumps( { "hook_event_name": "PostToolUse", "tool_name": "Read", "tool_input": {"file_path": str(source)}, "tool_response": "int add(int a, int b){return a+b;}", } )env = {"CLAUDE_CODE_SESSION_ID": "inside-session", "CLAUDE_PROJECT_DIR": str(repo)}spoke = [bool(_run(inside, state, env).stdout.strip()) for _ in range(hook._QUIET_BELOW)]
When
- —
Then
- ✓ any(spoke) holds
tests/test_hook.py:1392 · its file's page
What it checks (1)
assert any(spoke), "an in-tree read must still drive the note"observes_runviaspoke
Where the product reaches it
main→_run(flow)
Call flow
test_reads_inside_the_repository_still_count→_runWhat 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.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-WIKI-054 | catalog | unknown |