|
| 1 | +# Architecture |
| 2 | + |
| 3 | +The heart of the `gsd-orchestrator` is a durable State Machine built around the `WorkflowState` enumeration. It decomposes the massive complexity of an autonomous coding task into discrete, verifyable phases. |
| 4 | + |
| 5 | +## Workflow State Machine |
| 6 | + |
| 7 | +The orchestrator guarantees that no code is pushed to a PR without passing through `TestGenerating` and `Validating`. |
| 8 | + |
| 9 | +```mermaid |
| 10 | +stateDiagram-v2 |
| 11 | + [*] --> Idle |
| 12 | +
|
| 13 | + Idle --> Triaging : Issue Received |
| 14 | + Triaging --> Analyzing : Issue Classified |
| 15 | + Analyzing --> Branching : Action Plan Approved |
| 16 | + |
| 17 | + Branching --> Editing : Branch Created |
| 18 | + Editing --> TestGenerating : Files Modified |
| 19 | + |
| 20 | + TestGenerating --> Validating : xUnit Tests Written |
| 21 | + |
| 22 | + Validating --> Committing : Tests Passed |
| 23 | + Validating --> Editing : Tests Failed (Feedback Loop) |
| 24 | + |
| 25 | + Committing --> PrCreating : Commits Hashed |
| 26 | + PrCreating --> Reviewing : PR Opened |
| 27 | + |
| 28 | + Reviewing --> Documenting : PR Approved by Agent |
| 29 | + Reviewing --> Editing : PR Rejected (Feedback Loop) |
| 30 | + |
| 31 | + Documenting --> Done : Docs Generated |
| 32 | +
|
| 33 | + state Failed { |
| 34 | + [*] --> Recoverable |
| 35 | + [*] --> TerminalStopReason |
| 36 | + } |
| 37 | +
|
| 38 | + Analyzing --> Failed : Ambiguity |
| 39 | + Validating --> Failed : BudgetExhausted |
| 40 | +``` |
| 41 | + |
| 42 | +## Validation & SDLC Status |
| 43 | + |
| 44 | +Beyond linear states, the Orchestrator maps operations to Software Development Life Cycle (SDLC) batches: |
| 45 | +- `Discovery` (Triaging, Analyzing) |
| 46 | +- `Design` |
| 47 | +- `Change` (Branching, Editing, TestGenerating) |
| 48 | +- `Assurance` (Validating, Reviewing) |
| 49 | +- `Closure` (Committing, PrCreating, Documenting) |
| 50 | + |
| 51 | +If a phase reaches `ValidationStatus.Block`, the engine triggers a `TerminalStopReason` (e.g., `PolicyDenied`, `DestructiveAction`), rolling back the branch and alerting the human operator. |
0 commit comments