Repository navigation
refactor(cli): move setup and UI commands to owners - #2255
Conversation
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
|
Warning Review limit reached
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 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (34)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 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)) |
There was a problem hiding this comment.
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 👍 / 👎.
| if output_format == "json": | ||
| click.echo(_json.dumps(outlook.model_dump(mode="json"), indent=2, default=str)) | ||
| return | ||
| render_outlook_plain(env, outlook) |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Moves several misplaced
polylogue opssurfaces to their actual owners and refreshes README/docs around the current command model. Cost outlook is now ananalyzemode, shell completions and archive paths live underconfig, dashboard and tutorial are deliberate root surfaces, and the README no longer carries the oversized architecture diagram.Problem
polylogue opshad 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
ops cost outlooktofind QUERY then analyze --cost-outlook, preserving plan and projection-method behavior through a shared cost renderer.config completionsand archive path discovery toconfig paths.dashboardandtutorialout ofopsas explicit root UI/onboarding surfaces.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 whetherdemo/tutorialshould 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 passeddevtools 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 deselecteddevtools 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 deselecteddevtools 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 deselecteddevtools 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 deselecteddevtools verify doc-commands→ 76 doc files scanned, no stale commandspython -m devtools.render_docs_surface --check→ sync OKgit diff --check README.md→ cleandevtools verify --quick→ exit_code 0, run_id20260621T002618Z-quick-321582-e2106105