Skip to content

Harden checkpoint and temporary-directory cleanup operations #3732

Description

@Widthdom

Problem

Several cleanup and rollback paths manipulate checkpoint backups or recursively delete temporary directories after earlier validation. If a path changes between validation and use, or cleanup failures are swallowed, recovery behavior becomes hard to audit and can leave partial state behind.

Evidence

  • src/CodeIndex/Cli/DbCommandRunner.cs: checkpoint restore delete/move/copy helpers around backup restoration.
  • src/CodeIndex/Cli/DbCommandRunner.cs: temporary directory recursive cleanup after validation.
  • src/CodeIndex/Cli/ProgramRunner.cs: upgrade script directory cleanup catches and ignores failures.

Requested improvement

  • Revalidate cleanup targets immediately before recursive delete or restore moves.
  • Make backup restore ordering/rollback auditable and fail predictably.
  • Emit bounded diagnostics for cleanup failures instead of silent catches.

Duplicate check: no matching OPEN ISSUE found during the cdidx audit pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions