test_the_winning_tier_reaches_the_stamped_provenance¶
Tests › tests/test_index_scope_inheritance.py
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
root = _repo_with_exempt_fixture(tmp_path / "undeclared")declared_root = _repo_with_exempt_fixture(tmp_path / "declared")
3 more
(declared_root / ".clew.yaml").write_text("index_scope:\n roots: ['src']\n", encoding="utf-8")resolved = argparse.Namespace(scope=sc.SCOPE_FROM_GUARD, guard_config=None)narrowed = argparse.Namespace(scope=sc.SCOPE_DOXYFILE, guard_config=None)
When
- —
Then
- ✓ _scope_provenance(declared_root, resolved)["source"] equals sc.SOURCE_DECLARED
- ✓ _scope_provenance(root, resolved)["source"] equals sc.SOURCE_WHOLE_REPO
- ✓ _scope_provenance(root, narrowed)["source"] equals sc.SOURCE_DOXYFILE
- ✓ _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
… 18 steps between
… 39 steps between
… 285 later steps
4 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 30 of 142 steps
- Build, refresh and check the index · 20 of 153 steps
- Build this wiki from the index · 8 of 400 steps
- `main` (clew/guard/main.py) · 2 of 357 steps
tests/test_index_scope_inheritance.py:349 · its file's page
What it checks (4)
assert _scope_provenance(declared_root, resolved)["source"] == sc.SOURCE_DECLAREDobserves_repo_with_exempt_fixtureviadeclared_rootassert _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_fixtureviarootassert _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_fixtureviarootassert "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_fixtureviaroot
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_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