test_the_pre_rename_cost_key_is_still_read¶
Tests › tests/test_freshness.py
What this test is for
Why it exists
#470 renamed the persisted key `files_reprocessed` to `payloads_recomputed` because the old name named the wrong UNIT. An index built by an earlier version carries only the old key, and dropping to "unmeasured" there would discard a real measurement over a spelling.
Verifies REQ-DDB-MCP-004
Given
- —
When
clause = fr._cost_clause({"duration_ms": "1612", "files_reprocessed": "45"})
Then
- ✓ clause contains "1612 ms"
- ✓ clause contains "45 cached stage payload(s)"
- ✓ clause does not contain "file(s)"
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:264 · its file's page
What it checks (3)
assert "1612 ms" in clauseobserves_cost_clauseviaclauseassert "45 cached stage payload(s)" in clause, ( f"the legacy key must still be read, and reported under the CORRECTED label — the old " f"name was wrong about the unit, not about the number: {clause}" )observes_cost_clauseviaclauseassert "file(s)" not in clause, "the corrected label applies to legacy values too"observes_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 |