Fix #23: Improve safety gates signals to start work to make work more interactive#27
Merged
Merged
Conversation
- Replace authorization gate with content filtering: any assigned issue is a
candidate, but LLM only sees comments/bodies created by or approved (👍) by
whitelisted users. Issues with no visible content are skipped.
- Two-phase planning: preliminary plan (short overview + questions) →
approval → thorough implementation plan → approval → implementation.
- New comment detection: when new visible comments arrive during
awaiting_preliminary_approval or awaiting_plan_approval, the plan is
updated (existing comment edited + change summary posted).
- Blocked issue detection: skip issues with 'blocked by #N' / 'depends on #N'
in body text, and check GitHub sub-issue relationships via timeline API.
- Post-PR review handling: assign issue author as reviewer after PR creation;
monitor for reviews and address comments in new addressing_review state.
- New state machine:
(none) → preliminary_planning → awaiting_preliminary_approval
→ planning → awaiting_plan_approval → implementing → pr_open → done
- Backward compatibility: old 'awaiting_approval' status mapped to
'awaiting_plan_approval'.
New files:
- src/clayde/prompts/preliminary_plan.j2
- src/clayde/prompts/thorough_plan.j2
- src/clayde/prompts/update_plan.j2
- src/clayde/prompts/address_review.j2
- src/clayde/tasks/review.py
- tests/test_tasks_review.py
Modified files:
- src/clayde/safety.py (content filtering replaces authorization gate)
- src/clayde/github.py (blocked detection, PR review helpers, edit_comment)
- src/clayde/orchestrator.py (new dispatch logic for all states)
- src/clayde/tasks/plan.py (two-phase planning + update support)
- src/clayde/tasks/implement.py (reviewer assignment, pr_open status)
- CLAUDE.md (updated documentation)
- All corresponding test files updated (206 tests passing)
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 #23