test_a_zero_duration_reads_as_measured_not_as_missing

Tests › tests/test_freshness.py

passed Passed in the packaged run.

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

  1. —
→

When

  1. clause = fr._cost_clause({"duration_ms": "0", "payloads_recomputed": "0"})
→

Then

  1. ✓ clause contains "0 ms"
  2. ✓ 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

thread startthread startthread startthread startclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.py_first_build_worker91–92. notices → _data_notice91_data_notice +1 more93. _cost_clause → _humanise_ms93_humanise_ms▶ test enters94. _cost_clause → _dominant_clause94_dominant_clause95–96. notices → _schema_notice95_schema_notice +1 more

… 46 later steps

2 more

tests/test_freshness.py:248 · its file's page

What it checks (2)

  1. assert "0 ms" in clause observes _cost_clause via clause
  2. assert "unmeasured" not in clause observes _cost_clause via clause

Where the product reaches it

  • index → _index_action → build_or_refresh → db_status → notices → _data_notice → _cost_clause (flow)

Call flow

test_a_zero_duration_reads_as_measured_not_as_missing→_cost_clause

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)

requirementlinked byimplementers exercised
REQ-DDB-MCP-004catalogunknown