Skip to content

refactor(raw-authority): remove legacy reset facade - #3922

Merged
Sinity merged 2 commits into
masterfrom
feature/raw-authority/actuator-consent
Aug 10, 2026
Merged

refactor(raw-authority): remove legacy reset facade#3922
Sinity merged 2 commits into
masterfrom
feature/raw-authority/actuator-consent

Conversation

@Sinity

@Sinity Sinity commented Aug 10, 2026

Copy link
Copy Markdown
Owner

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_reset was 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

  • Delete the legacy reset/prune facade.
  • Exercise the real recovery route directly in its unit coverage, including durable SQLite state and refusal cases.
  • Assert that a backup-authority refusal leaves both the active-generation and archive index copies byte-for-byte unchanged.
  • Keep the existing CLI decision: raw-authority-frontier inspects only; the daemon applies bounded executable plans; raw-authority-recovery --apply is the explicit offline-consent route for destructive recovery.

Whole-Bead disposition

Bead Disposition Evidence
polylogue-fbkr Satisfied Commits 0efd7923b and 4b7eaddcf, focused production-route tests, and quick verification.

Acceptance criteria

AC Status Evidence
1. Reachable daemon-owned actuator Satisfied DaemonConverger dispatches bounded executable plans through the writer lease; the focused daemon route test passed.
2. Fail-closed evidence, backup, ownership, and recovery Satisfied The retained recovery service enforces exact plan, signed build, verified backup, ownership, immutable intent, and restart revalidation. Real SQLite recovery tests passed.
3. Inspection plus explicit authorized apply/recovery Satisfied Frontier CLI rejects removed apply options; recovery CLI rejects a plan for another operation.
4. Real-route mutation twins Satisfied Focused suite covers recovery refusal/mutation behavior, CLI dispatch, and daemon application. The rejected prune route now proves both physical index copies remain unchanged.
5. No live-convergence claim Satisfied for this implementation scope Read-only production census found 4,194 unresolved blockers and 256 nonterminal censuses. No live operation was attempted. Remaining convergence and live execution are owned by open successor 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.58s
  • direnv exec . devtools test tests/unit/maintenance/test_raw_authority_reset.py::test_index_prune_requires_index_backup -> 1 passed in 1.16s
  • direnv exec . devtools verify --quick -> all 24 steps passed.
  • Worktree guard resolved polylogue to /realm/worktrees/polylogue-fbkr/polylogue/__init__.py before 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 4b7eaddcf adds 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-c0z2a remains open for recovery convergence and daemon-owned live execution.

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.
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Sinity, you've reached your PR review limit, so we couldn't start this review.

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 @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 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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9da17923-89a9-4126-b145-179190de1816

📥 Commits

Reviewing files that changed from the base of the PR and between 0efd792 and 4b7eadd.

📒 Files selected for processing (1)
  • tests/unit/maintenance/test_raw_authority_reset.py
📝 Walkthrough

Walkthrough

The legacy raw_authority_reset.py module and its compatibility APIs were deleted. Maintenance tests now use recovery-plan APIs. CLI and maintenance tests force clean version metadata for deterministic assertions.

Changes

Raw authority recovery migration

Layer / File(s) Summary
Update recovery tests to current APIs
polylogue/maintenance/raw_authority_reset.py, tests/unit/maintenance/test_raw_authority_reset.py, tests/unit/cli/test_archive_maintenance_cli.py
The legacy reset and pruning APIs were removed. Tests now inspect and apply recovery plans, verify backup authority requirements, and force VERSION_INFO.dirty to False.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely identifies removal of the legacy raw-authority reset facade, which is the primary change.
Description check ✅ Passed The description covers the change, problem, solution, verification, disposition, risks, residual scope, and evidence with sufficient detail.
✨ 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/raw-authority/actuator-consent

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.

@coderabbitai coderabbitai 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between e4aea76 and 0efd792.

📒 Files selected for processing (3)
  • polylogue/maintenance/raw_authority_reset.py
  • tests/unit/cli/test_archive_maintenance_cli.py
  • tests/unit/maintenance/test_raw_authority_reset.py
💤 Files with no reviewable changes (1)
  • polylogue/maintenance/raw_authority_reset.py

Comment thread tests/unit/maintenance/test_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.
@Sinity

Sinity commented Aug 10, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Sinity
Sinity merged commit d8ba0e3 into master Aug 10, 2026
2 of 3 checks passed
@Sinity
Sinity deleted the feature/raw-authority/actuator-consent branch August 10, 2026 15:31
Sinity added a commit that referenced this pull request Aug 10, 2026
## 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
}
-->
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