Files
kandev/docs/plans/workflow-profile-session-reuse/task-02-implement-safe-session-parking.md
T
2026-09-02 19:50:14 +00:00

2.0 KiB

id, title, status, wave, depends_on, plan, requirements, acceptance_criteria, system_design
id title status wave depends_on plan requirements acceptance_criteria system_design
02-implement-safe-session-parking Route source and destination behavior pending 2
01-add-portable-workflow-policy
plan.md
REQ-TASKS-WORKFLOW-PROFILE-SESSIONS-001
AC-TASKS-WORKFLOW-PROFILE-SESSIONS-001.1
AC-TASKS-WORKFLOW-PROFILE-SESSIONS-001.2
AC-TASKS-WORKFLOW-PROFILE-SESSIONS-001.3
AC-TASKS-WORKFLOW-PROFILE-SESSIONS-001.4
AC-TASKS-WORKFLOW-PROFILE-SESSIONS-001.5
AC-TASKS-WORKFLOW-PROFILE-SESSIONS-001.6
AC-TASKS-WORKFLOW-PROFILE-SESSIONS-001.11
../../specs/tasks/system-design/workflow-profile-session-lifecycle.md

Task 02: Route Source and Destination Behavior

Summary

Use the destination step for session selection and the source step for session retirement.

In scope

  • Split profile-switch routing into start and end inputs.
  • Thread the source step or normalized end setting through every entry path.
  • Keep credential preflight, promotion, queue rollback, parking, stop intent, guard release, and callback suppression.
  • Cover legacy, manual, queued, and direct engine transitions.

Acceptance

  • Tests prove all four start-and-end combinations.
  • A destination setting cannot change source retirement.
  • The workflow engine core gains no action, event, or state.

Verification

cd apps/backend && go test -tags fts5 ./internal/orchestrator -run 'Test(SwitchSessionForStep|PrepareWorkflowStepSession|HandleAgentCompleted|HandleAgentStopped).*ProfileSession' -count=1 -v

Files likely touched

  • apps/backend/internal/orchestrator/event_handlers_workflow.go
  • apps/backend/internal/orchestrator/workflow_callbacks.go
  • apps/backend/internal/orchestrator/event_handlers_workflow_profile_session_policy_test.go
  • apps/backend/internal/orchestrator/workflow_profile_session_lifecycle.go

Dependencies

Task 01.

Risks

A direct engine entry can lose the source step after the task moves.

Parallelism

sequential

Results

Pending.