refactor(raw-authority): remove legacy reset facade - #3922
Conversation
Problem: the guarded recovery CLI was the production consent surface, but a caller-less Python facade retained an undocumented direct reset entry point.\n\nWhat changed: delete the compatibility facade and keep its temporary SQLite safety tests on the recovery implementation. The CLI route test explicitly models a clean signed build so it reaches exact plan identity validation.
|
Warning Review limit reached
Next review available in: 39 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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 (1)
📝 WalkthroughWalkthroughThe legacy ChangesRaw authority recovery migration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/unit/maintenance/test_raw_authority_reset.py`:
- Around line 969-974: Update test_index_prune_requires_index_backup to capture
the active and archive SQLite index state after seeding and before
apply_raw_authority_recovery(plan), then assert both states are unchanged after
the expected RawAuthorityRecoveryError. Reuse the existing state-inspection
helpers and preserve the current rejection assertion.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 330bcbd8-aea3-4771-b7ea-b2d8d8086ee7
📒 Files selected for processing (3)
polylogue/maintenance/raw_authority_reset.pytests/unit/cli/test_archive_maintenance_cli.pytests/unit/maintenance/test_raw_authority_reset.py
💤 Files with no reviewable changes (1)
- polylogue/maintenance/raw_authority_reset.py
Problem: the backup-authority refusal test observed only the exception, so it did not prove the rejection preserved either seeded index copy. What changed: snapshot the active generation and archive index bytes before the real recovery call and assert both remain unchanged after the expected refusal.
|
@coderabbitai review |
|
## Summary
Restore the guarded acceptance-contract snapshot for the 216 safely
reconciled Beads records and record the closure of the three
implementation lanes whose reviewed PRs are already merged.
## Problem
The merged repository contained the acceptance-contract tooling and
historical contract wave, but the current `.beads/issues.jsonl` snapshot
had lost nearly all structured contracts after a stale export. Three
implementation Beads also remained in progress after their exact-head
PRs merged.
## Solution
- Reconciled the historical contract snapshot against the current issue
population with the guarded repository reconciler.
- Imported 216 exact/timestamp-safe contract rows and adjudicated the
two drifted manifest rows (`4n8k` and `fbkr`) separately; the latter now
carries a fresh contract bound to its current closed record.
- Closed `fbkr`, `q4qpl`, and `6k0na` only for their implementation/test
scope, retaining live-operation successors and residual production work.
- Preserved the two operator-action rows without invented implementation
contracts.
## Verification
- Guarded reconciliation: 216 rows applied; two drifted rows separately
adjudicated.
- Structured contract population: 218 records present after import.
- `devtools lab policy bead-graph`: no cycles, no invalid contracts, and
no missing required contracts; two deferred operator-action rows remain
intentionally without AC (`av2g`, `n2f4`).
- Merged implementation evidence is recorded in the three closed Beads
and the exact PR carriers below.
<!-- polylogue-pr-scope:v1
{
"assigned_beads": [
"polylogue-fbkr",
"polylogue-q4qpl",
"polylogue-6k0na"
],
"beads_digest":
"1dba3dcb4de072e61123ac05863732ba9c05715f586651ec3ea69039db26beaf",
"dispositions": [
{
"bead_id": "polylogue-fbkr",
"disposition": "partial",
"evidence": [
{"kind": "commit", "ref": "d8ba0e3a9da6 merged PR #3922"},
{"kind": "test", "ref": "raw-authority frontier focused tests and quick
gate passed"},
{"kind": "review", "ref": "late mutation-preservation assertion repaired
and independently checked"}
],
"successors": ["polylogue-c0z2a"]
},
{
"bead_id": "polylogue-q4qpl",
"disposition": "satisfied",
"evidence": [
{"kind": "commit", "ref": "b941e330b152 merged PR #3923"},
{"kind": "test", "ref": "focused maintenance/CLI provenance suite and
quick gate passed"},
{"kind": "review", "ref": "offline post-promotion reconciliation
regression covered both checkpoint-write failures"}
],
"successors": []
},
{
"bead_id": "polylogue-6k0na",
"disposition": "satisfied",
"evidence": [
{"kind": "commit", "ref": "e33fbcac2 merged PR #3924"},
{"kind": "test", "ref": "focused durable/liveness/CLI suite: 97
passed"},
{"kind": "command", "ref": "devtools verify --quick: 24 checks passed"}
],
"successors": []
}
],
"head_sha": "d4c2e4ef3fb46d84af7120d414967c7d7f87f49d",
"scope_digest":
"edc3f90b7a687388dbe8a8385ae352673718b510edc8a2a0db70069088012508",
"version": 1
}
-->
Summary
Remove the last caller-less raw-authority reset facade. The supported surfaces are now a read-only frontier inspector, daemon-owned application for bounded safe plans, and an explicitly authorized offline recovery command for destructive operations.
Problem
polylogue.maintenance.raw_authority_resetwas still directly importable even though its CLI had already moved destructive recovery behind an exact-plan, backup-verified, ownership-checked maintenance route. That duplicate programmatic surface obscured the production authority boundary and left an undocumented direct-reset path available to callers.Solution
raw-authority-frontierinspects only; the daemon applies bounded executable plans;raw-authority-recovery --applyis the explicit offline-consent route for destructive recovery.Whole-Bead disposition
polylogue-fbkr0efd7923band4b7eaddcf, focused production-route tests, and quick verification.Acceptance criteria
DaemonConvergerdispatches bounded executable plans through the writer lease; the focused daemon route test passed.polylogue-c0z2a.Verification
direnv exec . devtools test tests/unit/maintenance/test_raw_authority_reset.py tests/unit/cli/test_archive_maintenance_cli.py::test_raw_authority_frontier_cli_inspects_without_applying_plans tests/unit/cli/test_archive_maintenance_cli.py::test_raw_authority_frontier_cli_rejects_removed_apply_options tests/unit/cli/test_archive_maintenance_cli.py::test_raw_authority_recovery_cli_refuses_plan_for_another_operation tests/unit/cli/test_archive_maintenance_cli.py::test_raw_authority_frontier_cli_refuses_durable_census_while_daemon_runs tests/unit/daemon/test_daemon_cli.py::test_converge_raw_authority_frontier_applies_only_bounded_executable_plans->37 passed in 3.58sdirenv exec . devtools test tests/unit/maintenance/test_raw_authority_reset.py::test_index_prune_requires_index_backup->1 passed in 1.16sdirenv exec . devtools verify --quick-> all 24 steps passed.polylogueto/realm/worktrees/polylogue-fbkr/polylogue/__init__.pybefore tests.Decision
Safe byte/provenance frontier application remains daemon-owned. The manual frontier surface is retained only as read-only inspection. Destructive ledger reset and orphan-index pruning remain available only through explicit offline recovery consent with the guarded plan, backup, ownership, and restart protocol. The duplicate facade is removed.
Automated review
CodeRabbit found that the backup-authority refusal test did not prove non-mutation. Commit
4b7eaddcfadds active-generation and archive-index byte snapshots around the real recovery call. A fresh CodeRabbit review is requested after the pushed head updates. Earlier local reviewer launches failed before a verdict because of a Claude transport/process error and unavailable Codex system skills.Residual scope
This change does not apply a plan to the live archive or claim production convergence.
polylogue-c0z2aremains open for recovery convergence and daemon-owned live execution.