3.0 KiB
3.0 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 07-workflow-step-action | run_code_review workflow step entry action | done | 4 |
|
plan.md | ../../specs/agents/requirements/native-code-review.md |
Task 07: run_code_review workflow step entry action
Make a review pass a declarative step behavior, with its own agent profile.
Inputs
- Spec API surface → Workflow step action; the passthrough scenario in Scenarios ("the task still enters the step").
internal/workflow/models/models.go—OnEnterActionType/GenericActionTypeconstants andStepEvents.internal/workflow/engine/types.goActionKind,internal/workflow/engine/adapters.gomodel→engine mapping.internal/orchestrator/workflow_callbacks.go—autoStartAgentCallbackis the closest shape; note the conditional registration pattern for optional adapters.internal/workflow/models/export.go— portable agent-profile references.
Work
internal/workflow/models/models.go—OnEnterRunCodeReview OnEnterActionType = "run_code_review",GenericActionRunCodeReview GenericActionType = "run_code_review", andRunCodeReviewAction struct { AgentProfileID string }added as a nullable field on the on-enter and generic action structs.internal/workflow/engine/types.go—ActionRunCodeReview ActionKind = "run_code_review"and theRunCodeReview *RunCodeReviewSpecfield on the engine action.internal/workflow/engine/adapters.go— map the model action to the engine action, carryingAgentProfileID.internal/orchestrator/workflow_callbacks.go—runCodeReviewCallback{svc}registered only whensvc.reviewRunner != nil. It resolves the task's session, callsRunner.RunwithTrigger = workflow_stepandWorkflowStepID = in.Step.ID, and on error logs and returnsengine.ActionResult{}, nilso step entry still succeeds (the run row carries the failure).internal/workflow/models/export.go— export/import the action, resolvingAgentProfileIDthroughAgentProfileResolver/AgentProfileMatcherlike existing step profiles; validate the referenced profile exists on import ininternal/workflow/service/.internal/workflow/service/— reject arun_code_reviewaction whoseagent_profile_idnames an unknown profile at save time.
Acceptance
- Entering a step with the action starts a run with
trigger = workflow_stepand the step's profile agent/model. - A run failure (including a passthrough profile) does not block the transition.
- Export → import round-trips the action and its profile reference across workspaces.
Verification
cd apps/backend && go test ./internal/workflow/... ./internal/orchestrator/...
Files likely touched
internal/workflow/models/{models.go,export.go} + tests, internal/workflow/engine/{types.go,adapters.go} + tests, internal/workflow/service/, internal/orchestrator/workflow_callbacks.go + test.
Output contract
Summary, files changed, tests run with results, blockers, risks, status: done, plan checkbox.