Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Saves state before risky operations, detects anomalies during execution, and restores checkpoints on failure or incomplete results.
55% 86%+32 ptsof test cases passed
Passed 19 of 22 test cases with the skill, and 12 of 22 without it.
An asset processing batch completed 85% of target files, but 15% failed due to missing source images. The calculated usefulness of the generated assets exceeds our minimum acceptance threshold. Should we discard all progress and restore state, or keep the partial result?
Returns PARTIAL execution status when output value exceeds threshold.
3 of 3 safety checks passed
FUNCTION checkpoint_and_recover(task, execute_fn):
// Pre-execution checkpoint
checkpoint = {
timestamp: now(),
task_id: task.id,
state: capture_current_state(),
files_modified: [],
outputs_produced: []
}
save_checkpoint(checkpoint)
TRY:
// Execute with monitoring
monitor = SPAWN execution-monitoring(task)
result = execute_fn(task)
// Post-execution validation
IF monitor.anomalies_detected:
RAISE AnomalyError(monitor.anomalies)
END
// Validate result integrity
validated = SPAWN result-collection(result, task.success_criterion)
IF validated.complete AND validated.consistent:
// Success — archive checkpoint (keep for audit trail)
archive_checkpoint(checkpoint)
RETURN {status: DONE, result: validated}
ELSE:
// Partial success — decide whether to keep or rollback
IF validated.partial_value > threshold:
archive_checkpoint(checkpoint)
RETURN {status: PARTIAL, result: validated, missing: validated.gaps}
ELSE:
restore_state(checkpoint)
Next to this one in the catalogue, plus more from the same author.