test_the_winning_tier_reaches_the_stamped_provenance

Tests › tests/test_index_scope_inheritance.py

passed Passed in the packaged run.

What this test is for

Why it exists

`DerivedScope` living in the build's memory is what gh#20's first half was already about: the pipeline computed the scope decision and logged it, and the log is gone by the time anyone queries. `scope.*` in `build_meta` is the surface `status` reads, so the tier has to be stamped there or it does not exist.

Given

  1. root = _repo_with_exempt_fixture(tmp_path / "undeclared")
  2. declared_root = _repo_with_exempt_fixture(tmp_path / "declared")
3 more
  1. (declared_root / ".clew.yaml").write_text("index_scope:\n roots: ['src']\n", encoding="utf-8")
  2. resolved = argparse.Namespace(scope=sc.SCOPE_FROM_GUARD, guard_config=None)
  3. narrowed = argparse.Namespace(scope=sc.SCOPE_DOXYFILE, guard_config=None)
→

When

  1. —
→

Then

  1. ✓ _scope_provenance(declared_root, resolved)["source"] equals sc.SOURCE_DECLARED
  2. ✓ _scope_provenance(root, resolved)["source"] equals sc.SOURCE_WHOLE_REPO
  3. ✓ _scope_provenance(root, narrowed)["source"] equals sc.SOURCE_DOXYFILE
  4. ✓ _scope_provenance(root, resolved) does not contain "inherited"

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) · 32 of 400 steps

… 10 earlier steps

command-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesalt (line 1171)altopt (line 529)optmain11. propose → build_context11build_context12. build_context → derive_scope12derive_scope13. derive_scope → _declared_index_scope13_declared_index_scope▶ test enters14. _declared_index_scope → load_declaration_located14load_declaration_located15–18. load_declaration_located → _read_mapping15_read_mapping +3 more19–20. _checked_section → _checked_list_section19_checked_list_section +1 more

… 18 steps between

command-line usercommand-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesother filesloop (line 598)loopopt (line 696)opttry (line 1003)tryopt (line 847)optloop (line 746)looploop (line 1055)loopopt (line 1075)optmain39–40. _checked_document → _checked_entries39_checked_entries +1 more41. _checked_section → _check_section_keys41_check_section_keys42–44. _declared_index_scope → _existing_paths42_existing_paths +2 more45. derive_scope → whole_repo_scope45whole_repo_scope46. whole_repo_scope → _gitignored_paths46_gitignored_paths47. _gitignored_paths → git_argv47git_argv48–49. git_argv → _no_ext_diff48_no_ext_diff +1 more50. _gitignored_paths → git_env50git_env51. whole_repo_scope → list51list52–56. whole_repo_scope → nested_repo_roots52nested_repo_roots +4 more57. nested_repo_roots → _nested_repos_under57_nested_repos_under58. whole_repo_scope → _gitignored_paths58_gitignored_paths59–60. whole_repo_scope → _pruned_dirs59_pruned_dirs +1 more61. _pruned_dirs → _skip_dir61_skip_dir62–64. _pruned_dirs → _descendable62_descendable +2 more65–68. whole_repo_scope → _declaration_note65_declaration_note +3 more69. derive_scope → whole_repo_scope69whole_repo_scope▶ test enters70–71. build_context → repo_source_files70repo_source_files +1 more

… 39 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/propose/astdefs.pyclew/propose/astdefs.pyclew/propose/astdefs.pyclew/propose/astdefs.pyother filesother filesother filesother filesmain111. _accessor_site → callee_name111callee_name112. build_context → load_declaration112load_declaration113. load_declaration → load_declaration_located113load_declaration_located▶ test enters114–115. propose → _sections114_sections +1 more

… 285 later steps

4 more

tests/test_index_scope_inheritance.py:349 · its file's page

What it checks (4)

  1. assert _scope_provenance(declared_root, resolved)["source"] == sc.SOURCE_DECLARED observes _repo_with_exempt_fixture via declared_root
  2. assert _scope_provenance(root, resolved)["source"] == sc.SOURCE_WHOLE_REPO, ( "a build that indexed the whole repository must not be stamped as a Doxyfile scope" ) observes _repo_with_exempt_fixture via root
  3. assert _scope_provenance(root, narrowed)["source"] == sc.SOURCE_DOXYFILE, ( "the explicit opt-out really does index the Doxyfile's INPUT, and must say so" ) observes _repo_with_exempt_fixture via root
  4. assert "inherited" not in _scope_provenance(root, resolved), ( "nothing is inherited from the gate any more, and a stamped key nothing sets " "is a fact a consumer would read as one" ) observes _repo_with_exempt_fixture via root

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_the_winning_tier_reaches_the_stamped_provenance→_repo_with_exempt_fixture

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 2 requirements

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