test_the_edited_files_code_text_is_current¶
Tests › tests/test_fast_tier.py
What this test is for
Why it exists
PHASE 6. `search(corpus='code')` over an edited body must find the new text and not the old: the contentless corpus cannot delete by query, so the fast tier deletes each old row with the exact text the full stage indexed (from the cache) and inserts the new.
Given
repo, out = _indexed(tmp_path)(repo / "src" / "widget.ts").write_text(_SOURCE.replace("id.length", "id.zebraquotient"))
2 more
_build(repo, out, tier="fast")fast = _fast(out)
When
with sqlite3.connect(out) as conn: new_hits = search_code(conn, "zebraquotient", 10, repo) old_hits = search_code(conn, "length", 10, repo)
Then
- ✓ fast.get("pending") equals "1"
- ✓ fast.get("layers", "").split(",") does not contain "code_text"
- ✓ [h.name for h in new_hits or []] equals ["fetchWidget"]
- ✓ old_hits is false
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) · 42 of 400 steps
… 10 earlier steps
… 26 steps between
… 23 steps between
… 57 steps between
… 27 steps between
… 102 steps between
… 77 later steps
7 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 27 of 142 steps
- Build, refresh and check the index · 21 of 153 steps
- `main` (clew/guard/main.py) · 19 of 357 steps
- `main` (scripts/export_parity.py) · 7 of 203 steps
- Build this wiki from the index · 6 of 400 steps
- clew-mcp — `main` (clew/mcp_server/server.py) · 1 of 17 steps
- `main` (scripts/incremental_probe.py) · 1 of 3 steps
tests/test_fast_tier.py:254 · its file's page
What it checks (4)
assert fast.get("pending") == "1"observes_fastviafastassert "code_text" not in fast.get("layers", "").split(",")observes_fastviafastassert [h.name for h in new_hits or []] == ["fetchWidget"]observessearch_codevianew_hitsassert not old_hits, "the pre-edit body is still searchable"observessearch_codeviaold_hits
Where the product reaches it
main→query_main→_payload→export_search→corpus_payload→_code_corpus→search_code(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.
and 42 more requirement paths, listed below.
Also reaches 57 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CLI-001 measured
- REQ-DDB-CLI-002 inferred
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-003 inferred
- 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-GUARD-012 inferred
- REQ-DDB-GUARD-019 measured
- REQ-DDB-GUARD-020 measured
- REQ-DDB-GUARD-024 measured
- REQ-DDB-GUARD-025 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 inferred
- 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
- REQ-DDB-WIKI-054 inferred