Repository navigation
fix(tests): clear inherited test drift (#1180) - #1187
Conversation
Two unrelated test failures had accumulated on master and were inherited into every feature branch's verify run. Both are addressed here so the master baseline goes green again. Problem - tests/unit/cli/test_check.py::TestCheckCommandSupplementary 4 cases: `doctor --repair` raised `KeyError: 'message_embeddings'`. The `message_embeddings` maintenance target was added to polylogue/maintenance/targets.py in #1157 (typed planner contract) with `mode=REPAIR`, but no matching handler was registered in `_REPAIR_HANDLERS` in polylogue/storage/repair.py. The catalog still pushed `message_embeddings` through `run_safe_repairs`, which crashed. - tests/unit/mcp/test_tool_schema_witness.py::test_mcp_tool_catalog_matches_witness: the committed witness in tests/data/witnesses/mcp-tool-schemas.json still contained `cost_outlook` from before #1168 added the `cost_outlook` MCP tool. The catalog now has 64 tools (both cost_outlook and cost_rollups). Solution - Add `repair_message_embeddings()` as a no-op handler that records the embedding rebuild as dormant (#828): the embedding pipeline is daemon-owned and there is no synchronous rebuild path, so a `doctor --repair` invocation that touches this target should report dormancy rather than crash. - Regenerate tests/data/witnesses/mcp-tool-schemas.json from `build_server(role="admin")` so it matches the live tool registry. Verification - pytest tests/unit/cli/test_check.py::TestCheckCommandSupplementary \ tests/unit/mcp/test_tool_schema_witness.py => 25 passed (was 5 failing) - devtools verify --quick => exit_code: 0 Closes #1180
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Two unrelated test failures had accumulated on master and were inherited
into every feature branch's verify run. This PR clears both so the
master baseline goes green again. Closes #1180.
Problem
Reproduced on a clean
origin/mastercheckout:5 failures (4 + 1):
tests/unit/cli/test_check.py::TestCheckCommandSupplementary—test_json_output_with_repair,test_repair_with_no_issues_shows_message,test_vacuum_with_repair,test_json_output_with_repair_and_vacuum_is_machine_safeall raised
KeyError: 'message_embeddings'frompolylogue/storage/repair.py:run_safe_repairs. Themessage_embeddingsmaintenance target was added topolylogue/maintenance/targets.pyin feat(maintenance): typed planner contract (#1144) #1157 (typed planner contract)with
mode=REPAIR, but no matching entry was added to_REPAIR_HANDLERS.run_safe_repairsthen iterated every name fromSAFE_REPAIR_TARGETSand crashed on the missing key.tests/unit/mcp/test_tool_schema_witness.py::test_mcp_tool_catalog_matches_witnessfailed because the committed witness in
tests/data/witnesses/mcp-tool-schemas.jsonstill contained thepre-feat(cost): expose cycle outlook through CLI and MCP (#1138) #1168 catalog. PR feat(cost): expose cycle outlook through CLI and MCP (#1138) #1168 added
cost_outlookto the MCP server(
polylogue/mcp/server_insight_tools.py); the witness neededregeneration. The current registry exposes 64 tools — both
cost_outlookandcost_rollups.Solution
polylogue/storage/repair.py: addrepair_message_embeddings()as ano-op handler that records the embedding rebuild as dormant (feat(daemon): post-ingest embedding task — voyage-4 integration, cost tracking, status surface #828).
The embedding pipeline is daemon-owned and has no synchronous rebuild
path, so a
doctor --repairinvocation that touches this targetshould report dormancy rather than crash. The catalog continues to
list the target so planners and surfaces can name the dormant work.
tests/data/witnesses/mcp-tool-schemas.json: regenerate frombuild_server(role="admin")per the regeneration recipe in the testmodule docstring.
No production semantics changed: the embedding stub is the smallest
change that closes the crash without inventing a new rebuild contract
that #828 will eventually own.
Verification
Closes #1180