test_a_session_ignoring_the_index_is_escalated¶
Tests › tests/test_hook.py
What this test is for
Why it exists
THE OTHER HALF, and without it the credit test is satisfied by a hook that never speaks. gh#7 measured a real session making six searches, four of them index-answerable, and calling the index zero times. That session is this one.
Verifies REQ-DDB-WIKI-054
Given
env = { **os.environ, "TMPDIR": str(tmp_path), "CLAUDE_CODE_SESSION_ID": "ignoring-session", }spoke = [ bool( subprocess.run( [sys.executable, "-m", "clew_hook"], input=HOSTILE_EVENT, capture_output=True, text=True, env=env, ).stdout.strip() ) for _ in range(hook._LOUD_AT + 4) ]loud = spoke[hook._LOUD_AT - 1 :]
When
all(loud)middle = spoke[hook._QUIET_BELOW : hook._LOUD_AT - 1]all(middle)
Then
- ✓ any(spoke[: hook._QUIET_BELOW - 1]) is false
- ✓ spoke[hook._QUIET_BELOW - 1] holds
- ✓ sum(loud) is at least 2
- ✓ all(loud) is false
- ✓ all(middle) is false
tests/test_hook.py:496 · its file's page
What it checks (5)
assert not any(spoke[: hook._QUIET_BELOW - 1]), "the first few searches must pass in silence"not attributedassert spoke[hook._QUIET_BELOW - 1], f"a note is due at {hook._QUIET_BELOW} unanswered searches"not attributedassert sum(loud) >= 2, ( f"a session ignoring the index this long must keep hearing about it; spoke {sum(loud)} " f"time(s) across {len(loud)} calls above the threshold" )not attributedassert not all(loud), ( "the loud tier still fires on every call — the cadence fix did not take effect" )observesallassert not all(middle), "between the thresholds the note must be periodic, not every call"observesall
Where the product reaches it
dossier→_rank_enum_over_mirror→_class_side_is_only_enum_mirrors→all(flow)
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.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-WIKI-054 | catalog | 1 of 18: all |