Skip to content

refactor(cli): split read-view execution by owner (#2177) - #2206

Merged
Sinity merged 3 commits into
masterfrom
feature/refactor/contracts-own-surfaces-2177
Jun 20, 2026
Merged

Sinity merged 3 commits into
masterfrom
feature/refactor/contracts-own-surfaces-2177

Conversation

@Sinity

@Sinity Sinity commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

Refactors CLI read-view execution so the registry is no longer the view implementation dump: read-view option ownership is grouped by view family, concrete handlers live under polylogue/cli/read_views/, and read_view_handlers.py is reduced to profile/handler registry glue plus validation.

Problem

#2177 tracks cleanup where existing contracts should own behavior instead of being shadowed by parallel dispatch. The read-view surface had drifted in that direction: one ReadViewInvocation carried unrelated options for messages, raw, context, context-pack, recovery, neighbors, and correlation, while one large read_view_handlers.py module mixed registry validation, shared delivery helpers, query passthrough, and every concrete view implementation. That made each new view more likely to add another field or branch to the shared dispatcher.

Solution

  • Added typed option groups for message/raw, context, context-pack, recovery, neighbors, and correlation options.
  • Moved shared read-view contracts and delivery/query helpers to polylogue/cli/read_views/base.py.
  • Split concrete handlers into polylogue/cli/read_views/{standard,messages,context,recovery,neighbors,correlation,bulk}.py.
  • Kept polylogue/cli/read_view_handlers.py as the small executable registry that validates profile/handler drift and dispatches by view id.
  • Updated tests and operation/artifact metadata to reference the concrete handler owner modules rather than old private registry helpers.
  • Regenerated topology surfaces for the new package layout.

Verification

  • devtools test tests/unit/cli/test_query_verbs_runtime.py tests/unit/cli/test_continue_absorption.py tests/unit/cli/test_terminal_snapshots.py tests/unit/cli/test_neighbors_command.py -q -> 52 passed
  • devtools test tests/unit/cli/test_plain_cli_snapshots.py::test_json_status_snapshot -q -> 1 passed
  • devtools verify --quick -> exit_code 0
  • devtools verify --seed-testmon --skip-slow -> 11615 passed, exit_code 0; first run caught one status snapshot drift from fix(assertions): finish candidate judgment catalogs (#2182) #2205, fixed here and rerun green.

Ref #2177

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 14 minutes and 33 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a52f8dac-7d5b-4bc4-bc73-e591f1db4183

📥 Commits

Reviewing files that changed from the base of the PR and between 1fb8ace and f608aa1.

📒 Files selected for processing (18)
  • docs/plans/topology-target.yaml
  • docs/topology-status.md
  • polylogue/artifacts/runtime.py
  • polylogue/cli/query_verbs.py
  • polylogue/cli/read_view_handlers.py
  • polylogue/cli/read_views/__init__.py
  • polylogue/cli/read_views/base.py
  • polylogue/cli/read_views/bulk.py
  • polylogue/cli/read_views/context.py
  • polylogue/cli/read_views/correlation.py
  • polylogue/cli/read_views/messages.py
  • polylogue/cli/read_views/neighbors.py
  • polylogue/cli/read_views/recovery.py
  • polylogue/cli/read_views/standard.py
  • polylogue/operations/specs.py
  • tests/unit/cli/__snapshots__/test_plain_cli_snapshots.ambr
  • tests/unit/cli/test_neighbors_command.py
  • tests/unit/cli/test_query_verbs_runtime.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/refactor/contracts-own-surfaces-2177

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.

github-actions Bot pushed a commit that referenced this pull request Jun 20, 2026
@Sinity
Sinity merged commit 0c72e18 into master Jun 20, 2026
14 checks passed
@Sinity
Sinity deleted the feature/refactor/contracts-own-surfaces-2177 branch June 20, 2026 02:57
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