test_declared_scope_rejection_reports_without_falling_back¶
Tests › tests/test_scope.py
What this test is for
Why it exists
THE SEPARATE, BUILD-TIME CHECK a caller who can still refuse uses — `derive_scope` itself keeps absorbing a rejected declaration into the whole-repo tier for every other caller (the test right above this one asserts exactly that, unchanged). This one is for the NEW build-time guard, `_apply_scope`, to consult before committing to a scope.
Verifies REQ-DDB-PIPE-014
Given
root = tmp_path / "repo"(root / "src").mkdir(parents=True)(root / ".clew.yaml").write_text("index_scope:\n excludes:\n - src\n", encoding="utf-8")
When
rejection = sc.declared_scope_rejection(root)plain = tmp_path / "plain"(plain / "src").mkdir(parents=True)
5 more
sc.declared_scope_rejection(plain)usable = tmp_path / "usable"(usable / "src").mkdir(parents=True)(usable / ".clew.yaml").write_text("index_scope:\n roots: [src]\n", encoding="utf-8")sc.declared_scope_rejection(usable)
Then
- ✓ rejection is not None
- ✓ rejection contains "roots"
- ✓ rejection contains "REPLACES"
- ✓ sc.declared_scope_rejection(plain) is None
- ✓ sc.declared_scope_rejection(usable) is None
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) · 10 of 142 steps
… 97 earlier steps
… 18 steps between
… 9 later steps
2 more
- clew — `main` (clew/cli.py) · 9 of 400 steps
- Build this wiki from the index · 5 of 400 steps
tests/test_scope.py:520 · its file's page
What it checks (4)
assert rejection is not Noneobservesdeclared_scope_rejectionviarejectionassert "roots" in rejection and "REPLACES" in rejectionobservesdeclared_scope_rejectionviarejectionassert sc.declared_scope_rejection(plain) is Noneobservesdeclared_scope_rejectionassert sc.declared_scope_rejection(usable) is Noneobservesdeclared_scope_rejection
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
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.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-014 | catalog | unknown |
Also reaches 3 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-GUARD-012 inferred
- REQ-DDB-WIKI-054 inferred