test_the_data_axis_quotes_the_measured_refresh_cost¶
Tests › tests/test_freshness.py
What this test is for
Why it exists
gh#9's whole argument in one assertion: an agent that cannot measure the correction must estimate it, and it estimates badly — Q7 and Q8 are the only two questions where the index arm scored BELOW reading source, and Q8 is the worst result in the matrix. The number must come from THIS target's history, so it is quoted from the persisted `refresh` block rather than from a constant.
Given
status = _status( source_changed_files=5, newest_changed_source="clew/mcp_server/tools_query.py", stale=True, refresh={"duration_ms": "3314", "payloads_recomputed": "70"}, )
When
message = _message(fr.notices(status, MATCHING_CODE), fr.AXIS_DATA)
Then
- ✓ message contains "5 indexed source file(s)"
- ✓ message contains "tools_query.py"
- ✓ message contains "3314 ms"
- ✓ message contains "70 cached stage payload(s)"
- ✓ message does not contain "70 file(s)"
- ✓ message.count("file(s)") equals 1
- ✓ message contains "index(action='refresh'"
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) · 9 of 142 steps
… 87 earlier steps
… 42 later steps
2 more
- Build, refresh and check the index · 9 of 153 steps
- `main` (scripts/stage_probe.py) · 9 of 37 steps
tests/test_freshness.py:192 · its file's page
What it checks (7)
assert "5 indexed source file(s)" in messageobserves_messageviamessageassert "tools_query.py" in message, "naming the newest changed file makes it checkable"observes_messageviamessageassert "3314 ms" in message, "the cost must be the measured one"observes_messageviamessageassert "70 cached stage payload(s)" in messageobserves_messageviamessageassert "70 file(s)" not in message, "the payload count must not be reported as a file count"observes_messageviamessageassert message.count("file(s)") == 1, ( f"exactly one file count belongs in this notice, the changed-source one; got: {message}" )observes_messageviamessageassert "index(action='refresh'" in message, "the action that clears this axis must be named"observes_messageviamessage
Where the product reaches it
index→_index_action→build_or_refresh→db_status→notices(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