test_a_vendored_accessor_family_is_counted_but_not_named

Tests › tests/test_diagnostics.py

passed Passed in the packaged run.

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

  1. 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

  1. meta = dg.collect(db, tmp_path / "absent.Doxyfile", None, None, None).as_meta()
→

Then

  1. ✓ meta["accessor_families_count"] equals "2"
  2. ✓ meta["accessor_families_first_party_count"] equals "1"
  3. ✓ meta["accessor_families_external_count"] equals "1"
  4. ✓ int(meta["accessor_families_first_party_count"]) + int( meta["accessor_families_external_count"] ) equals int(meta["accessor_families_count"])
  5. ✓ meta["accessor_families"] contains "Store_Set_*"
  6. ✓ meta["accessor_families"] does not contain "ggml_set_"

tests/test_diagnostics.py:113 · its file's page

What it checks (6)

  1. assert meta["accessor_families_count"] == "2", "both families are found" observes collect via meta
  2. assert meta["accessor_families_first_party_count"] == "1" observes collect via meta
  3. assert meta["accessor_families_external_count"] == "1" observes collect via meta
  4. assert int(meta["accessor_families_first_party_count"]) + int( meta["accessor_families_external_count"] ) == int(meta["accessor_families_count"]) observes collect via meta
  5. assert "Store_Set_*" in meta["accessor_families"], "the actionable family is named" observes collect via meta
  6. assert "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" ) observes collect via meta

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_vendored_accessor_family_is_counted_but_not_named→_attributed_corpus→collect

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.

test_a_vendored_accessor_family_is_counted_but_not_named · 6 checkscollectresolve_shared_key_patternsREQ-DDB-CONFIG-006 · measuredcollectREQ-DDB-CONFIG-007 · measuredcollectload_thread_patternsREQ-DDB-SCHEMA-001 · measuredcollectresolve_shared_key_patternsREQ-DDB-SCHEMA-005 · measuredcollectload_lock_patternsREQ-DDB-SCHEMA-011 · measuredcollectload_lock_patternsdeclaration_originREQ-DDB-SCHEMA-012 · measured
Also reaches 7 requirements

Its run touches their code; that is reach, not proof.