CI Heal Worker
Diagnoses failed CI runs and generates patch PRs.
Queue: ci-healing
Job Flow
- Receive job with CI run data
- Fetch failure logs from GitHub Actions API
- Send logs to Claude for diagnosis
- Parse: failure type, root cause, healable flag
- Update
ci_runswith diagnosis - If healable and not already healed:
- Fetch failing file from GitHub
- Send file + context to Claude for full-file fix
- Validate the fix (non-empty, line delta, syntax)
- Create branch, commit, open PR
- Record in
heal_prs
Claude Diagnosis
Claude receives the last ~100 lines of the failure log and returns:
json
{
"failure_type": "lint_error",
"root_cause": "Missing semicolon on line 42 of src/utils.ts",
"healable": true,
"confidence": "high"
}Full-File Fix Generation
The fix is generated as a complete file replacement:
- Fetch current file from
GET /repos/:owner/:repo/contents/:path - Send file + error to Claude: "Fix this file to resolve the error"
- Claude returns the entire corrected file
- GitWire validates and commits
Branch Naming
gitwire/heal/{github_run_id}Worker File
packages/web/src/workers/ciHealWorker.js