Skip to content

refactor(cli): move setup and UI commands to owners - #2255

Merged
Sinity merged 6 commits into
masterfrom
feature/refactor/ops-product-command-placement-2253
Jun 21, 2026
Merged

Sinity merged 6 commits into
masterfrom
feature/refactor/ops-product-command-placement-2253

Conversation

@Sinity

@Sinity Sinity commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

Moves several misplaced polylogue ops surfaces to their actual owners and refreshes README/docs around the current command model. Cost outlook is now an analyze mode, shell completions and archive paths live under config, dashboard and tutorial are deliberate root surfaces, and the README no longer carries the oversized architecture diagram.

Problem

polylogue ops had become a hiding place for commands that were not operational archive/runtime maintenance: cost analysis, first-run tutorial, shell completion setup, archive path discovery, and dashboard launch. That made the root surface look cleaner while leaving the product model semantically muddy. README examples also still taught older query forms and carried a large diagram that dominated the first screen without helping command discovery.

Solution

  • Move cost outlook from ops cost outlook to find QUERY then analyze --cost-outlook, preserving plan and projection-method behavior through a shared cost renderer.
  • Move shell completion generation to config completions and archive path discovery to config paths.
  • Move dashboard and tutorial out of ops as explicit root UI/onboarding surfaces.
  • Remove the giant README architecture diagram and replace it with compact text describing archive tiers and product rings.
  • Regenerate CLI docs/topology/generated references and retarget behavior tests to the retained paths.

No hidden aliases or absence-memorial tests are added. #2253 remains open for the harder remaining decisions around ops insights, ops state, ops schema, and whether demo/tutorial should stay product-visible.

Ref #2253

Verification

  • devtools test tests/unit/cli/test_cost_outlook_cli.py tests/unit/cli/test_query_verbs_runtime.py::test_read_all_and_analyze_count_update_parent_request tests/unit/cli/test_query_verbs_runtime.py::test_analyze_verb_toggles_stats_only_and_updates_grouping tests/unit/cli/test_verb_cardinality.py::TestAnalyzeVerbNoBcardinality -q → 12 passed
  • devtools test tests/unit/cli/test_tutorial.py tests/unit/cli/test_stdout_stderr_split.py::TestHelpExitCodeAndContent tests/unit/cli/test_deterministic_output.py tests/unit/cli/test_json_output.py -k 'tutorial or help or root_json' -q → 86 passed, 124 deselected
  • devtools test tests/unit/cli/test_config_command.py tests/unit/cli/test_cli_action_contracts.py tests/unit/cli/test_completions_contract.py tests/unit/cli/test_completion_matrix.py tests/unit/cli/test_stdout_stderr_split.py::TestHelpExitCodeAndContent tests/unit/cli/test_deterministic_output.py tests/unit/cli/test_json_output.py -k 'config or completion or completions or help' -q → 206 passed, 139 deselected
  • devtools test tests/unit/cli/test_click_app.py::TestDashboardCommand tests/unit/cli/test_click_app.py::TestCompletionsCommand tests/unit/cli/test_stdout_stderr_split.py::TestHelpExitCodeAndContent tests/unit/cli/test_deterministic_output.py tests/unit/cli/test_json_output.py -k 'dashboard or completion or completions or help' -q → 87 passed, 122 deselected
  • devtools test tests/unit/cli/test_config_command.py tests/unit/cli/test_stdout_stderr_split.py::TestHelpExitCodeAndContent tests/unit/cli/test_deterministic_output.py tests/unit/cli/test_json_output.py -k 'config or paths or help' -q → 89 passed, 121 deselected
  • devtools verify doc-commands → 76 doc files scanned, no stale commands
  • python -m devtools.render_docs_surface --check → sync OK
  • git diff --check README.md → clean
  • devtools verify --quick → exit_code 0, run_id 20260621T002618Z-quick-321582-e2106105

Sinity added 6 commits June 21, 2026 01:52
Problem: Shell completion installation is setup/configuration work, not an operational archive action, and keeping it under ops turns ops into a miscellaneous command bucket.\n\nWhat changed: Config is now a Click group that preserves bare polylogue config output while owning polylogue config completions. The old ops completions help baseline was removed, completion docs were regenerated, and tests now exercise the config-owned surface.\n\nVerification: devtools test tests/unit/cli/test_config_command.py tests/unit/cli/test_cli_action_contracts.py tests/unit/cli/test_completions_contract.py tests/unit/cli/test_completion_matrix.py tests/unit/cli/test_stdout_stderr_split.py::TestHelpExitCodeAndContent tests/unit/cli/test_deterministic_output.py tests/unit/cli/test_json_output.py -k 'config or completion or completions or help' -q; devtools render pages && devtools verify --quick
Problem: The README carried a large architecture SVG and stale command examples that made the public surface look heavier and less current than the actual query/config shape.\n\nWhat changed: Removed the architecture image and media-regeneration reference, replaced it with compact text about the four rings and archive tiers, and updated examples toward explicit find/then query flows plus config-owned shell completions.\n\nVerification: devtools verify doc-commands; python -m devtools.render_docs_surface --check; git diff --check README.md
Problem: The dashboard is a TUI/read surface, not archive or daemon operations. Keeping it under ops made ops a junk drawer and obscured the actual product surface.\n\nWhat changed: Registered dashboard as a root command, updated tutorial copy and generated help docs, removed the stale ops-dashboard baseline, and retargeted existing dashboard launch tests to prove the TUI still constructs with the archive facade.\n\nVerification: devtools test tests/unit/cli/test_click_app.py::TestDashboardCommand tests/unit/cli/test_click_app.py::TestCompletionsCommand tests/unit/cli/test_stdout_stderr_split.py::TestHelpExitCodeAndContent tests/unit/cli/test_deterministic_output.py tests/unit/cli/test_json_output.py -k 'dashboard or completion or completions or help' -q; devtools render pages && devtools verify --quick
Problem: Archive path reporting describes configuration and filesystem resolution, not operational maintenance. Keeping it under ops made the ops namespace carry setup introspection.\n\nWhat changed: Nested the existing paths command under config, removed it from ops, updated README/configuration/internals references, regenerated CLI and quality docs plus AGENTS, and removed the stale ops-paths help baseline.\n\nVerification: devtools test tests/unit/cli/test_config_command.py tests/unit/cli/test_stdout_stderr_split.py::TestHelpExitCodeAndContent tests/unit/cli/test_deterministic_output.py tests/unit/cli/test_json_output.py -k 'config or paths or help' -q; devtools render pages && devtools render agents --input CLAUDE.md --output AGENTS.md && devtools verify --quick
@coderabbitai

coderabbitai Bot commented Jun 21, 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 7 minutes and 3 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: eeccf7c7-5ba7-4914-869d-67fe0c326712

📥 Commits

Reviewing files that changed from the base of the PR and between e6032ac and e82bef3.

📒 Files selected for processing (34)
  • AGENTS.md
  • README.md
  • devtools/render_cli_reference.py
  • docs/cli-reference.md
  • docs/configuration.md
  • docs/cost-model.md
  • docs/design/whole-product.md
  • docs/getting-started.md
  • docs/internals.md
  • docs/plans/topology-target.yaml
  • docs/test-quality-workflows.md
  • polylogue/cli/click_command_registration.py
  • polylogue/cli/commands/completions.py
  • polylogue/cli/commands/config.py
  • polylogue/cli/commands/cost.py
  • polylogue/cli/commands/tutorial.py
  • polylogue/cli/query_verbs.py
  • polylogue/cli/shared/cost_rendering.py
  • tests/baselines/showcase/help-ops-completions.txt
  • tests/baselines/showcase/help-ops-cost-outlook.txt
  • tests/baselines/showcase/help-ops-cost.txt
  • tests/baselines/showcase/help-ops-dashboard.txt
  • tests/baselines/showcase/help-ops-paths.txt
  • tests/baselines/showcase/help-ops-tutorial.txt
  • tests/unit/cli/test_click_app.py
  • tests/unit/cli/test_completion_matrix.py
  • tests/unit/cli/test_completions_contract.py
  • tests/unit/cli/test_cost_outlook_cli.py
  • tests/unit/cli/test_deterministic_output.py
  • tests/unit/cli/test_json_output.py
  • tests/unit/cli/test_query_verbs_runtime.py
  • tests/unit/cli/test_stdout_stderr_split.py
  • tests/unit/cli/test_tutorial.py
  • tests/unit/cli/test_verb_cardinality.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/refactor/ops-product-command-placement-2253

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 21, 2026
@Sinity
Sinity merged commit b65833c into master Jun 21, 2026
14 checks passed
@Sinity
Sinity deleted the feature/refactor/ops-product-command-placement-2253 branch June 21, 2026 00:29

@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: e82bef3efe

ℹ️ 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".

raise click.UsageError("`analyze --cost-outlook` requires --plan.")
projection_method = ProjectionMethod(method)
try:
outlook = run_coroutine_sync(env.polylogue.cost_outlook(plan_name, method=projection_method))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Apply query filters to cost outlook

When --cost-outlook is invoked through a scoped query (for example polylogue --origin chatgpt find repo:x then analyze --cost-outlook --plan claude-pro), the command has already built the parent request but this call ignores it and asks Polylogue.cost_outlook(plan, method=...) for the archive-wide outlook. Since that API has no query/session scope argument and reads all session-cost insights, the CLI exits successfully with unscoped numbers while the analyze verb implies analysis of the matched result set; either reject scoped invocations or thread the matched scope into the outlook calculation.

Useful? React with 👍 / 👎.

Comment on lines +1014 to +1017
if output_format == "json":
click.echo(_json.dumps(outlook.model_dump(mode="json"), indent=2, default=str))
return
render_outlook_plain(env, outlook)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject unsupported cost outlook formats

Because --cost-outlook reuses analyze's broad --format choice list, invocations such as polylogue analyze --cost-outlook --plan claude-pro --format csv or --format yaml now exit 0 but fall through to the human renderer. The old cost surface only accepted plain/json, so machine callers can now receive non-CSV/non-YAML text for a format they explicitly requested; please fail fast for formats other than JSON and the intended plain/plaintext mode, or implement those renderers.

Useful? React with 👍 / 👎.

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