Fix #75: Rework clayde GitHub integration#76
Merged
Conversation
Replace the six-phase planning/approval/implementation state machine with a simple timestamp-based event loop. For each assigned issue, Clayde checks for new whitelist-visible activity since last_seen_at and invokes Claude once — Claude decides the next action (ask questions, plan, implement, or address reviews) without hard phases or approval gates. Key changes: - state.py: remove IssueStatus enum and all phase fields; add last_seen_at, in_progress, branch_name, pr_url per issue - orchestrator.py: replace all phase handlers with a single _handle_issue that checks timestamps, detects PR review activity, and handles crash recovery via in_progress flag - tasks/: delete plan.py, implement.py, review.py; add work.py — unified task that builds full issue context and invokes Claude once - prompts/: delete five phase-specific templates; add work.j2 — guides Claude to engage naturally, implement when ready, create PR with summary and recommended reading order for large diffs - responses.py: replace five models with WorkResponse(summary) - safety.py: add get_new_visible_comments() using datetime comparison; remove is_plan_approved() - README.md: rewrite to document event-driven loop, remove state machine diagram and approval-gate documentation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Closes #75
Replaced the rigid six-phase state machine (preliminary plan → approval → thorough plan → approval → implement → review) with a simple event-driven loop. Each assigned issue now tracks only
last_seen_at,in_progress,branch_name, andpr_url. The orchestrator checks for new whitelist-visible activity since the last timestamp and, if found, invokes a single unifiedwork.pytask — Claude decides what to do next (ask questions, post a plan, implement, or address reviews). The five phase-specific prompt templates and three task modules were replaced withwork.j2andtasks/work.py.responses.pynow has a singleWorkResponse(summary)model.safety.pyaddsget_new_visible_comments()using datetime comparison and dropsis_plan_approved(). Crash recovery uses anin_progressflag set before invocation. PR creation is handled by Claude viagh pr create, with a description summary and recommended reading order for diffs touching more than 3 files; Python detects the resulting PR viafind_open_pr()and assigns the issue author as reviewer. README updated to reflect the new event-driven architecture.