Problem
Given a list of Linux automation task results, implement a function that determines whether the automation run is safe and repeatable. Each task is represented as a dictionary with keys name, changed, rc, and check_rc, where changed is a boolean indicating whether the task modified the system, rc is the normal execution return code, and check_rc is the dry-run return code. Return True if every task succeeded in both modes and at least one task is idempotent, meaning its dry-run and normal execution agree on whether a change is needed; otherwise return False.
Constraints
- 1 <= len(tasks) <= 10^4
- Each task contains keys:
name,changed,rc,check_rc rcandcheck_rcare integers in the range[-255, 255]
Function Signature
def validate_task_run(tasks):
You are practicing as a guest. Sign up free to run your code against the sample data. Your draft stays right here.


