test_a_named_gate_symbol_resolves_to_its_definition_sites¶
Tests › tests/test_payload_completeness.py
What this test is for
Why it exists
ONE CALL, NOT TWO. Naming a symbol the caller now needs, without saying where it lives, is an instruction to go looking — and the tool the caller reaches for is grep, because grep is in its training distribution millions of times and our tool is not.
Given
payload = {"name": "SOMETHING_ELSE", "gated_by": [{"symbol": "SOUND_FINDME"}]}
When
resolved, _gaps = _gate_definitions(rich_db, payload)itself = {"name": "SOUND_FINDME", "gated_by": [{"symbol": "SOUND_FINDME"}]}_gate_definitions(rich_db, itself)_gate_definitions(rich_db, {"name": "X", "gated_by": []})
Then
- ✓ resolved contains "SOUND_FINDME"
- ✓ resolved["SOUND_FINDME"][0]["file"] holds
- ✓ _gate_definitions(rich_db, itself)[0] equals {}
- ✓ _gate_definitions(rich_db, {"name": "X", "gated_by": []})[0] equals {}
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:157 · its file's page
What it checks (4)
assert "SOUND_FINDME" in resolved, ( "a gate symbol the index can place must come back placed — leaving it unresolved is the " "open loop that cost four greps in a measured cell" )not attributedassert resolved["SOUND_FINDME"][0]["file"], "a resolved site without a file is not a route"not attributedassert _gate_definitions(rich_db, itself)[0] == {}, ( "a subject listed among its own gates must not have its sites echoed back" )observes_gate_definitionsassert _gate_definitions(rich_db, {"name": "X", "gated_by": []})[0] == {}observes_gate_definitions
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