test_a_session_ignoring_the_index_is_escalated

Tests › tests/test_hook.py

passed Passed in the packaged run.

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

  1. env = { **os.environ, "TMPDIR": str(tmp_path), "CLAUDE_CODE_SESSION_ID": "ignoring-session", }
  2. 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) ]
  3. loud = spoke[hook._LOUD_AT - 1 :]
→

When

  1. all(loud)
  2. middle = spoke[hook._QUIET_BELOW : hook._LOUD_AT - 1]
  3. all(middle)
→

Then

  1. ✓ any(spoke[: hook._QUIET_BELOW - 1]) is false
  2. ✓ spoke[hook._QUIET_BELOW - 1] holds
  3. ✓ sum(loud) is at least 2
  4. ✓ all(loud) is false
  5. ✓ all(middle) is false

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

What it checks (5)

  1. assert not any(spoke[: hook._QUIET_BELOW - 1]), "the first few searches must pass in silence" not attributed
  2. assert spoke[hook._QUIET_BELOW - 1], f"a note is due at {hook._QUIET_BELOW} unanswered searches" not attributed
  3. assert 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 attributed
  4. assert not all(loud), ( "the loud tier still fires on every call — the cadence fix did not take effect" ) observes all
  5. assert not all(middle), "between the thresholds the note must be periodic, not every call" observes all

Where the product reaches it

  • dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all (flow)

Call flow

test_a_session_ignoring_the_index_is_escalated→all

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.

test_a_session_ignoring_the_index_is_escalated · 5 checksallREQ-DDB-WIKI-054 · catalog

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-WIKI-054catalog1 of 18: all