test_a_vendored_accessor_family_is_counted_but_not_named¶
Tests › tests/test_diagnostics.py
What this test is for
Why it exists
WHY THIS SPLIT EXISTS, measured rather than argued. Probing this detector against both public targets: [tvanfossen/entropic](https://github.com/tvanfossen/entropic) examines 17,773 distinct names and names NINE families, ALL NINE vendored inside `extern/llama.cpp` (`ma_*` from miniaudio, `ggml_set_*`); Mbed-TLS/mbedtls examines 5,967 and names TWO, both DES key-schedule setters. Eleven families across two repos, and an operator should declare NONE of them.
Given
db = _attributed_corpus( tmp_path / "clew.db", [("macro definition", f"ggml_set_{key}", 2) for key in ("A", "B", "C", "D", "E")] + [("function", f"Store_Set_{key}", 1) for key in ("A", "B", "C", "D")], [(1, "src/store.c", None), (2, "extern/llama.cpp/ggml/src/ggml.c", "extern/llama.cpp")], )
When
meta = dg.collect(db, tmp_path / "absent.Doxyfile", None, None, None).as_meta()
Then
- ✓ meta["accessor_families_count"] equals "2"
- ✓ meta["accessor_families_first_party_count"] equals "1"
- ✓ meta["accessor_families_external_count"] equals "1"
- ✓ int(meta["accessor_families_first_party_count"]) + int( meta["accessor_families_external_count"] ) equals int(meta["accessor_families_count"])
- ✓ meta["accessor_families"] contains "Store_Set_*"
- ✓ meta["accessor_families"] does not contain "ggml_set_"
tests/test_diagnostics.py:113 · its file's page
What it checks (6)
assert meta["accessor_families_count"] == "2", "both families are found"observescollectviametaassert meta["accessor_families_first_party_count"] == "1"observescollectviametaassert meta["accessor_families_external_count"] == "1"observescollectviametaassert int(meta["accessor_families_first_party_count"]) + int( meta["accessor_families_external_count"] ) == int(meta["accessor_families_count"])observescollectviametaassert "Store_Set_*" in meta["accessor_families"], "the actionable family is named"observescollectviametaassert "ggml_set_" not in meta["accessor_families"], ( "a vendored family is not the operator's to declare, so naming it beside the one they " "can act on is what trains a reader to ignore the whole hint" )observescollectviameta
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
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-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-QUERY-011 measured
- REQ-DDB-SCHEMA-001 measured
- REQ-DDB-SCHEMA-005 measured
- REQ-DDB-SCHEMA-011 measured
- REQ-DDB-SCHEMA-012 measured