test_the_config_inventory_lists_symbols_and_honours_text¶
Tests › tests/test_kconfig.py
What this test is for
Why it exists
A 2.1 MB REPLY ON THE AXIS UNDER TEST. `search(corpus='config', text='MBEDTLS_THREADING_C')` returned 2,149,463 characters on mbedtls 2026-08-14 — all 12,096 gate SITES, because inventory corpora ignored `text` — while reporting `found: false` for a symbol whose name sits in `configured_macros` in the same reply. In a graded cell that is a budget-destroying reply or a bail-out.
Verifies REQ-DDB-CONFIG-005 REQ-DDB-PIPE-007 REQ-DDB-PIPE-014
Given
db = tmp_path / "clew.db"conn = sqlite3.connect(str(db))
3 more
conn.executescript( """ CREATE TABLE kconfig_gates ( symbol TEXT, macro TEXT, form TEXT, file_path TEXT, line INTEGER, origin TEXT, end_line INTEGER ); INSERT INTO kconfig_gates VALUES ('MBEDTLS_THREADING_C','MBEDTLS_THREADING_C','if_expr','a.c',1,'declared',3); INSERT INTO kconfig_gates VALUES ('MBEDTLS_THREADING_C','MBEDTLS_THREADING_C','if_expr','b.c',9,'declared',11); INSERT INTO kconfig_gates VALUES ('MBEDTLS_SSL_PROTO_TLS1_3','MBEDTLS_SSL_PROTO_TLS1_3','ifdef','c.c',4,'undeclared',6); """ )conn.commit()conn.close()
When
inventory = kconfig_space(db, None, include_gates=False)filtered = kconfig_space(db, "MBEDTLS_THREADING_C", include_gates=False)kconfig_space(db, "CONFIG_MBEDTLS_THREADING_C", include_gates=False)
4 more
sites = kconfig_space(db, "MBEDTLS_THREADING_C")gates_meaning(_NAME_CAP, _NAME_CAP + 7, False)gates_meaning(3, 3, False)gates_meaning(0, 0, False)
Then
- ✓ inventory.gate_symbol_names equals ("MBEDTLS_SSL_PROTO_TLS1_3", "MBEDTLS_THREADING_C")
- ✓ inventory.gates equals ()
- ✓ inventory.gates_meaning contains "omitted"
- ✓ inventory.gates_meaning contains "dossier"
- ✓ filtered.gate_symbol_names equals ("MBEDTLS_THREADING_C",)
- ✓ kconfig_space(db, "CONFIG_MBEDTLS_THREADING_C", include_gates=False).gate_symbol_names holds
- ✓ len(sites.gates) equals 2
- ✓ sites.gates_meaning equals ""
- ✓ gates_meaning(_NAME_CAP, _NAME_CAP + 7, False) contains f"{_NAME_CAP}"
- ✓ gates_meaning(_NAME_CAP, _NAME_CAP + 7, False) contains "7 are not shown"
- ✓ gates_meaning(3, 3, False) holds
- ✓ gates_meaning(3, 3, False) does not contain "not shown"
- ✓ gates_meaning(0, 0, False) 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.
`main` (scripts/export_parity.py) · 19 of 203 steps
… 13 earlier steps
… 159 steps between
2 more
- clew — `main` (clew/cli.py) · 17 of 400 steps
- Look up one name: everything the index holds about it · 4 of 226 steps
tests/test_kconfig.py:1064 · its file's page
What it checks (11)
assert inventory.gate_symbol_names == ("MBEDTLS_SSL_PROTO_TLS1_3", "MBEDTLS_THREADING_C")observeskconfig_spaceviainventoryassert inventory.gates == (), "the inventory form must NOT carry the per-site rows"observeskconfig_spaceviainventoryassert "omitted" in inventory.gates_meaning and "dossier" in inventory.gates_meaning, ( "an empty gates list must say it was omitted and where the sites are" )observeskconfig_spaceviainventoryassert filtered.gate_symbol_names == ("MBEDTLS_THREADING_C",)observeskconfig_spaceviafilteredassert kconfig_space(db, "CONFIG_MBEDTLS_THREADING_C", include_gates=False).gate_symbol_namesobserveskconfig_spaceassert len(sites.gates) == 2, "naming a symbol must still return ITS sites"observeskconfig_spaceviasitesassert sites.gates_meaning == "", "the site form has nothing omitted to explain"observeskconfig_spaceviasitesassert f"{_NAME_CAP}" in gates_meaning(_NAME_CAP, _NAME_CAP + 7, False)observesgates_meaningassert "7 are not shown" in gates_meaning(_NAME_CAP, _NAME_CAP + 7, False)observesgates_meaningassert gates_meaning(3, 3, False) and "not shown" not in gates_meaning(3, 3, False)observesgates_meaningassert gates_meaning(0, 0, False) == ""observesgates_meaning
Where the product reaches it
main→query_main→_payload→export_search→corpus_payload→kconfig_space(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.
Requirements it verifies (3)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-CONFIG-005 | catalog | unknown |
| REQ-DDB-PIPE-007 | catalog | unknown |
| REQ-DDB-PIPE-014 | catalog | unknown |
Also reaches 5 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-004 inferred
- REQ-DDB-QUERY-006 measured
- REQ-DDB-QUERY-013 inferred