test_the_data_axis_quotes_the_measured_refresh_cost

Tests › tests/test_freshness.py

passed Passed in the packaged run.

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

  1. 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

  1. message = _message(fr.notices(status, MATCHING_CODE), fr.AXIS_DATA)
→

Then

  1. ✓ message contains "5 indexed source file(s)"
  2. ✓ message contains "tools_query.py"
  3. ✓ message contains "3314 ms"
  4. ✓ message contains "70 cached stage payload(s)"
  5. ✓ message does not contain "70 file(s)"
  6. ✓ message.count("file(s)") equals 1
  7. ✓ 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

thread startthread startthread startthread startclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pytry (line 3260)try_first_build_worker88. code_identity → package_version88package_version89. db_status → notices89notices90. notices → code_identity90code_identity▶ test enters91–98. notices → _data_notice91_data_notice +7 more99. _run_build_walked → declared_scope_rejection99declared_scope_rejection100. declared_scope_rejection → _declared_index_scope100_declared_index_scope

… 42 later steps

2 more

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

What it checks (7)

  1. assert "5 indexed source file(s)" in message observes _message via message
  2. assert "tools_query.py" in message, "naming the newest changed file makes it checkable" observes _message via message
  3. assert "3314 ms" in message, "the cost must be the measured one" observes _message via message
  4. assert "70 cached stage payload(s)" in message observes _message via message
  5. assert "70 file(s)" not in message, "the payload count must not be reported as a file count" observes _message via message
  6. assert message.count("file(s)") == 1, ( f"exactly one file count belongs in this notice, the changed-source one; got: {message}" ) observes _message via message
  7. assert "index(action='refresh'" in message, "the action that clears this axis must be named" observes _message via message

Where the product reaches it

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

Call flow

test_the_data_axis_quotes_the_measured_refresh_cost→_status→_message→notices

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.

test_the_data_axis_quotes_the_measured_refresh_cost · 7 checksnoticesREQ-DDB-MCP-004 · measured
Also reaches 1 requirement

Its run touches their code; that is reach, not proof.