Skip to content

feat(cli): expose read view profiles (#1997) - #2022

Merged
Sinity merged 2 commits into
masterfrom
feature/feat/read-view-profile-command-1997
Jun 17, 2026
Merged

Sinity merged 2 commits into
masterfrom
feature/feat/read-view-profile-command-1997

Conversation

@Sinity

@Sinity Sinity commented Jun 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

Expose the shared SessionViewProfile registry through a root polylogue read-views command with plain and JSON output.

Problem

#1997 needs read-view profiles to be inspectable by callers, not only consumed internally by read --view and shell completion. Without a profile listing surface, API/web/MCP work still has to rediscover view metadata from code.

Solution

  • Add polylogue read-views over the existing READ_VIEW_PROFILES registry.
  • Support compact plain output and machine-envelope JSON output.
  • Register the command at the root CLI.
  • Add tests for plain output, JSON payload shape, and root command registration.
  • Refresh generated CLI/topology docs and showcase help baselines.

Verification

  • nix develop --command devtools test tests/unit/cli/test_click_app.py -k 'read_views or all_subcommands_registered' -> 3 passed, 62 deselected
  • nix develop --command devtools lab-scenario verify-baselines -> All baselines match
  • nix develop --command devtools verify --quick -> exit_code 0
  • pre-push devtools verify --quick -> exit_code 0

Ref #1997

Problem: #1997 needs view profiles to be inspectable by callers, not only consumed internally by read --view and shell completion. Without a profile listing surface, API/web/MCP work still has to rediscover the metadata from code.

What changed: add polylogue read-views with plain and JSON output over the shared SessionViewProfile registry, register it as a root command, test both output forms and root registration, and refresh generated CLI/topology docs.

Verification: nix develop --command devtools test tests/unit/cli/test_click_app.py -k 'read_views or all_subcommands_registered' (3 passed, 62 deselected); nix develop --command devtools verify --quick (exit_code 0).
@coderabbitai

coderabbitai Bot commented Jun 17, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

A new read-views CLI subcommand is added to the polylogue root Click group. The command lists executable read-view profile metadata in either plain text or JSON format. Registration metadata, CLI reference docs, topology target/status YAML, and test quality workflow counts are all updated to reflect the new module.

Changes

read-views CLI subcommand

Layer / File(s) Summary
read-views command implementation and registration
polylogue/cli/commands/read_views.py, polylogue/cli/click_command_registration.py
New read_views_command iterates READ_VIEW_PROFILES and emits plain text (lossiness, evidence policy, formats, purpose, successor handoff) or a JSON success payload. _SHORT_HELP and ROOT_COMMANDS in the registration module are extended to wire it onto the root group.
CLI routing tests
tests/unit/cli/test_click_app.py
Two new tests cover plain and JSON output modes; the existing subcommand-registration assertion is updated to include read-views.
Generated docs and topology artifact updates
docs/cli-reference.md, docs/plans/topology-target.yaml, docs/test-quality-workflows.md, docs/topology-status.md
CLI reference adds the read-views entry; topology target YAML adds read_views.py with loc: 57 and adjusts LOC counts for two other files; test quality workflow increments projection counts and adds help-read-views; topology status increments Stable and total declared counts.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Sinity/polylogue#968: Both PRs extend ROOT_COMMANDS in polylogue/cli/click_command_registration.py to register a new root subcommand.
  • Sinity/polylogue#2015: Both PRs add entries to _SHORT_HELP/ROOT_COMMANDS and update the test_all_subcommands_registered assertion in tests/unit/cli/test_click_app.py.
  • Sinity/polylogue#1885: Both PRs modify CLI routing test expectations in tests/unit/cli/test_click_app.py to account for newly registered subcommands.

Poem

🐇 A new little command has hopped into view,
read-views now lists every profile it knew!
With plain text or JSON, the rabbit declared,
"All read-view profiles shall finally be shared!"
✨ The topology counts tick upward with glee —
one more stable module for all to foresee! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(cli): expose read view profiles (#1997)' clearly and specifically summarizes the main change—adding a CLI command to expose read-view profiles.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description follows the template with complete Summary, Problem, Solution, and Verification sections, clearly documenting the new read-views command and all supporting changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/feat/read-view-profile-command-1997

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 commented Jun 17, 2026

Copy link
Copy Markdown
Owner Author

@codex review

github-actions Bot pushed a commit that referenced this pull request Jun 17, 2026
Problem: CI showcase-verify caught the new read-views command as committed baseline drift. The PR added root command help, but did not commit the tier-0 showcase snapshots.

What changed: update help-main and add help-read-views through devtools lab-scenario verify-baselines --update.

Verification: nix develop --command devtools lab-scenario verify-baselines (All baselines match); nix develop --command devtools test tests/unit/cli/test_click_app.py -k 'read_views or all_subcommands_registered' (3 passed, 62 deselected); nix develop --command devtools verify --quick (exit_code 0).
@Sinity

Sinity commented Jun 17, 2026

Copy link
Copy Markdown
Owner Author

@codex review latest commit 5e11992 as well

@Sinity
Sinity merged commit 837af0a into master Jun 17, 2026
14 checks passed
@Sinity
Sinity deleted the feature/feat/read-view-profile-command-1997 branch June 17, 2026 04:01

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e119920a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/baselines/showcase/help-main.txt Resolved
@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

Only the rows listed above are dispositioned. Held findings remain open.

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