Skip to content

fix(tests): clear inherited test drift (#1180) - #1187

Merged
Sinity merged 1 commit into
masterfrom
feature/fix/test-master-drift-1180
May 17, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/fix/test-master-drift-1180

Conversation

@Sinity

@Sinity Sinity commented May 17, 2026

Copy link
Copy Markdown
Owner

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/master checkout:

pytest tests/unit/cli/test_check.py::TestCheckCommandSupplementary \
       tests/unit/mcp/test_tool_schema_witness.py

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_safe
    all raised KeyError: 'message_embeddings' from
    polylogue/storage/repair.py:run_safe_repairs. The
    message_embeddings maintenance target was added to
    polylogue/maintenance/targets.py in feat(maintenance): typed planner contract (#1144) #1157 (typed planner contract)
    with mode=REPAIR, but no matching entry was added to
    _REPAIR_HANDLERS. run_safe_repairs then iterated every name from
    SAFE_REPAIR_TARGETS and crashed on the missing key.

  • tests/unit/mcp/test_tool_schema_witness.py::test_mcp_tool_catalog_matches_witness
    failed because the committed witness in
    tests/data/witnesses/mcp-tool-schemas.json still contained the
    pre-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_outlook to the MCP server
    (polylogue/mcp/server_insight_tools.py); the witness needed
    regeneration. The current registry exposes 64 tools — both
    cost_outlook and cost_rollups.

Solution

  • polylogue/storage/repair.py: add repair_message_embeddings() as a
    no-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 --repair invocation that touches this target
    should 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 from
    build_server(role="admin") per the regeneration recipe in the test
    module 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

pytest tests/unit/cli/test_check.py::TestCheckCommandSupplementary \
       tests/unit/mcp/test_tool_schema_witness.py
# => 25 passed in 10.59s (was 5 failed, 20 passed)

devtools verify --quick
# => "exit_code": 0

Closes #1180

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
@coderabbitai

coderabbitai Bot commented May 17, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 44 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7a2de2fe-23ef-44b1-bf95-3eeff9fe10e0

📥 Commits

Reviewing files that changed from the base of the PR and between 664502a and 7c2ee54.

📒 Files selected for processing (2)
  • polylogue/storage/repair.py
  • tests/data/witnesses/mcp-tool-schemas.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix/test-master-drift-1180

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity merged commit c3f3d82 into master May 17, 2026
4 checks passed
@Sinity
Sinity deleted the feature/fix/test-master-drift-1180 branch May 17, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: master drift — doctor --repair, message_embeddings, MCP cost_outlook

1 participant