test_unresolved_gates_distinguish_no_definition_site_from_never_tried¶
Tests › tests/test_payload_completeness.py
What this test is for
Why it exists
TWO GAPS THAT LOOKED IDENTICAL AND MEAN OPPOSITE THINGS. `if sites:` dropped the key for a gate the index cannot place, so its absence was indistinguishable from having been capped out.
Given
payload = { "name": "subject_fn", "gated_by": [{"symbol": "SOUND_FINDME"}, {"symbol": "NOWHERE_DEFINED_XYZ"}], }
When
resolved, gaps = _gate_definitions(rich_db, payload)many = { "name": "subject_fn", "gated_by": [{"symbol": f"GATE_{i:03d}"} for i in range(_GATE_DEFINITION_CAP + 3)], }_resolved2, gaps2 = _gate_definitions(rich_db, many)_r3, gaps3 = _gate_definitions(rich_db, {"name": "f", "gated_by": [{"symbol": "SOUND_FINDME"}]})
Then
- ✓ resolved contains "SOUND_FINDME"
- ✓ gaps is not None
- ✓ gaps["no_definition_site"] equals ["NOWHERE_DEFINED_XYZ"]
- ✓ gaps does not contain "not_attempted"
- ✓ gaps2 is not None
- ✓ len(gaps2["not_attempted"]) equals 3
- ✓ gaps3 is None
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.
Look up one name: everything the index holds about it · 23 of 226 steps
… 17 earlier steps
… 32 steps between
… 142 later steps
2 more
- clew — `main` (clew/cli.py) · 6 of 400 steps
- `main` (scripts/export_parity.py) · 6 of 203 steps
tests/test_payload_completeness.py:282 · its file's page
What it checks (6)
assert "SOUND_FINDME" in resolved, "precondition: the placeable gate must still resolve"not attributedassert gaps is not None, "an unplaceable gate must be disclosed, not silently dropped"not attributedassert gaps["no_definition_site"] == ["NOWHERE_DEFINED_XYZ"], ( f"the unplaceable gate must be NAMED, not counted — a count leaves a reader unable to ask " f"for the one they care about; got {gaps}" )not attributedassert "not_attempted" not in gaps, "nothing was capped here, so nothing may claim it was"not attributedassert gaps2 is not None and len(gaps2["not_attempted"]) == 3, ( f"the three gates beyond the cap must be named as not attempted; got {gaps2}" )not attributedassert gaps3 is None, ( "when every gate resolves there is nothing to disclose — a block on every reply is one a " "reader learns to skip" )not attributed
Where the product reaches it
dossier→subject_payload→_flatten_subject→_gate_definitions(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.
Also reaches 7 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-INDEX-004 measured
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-004 inferred
- REQ-DDB-QUERY-006 measured
- REQ-DDB-QUERY-012 measured
- REQ-DDB-QUERY-013 inferred