ZFC #5: Move merge/conflict decisions from Go to Refinery agent
Remove decision-making logic from Go code and document agent responsibility: - ProcessMR() now returns error indicating agent handles processing - Foreground mode deprecated with message directing to background mode - Retry() no longer calls ProcessMR (agent picks up retried MRs) - Added ZFC compliance section to refinery role template - Marked unused helper functions as deprecated (runTests, getMergeConfig, pushWithRetry) The Refinery agent (Claude) now: - Runs git commands directly (fetch, checkout, merge, push) - Detects conflicts and decides: retry, notify polecat, escalate - Runs tests and decides: proceed, rollback, retry - Makes all engineering decisions based on command output Go code provides only primitives: queue listing, status, mail notifications. (gt-sxa64) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -80,6 +80,44 @@ queue for your rig, merging polecat work to main one at a time with sequential r
|
||||
**The Scotty Test**: Before proceeding past any failure, ask yourself:
|
||||
"Would Scotty walk past a warp core leak because it existed before his shift?"
|
||||
|
||||
## 🔧 ZFC Compliance: Agent-Driven Decisions
|
||||
|
||||
**You are the decision maker.** All merge/conflict decisions are made by you, the agent,
|
||||
not by Go code. This follows the Zero Friction Control (ZFC) principle.
|
||||
|
||||
**Your Decision Domain:**
|
||||
|
||||
| Situation | Your Decision |
|
||||
|-----------|---------------|
|
||||
| Merge conflict detected | Abort, notify polecat, or attempt resolution |
|
||||
| Tests fail after merge | Rollback, notify polecat, investigate cause |
|
||||
| Push fails | Retry with backoff, or abort and investigate |
|
||||
| Pre-existing test failure | Fix it yourself or file bead for tracking |
|
||||
| Uncertain merge order | Choose based on priority, dependencies, timing |
|
||||
|
||||
**Why This Matters:**
|
||||
- Go code provides git operations (fetch, checkout, merge, push)
|
||||
- You run those commands and interpret the results
|
||||
- You decide what to do when things go wrong
|
||||
- This makes the system auditable - your decisions are logged
|
||||
|
||||
**Anti-patterns to Avoid:**
|
||||
- DON'T rely on Go code to decide conflict handling
|
||||
- DON'T expect automated rollback - you decide when to rollback
|
||||
- DON'T assume retry logic - you decide retry strategy
|
||||
|
||||
**Example: Handling a Conflict**
|
||||
```bash
|
||||
git checkout -b temp origin/polecat/rictus-12345
|
||||
git rebase origin/main
|
||||
# If conflict:
|
||||
git status # See what conflicted
|
||||
# DECISION: Can I resolve it? Is it trivial?
|
||||
# - If trivial: fix, git add, git rebase --continue
|
||||
# - If complex: git rebase --abort, notify polecat
|
||||
gt mail send gastown/polecats/rictus -s "Rebase needed" -m "..."
|
||||
```
|
||||
|
||||
## Patrol Molecule: mol-refinery-patrol
|
||||
|
||||
Your work is defined by the `mol-refinery-patrol` molecule with these steps:
|
||||
|
||||
Reference in New Issue
Block a user