test_a_declared_exclude_outside_the_repository_is_dropped¶
Tests › tests/test_scope.py
What this test is for
Why it exists
The same resolution bug on the quieter half. An exclude cannot leak a tree, but one pointing outside the repo silently excludes NOTHING while reading as honoured — the accepted-but-unread failure this module fixes everywhere else.
Verifies REQ-DDB-PIPE-014
Given
root = tmp_path / "repo"(root / "src").mkdir(parents=True)
2 more
(tmp_path / "outside").mkdir()(root / ".clew.yaml").write_text( "index_scope:\n roots: [src]\n excludes:\n - ../outside\n", encoding="utf-8" )
When
derived = sc.derive_scope(root)
Then
- ✓ derived.source equals sc.SOURCE_DECLARED
- ✓ derived.excludes equals ()
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) · 11 of 400 steps
… 10 earlier steps
… 18 steps between
… 20 steps between
… 329 later steps
2 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 9 of 142 steps
- Build this wiki from the index · 5 of 400 steps
tests/test_scope.py:634 · its file's page
What it checks (2)
assert derived.source == sc.SOURCE_DECLAREDobservesderive_scopeviaderivedassert derived.excludes == (), ( f"an exclude outside the repository must be dropped, not resolved; got {derived.excludes}" )observesderive_scopeviaderived
Where the product reaches it
main→propose_main→propose→build_context→derive_scope(flow)
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