test_every_input_exits_zero_and_never_two

Tests › tests/test_hook.py

passed Passed in the packaged run.

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

  1. result = _run(event, tmp_path)
→

When

  1. —
→

Then

  1. ✓ result.returncode equals 0
  2. ✓ result.stderr does not contain "Traceback"

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

What it checks (2)

  1. assert result.returncode == 0, ( f"exit {result.returncode} on {event!r}; exit 2 in particular surfaces stderr to the model" ) observes _run via result
  2. assert "Traceback" not in result.stderr, "a traceback would carry event content to the model" observes _run via result

Where the product reaches it

Call flow

test_every_input_exits_zero_and_never_two→_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