Add patrol formula YAML files (gt-ingm.1)
Create initial formula definitions for patrol molecules: - mol-deacon-patrol: Mayor daemon loop (8 steps) - mol-witness-patrol: Christmas Ornament pattern with dynamic bonding (9 steps) - mol-refinery-patrol: Merge queue processor with verification gates (10 steps) - mol-polecat-arm: Single polecat inspection cycle for witness bonding (5 steps) These replace the embedded markdown in molecules_patrol.go with proper formula YAML files that can be cooked into proto beads. Generated with Claude Code Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,154 @@
|
||||
# Refinery Patrol: Merge queue processor with verification gates
|
||||
# The Refinery is the Engineer in the engine room. You process polecat branches,
|
||||
# merging them to main one at a time with sequential rebasing.
|
||||
|
||||
formula: mol-refinery-patrol
|
||||
description: |
|
||||
Merge queue processor patrol loop.
|
||||
|
||||
The Refinery is the Engineer in the engine room. You process polecat branches,
|
||||
merging them to main one at a time with sequential rebasing.
|
||||
|
||||
**The Scotty Test**: Before proceeding past any failure, ask yourself:
|
||||
"Would Scotty walk past a warp core leak because it existed before his shift?"
|
||||
version: 1
|
||||
|
||||
steps:
|
||||
- id: inbox-check
|
||||
description: |
|
||||
Check mail for MR submissions, escalations, messages.
|
||||
|
||||
```bash
|
||||
gt mail inbox
|
||||
# Process any urgent items
|
||||
```
|
||||
|
||||
Handle shutdown requests, escalations, and status queries.
|
||||
|
||||
- id: queue-scan
|
||||
needs: [inbox-check]
|
||||
description: |
|
||||
Fetch remote and identify polecat branches waiting.
|
||||
|
||||
```bash
|
||||
git fetch origin
|
||||
git branch -r | grep polecat
|
||||
gt refinery queue <rig>
|
||||
```
|
||||
|
||||
If queue empty, skip to context-check step.
|
||||
Track branch list for this cycle.
|
||||
|
||||
- id: process-branch
|
||||
needs: [queue-scan]
|
||||
description: |
|
||||
Pick next branch. Rebase on current main.
|
||||
|
||||
```bash
|
||||
git checkout -b temp origin/<polecat-branch>
|
||||
git rebase origin/main
|
||||
```
|
||||
|
||||
If rebase conflicts and unresolvable:
|
||||
- git rebase --abort
|
||||
- Notify polecat to fix and resubmit
|
||||
- Skip to loop-check for next branch
|
||||
|
||||
- id: run-tests
|
||||
needs: [process-branch]
|
||||
description: |
|
||||
Run the test suite.
|
||||
|
||||
```bash
|
||||
go test ./...
|
||||
```
|
||||
|
||||
Track results: pass count, fail count, specific failures.
|
||||
|
||||
- id: handle-failures
|
||||
needs: [run-tests]
|
||||
description: |
|
||||
**VERIFICATION GATE**: This step enforces the Beads Promise.
|
||||
|
||||
If tests PASSED: This step auto-completes. Proceed to merge.
|
||||
|
||||
If tests FAILED:
|
||||
1. Diagnose: Is this a branch regression or pre-existing on main?
|
||||
2. If branch caused it:
|
||||
- Abort merge
|
||||
- Notify polecat: "Tests failing. Please fix and resubmit."
|
||||
- Skip to loop-check
|
||||
3. If pre-existing on main:
|
||||
- Option A: Fix it yourself (you're the Engineer!)
|
||||
- Option B: File a bead: bd create --type=bug --priority=1 --title="..."
|
||||
|
||||
**GATE REQUIREMENT**: You CANNOT proceed to merge-push without:
|
||||
- Tests passing, OR
|
||||
- Fix committed, OR
|
||||
- Bead filed for the failure
|
||||
|
||||
This is non-negotiable. Never disavow. Never "note and proceed."
|
||||
|
||||
- id: merge-push
|
||||
needs: [handle-failures]
|
||||
description: |
|
||||
Merge to main and push immediately.
|
||||
|
||||
```bash
|
||||
git checkout main
|
||||
git merge --ff-only temp
|
||||
git push origin main
|
||||
git branch -d temp
|
||||
git branch -D <polecat-branch> # Local delete (branches never go to origin)
|
||||
```
|
||||
|
||||
Main has moved. Any remaining branches need rebasing on new baseline.
|
||||
|
||||
- id: loop-check
|
||||
needs: [merge-push]
|
||||
description: |
|
||||
More branches to process?
|
||||
|
||||
If yes: Return to process-branch with next branch.
|
||||
If no: Continue to generate-summary.
|
||||
|
||||
Track: branches processed, branches skipped (with reasons).
|
||||
|
||||
- id: generate-summary
|
||||
needs: [loop-check]
|
||||
description: |
|
||||
Summarize this patrol cycle.
|
||||
|
||||
Include:
|
||||
- Branches processed (count, names)
|
||||
- Test results (pass/fail)
|
||||
- Issues filed (if any)
|
||||
- Branches skipped (with reasons)
|
||||
- Any escalations sent
|
||||
|
||||
This becomes the digest when the patrol is squashed.
|
||||
|
||||
- id: context-check
|
||||
needs: [generate-summary]
|
||||
description: |
|
||||
Check own context usage.
|
||||
|
||||
If context is HIGH (>80%):
|
||||
- Write handoff summary
|
||||
- Prepare for burn/respawn
|
||||
|
||||
If context is LOW:
|
||||
- Can continue processing
|
||||
|
||||
- id: burn-or-loop
|
||||
needs: [context-check]
|
||||
description: |
|
||||
End of patrol cycle decision.
|
||||
|
||||
If queue non-empty AND context LOW:
|
||||
- Burn this wisp, start fresh patrol
|
||||
- Return to inbox-check
|
||||
|
||||
If queue empty OR context HIGH:
|
||||
- Burn wisp with summary digest
|
||||
- Exit (daemon will respawn if needed)
|
||||
Reference in New Issue
Block a user