Reverse recorded moves and script edits from an unfinished renumber() call. Recovery does not infer progress from filename prefixes. Operations are reversed in reverse order, and a move whose recorded intent was saved but not executed is skipped. Repeated recovery attempts can resume a partial rollback.

renumber_recover(recovery_dir)

Arguments

recovery_dir

The recovery directory reported by renumber(), normally .slurmjobs-renumber inside its base_dir.

Value

Invisibly NULL on successful rollback or cleanup.

Details

Stop other writers before recovery. Recovery stops if a destination is occupied or a renamed object's recorded identity/metadata changed, retaining the journal and remaining originals for inspection. Script bytes are restored in the existing file after verifying identity and the saved backup. An unfinished write may have any length or content; its recorded identity must still match. A completed write with unexpectedly changed contents is a recovery conflict. Unfinished writes cannot be distinguished from edits by another writer to the same file, so exclude concurrent writers during both execution and recovery. These checks do not protect against changes between checks and writes/renames. Once a call committed successfully, recovery only finishes cleaning up its temporary files. Recovery validates non-log paths against the original physical base_dir. Log moves use the saved project root when protect_log_location was TRUE, or may be outside the project when it was FALSE. Recovery never recomputes the project with here. A moved journal or a path outside its saved scope is refused. Older journals without log provenance remain confined to base_dir. The journal is private local package state; do not edit it or use an untrusted recovery directory.