Skip to content

fix(archive): report retirement cleanup failures accurately - #1792

Draft
Marzx13 wants to merge 2 commits into
Fission-AI:mainfrom
Marzx13:codex/clarify-archive-recovery-diagnostic
Draft

fix(archive): report retirement cleanup failures accurately#1792
Marzx13 wants to merge 2 commits into
Fission-AI:mainfrom
Marzx13:codex/clarify-archive-recovery-diagnostic

Conversation

@Marzx13

@Marzx13 Marzx13 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

When a retirement backup disappears or changes after a change is archived, the cleanup error can say that every backup was retained. JSON also reduces this recovery state to the generic archive_error, making it difficult for callers to distinguish it from other failures.

This PR reports archive_retirement_cleanup_failed and corrects the message to state that archiving occurred but retirement cleanup did not complete. Recovery guidance covers all reported paths, including a staged source left by fallback-copy cleanup, without promising that those paths still exist or contain their original bytes. The agent contract documents the diagnostic and explains that archive: null does not guarantee unchanged files.

Exit 1, the failure envelope, underlying error details, and transaction behavior are preserved. Consumers matching only archive_error for this failure should account for the more precise code. No automatic cleanup or retry is added. This is separate from the archive-claim lock release addressed by #1769.

Validation

  • CI on 76a0e75 passes the full test suite on Linux, macOS, and Windows, plus build, lint, type checks, and release tracking. Security checks also pass.
  • Seven focused regression cases pass, covering human/JSON output, pre-mutation failure, edited/replaced/disappeared backups, and combined source/backup cleanup failures.
  • An aliased Windows temporary path reproduced the five initial CI failures. Canonicalizing the fixture made all five pass, with assertions confirming each fault injection fired. The full archive file also passes locally: 197 tests, 24 existing Windows skips.
  • Sixteen built-CLI fault-injection scenarios pass across local roots and selected stores; twelve retry checks preserve surviving file contents.
  • Before submission, the local Windows full suite had 4,346 passing tests, 79 skips, and one unchanged Git-source packaging test blocked by npm 12.0.1 with EALLOWGIT (allow-git: none). That packaging test and npm restriction were not changed; the hosted Windows suite now passes.

Generated and reviewed with Codex using gpt-6-astra with xhigh reasoning.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

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