From 726f71e6c2b697d198eb35f2ba9e3f19ee7b2482 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 1 Dec 2025 12:34:34 -0500 Subject: Add actor tracking for status changes and use unified timeline - updateTaskStatusWithActor logs status_change events to agent_events - Worker uses Junior actor for status changes - Jr review uses System/Human actors appropriately - CLI task update uses Human actor - Remove task_activity table schema (migrated to agent_events) - addComment now inserts into agent_events with event_type='comment' Task-Id: t-213 --- Omni/Jr.hs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Omni/Jr.hs') diff --git a/Omni/Jr.hs b/Omni/Jr.hs index dc6ded0..c35efa3 100755 --- a/Omni/Jr.hs +++ b/Omni/Jr.hs @@ -209,7 +209,7 @@ runLoop delaySec = do then do putText "[review] No commit found for this task." putText "[review] Resetting to Open for retry." - TaskCore.updateTaskStatus tid TaskCore.Open [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Open [] TaskCore.System else do let commitSha = case List.lines shaOut of (x : _) -> x @@ -237,7 +237,7 @@ handleConflict tid conflictFiles commitSha = do if attempt > 3 then do putText "[review] Task has failed 3 times. Needs human intervention." - TaskCore.updateTaskStatus tid TaskCore.Open [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Open [] TaskCore.System else do conflictDetails <- gatherConflictContext commitSha conflictFiles maybeExistingCtx <- TaskCore.getRetryContext tid @@ -254,7 +254,7 @@ handleConflict tid conflictFiles commitSha = do TaskCore.retryReason = accumulatedReason, TaskCore.retryNotes = maybeExistingCtx +> TaskCore.retryNotes } - TaskCore.updateTaskStatus tid TaskCore.Open [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Open [] TaskCore.System putText ("[review] Task " <> tid <> " returned to queue (attempt " <> tshow attempt <> "/3).") -- | Build a review comment for merge conflicts @@ -421,7 +421,7 @@ autoReview tid task commitSha = do let reviewComment = buildReviewComment commitSha testTarget True testOut testErr _ <- TaskCore.addComment tid reviewComment TaskCore.Junior TaskCore.clearRetryContext tid - TaskCore.updateTaskStatus tid TaskCore.Done [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Done [] TaskCore.System putText ("[review] Task " <> tid <> " -> Done") addCompletionSummary tid commitSha extractFacts tid commitSha @@ -439,7 +439,7 @@ autoReview tid task commitSha = do if attempt > 3 then do putText "[review] Task has failed 3 times. Needs human intervention." - TaskCore.updateTaskStatus tid TaskCore.Open [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Open [] TaskCore.System else do let currentReason = "attempt " <> tshow attempt <> ": " <> reason let accumulatedReason = case maybeCtx of @@ -454,7 +454,7 @@ autoReview tid task commitSha = do TaskCore.retryReason = accumulatedReason, TaskCore.retryNotes = maybeCtx +> TaskCore.retryNotes } - TaskCore.updateTaskStatus tid TaskCore.Open [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Open [] TaskCore.System putText ("[review] Task " <> tid <> " reopened (attempt " <> tshow attempt <> "/3).") -- | Build a review comment summarizing what was tested and the result @@ -502,7 +502,7 @@ interactiveReview tid task commitSha = do let acceptComment = buildHumanReviewComment commitSha True Nothing _ <- TaskCore.addComment tid acceptComment TaskCore.Human TaskCore.clearRetryContext tid - TaskCore.updateTaskStatus tid TaskCore.Done [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Done [] TaskCore.Human putText ("Task " <> tid <> " marked as Done.") addCompletionSummary tid commitSha extractFacts tid commitSha @@ -528,7 +528,7 @@ interactiveReview tid task commitSha = do TaskCore.retryReason = accumulatedReason, TaskCore.retryNotes = maybeCtx +> TaskCore.retryNotes } - TaskCore.updateTaskStatus tid TaskCore.Open [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Open [] TaskCore.Human putText ("Task " <> tid <> " reopened (attempt " <> tshow attempt <> "/3).") | otherwise -> putText "Skipped; no status change." @@ -850,7 +850,7 @@ checkEpicCompletion task = allDone = all (\t -> TaskCore.taskStatus t == TaskCore.Done) children when (allDone && not (null children)) <| do putText ("[review] All children of epic " <> parentId <> " are Done.") - TaskCore.updateTaskStatus parentId TaskCore.Review [] + TaskCore.updateTaskStatusWithActor parentId TaskCore.Review [] TaskCore.System putText ("[review] Epic " <> parentId <> " -> Review") -- Generate summary comment for the epic generateEpicSummary parentId parentTask children -- cgit v1.2.3