feat: TypeScript runner infrastructure with XState (V2)#10
Merged
Conversation
Implements the core runner loop that orchestrates workflow phases: - WorkflowRunner class with XState actor management - ClaudeCLIAdapter for spawning fresh Claude subprocesses - SignalParser for XML signal extraction from output - ProgressWriter for state persistence - PhaseMapper for phase-to-command translation
Complete state machine with: - idle → setup → planning → implementing → submitting flow - ci_resolution ↔ ci_fixing loop with retry limits - comment_resolution ↔ comment_resolving loop - Proper guards and context updates on transitions
Each phase runs as separate Claude CLI subprocess: - phase-setup: Create worktree, init progress - phase-plan: Split research into plans - phase-impl: Execute single plan - phase-submit: Create PR - phase-verify-ci: Check CI status - phase-fix-ci: Fix CI failures - phase-resolve-comments: Handle reviewer feedback Updated build.md to be thin wrapper spawning TypeScript runner.
51 tests covering: - SignalParser: XML signal extraction, error handling - ProgressWriter: File I/O, state persistence - PhaseMapper: Phase-to-command mapping, terminal states
- Add xstate for state machine management - Add typescript for type checking - Configure tsconfig for Bun runtime - Add test and build scripts
Document: - Internal phase commands for debugging - Updated workflow phases including CI/comment resolution - New src/ directory structure - XState-based state management
Release includes: - TypeScript runner infrastructure with XState - Phase commands for fresh-context execution - CI and comment resolution loops - 51 unit tests
Runs on PRs and main branch pushes: - Plugin validation - TypeScript type checking - Unit tests (51 tests) - Shell script syntax validation
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
Implements the TypeScript workflow runner that orchestrates the full SDLC pipeline from research to merge-ready PR.
Key Changes
TypeScript Runner Infrastructure (
src/runner/)WorkflowRunner- Main orchestration loop with XState actorClaudeCLIAdapter- Spawn fresh Claude subprocesses per phaseSignalParser- Parse XML signals from CLI outputProgressWriter- State persistence to progress filePhaseMapper- Map XState phases to slash commandsXState State Machine (
src/workflows/main.workflow.ts)idle → setup → planning → implementing → submitting → ci_resolution → comment_resolution → completedPhase Commands (
commands/phase-*.md)Architecture
Test Plan