test_text_escalates_and_never_repeats¶
Tests › tests/test_hook.py
What this test is for
Why it exists
A CONSTANT STRING BECOMES WALLPAPER. Measured: ~1,900 byte-identical injections across one session changed nothing, and that session made 2 index calls against ~1,900 searches. A varying integer invalidates the prompt cache at that point, so the note must be processed rather than replayed — the defence is mechanical, not persuasive.
Verifies REQ-DDB-WIKI-054
Given
emitted = [out for _ in range(30) if (out := _hook_once(tmp_path, "escalate-probe"))]capability = [e for e in emitted if not _is_operator(e)]operator = [e for e in emitted if _is_operator(e)]
When
all(emitted.index(c) < emitted.index(o) for c in capability[:1] for o in operator[:1])first = capability[0].lower()
Then
- ✓ len(emitted) is greater than 5
- ✓ len(set(emitted)) equals len(emitted)
- ✓ capability holds
- ✓ operator holds
- ✓ all(emitted.index(c) < emitted.index(o) for c in capability[:1] for o in operator[:1]) holds
- ✓ first contains "verbatim"
- ✓ first contains "dossier"
tests/test_hook.py:791 · its file's page
What it checks (5)
assert len(emitted) > 5, "the policy must emit something over 30 misses"observes_hook_onceviaemittedassert len(set(emitted)) == len(emitted), ( "every injection must be unique or it is filtered as boilerplate" )observes_hook_onceviaemittedassert capability and operator, "both tiers must be reachable in one ramp"observes_is_operatorviacapabilityassert all(emitted.index(c) < emitted.index(o) for c in capability[:1] for o in operator[:1]), ( "the capability tier must precede the operator tier" )observesallassert "verbatim" in first and "dossier" in first, ( f"the first note must state that dossier returns source verbatim; believing otherwise is " f"what sent a measured session to grep for twenty turns. Got: {capability[0][:200]}" )observes_is_operatorviacapability
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 |