From 3226af322cb7c7f7a93a91e98651538b1bec54ee Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Tue, 10 Mar 2026 17:16:49 +0000 Subject: task: promote validTransitions to package-level var; fix ADR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hoists the map out of ValidTransition so it's not reallocated on every call. Adds missing CANCELLED→QUEUED and BUDGET_EXCEEDED→QUEUED entries to the ADR transition table to match the implemented state machine. Co-Authored-By: Claude Sonnet 4.6 --- internal/task/task_test.go | 1 + 1 file changed, 1 insertion(+) (limited to 'internal/task/task_test.go') diff --git a/internal/task/task_test.go b/internal/task/task_test.go index 637baf5..9873084 100644 --- a/internal/task/task_test.go +++ b/internal/task/task_test.go @@ -26,6 +26,7 @@ func TestValidTransition_AllowedTransitions(t *testing.T) { {"blocked to queued (answer resume)", StateBlocked, StateQueued}, {"blocked to ready (parent unblocked by subtasks)", StateBlocked, StateReady}, {"budget exceeded to queued (retry)", StateBudgetExceeded, StateQueued}, + {"cancelled to queued (restart)", StateCancelled, StateQueued}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { -- cgit v1.2.3