test_a_split_build_separates_first_party_from_vendored¶
Tests › tests/integration/test_sub_index_build.py
What this test is for
Why it exists
Asserts on SYMBOL MEMBERSHIP rather than counts: each index must hold its own function and not the other's. Counts would be satisfied by two indexes that both covered everything.
Given
repo = _split_repo(tmp_path / "repo")
When
with captured_output(): built = build_sub_indexes(repo, home=tmp_path / "state")by_name = {t.name: t for t in built}def _functions(db: str) -> set[str]: conn = sqlite3.connect(f"file:{db}?mode=ro", uri=True) try: return {r[0] for r in conn.execute("SELECT name FROM memberdef WHERE kind='function'")} finally: conn.close()
2 more
first = _functions(by_name[FIRST_PARTY_INDEX].db_path)vendored = _functions(by_name["extern-dep"].db_path)
Then
- ✓ set(by_name) equals {FIRST_PARTY_INDEX, "extern-dep"}
- ✓ first contains "app_entry"
- ✓ first does not contain "dep_helper"
- ✓ vendored contains "dep_helper"
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) · 49 of 142 steps
… 3 steps between
… 3 steps between
… 31 steps between
… 22 steps between
… 1 step between
… 3 later steps
6 more
- Build, refresh and check the index · 40 of 153 steps
- clew — `main` (clew/cli.py) · 38 of 400 steps
- Build this wiki from the index · 6 of 400 steps
- `main` (clew/guard/main.py) · 3 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/integration/test_sub_index_build.py:75 · its file's page
What it checks (4)
assert set(by_name) == {FIRST_PARTY_INDEX, "extern-dep"}, f"unexpected split: {sorted(by_name)}"not attributedassert "app_entry" in first, "the first-party index is missing first-party code"not attributedassert "dep_helper" not in first, ( "the first-party index still contains the vendored tree, so the split saved nothing" )not attributedassert "dep_helper" in vendored, "the vendored index is missing the vendored code"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_a_split_build_separates_first_party_from_vendored→_split_repo→captured_output→build_sub_indexesWhat 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 49 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CLI-001 measured
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-004 measured
- REQ-DDB-CONFIG-005 measured
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-CONFIG-009 measured
- REQ-DDB-INDEX-001 measured
- REQ-DDB-INDEX-002 measured
- REQ-DDB-INDEX-003 measured
- REQ-DDB-INDEX-004 measured
- REQ-DDB-INDEX-005 measured
- REQ-DDB-INDEX-006 measured
- REQ-DDB-INDEX-007 measured
- REQ-DDB-INDEX-008 measured
- REQ-DDB-INDEX-009 measured
- REQ-DDB-INDEX-010 measured
- REQ-DDB-INDEX-011 measured
- REQ-DDB-MCP-001 measured
- REQ-DDB-MCP-004 measured
- REQ-DDB-PIPE-001 measured
- REQ-DDB-PIPE-003 measured
- REQ-DDB-PIPE-004 measured
- REQ-DDB-PIPE-005 measured
- REQ-DDB-PIPE-006 measured
- REQ-DDB-PIPE-007 measured
- REQ-DDB-PIPE-008 measured
- REQ-DDB-PIPE-009 measured
- REQ-DDB-PIPE-010 measured
- REQ-DDB-PIPE-011 measured
- REQ-DDB-PIPE-012 measured
- REQ-DDB-PIPE-013 measured
- REQ-DDB-PIPE-014 measured
- REQ-DDB-PIPE-015 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-011 measured
- REQ-DDB-SCHEMA-001 measured
- REQ-DDB-SCHEMA-002 measured
- REQ-DDB-SCHEMA-003 measured
- REQ-DDB-SCHEMA-004 measured
- REQ-DDB-SCHEMA-005 measured
- REQ-DDB-SCHEMA-006 measured
- REQ-DDB-SCHEMA-007 measured
- REQ-DDB-SCHEMA-009 measured
- REQ-DDB-SCHEMA-011 measured
- REQ-DDB-SCHEMA-012 measured
- REQ-DDB-SCHEMA-013 measured
- REQ-DDB-SCHEMA-014 measured
- REQ-DDB-SCHEMA-015 measured