Add mix loop: autonomous AI-driven issue resolution - #38
Closed
KTSCode wants to merge 1 commit into
Closed
Conversation
Adds Mix.Tasks.Loop, a self-correcting loop that picks an open GitHub issue, classifies it as a feature or bug from its labels, and repeatedly drives `claude` headless to implement/fix it — verifying each attempt with `mix quality` and feeding failures back into the next attempt until the suite is green or the iteration budget is spent. On success it commits, pushes, opens a PR closing the issue, and comments the outcome. Inspired by the mix todo / mix bump prompt-emitting pattern, extended into an autonomous cycle. Pure functions (issue parsing, classification, prompt building, loop decision) are unit-tested; git/gh/claude shell wrappers follow the project convention of manual testing. https://claude.ai/code/session_01FJ7GGnsNFWoyqr8KzDEyyp
Owner
Author
|
Closing this. Severance isn't complex enough to justify an autonomous feature/debug loop — the manual |
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
Introduces
mix loop, a new Mix task that autonomously resolves GitHub issues by driving a self-correcting AI loop. The task picks an open issue, classifies it as a feature or bug, repeatedly invokes theclaudeagent to implement/fix it, verifies each attempt withmix quality, and feeds failures back into subsequent attempts until the suite passes or the iteration budget is exhausted.Key Changes
New task module (
lib/mix/tasks/loop.ex): 619-line implementation with:claudeheadless →mix quality→ decision logicPure functions (unit-testable):
parse_issues/1,parse_issue/1: JSON decoding fromghCLIclassify_issue/1: label-based feature/bug detectionslugify/1,build_branch_name/2: branch naming conventionspr_title/2,commit_message/2: conventional commit formattingbuild_initial_prompt/3,build_retry_prompt/5: context-aware promptsshould_continue?/3: loop termination logic (done/retry/exhausted)build_summary/4,extract_pr_url/1: result reportingTest suite (
test/mix/tasks/loop_test.exs): 302 lines covering all pure functions with 40+ test casesDocumentation:
docs/specs/2026-06-08-feature-debug-loop-design.md)Notable Implementation Details
mix todo)--maxflag (default 5) prevents infinite loopsghandclaudeare installed upfrontmix qualityoutput (last 40 lines by default) to guide the agent's fixes--issue Nfor specific issues,--label Lto filter, or auto-pick the next open issue--quick(default) for faster iteration;--fullfor comprehensive quality checksUsage
https://claude.ai/code/session_01FJ7GGnsNFWoyqr8KzDEyyp