Files
kandev/docs/plans/workflow-cycle-guardrails/task-01-cycle-analyzer.md
T
2026-08-23 17:34:52 +00:00

1.7 KiB

id, title, status, wave, depends_on, plan, spec
id title status wave depends_on plan spec
01-cycle-analyzer Workflow replay cycle analyzer done 1
plan.md ../../specs/tasks/requirements/workflow-cycle-guardrails.md

Task 01: Workflow replay cycle analyzer

Acceptance

  • A pure deterministic analyzer returns the diagnostic contract from the spec for cycles over on_turn_start and on_turn_complete move actions.
  • Fully automatic versus user-mediated classification accounts for source-step auto-start and approval, including automatic on_turn_start transitions, and ignores cycles without auto-start re-entry through on_turn_complete. An on_turn_start edge into an auto-start step is covered as a safe non-replay regression.
  • Trace choice, bounded identity inventory with conservative truncation, affected steps, dangling targets, reorder behavior, and all three prompt-source categories have focused unit coverage.

Verification

(cd apps && pnpm --filter @kandev/web test -- lib/workflows/replay-cycle-analysis.test.ts)
(cd apps/web && pnpm run typecheck)

Files Likely Touched

  • apps/web/lib/workflows/replay-cycle-analysis.ts
  • apps/web/lib/workflows/replay-cycle-analysis.test.ts

Dependencies

None.

Inputs

  • Spec sections What, Analysis Contract, and Scenarios.
  • apps/web/lib/types/workflow-actions.ts for action shapes.
  • apps/backend/internal/workflow/engine/types.go for transition resolution and trigger semantics.
  • apps/backend/internal/orchestrator/event_handlers_workflow.go for the auto-start/user-turn distinction.

Output Contract

When finished, change this task's status to done, check it in plan.md, and report the analyzer API, files changed, tests run, blockers, and residual risks.