test_scope_provenance_fallback_also_reads_a_stated_scope¶
Tests › tests/test_index_scope_inheritance.py
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
root = _repo_with_exempt_fixture(tmp_path / "stated_fallback")args = argparse.Namespace( scope=sc.SCOPE_FROM_GUARD, guard_config=None, doxyfile=None, exclude=None, index_scope={"roots": ["src"]}, )provenance = _scope_provenance(root, args)
When
- —
Then
- ✓ 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
… 22 steps between
… 20 steps between
… 39 steps between
… 285 later steps
2 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 5 of 142 steps
- Build this wiki from the index · 2 of 400 steps
tests/test_index_scope_inheritance.py:442 · its file's page
What it checks (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_fixtureWhat 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.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-INDEX-001 measured