Your question is Validate Idempotent Linux Task Runner. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
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.
name, changed, rc, check_rcrc and check_rc are integers in the range [-255, 255]def validate_task_run(tasks):