Advance a task with optimistic revision checks
Implement advance_task(state, new_status, expected_revision), returning a copied local task record with revision incremented when a legal transition occurs.
Your task
- Use the local transition table in the starter; it is a teaching model, not the full A2A normative lifecycle.
- Reject a revision mismatch, unknown status, or disallowed transition with ValueError.
- Terminal states have no outgoing transitions.
- Do not mutate the input record; preserve its other fields.
Examples
EXAMPLE 1
Inputstate={'id':'t1','status':'working','revision':1}, new_status='completed', expected_revision=1
Output{'id':'t1','status':'completed','revision':2}
Implement the function, then run the tests.
Ctrl / ⌘ + Enter to test · Shift + Tab leaves editor