Skip to content

feat: add true terminal states to all workflows#284

Merged
mrsimpson merged 3 commits into
mainfrom
feat/add-terminal-done-state
Jun 2, 2026
Merged

feat: add true terminal states to all workflows#284
mrsimpson merged 3 commits into
mainfrom
feat/add-terminal-done-state

Conversation

@mrsimpson

Copy link
Copy Markdown
Collaborator

Summary

  • Remove all outgoing transitions from final states of 14 workflows to make them truly terminal
  • Add $DONE_DEFAULT instruction that explicitly tells agents to present results and create PRs without transitioning to any other state
  • Delete obsolete state-machine.ts (100% dead code with zero usage)

Changes

Core

  • Updated ProjectDocsManager.getVariableSubstitutions() to include $DONE_DEFAULT with explicit "do NOT transition" instruction
  • Deleted packages/core/src/state-machine.ts (dead code)
  • Removed re-export from packages/core/src/index.ts

Workflows (14 final states updated)

All final states now have transitions: [] and $DONE_DEFAULT in their default_instructions:

  • boundary-testing, bugfix, epcc, greenfield, minor, posts, pr-review, qrspi
  • skilled-bugfix, skilled-epcc, skilled-greenfield, slides, waterfall
  • TDD exception: Added explicit done state; feature_complete now transitions to done instead of looping back to explore

Tests

  • Updated project-docs-manager.test.ts to match new $DONE_DEFAULT value
  • All 735 tests pass (core: 385, server: 286, opencode: 64)

Key Decision

The $DONE_DEFAULT instruction now explicitly states: "Do NOT transition to any other state — this is a terminal state." This ensures agents understand they should not attempt to proceed to another phase when reaching a final state.

mrsimpson and others added 2 commits June 2, 2026 08:35
…struction

Remove all outgoing transitions from final states of 14 workflows to make
them truly terminal. Add $DONE_DEFAULT placeholder that instructs agents
to present results and create PRs (on GitHub repos) without transitioning
to any other state.

Key changes:
- Updated ProjectDocsManager to include $DONE_DEFAULT with explicit
  'do NOT transition' instruction
- Removed all transitions from final states in 13 workflows
- Added explicit 'done' state to TDD workflow (exits TDD cycle)
- Deleted obsolete state-machine.ts (100% dead code)
- Updated test expectations for new $DONE_DEFAULT value

All 385+286+64 tests pass.
@mrsimpson mrsimpson force-pushed the feat/add-terminal-done-state branch from f0e9558 to 61dac6a Compare June 2, 2026 06:35
@mrsimpson mrsimpson merged commit deed235 into main Jun 2, 2026
3 checks passed
@mrsimpson mrsimpson deleted the feat/add-terminal-done-state branch June 2, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant