feat(execution): add deterministic step display ordering#342
Merged
pocky merged 1 commit intoMay 13, 2026
Conversation
- `CHANGELOG.md`: Document F095 deterministic step display ordering - `CLAUDE.md`: Update pitfalls and test conventions with new rules - `docs/user-guide/commands.md`: Document execution summary ordering behavior - `internal/domain/workflow/graph.go`: Add `ExecutionOrder` and `NextDefaultStep` domain functions for default-path graph traversal - `internal/domain/workflow/graph_test.go`: Add 460+ lines of unit tests for new graph traversal functions - `internal/interfaces/cli/resume.go`: Accept `*workflow.Workflow` param and iterate via `ExecutionOrder()` - `internal/interfaces/cli/run.go`: Update display functions to use domain-level ordering instead of map iteration - `internal/interfaces/cli/run_internal_test.go`: Add 312+ lines of tests for CLI display helper functions - `internal/interfaces/tui/tab_monitoring.go`: Replace private `orderedSteps`/`nextStepName` with delegation to domain functions - `internal/interfaces/tui/tab_monitoring_test.go`: Remove tests for deleted TUI-private ordering logic - `tests/integration/features/execution_order_determinism_test.go`: Add integration tests verifying deterministic ordering end-to-end Closes #341
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ExecutionOrder(*Workflow)andNextDefaultStep(*Step)domain functions ingraph.goas a single authoritative source for default-path graph traversal, replacing duplicated ordering logic in both CLI and TUI layersshowExecutionDetails,showStepOutputs,showEmptyStepFeedback,buildStepInfos) and theresumecommand to accept*workflow.Workflowand iterate viaExecutionOrder()instead of direct map accessorderedSteps/nextStepNamehelpers and delegate to the new domain functions, eliminating inconsistent parallel implementationsChanges
Domain — Graph traversal
internal/domain/workflow/graph.go: AddNextDefaultStep(*Step)(returns next step via unconditional transition, falling back toOnSuccess) andExecutionOrder(*Workflow)(walk default path fromInitial, stop at terminals, cycle-safe)CLI — Deterministic display
internal/interfaces/cli/run.go: Thread*workflow.WorkflowintoshowExecutionDetails,showStepOutputs,showEmptyStepFeedback,buildStepInfos; replace map iteration withExecutionOrder()loop using thread-safeGetStepStateper stepinternal/interfaces/cli/resume.go: Load workflow from repository after execution; pass to all display helpers replacing previous map-based iterationTUI — Remove duplicate ordering logic
internal/interfaces/tui/tab_monitoring.go: Delete privateorderedSteps/nextStepName; delegate toworkflow.ExecutionOrder()andworkflow.NextDefaultStep()internal/interfaces/tui/tab_monitoring_test.go: Remove tests that validated the now-deleted private TUI ordering helpersTests
internal/domain/workflow/graph_test.go: Add full unit test suite forNextDefaultStep(nil, default transition precedence, OnSuccess fallback, conditional-only) andExecutionOrder(linear chains, cycle prevention, terminal stops, parallel steps, value copy safety)internal/interfaces/cli/run_internal_test.go: UpdateshowExecutionDetails,showStepOutputs,showEmptyStepFeedback,buildStepInfostests to supply*workflow.Workflow; add ordering assertion coveragetests/integration/features/execution_order_determinism_test.go: New integration test suite verifying deterministic step ordering across repeated runs, branching workflows, and parallel step scenariosDocumentation
docs/user-guide/commands.md: Document that execution summary steps always appear in workflow-defined order; add annotated example outputCHANGELOG.md: Add F095 entry under UnreleasedProject config
CLAUDE.md: Refine development pitfall and test convention rules based on lessons from this featureTest plan
make test— all unit and integration tests pass, including newexecution_order_determinismsuitemake lint— zero violationsawf run <workflow> --verboseand confirm--- Execution Details ---steps appear in workflow-defined order, not random map order, across multiple invocationsawf resume <id>on a completed workflow and verify execution summary uses the same deterministic orderingCloses #341
Generated with awf commit workflow