Repository navigation
refactor(cli): split maintenance run/blob-integrity preview from apply - #3608
Conversation
|
Warning Review limit reached
Next review available in: 26 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?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 reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. 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, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
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 |
Problem: `maintenance run` fused --dry-run + resume + scope filters + target catalog into one verb, and the two blob-integrity mutation commands (blob-reference-replace-from-source, blob-reference-prune- orphans) fused apply/dry-run behind a --yes flag with diagnostic sample-limit options. Both repeat the same anti-pattern the maintenance group's own preview/plan/run naming already avoids elsewhere. What changed: split each fused command along the seam the group already established -- a preview-shaped read command with no --apply/--yes flag (the command type itself is read-only) and a lean apply command whose flags are only what execution needs. - `maintenance run` now always executes (no --dry-run); the identical dry-run replay path (including resumable per-target checkpointing) moved to a new `maintenance run-preview` command. Both share `_execute_and_render` in _run.py so the execute_replay call and output rendering stay byte-identical to the old fused behavior. - `blob-reference-replace-from-source` now always applies (--manifest- file required, no --yes); `blob-reference-replace-from-source-preview` is the new read-only twin (--manifest-file optional, writes a would-be manifest if given). - `blob-reference-prune-orphans` now always prunes (no --yes); `blob-reference-prune-orphans-preview` is the new read-only twin (drops --quarantine-file, which is meaningless without a mutation). Explicitly out of scope: _rebuild_index.py's own --plan fusion (separate tracked design) and _shared.py (owned by a parallel lane) are untouched. Verification: tests updated for the new command names/flags; devtools test + devtools verify --quick to follow.
devtools verify --quick's docs-coverage check flagged the two new blob-reference-*-preview commands as undocumented public surface (the apply-only counterparts were already covered by pre-existing baseline debt entries, but the new preview twins are new surface, not debt). Documented both pairs in docs/maintenance.md instead of adding them to docs/plans/docs-coverage-baseline.yaml.
9d2ffba to
2ea6475
Compare
test_source_laws.py: monkeypatch target renamed to detect_provider_from_raw_bytes_evidence; multi-session-zip fixture used chat_messages:[] which PR #3537's looks_like_ai tightening (pre-existing, unrelated to today) correctly refuses -- gave it real message shape. test_targets.py: PR #3608 split 'run --dry-run' into 'run'/'run-preview'; 3 call sites still used the removed --dry-run flag on 'run'. Co-Authored-By: Claude <[email protected]>
Summary
Splits three fused CLI verbs in
polylogue/cli/commands/maintenance/along the preview/apply seam the maintenance group already establishes elsewhere (preview/plan/run,archive-plan/archive-init): a read-only-previewcommand with no--apply/--yesflag at all, plus a lean apply command whose flags are only what execution needs.Problem
maintenance runfused--dry-run+ resume/operation-id + scope filters + target catalog into one verb, so a mutating and a non-mutating invocation were indistinguishable by command name alone.blob-reference-replace-from-sourceandblob-reference-prune-orphansfused apply/dry-run behind a--yesflag plus diagnostic sample-limit options, the same anti-pattern.Solution
polylogue/cli/commands/maintenance/_run.py:runnow always executes (no--dry-run). The shared body (execute_replaycall + output rendering) moved into a private_execute_and_renderhelper so behavior stays byte-identical.polylogue/cli/commands/maintenance/_run_preview.py(new):run-previewcalls the identical_execute_and_renderhelper withdry_run=Truefixed — same resumable per-target checkpointing as before, just no flag to forget.polylogue/cli/commands/maintenance/_blob_integrity.py:blob-reference-replace-from-sourcenow always applies (--manifest-filerequired, no--yes); newblob-reference-replace-from-source-previewis the read-only twin (--manifest-fileoptional, still writes a would-be manifest if given).blob-reference-prune-orphansnow always prunes (no--yes); newblob-reference-prune-orphans-previewdrops--quarantine-fileentirely since it's meaningless without a mutation.polylogue/cli/commands/maintenance/__init__.py: registers the two new preview commands.docs/maintenance.md: documentsrun-previewand the blob-reference preview/apply pairs.docs/plans/topology-target.yaml: regenerated for the new_run_preview.pymodule.Out of scope per the tracking mission:
_rebuild_index.py's own--planfusion (separate tracked design) and_shared.py(owned by a parallel lane) are untouched.Verification
devtools test tests/unit/cli/test_archive_maintenance_cli.py tests/unit/cli/test_maintenance_registration.py— 72 passed.devtools verify --quick— all 23 steps ok, includingverify docs-coverage(the new preview commands are documented, not baselined).devtools render all --check— no "out of sync" surfaces.Not run:
devtools verify --all(full non-integration suite) — left for CI / a follow-up pass if requested.