test_every_input_exits_zero_and_never_two¶
Tests › tests/test_hook.py
What this test is for
Why it exists
EXIT 2 IS A SECOND INJECTION CHANNEL. On `PostToolUse` it is documented as non-blocking but it surfaces stderr TO THE MODEL — so a crash would put a Python traceback, including whatever of the event it quoted, into the context this component exists to protect. Every path returns 0, including every failure path, and malformed input is the obvious way to try to break that.
Verifies REQ-DDB-WIKI-054
Given
result = _run(event, tmp_path)
When
- —
Then
- ✓ result.returncode equals 0
- ✓ result.stderr does not contain "Traceback"
tests/test_hook.py:576 · its file's page
What it checks (2)
assert result.returncode == 0, ( f"exit {result.returncode} on {event!r}; exit 2 in particular surfaces stderr to the model" )observes_runviaresultassert "Traceback" not in result.stderr, "a traceback would carry event content to the model"observes_runviaresult
Where the product reaches it
main→_run(flow)
Call flow
test_every_input_exits_zero_and_never_two→_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 |