test_admitting_a_submodule_leaves_first_party_coverage_identical

Tests › tests/test_external_provenance.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE LOAD-BEARING CONTROL, and the reason it is phrased as a comparison of two builds rather than as an expected number: it holds whatever the matcher does. If a first-party figure moves when a nested tree is admitted, the tagging is wrong, and no assertion about the matcher's internals would have caught it.

Verifies REQ-DDB-PIPE-014

Given

  1. alone_db, alone_root = _indexed(tmp_path / "alone", _ours())
→

When

  1. stamp_external_provenance(alone_db, alone_root)
  2. alone = measure_index_coverage(alone_db, alone_root)
  3. both_db, both_root = _indexed( tmp_path / "both", [*_ours(), *_theirs()], nested=("vendor/theirs",) )
2 more
  1. stamp_external_provenance(both_db, both_root)
  2. both = measure_index_coverage(both_db, both_root)
→

Then

  1. ✓ both.indexed_files equals alone.indexed_files
  2. ✓ both.substantive_files equals alone.substantive_files
  3. ✓ both.barren_files equals alone.barren_files
  4. ✓ both.barren_ratio equals alone.barren_ratio
  5. ✓ both.undocumented_files equals alone.undocumented_files
  6. ✓ both.external_files equals 12
  7. ✓ both.external_roots equals ("vendor/theirs",)
  8. ✓ alone.external_files equals 0

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.

thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 6 of 142 steps

… 2 earlier steps

thread startthread startthread startthread startclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filestry (line 1003)tryopt (line 845)optloop (line 1239)loopopt (line 847)optloop (line 746)loop_first_build_worker3. whole_repo_scope → _gitignored_paths3_gitignored_paths4. _gitignored_paths → git_argv4git_argv5. git_argv → _no_ext_diff5_no_ext_diff▶ test enters6. git_argv → list6list7. list → link7link8. _gitignored_paths → git_env8git_env9. whole_repo_scope → list9list10. whole_repo_scope → nested_repo_roots10nested_repo_roots11. nested_repo_roots → _nested_repos_under11_nested_repos_under▶ test enters12–14. _nested_repos_under → _warn_unwalkable12_warn_unwalkable +2 more15. nested_repo_roots → _nested_repos_under15_nested_repos_under16. whole_repo_scope → _gitignored_paths16_gitignored_paths

… 126 later steps

4 more

tests/test_external_provenance.py:218 · its file's page

What it checks (8)

  1. assert both.indexed_files == alone.indexed_files observes measure_index_coverage via alone
  2. assert both.substantive_files == alone.substantive_files observes measure_index_coverage via alone
  3. assert both.barren_files == alone.barren_files observes measure_index_coverage via alone
  4. assert both.barren_ratio == alone.barren_ratio observes measure_index_coverage via alone
  5. assert both.undocumented_files == alone.undocumented_files observes measure_index_coverage via alone
  6. assert both.external_files == 12 observes measure_index_coverage via both
  7. assert both.external_roots == ("vendor/theirs",) observes measure_index_coverage via both
  8. assert alone.external_files == 0 observes measure_index_coverage via alone

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_admitting_a_submodule_leaves_first_party_coverage_identical→_indexed→_ours→stamp_external_provenance→measure_index_coverage→_theirs

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_admitting_a_submodule_leaves_first_party_coverage_identical · 8 checksstamp_external_provenanceexternal_rootsdependency_rootsREQ-DDB-CONFIG-001 · measuredmeasure_index_coverage_file_yieldsmemoizedREQ-DDB-INDEX-002 · measuredmeasure_index_coverageREQ-DDB-INDEX-003 · measuredstamp_external_provenanceREQ-DDB-INDEX-005 · measured

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-014catalogunknown
Also reaches 5 requirements

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