test_reads_inside_the_repository_still_count

Tests › tests/test_hook.py

passed Passed in the packaged run.

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

  1. repo = tmp_path / "repo"
  2. state = tmp_path / "state"
7 more
  1. state.mkdir()
  2. (repo / "src").mkdir(parents=True)
  3. source = repo / "src" / "app.c"
  4. source.write_text("int add(int a, int b){return a+b;}\n", encoding="utf-8")
  5. 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;}", } )
  6. env = {"CLAUDE_CODE_SESSION_ID": "inside-session", "CLAUDE_PROJECT_DIR": str(repo)}
  7. spoke = [bool(_run(inside, state, env).stdout.strip()) for _ in range(hook._QUIET_BELOW)]
→

When

  1. —
→

Then

  1. ✓ any(spoke) holds

tests/test_hook.py:1392 · its file's page

What it checks (1)

  1. assert any(spoke), "an in-tree read must still drive the note" observes _run via spoke

Where the product reaches it

Call flow

test_reads_inside_the_repository_still_count→_run

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.

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-WIKI-054catalogunknown