test_scope_provenance_fallback_also_reads_a_stated_scope

Tests › tests/test_index_scope_inheritance.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE LATENT MISMATCH THIS FIX ALSO CLOSES, found while tracing the redundant walk: `_scope_provenance`'s own re-derivation call never passed `stated` — a tier-1 caller's own `index_scope` (e.g. a vendored sub-index's `roots` override) — so a caller reaching this function WITHOUT going through `_apply_scope` first (this test) could get back provenance describing a DIFFERENT boundary than the one a caller who DID pass `stated` actually built. Exercises the fallback path specifically — no `scope_result` cached.

Given

  1. root = _repo_with_exempt_fixture(tmp_path / "stated_fallback")
  2. args = argparse.Namespace( scope=sc.SCOPE_FROM_GUARD, guard_config=None, doxyfile=None, exclude=None, index_scope={"roots": ["src"]}, )
  3. provenance = _scope_provenance(root, args)
→

When

  1. —
→

Then

  1. ✓ provenance["source"] equals sc.SOURCE_DECLARED

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) · 7 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 485)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. load_declaration_located → _read_mapping15_read_mapping16. _read_mapping → _parsed_declaration16_parsed_declaration17. load_declaration_located → _checked_sections17_checked_sections

… 22 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesloop (line 648)loopopt (line 696)optmain40. _checked_entries → _checked_entry40_checked_entry41. _checked_section → _check_section_keys41_check_section_keys42–44. _declared_index_scope → _existing_paths42_existing_paths +2 more45–46. derive_scope → whole_repo_scope45whole_repo_scope +1 more

… 20 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesmain67–68. whole_repo_scope → _vendored_clause67_vendored_clause +1 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

2 more

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

What it checks (1)

  1. assert provenance["source"] == sc.SOURCE_DECLARED, ( f"a stated index_scope must be honoured by the fallback path too, got: {provenance}" ) not attributed

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_scope_provenance_fallback_also_reads_a_stated_scope→_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.