Pausing an agent run — for a human to review progress, or just because the system needs to shut down for a deploy — only works if resuming can trust the saved progress actually matches what's about to run. If the plan changed between pause and resume (a config update, a code deploy that altered step ordering), blindly continuing from "step 3" onward could skip steps that no longer match what was actually completed, or worse, silently redo something already done differently.
You're given full_plan (the run's full, fixed plan, as seen by the resuming session) and completed_steps (what the paused session recorded as already done, in order). Implement compute_remaining_steps(full_plan, completed_steps). Resuming is only safe if completed_steps is exactly a prefix of full_plan — the plan hasn't changed underneath the paused run. If it is, return the remaining steps (everything after the completed prefix). If completed_steps diverges from full_plan anywhere, return the literal string "STATE_MISMATCH" instead of guessing.
full_plan[:len(completed_steps)] == completed_steps is the entire validity check — it directly compares "the first N steps of the current plan" against "everything the paused run says it already did," in one list-equality comparison.
completed_steps longer than full_plan is also a mismatch, not a special case to handle separately — slicing full_plan[:len(completed_steps)] when completed_steps is longer just returns the whole (shorter) full_plan, which then correctly fails to equal the longer completed_steps list.
No results yet
Run your code to check it against the examples, or submit to run every test.