Skip to content

fix(tests): teach CLI parity adapter the typed search-result envelope - #1384

Merged
Sinity merged 1 commit into
masterfrom
fix/cli-parity-typed-envelope
May 19, 2026
Merged

Sinity merged 1 commit into
masterfrom
fix/cli-parity-typed-envelope

Conversation

@Sinity

@Sinity Sinity commented May 19, 2026

Copy link
Copy Markdown
Owner

Summary

PR #1370 (typed ranked-result envelope) changed polylogue list --format json for search-mode queries to emit {"hits": [...], "limit": N, "next_cursor": ...} rather than a bare JSON array. The CLI parity adapter at tests/infra/surfaces.py:307 still expected a bare array and asserted not isinstance(parsed, list), causing both test_search_unique_token_parity and test_search_shared_token_parity to fail on every search-mode case on master.

Solution

When the parsed CLI output is a dict carrying a hits array (the typed envelope shape), peel the hits and continue with the existing per-row id extraction. The list-mode and search-hit-mode shapes still work unchanged — they hit the same row loop directly.

Updated the inline doc to enumerate all three shapes the adapter now handles.

Verification

  • nix develop --command pytest tests/unit/storage/test_surface_parity_adapters.py -q → 10 passed (was 2 failures on master).
  • No production code touched; test-infra only.

Scope

Single-file, test-infra-only change. Should land before #1379 / #1380 / #1382 (or alongside) so those PRs' CI runs are unmasked by this pre-existing failure.

@coderabbitai

coderabbitai Bot commented May 19, 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 36 minutes and 16 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: 135f1760-178e-4925-8942-005f269bae20

📥 Commits

Reviewing files that changed from the base of the PR and between 8382b18 and 21ebcc9.

📒 Files selected for processing (1)
  • tests/infra/surfaces.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cli-parity-typed-envelope

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.

PR #1370 changed `polylogue list --format json` for search-mode
queries to emit a typed ranked-result envelope
(`{"hits": [...], "limit": N, "next_cursor": ...}`) rather than a
bare JSON array. The parity adapter at tests/infra/surfaces.py:307
still expected the bare array shape, causing
`test_search_unique_token_parity` and `test_search_shared_token_parity`
to fail on every search-mode case.

Fix: when the parsed CLI output is a dict carrying a `hits` array,
peel it and continue with the existing per-row id extraction. The
list-mode and search-hit-mode shapes still work unchanged (both go
through the same row loop).

Updates the docstring to enumerate all three shapes the adapter
now handles.

Verification:
- `nix develop --command pytest tests/unit/storage/test_surface_parity_adapters.py -q`
  → 10 passed (previously 2 failed).
- No production code touched; test-infra only.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@Sinity
Sinity force-pushed the fix/cli-parity-typed-envelope branch from c3e9741 to 21ebcc9 Compare May 19, 2026 16:21
@Sinity
Sinity merged commit 9743e00 into master May 19, 2026
4 checks passed
@Sinity
Sinity deleted the fix/cli-parity-typed-envelope branch May 19, 2026 16:25
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.

1 participant