test_the_fingerprint_tracks_the_source_tree¶
Tests › tests/test_freshness.py
What this test is for
Why it exists
Both halves matter. A fingerprint that never changes cannot detect drift; one that changes when nothing did makes the code axis fire permanently, which is the same failure as no signal at all.
Given
pkg = tmp_path / "pkg"pkg.mkdir()(pkg / "a.py").write_text("x = 1\n", encoding="utf-8")
When
before = fr.source_fingerprint(pkg)fr.source_fingerprint(pkg)(pkg / "a.py").write_text("x = 2\n", encoding="utf-8")
Then
- ✓ before holds
- ✓ fr.source_fingerprint(pkg) equals before
- ✓ fr.source_fingerprint(pkg) differs from before
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) · 1 of 142 steps
… 84 earlier steps
… 53 later steps
2 more
- Build, refresh and check the index · 1 of 153 steps
- `main` (scripts/stage_probe.py) · 1 of 37 steps
tests/test_freshness.py:401 · its file's page
What it checks (3)
assert before, "a readable tree must fingerprint"observessource_fingerprintviabeforeassert fr.source_fingerprint(pkg) == before, "an untouched tree must not drift"observessource_fingerprintassert fr.source_fingerprint(pkg) != before, "an edited file must move the fingerprint"observessource_fingerprint
Where the product reaches it
index→_index_action→build_or_refresh→code_identity→source_fingerprint(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 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-MCP-004 measured