Skip to content

fix(apps): retire withdrawn inactive releases - #671

Merged
RentnerKev merged 2 commits into
mainfrom
rentner/fix/withdrawn-app-releases
Dec 1, 2026
Merged

RentnerKev merged 2 commits into
mainfrom
rentner/fix/withdrawn-app-releases

Conversation

@RentnerKev

@RentnerKev RentnerKev commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Problem

After a release is withdrawn, an otherwise healthy installation can retain it as a rollback or staging candidate. Package verification then rejects every backup that still references that release.

Changes

  • Reconcile inactive journal references after an authenticated catalog refresh, staging and activation. Check the catalog revision and release identity before discarding a reference.
  • Filter withdrawn or absent inactive releases in legacy and portable backups. Restore retains the original backup identity and verifies every retained package, including the active release, against the trusted catalog.
  • Preserve the candidate identity needed for an interrupted handoff or a potentially committed migration.
  • Retry an incomplete process identity census when a task exits during a procfs read. The ARM64 Greeting suite exposed that race during app recovery.

Verification

  • Bun typecheck and Oxlint passed. The focused Linux app install, manager and backup suites and strict Clippy passed in Kiri.
  • The signed lifecycle verifies capture and restore from before a withdrawal, catalog pruning, and rejection of an active withdrawal.
  • The native Greeting fixture verifies portable restore against a newer checkpoint and repetition without rewinding the restored database.

Closes #649

Summary by CodeRabbit

  • Bug Fixes
    • Backups and restores now account for releases withdrawn from the catalog, helping prevent outdated releases from being retained or restored.
    • Catalog refreshes remove unlisted releases while preserving active releases and eligible interrupted installations.
    • Backup verification and recovery now handle unavailable or invalid packages more safely.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Catalog release listings now guide pruning of inactive releases in manager journals and backup inventories. Portable backup capture and restore use the pruned inventory, and recovery stages selected package archives separately from recovery setup.

Changes: Catalog-aware release pruning and backup recovery

Layer / File(s) Summary
Release listings and recovery archive staging
core/src/app_install.rs, core/src/app_install/recovery.rs, core/tests/private/app_install.rs
Recovery exposes listings from verified catalogs. Archive staging is separated from recovery setup, and the recovery test covers listing revisions, selected archives, and target availability.
Catalog refresh and journal pruning
core/src/app_manager/catalog.rs, core/src/app_manager/journal.rs, core/src/app_manager/lifecycle.rs, core/src/app_manager.rs, core/tests/private/app_manager/lifecycle.rs
Manager lifecycle and catalog refresh paths prune eligible unlisted releases. Journal pruning validates release identities and retains interrupted or migrating candidates.
Pruned backup capture and restore
core/src/app_backup.rs, core/src/app_backup/portable.rs, core/src/app_manager.rs, core/src/app_manager/portable_backup.rs, core/tests/private/app_manager/lifecycle*
Backup capture prunes recorded inventories against a release listing. Portable restore uses pruned inventory and listings for destination selection, package handling, and journal completion. Lifecycle tests cover revoked releases and replacement restore.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

  • Issue 669 tracks issue 649’s backup failure after an old release is revoked. This change addresses pruning revoked or absent inactive releases during backup and restore.

Possibly related PRs

Merge Risk: Minimal · up to d226c

This change prunes withdrawn or absent inactive releases so backups and restores no longer fail, while still verifying the active release. No concrete merge-blocking problem was established in the reviewed code.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(apps): retire withdrawn inactive releases" matches the main change. The PR reconciles inactive previous and candidate journal references to withdrawn or absent releases, and filters the…
Linked Issues check Passed [#649] requires that revoked or absent inactive previous and candidate releases stop failing backups and restores, that they are dropped on catalog refresh, and that active keeps strict validati…
Out of Scope Changes check Passed The changes support #649 or the PR's stated goals of preserving interrupted-handoff and migration candidates. Archive staging moved out of prepare_recovery into RecoveryTarget::stage_archives and …
Description check Passed The description states the problem (withdrawn releases retained as rollback or staging candidates cause package verification to reject backups) and lists the main changes: reconciling inactive journal…
Full details: Title check

Explanation

The title "fix(apps): retire withdrawn inactive releases" matches the main change. The PR reconciles inactive previous and candidate journal references to withdrawn or absent releases, and filters them in backups. The title is concise and specific, and it follows a conventional-commit style. It does not name the backup and restore behavior, but it does not need to cover every detail.

Full details: Linked Issues check

Explanation

[#649] requires that revoked or absent inactive previous and candidate releases stop failing backups and restores, that they are dropped on catalog refresh, and that active keeps strict validation. The PR summary maps these requirements to code: Journal::prune_unlisted and Slot::prune_unlisted in core/src/app_manager/journal.rs drop valid previous or candidate releases omitted by a listing for the same app, and approvals are pruned with them. The control loop prunes on catalog refresh, and Manager::prune_unlisted_releases in core/src/app_manager/catalog.rs runs after stage and switch. prune_backup_snapshot in core/src/app_manager.rs removes unlisted candidate and previous entries before capture. BackupJournal::destination and finish in core/src/app_manager/portable_backup.rs use pruned inventories and listings during restore. ReleaseListing::omits in core/src/app_install/recovery.rs applies only when the listing revision is at least the recorded revision. Strict validation for active remains: the lifecycle test rejects an active withdrawal. The lifecycle test in core/tests/private/app_manager/lifecycle.rs covers capture and restore after a withdrawal and boot-time refresh clearing unlisted previous and candidate releases. The PR keeps an interrupted candidate for handoff recovery. The issue permits this qualification, so it does not conflict with #649. Assessment relies on the PR summary and tests described there; I did not read the changed source hunks directly.

Full details: Out of Scope Changes check

Explanation

The changes support #649 or the PR's stated goals of preserving interrupted-handoff and migration candidates. Archive staging moved out of prepare_recovery into RecoveryTarget::stage_archives and publish now borrows self. These changes support the recovery listing and pruning logic. Installation::new now classifies Interrupted by Slot::interrupted_candidate, which supports preserving candidate identity. The valid_release visibility change in core/src/app_manager/lifecycle.rs supports the new journal validation. The added ReleaseListing re-export in core/src/app_install.rs supports the app manager. The test changes cover capture, restore, and the published Greeting fixture behind the same behavior. I found no change that is clearly unrelated to #649 or the stated PR goals. Assessment is based on the PR summary; I did not inspect the changed hunks.

Full details: Description check

Explanation

The description states the problem (withdrawn releases retained as rollback or staging candidates cause package verification to reject backups) and lists the main changes: reconciling inactive journal references after catalog refresh, staging and activation; filtering withdrawn or absent inactive releases in legacy and portable backups; preserving candidate identity for interrupted handoffs; and a procfs census retry. It also gives verification notes and links the issue with 'Closes #649'. The template sections 'Related issue', 'Type of change', 'Breaking changes', and 'Screenshots' are not filled in, and the 'Checklist' and 'Testing' sections are only partially addressed. The Summary, Testing and Related issue content is mostly complete, so the description is substantively complete even though the template's checkboxes and breaking-change and screenshot sections were omitted.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8930742 and d226cb9.

Files selected for processing: 13

  • core/src/app_backup.rs
  • core/src/app_backup/portable.rs
  • core/src/app_install.rs
  • core/src/app_install/recovery.rs
  • core/src/app_manager.rs
  • core/src/app_manager/catalog.rs
  • core/src/app_manager/journal.rs
  • core/src/app_manager/lifecycle.rs
  • core/src/app_manager/portable_backup.rs
  • core/tests/private/app_install.rs
  • core/tests/private/app_manager/lifecycle.rs
  • core/tests/private/app_manager/lifecycle/published_greeting.rs
  • core/tests/private/app_manager/lifecycle/published_greeting/portable_backup.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Treat ESRCH from a process census as inconclusive within the current deadline. Only a complete scan admits a replacement writer.
@RentnerKev

Copy link
Copy Markdown
Member Author

Self-review (CodeRabbit rate-limited): Reviewed the complete diff through 22115153. Catalog pruning uses authenticated release identities and a revision floor. It leaves the active release under strict package verification and preserves candidates needed to finish an interrupted handoff or a potentially committed migration. Legacy snapshot comparison retains the remaining recorded fields. Portable recovery keeps the original backup digest and the destination's catalog floor, and only republishes retained archives.

The first ARM64 Greeting run surfaced an ESRCH during app recovery. The fix treats it as an inconclusive process identity census. A replacement writer still requires a complete scan within the existing deadline. Added a regression test that finds a live writer after the first scan fails and rejects persistent scan failures. The previous head's AMD64 Greeting check passed, including portable restore after withdrawal and a repeat of the original backup without rewinding the database. On this head, 158 focused Rust tests, strict Clippy and the privileged signed lifecycle passed in Kiri. Bun typecheck and lint passed on the preceding head. The follow-up changes only Rust.

The independent lifecycle and backup review findings were addressed, including pruning the old active release after a successful update and preserving recovery evidence. No actionable comments or unresolved threads remain. Merge is gated on the current head's required checks.

@RentnerKev
RentnerKev merged commit 6e629aa into main Dec 1, 2026
52 checks passed
@RentnerKev
RentnerKev deleted the rentner/fix/withdrawn-app-releases branch December 1, 2026 01:53
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.

fix(apps): drop revoked previous and candidate releases so backups keep working

1 participant