passed Passed in the packaged run.
What this test is for Why it exists
gh#9. An agent asked what refreshing cost had no way to find out — `build_or_refresh` returned no timing at all — so it had to estimate, and Q7 mark 7 and Q8 mark 5 missed 9 of 9 cells across every model tier. Q8 is the worst result in the whole matrix, and the losses were LARGEST for the strongest models: a capable model reasons confidently from whatever it is given.
Verifies REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009
Given
_mcp, state = serverrepo = tmp_path / "repo"6 more repo.mkdir()target = state.registry.register(str(repo))state.active = targetPath(target.db_path).write_bytes(rich_db.read_bytes())monkeypatch.setattr( state, "_run_build", lambda *_a, **_k: pytest.fail("a current db must not rebuild") )result = await state.build_or_refresh(_FakeCtx())→ → Then
✓ result["built"] is False✓ isinstance(result["duration_ms"], int) holds✓ result["duration_ms"] is at least 0What 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.
… 2 earlier steps
callercaller callercaller clew/mcp_server/server.pyclew/mcp_server/server.py clew/mcp_server/server.pyclew/mcp_server/server.py opt (line 3019) opt try (line 2509) try opt (line 2603) opt index 3–4. _index_action → status 3 status +1 more 5. build_or_refresh → _build_subject 5 _build_subject ▶ test enters 6. _build_subject → ensure_target 6 ensure_target 7–8. ensure_target → _target_from_roots 7 _target_from_roots +1 more … 9 steps between
callercaller callercaller caller clew/mcp_server/server.pyclew/mcp_server/server.py clew/mcp_server/server.pyclew/mcp_server/server.py clew/mcp_server/server.py clew/mcp_server/state.pyclew/mcp_server/state.py clew/mcp_server/state.pyclew/mcp_server/state.py clew/mcp_server/state.py clew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.js clew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.js clew/wiki/themes/clew/static/web.js clew/mcp_server/routing.pyclew/mcp_server/routing.py clew/mcp_server/routing.pyclew/mcp_server/routing.py clew/mcp_server/routing.py clew/mcp_server/freshness.pyclew/mcp_server/freshness.py clew/mcp_server/freshness.pyclew/mcp_server/freshness.py clew/mcp_server/freshness.py other filesother files other filesother files other files opt (line 352) opt opt (line 169) opt loop (line 169) loop opt (line 171) opt opt (line 172) opt loop (line 662) loop catch (line 562) catch index 18. repo_indexes → target_for 18 target_for 19. target_for → _safe_index_name 19 _safe_index_name 20. target_for → state_home 20 state_home ▶ test enters 21. repo_indexes → target_for 21 target_for 22. adopt → target_for 22 target_for 23–24. adopt → _sync_tier1 23 _sync_tier1 +1 more 25–29. register_query_tools → _add_tool 25 _add_tool +4 more 30. _answering_with_refresh → refused 30 refused 31. _answering_with_refresh → _take_context 31 _take_context 32. _take_context → list 32 list 33. register_query_tools → list 33 list 34. adopt → db_status 34 db_status 35–36. db_status → _options_meta 35 _options_meta +1 more 37. _meta_section → meta_section 37 meta_section 38. db_status → stated_options 38 stated_options 39. db_status → read_build_signature 39 read_build_signature 40–48. db_status → _source_drift 40 _source_drift +8 more 49. db_status → list 49 list 50–53. db_status → _diagnostics_meta 50 _diagnostics_meta +3 more 54. db_status → code_identity 54 code_identity 55–57. code_identity → source_fingerprint 55 source_fingerprint +2 more 58. db_status → notices 58 notices 59–60. notices → code_identity 59 code_identity +1 more 61–63. _data_notice → _cost_clause 61 _cost_clause +2 more 64–67. notices → _schema_notice 64 _schema_notice +3 more 68–69. _build_subject → resolve_target 68 resolve_target +1 more … 62 steps between
callercaller callercaller clew/mcp_server/server.pyclew/mcp_server/server.py clew/mcp_server/server.pyclew/mcp_server/server.py clew/mcp_server/state.pyclew/mcp_server/state.py clew/mcp_server/state.pyclew/mcp_server/state.py clew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.js clew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.js clew/mcp_server/freshness.pyclew/mcp_server/freshness.py clew/mcp_server/freshness.pyclew/mcp_server/freshness.py clew/scope.pyclew/scope.py clew/scope.pyclew/scope.py opt (line 2549) opt opt (line 2553) opt opt (line 3032) opt index 132. _offered_sub_indexes → derive_sub_indexes 132 derive_sub_indexes 133. _offered_sub_indexes → list 133 list 134. build_or_refresh → code_identity 134 code_identity ▶ test enters 135. build_or_refresh → stale_code_refusal 135 stale_code_refusal 136. stale_code_refusal → code_identity 136 code_identity 137–138. build_or_refresh → _build_lock 137 _build_lock +1 more 139. _build_once → db_status 139 db_status 140. build_or_refresh → adopt 140 adopt 141–142. build_or_refresh → _activate_tier1 141 _activate_tier1 +1 more 143. build_or_refresh → db_status 143 db_status 144–145. _index_action → read_comments 144 read_comments +1 more … 8 later steps
5 more tests/test_mcp_server.py:779 · its file's page
What it checks (3) assert result["built"] is False not attributed assert isinstance(result["duration_ms"], int) not attributed assert result["duration_ms"] >= 0 not attributed 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 (3) Also reaches 11 requirements Its run touches their code; that is reach, not proof.