recover
recover
¶
Recover command for Marianne CLI.
This module implements the hidden mzt recover command for recovering
sheets that completed work but were incorrectly marked as failed.
★ Insight ───────────────────────────────────── 1. Non-destructive recovery: The recover command re-runs validations without re-executing the backend. This is useful when work was completed but the process failed afterwards (e.g., transient network error after writing files).
-
State machine transitions: The command can transition sheets from FAILED to COMPLETED, and the job from FAILED to PAUSED. This allows the job to be resumed normally after recovery.
-
Dry-run safety: The --dry-run flag runs validations without modifying state. This lets users preview what would be recovered before committing. ─────────────────────────────────────────────────
Classes¶
Functions:¶
recover
¶
recover(job_id=Argument(..., help="The score's run id (job id) to recover"), sheet=Option(None, '--sheet', '-s', help='Specific sheet number to recover (default: all failed sheets)'), from_sheet=Option(None, '--from-sheet', '-f', help='Reset all FAILED sheets >= this number to PENDING (cascade recovery)'), dry_run=Option(False, '--dry-run', '-n', help='Check validations without modifying state'))
Recover sheets that completed work but were incorrectly marked as failed.
This command runs validations for failed and cascade-skipped sheets without re-executing them, in the context execution validates in (stage, instance, loop indices). A sheet is marked complete only when at least one validation applies to it and all that apply pass; a sheet no validation applies to is reset to pending, never completed on an empty pass.
This is useful when: - Claude CLI returned a non-zero exit code but the work was done - A transient error caused failure after files were created - You want to check if a failed sheet actually succeeded - A cascade failure wiped out downstream sheets after one failure
Examples:
mzt recover my-job # Recover all failed sheets mzt recover my-job --sheet 6 # Recover specific sheet mzt recover my-job --dry-run # Check without modifying mzt recover my-job --from-sheet 211 # Reset cascade from sheet 211+