test_by_default_inference_is_the_full_transitive_closure

Tests › tests/test_wiki_imports.py

passed Passed in the packaged run.

What this test is for

Why it exists

OWNER 2026-11-17: tests are linked to source by what they reach, transitively — "we should EXPLICITLY know which tests are related to which requirements by transitive linkage". A fixed hop cap was a guess: clew's REQ-DDB-GUARD-021 implementer sits 4 calls under its tests, so the demo read it MISSING. With no `infer_depth` declared, every test whose calls reach an implementer at ANY depth is linked; the cap stays available, and 0 still turns it off. The link's extent names the implementers each inferred test reaches.

Verifies REQ-DDB-WIKI-009

Given

  1. db = _with_calls(traced, tmp_path)
→

When

  1. rows = { r.req_id: r for r in requirement_evidence(db, junit=[], inputs=EvidenceInputs(), repo_root=tmp_path) }
→

Then

  1. ✓ rows["R-A"].inferred_tests equals ("test_far", "test_infer")
  2. ✓ dict(rows["R-A"].extent) equals {"test_far": ("impl",), "test_infer": ("impl",)}
  3. ✓ dict(rows["R-A"].distance) equals {"test_far": 3, "test_infer": 2}

What it exercises

The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.

Build this wiki from the index · 2 of 400 steps

… 344 earlier steps

callercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyother filesother filesother filesother filesbuild_wiki345. slice_svg → _hidden345_hidden346. _build_site → parse_junit346parse_junit347. parse_junit → fold_cases347fold_cases▶ test enters348. fold_cases → _folded348_folded349–350. parse_junit → _case_name349_case_name +1 more

… 50 later steps

tests/test_wiki_imports.py:528 · its file's page

What it checks (3)

  1. assert rows["R-A"].inferred_tests == ("test_far", "test_infer") observes requirement_evidence via rows
  2. assert dict(rows["R-A"].extent) == {"test_far": ("impl",), "test_infer": ("impl",)} observes requirement_evidence via rows
  3. assert dict(rows["R-A"].distance) == {"test_far": 3, "test_infer": 2} observes requirement_evidence via rows

Where the product reaches it

No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.

Call flow

test_by_default_inference_is_the_full_transitive_closure→_with_calls→requirement_evidence

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_by_default_inference_is_the_full_transitive_closure · 3 checksrequirement_evidenceconnectREQ-DDB-QUERY-001 · measuredrequirement_evidence_implementer_spanstable_existsREQ-DDB-QUERY-003 · measuredrequirement_evidenceREQ-DDB-WIKI-002 · measuredrequirement_evidence_tierallREQ-DDB-WIKI-054 · inferred

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-WIKI-009catalogunknown
Also reaches 10 requirements

Its run touches their code; that is reach, not proof.