test_the_source_fingerprint_ignores_mtime_and_tracks_content¶
Tests › tests/test_freshness.py
What this test is for
Why it exists
THE CODE AXIS IS A HARD REFUSAL, so a false positive on it is expensive.
Given
pkg = tmp_path / "pkg"pkg.mkdir()
2 more
(pkg / "a.py").write_text("x = 1\n", encoding="utf-8")(pkg / "b.py").write_text("y = 2\n", encoding="utf-8")
When
before = fr.source_fingerprint(pkg)os.utime(pkg / "a.py", ns=(10**18, 10**18))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:848 · its file's page
What it checks (3)
assert before, "a package with .py files must fingerprint to something"observessource_fingerprintviabeforeassert fr.source_fingerprint(pkg) == before, ( "a touch with identical content moved the fingerprint, so the code axis fires on " "every git checkout and branch switch and disables auto-refresh with no edit at all" )observessource_fingerprintassert fr.source_fingerprint(pkg) != before, ( "a real content edit did NOT move the fingerprint — the axis can no longer detect " "the stale process it exists to catch, which is worse than firing too often" )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