test_a_zero_duration_reads_as_measured_not_as_missing¶
Tests › tests/test_freshness.py
What this test is for
Why it exists
A fully cached rebuild legitimately costs ~0 ms and reprocesses 0 files. The persisted value is the STRING "0" precisely so it survives the falsy-drop rule, and the phrasing layer must not undo that by treating it as absent.
Verifies REQ-DDB-MCP-004
Given
- —
When
clause = fr._cost_clause({"duration_ms": "0", "payloads_recomputed": "0"})
Then
- ✓ clause contains "0 ms"
- ✓ clause does not contain "unmeasured"
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) · 2 of 142 steps
… 90 earlier steps
… 46 later steps
2 more
- Build, refresh and check the index · 2 of 153 steps
- `main` (scripts/stage_probe.py) · 2 of 37 steps
tests/test_freshness.py:248 · its file's page
What it checks (2)
assert "0 ms" in clauseobserves_cost_clauseviaclauseassert "unmeasured" not in clauseobserves_cost_clauseviaclause
Where the product reaches it
index→_index_action→build_or_refresh→db_status→notices→_data_notice→_cost_clause(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.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-MCP-004 | catalog | unknown |