test_the_output_is_always_valid_json

Tests › tests/test_hook.py

passed Passed in the packaged run.

What this test is for

Why it exists

Every input, hostile or malformed, yields parseable JSON and exit 0.

Verifies REQ-DDB-WIKI-054

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

What it checks (5)

  1. assert result.returncode == 0, f"exit {result.returncode}"
  2. assert "Traceback" not in result.stderr, (f"a traceback reaches the model through stderr: {result.stderr[:300]}" )
  3. assert out, "the probe never reached a speaking tier"
  4. assert list(doc) == ["hookSpecificOutput"]
  5. assert doc["hookSpecificOutput"]["additionalContext"]

Where the product reaches it

  • main → _run (flow)
  • dossier → subject_payload → _flatten_subject → list (flow)

Call flow

test_the_output_is_always_valid_json→_run→list

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