test_a_first_party_target_adds_nested_excludes¶
Tests › tests/test_named_targets.py
What this test is for
Why it exists
ADDS, never replaces. The operator's own exclusions and the derived ones answer different questions — "what I do not want indexed" and "what belongs to another index" — and dropping either produces a build that is quietly wrong in a different direction.
Given
repo = tmp_path / "vendored"(repo / "app").mkdir(parents=True)
3 more
nested = repo / "extern" / "dep"nested.mkdir(parents=True)(nested / ".git").write_text("gitdir: ../../.git/modules/dep\n", encoding="utf-8")
When
first = target_for(repo, tmp_path / "state", name=FIRST_PARTY_INDEX)got_exclude, got_options = _sub_index_scope(first, repo.resolve(), ["build"], None)
Then
- ✓ got_exclude contains "build"
- ✓ got_exclude contains "extern/dep"
- ✓ got_options 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) · 36 of 142 steps
… 62 steps between
… 26 steps between
… 3 later steps
6 more
- Build, refresh and check the index · 31 of 153 steps
- clew — `main` (clew/cli.py) · 26 of 400 steps
- Build this wiki from the index · 4 of 400 steps
- `main` (clew/guard/main.py) · 2 of 357 steps
- clew-mcp — `main` (clew/mcp_server/server.py) · 2 of 17 steps
- `main` (scripts/incremental_probe.py) · 2 of 3 steps
tests/test_named_targets.py:234 · its file's page
What it checks (3)
assert "build" in got_exclude, "the operator's own exclusion was dropped"not attributedassert "extern/dep" in got_exclude, "the nested tree was not excluded from first-party"not attributedassert got_options is Nonenot attributed
Where the product reaches it
main→query_main→_locate→target_for(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.
Also reaches 5 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-GUARD-012 inferred
- REQ-DDB-INDEX-002 measured
- REQ-DDB-MCP-001 measured
- REQ-DDB-WIKI-054 inferred