Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/andrioid/statesman. xstate inspired schema compatible statechart library for Go
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119{ "$schema": "../../schema/machineSchema.json", "description": "Automated GitHub issue triaging, investigation and fixing with help of invoked LLM agents from shell.", "id": "issues", "initial": "collecting", "states": { "collecting": { "description": "Fetches, parses and packages issue information (gh read). Wrapped in the retry/timeout pattern: per-attempt CollectAttemptTimeout, overall CollectDeadline, error+timeout funnel into a backoff loop.", "initial": "fetching", "after": { "CollectDeadline": { "target": "#failed" } }, "states": { "fetching": { "invoke": [ { "id": "collect", "src": "collectIssue", "onDone": { "target": "#classifying", "actions": [{ "type": "savePackage" }] }, "onError": [ { "guard": { "type": "shouldRetry" }, "target": "backingOff", "actions": [{ "type": "recordFailure" }] }, { "target": "#failed", "actions": [{ "type": "recordFailure" }] } ] } ], "after": { "CollectAttemptTimeout": [ { "guard": { "type": "hasAttemptsLeft" }, "target": "backingOff" }, { "target": "#failed" } ] } }, "backingOff": { "description": "Fixed backoff. For exponential/jitter, swap this `after` for a `backoff` invoke wired to statesman.BackoffActor.", "after": { "CollectBackoff": { "target": "fetching", "actions": [{ "type": "nextAttempt" }] } } } } }, "classifying": { "description": "One-shot LLM classifies the issue (bug / question / duplicate / invalid). onDone branches: actionable bugs investigate, the rest skip straight to summarising.", "invoke": [ { "id": "classify", "src": "classifyIssue", "onDone": [ { "guard": { "type": "isActionable" }, "target": "investigating", "actions": [{ "type": "saveClassification" }] }, { "target": "summarising", "actions": [{ "type": "saveClassification" }] } ], "onError": { "target": "failed" } } ], "after": { "ClassifyTimeout": { "target": "failed" } } }, "investigating": { "description": "Sub-machine: code analysis / repro / root-cause. Owns its own internal retries; onError still produces a summary.", "invoke": [ { "id": "investigate", "src": "investigate", "onDone": { "target": "fixing", "actions": [{ "type": "saveFindings" }] }, "onError": { "target": "summarising" } } ] }, "fixing": { "description": "Sub-machine: edit -> test -> re-edit loop. Internal retries; a failed fix is still summarised.", "invoke": [ { "id": "fix", "src": "fix", "onDone": { "target": "summarising", "actions": [{ "type": "savePatch" }] }, "onError": { "target": "summarising" } } ] }, "summarising": { "description": "One-shot LLM writes the human-facing summary/comment.", "invoke": [ { "id": "summarise", "src": "summariseIssue", "onDone": { "target": "syncing", "actions": [{ "type": "saveSummary" }] }, "onError": { "target": "failed" } } ], "after": { "SummariseTimeout": { "target": "failed" } } }, "syncing": { "description": "Syncs state back to GitHub (gh write). Same retry/timeout pattern as collecting; idempotency lives in the syncIssue adapter (dedupe marker), not the chart.", "initial": "posting", "after": { "SyncDeadline": { "target": "#failed" } }, "states": { "posting": { "invoke": [ { "id": "sync", "src": "syncIssue", "onDone": { "target": "#finished" }, "onError": [ { "guard": { "type": "shouldRetry" }, "target": "backingOff", "actions": [{ "type": "recordFailure" }] }, { "target": "#failed", "actions": [{ "type": "recordFailure" }] } ] } ], "after": { "SyncAttemptTimeout": [ { "guard": { "type": "hasAttemptsLeft" }, "target": "backingOff" }, { "target": "#failed" } ] } }, "backingOff": { "after": { "SyncBackoff": { "target": "posting", "actions": [{ "type": "nextAttempt" }] } } } } }, "failed": { "description": "Terminal: the run could not complete.", "type": "final" }, "finished": { "description": "Terminal: issue triaged and synced.", "type": "final" } }}