test_a_config_symbol_does_not_outrank_a_function_it_gates¶
Tests › tests/test_kconfig.py
What this test is for
Why it exists
THE COST OF THE NEW CORPUS, bounded. A gating symbol habitually shares every token with the function it gates, and the function is the row a caller can read a body for. The config tier breaks a TIE only, so a query that spells neither name exactly must still put the function first — otherwise adding the corpus degrades every existing query, which is how the neighbour-cap experiment cost 48% in tokens.
Verifies REQ-DDB-CONFIG-005 REQ-DDB-PIPE-014 REQ-DDB-QUERY-006
Given
root, db = _no_kconfig_repo(tmp_path)_add_functions(db, ("widget_lock", "widget_telemetry"))
When
import_kconfig_gates(db, root)hits = search(db, "telemetry")kinds = [h.kind for h in hits]exact = search(db, "PROJ_OMIT_TELEMETRY")
Then
- ✓ kinds contains "function"
- ✓ kinds contains CONFIG_SYMBOL_KIND
- ✓ kinds.index("function") is less than kinds.index(CONFIG_SYMBOL_KIND)
- ✓ exact[0].kind equals CONFIG_SYMBOL_KIND
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.
clew — `main` (clew/cli.py) · 40 of 400 steps
… 70 earlier steps
… 124 steps between
… 147 later steps
2 more
- `main` (scripts/export_parity.py) · 33 of 203 steps
- Look up one name: everything the index holds about it · 3 of 226 steps
tests/test_kconfig.py:665 · its file's page
What it checks (4)
assert "function" in kinds, "the fixture's functions must still be findable"not attributedassert CONFIG_SYMBOL_KIND in kinds, "and a gating symbol must be in the same reply"not attributedassert kinds.index("function") < kinds.index(CONFIG_SYMBOL_KIND)not attributedassert exact[0].kind == CONFIG_SYMBOL_KINDnot attributed
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_a_config_symbol_does_not_outrank_a_function_it_gates→_no_kconfig_repo→_add_functions→import_kconfig_gatesWhat 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 (3)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-CONFIG-005 | catalog | unknown |
| REQ-DDB-PIPE-014 | catalog | unknown |
| REQ-DDB-QUERY-006 | catalog | unknown |
Also reaches 12 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-004 measured
- REQ-DDB-INDEX-004 measured
- REQ-DDB-PIPE-003 measured
- REQ-DDB-PIPE-007 measured
- REQ-DDB-PIPE-011 measured
- REQ-DDB-PIPE-012 inferred
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-007 measured
- REQ-DDB-QUERY-012 measured
- REQ-DDB-SCHEMA-012 measured
- REQ-DDB-SCHEMA-013 measured