bd sync: 2025-12-25 11:45:01
This commit is contained in:
62
.beads/formulas/mol-gastown-boot.formula.json
Normal file
62
.beads/formulas/mol-gastown-boot.formula.json
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"formula": "mol-gastown-boot",
|
||||
"description": "Mayor bootstraps Gas Town via a verification-gated lifecycle molecule.\n\n## Purpose\nWhen Mayor executes \"boot up gas town\", this proto provides the workflow.\nEach step has action + verification - steps stay open until outcome is confirmed.\n\n## Key Principles\n1. **Verification-gated steps** - Not \"command ran\" but \"outcome confirmed\"\n2. **gt peek for verification** - Capture session output to detect stalls\n3. **gt nudge for recovery** - Reliable message delivery to unstick agents\n4. **Parallel where possible** - Witnesses and refineries can start in parallel\n5. **Ephemeral execution** - Boot is a wisp, squashed to digest after completion\n\n## Execution\n```bash\nbd wisp mol-gastown-boot # Create wisp\n```",
|
||||
"version": 1,
|
||||
"steps": [
|
||||
{
|
||||
"id": "ensure-daemon",
|
||||
"title": "Ensure daemon",
|
||||
"description": "Verify the Gas Town daemon is running.\n\n## Action\n```bash\ngt daemon status || gt daemon start\n```\n\n## Verify\n1. Daemon PID file exists: `~/.gt/daemon.pid`\n2. Process is alive: `kill -0 $(cat ~/.gt/daemon.pid)`\n3. Daemon responds: `gt daemon status` returns success\n\n## OnFail\nCannot start daemon. Log error and continue - some commands work without daemon."
|
||||
},
|
||||
{
|
||||
"id": "ensure-deacon",
|
||||
"title": "Ensure deacon",
|
||||
"needs": ["ensure-daemon"],
|
||||
"description": "Start the Deacon and verify patrol mode is active.\n\n## Action\n```bash\ngt deacon start\n```\n\n## Verify\n1. Session exists: `tmux has-session -t gt-deacon 2>/dev/null`\n2. Not stalled: `gt peek deacon/` does NOT show \"> Try\" prompt\n3. Heartbeat fresh: `deacon/heartbeat.json` modified < 2 min ago\n\n## OnStall\n```bash\ngt nudge deacon/ \"Start patrol.\"\nsleep 30\n# Re-verify\n```"
|
||||
},
|
||||
{
|
||||
"id": "ensure-witnesses",
|
||||
"title": "Ensure witnesses",
|
||||
"needs": ["ensure-deacon"],
|
||||
"type": "parallel",
|
||||
"description": "Parallel container: Start all rig witnesses.\n\nChildren execute in parallel. Container completes when all children complete.",
|
||||
"children": [
|
||||
{
|
||||
"id": "ensure-gastown-witness",
|
||||
"title": "Ensure gastown witness",
|
||||
"description": "Start the gastown rig Witness.\n\n## Action\n```bash\ngt witness start gastown\n```\n\n## Verify\n1. Session exists: `tmux has-session -t gastown-witness 2>/dev/null`\n2. Not stalled: `gt peek gastown/witness` does NOT show \"> Try\" prompt\n3. Heartbeat fresh: Last patrol cycle < 5 min ago"
|
||||
},
|
||||
{
|
||||
"id": "ensure-beads-witness",
|
||||
"title": "Ensure beads witness",
|
||||
"description": "Start the beads rig Witness.\n\n## Action\n```bash\ngt witness start beads\n```\n\n## Verify\n1. Session exists: `tmux has-session -t beads-witness 2>/dev/null`\n2. Not stalled: `gt peek beads/witness` does NOT show \"> Try\" prompt\n3. Heartbeat fresh: Last patrol cycle < 5 min ago"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "ensure-refineries",
|
||||
"title": "Ensure refineries",
|
||||
"needs": ["ensure-deacon"],
|
||||
"type": "parallel",
|
||||
"description": "Parallel container: Start all rig refineries.\n\nChildren execute in parallel. Container completes when all children complete.",
|
||||
"children": [
|
||||
{
|
||||
"id": "ensure-gastown-refinery",
|
||||
"title": "Ensure gastown refinery",
|
||||
"description": "Start the gastown rig Refinery.\n\n## Action\n```bash\ngt refinery start gastown\n```\n\n## Verify\n1. Session exists: `tmux has-session -t gastown-refinery 2>/dev/null`\n2. Not stalled: `gt peek gastown/refinery` does NOT show \"> Try\" prompt\n3. Queue processing: Refinery can receive merge requests"
|
||||
},
|
||||
{
|
||||
"id": "ensure-beads-refinery",
|
||||
"title": "Ensure beads refinery",
|
||||
"description": "Start the beads rig Refinery.\n\n## Action\n```bash\ngt refinery start beads\n```\n\n## Verify\n1. Session exists: `tmux has-session -t beads-refinery 2>/dev/null`\n2. Not stalled: `gt peek beads/refinery` does NOT show \"> Try\" prompt\n3. Queue processing: Refinery can receive merge requests"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "verify-town-health",
|
||||
"title": "Verify town health",
|
||||
"needs": ["ensure-witnesses", "ensure-refineries"],
|
||||
"description": "Final verification that Gas Town is healthy.\n\n## Action\n```bash\ngt status\n```\n\n## Verify\n1. Daemon running: Shows daemon status OK\n2. Deacon active: Shows deacon in patrol mode\n3. All witnesses: Each rig witness shows active\n4. All refineries: Each rig refinery shows active\n\n## OnFail\nLog degraded state but consider boot complete. Some agents may need manual recovery.\nRun `gt doctor` for detailed diagnostics."
|
||||
}
|
||||
]
|
||||
}
|
||||
36
.beads/formulas/mol-polecat-lease.formula.json
Normal file
36
.beads/formulas/mol-polecat-lease.formula.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"formula": "mol-polecat-lease",
|
||||
"description": "Semaphore tracking a single polecat's lifecycle.\n\nUsed by Witness to track polecat lifecycle during patrol. The Witness bonds this proto for each active polecat, creating a lease that tracks the polecat from spawn through work to cleanup.\n\n## Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| polecat | Yes | Name of the polecat |\n| issue | Yes | The issue assigned to the polecat |",
|
||||
"version": 1,
|
||||
"variables": [
|
||||
{
|
||||
"name": "polecat",
|
||||
"required": true,
|
||||
"description": "Name of the polecat"
|
||||
},
|
||||
{
|
||||
"name": "issue",
|
||||
"required": true,
|
||||
"description": "The issue assigned to the polecat"
|
||||
}
|
||||
],
|
||||
"steps": [
|
||||
{
|
||||
"id": "boot",
|
||||
"title": "Boot",
|
||||
"description": "Spawned. Verify it starts working.\n\nCheck if the polecat is alive and working:\n```bash\ngt peek {{polecat}}\n```\n\nIf idle for too long, nudge:\n```bash\ngt nudge {{polecat}} \"Please start working on your assigned issue.\"\n```\n\nTimeout: 60s before escalation to Mayor."
|
||||
},
|
||||
{
|
||||
"id": "working",
|
||||
"title": "Working",
|
||||
"needs": ["boot"],
|
||||
"description": "Actively working. Monitor for stuck.\n\nThe polecat is processing its assigned issue ({{issue}}).\nMonitor via peek. Watch for:\n- Progress on commits\n- Status updates in beads\n- SHUTDOWN mail when done\n\nWait for SHUTDOWN signal from the polecat."
|
||||
},
|
||||
{
|
||||
"id": "done",
|
||||
"title": "Done",
|
||||
"needs": ["working"],
|
||||
"description": "Exit received. Ready for cleanup.\n\nThe polecat has completed its work and sent SHUTDOWN.\nPerform cleanup:\n```bash\ngt session kill {{polecat}}\ngt worktree prune {{polecat}}\n```\n\nUpdate beads state and close the lease."
|
||||
}
|
||||
]
|
||||
}
|
||||
37
.beads/formulas/mol-polecat-work.formula.json
Normal file
37
.beads/formulas/mol-polecat-work.formula.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"formula": "mol-polecat-work",
|
||||
"description": "Full polecat lifecycle from assignment to decommission.\n\nThis proto enables nondeterministic idempotence for polecat work. A polecat that crashes after any step can restart, read its molecule state, and continue from the last completed step. No work is lost.\n\n## Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| issue | Yes | The source issue ID being worked on |",
|
||||
"version": 1,
|
||||
"variables": [
|
||||
{
|
||||
"name": "issue",
|
||||
"required": true,
|
||||
"description": "The source issue ID being worked on"
|
||||
}
|
||||
],
|
||||
"steps": [
|
||||
{
|
||||
"id": "load-context",
|
||||
"title": "Load context",
|
||||
"description": "Run gt prime and bd prime. Verify issue assignment.\nCheck inbox for any relevant messages.\n\nRead the assigned issue ({{issue}}) and understand the requirements.\nIdentify any blockers or missing information."
|
||||
},
|
||||
{
|
||||
"id": "implement",
|
||||
"title": "Implement",
|
||||
"needs": ["load-context"],
|
||||
"description": "Implement the solution for {{issue}}. Follow codebase conventions.\nFile discovered work as new issues with bd create.\n\nMake regular commits with clear messages.\nKeep changes focused on the assigned issue."
|
||||
},
|
||||
{
|
||||
"id": "self-review",
|
||||
"title": "Self-review",
|
||||
"needs": ["implement"],
|
||||
"description": "Review your own changes. Look for:\n- Bugs and edge cases\n- Style issues\n- Missing error handling\n- Security concerns\n\nFix any issues found before proceeding."
|
||||
},
|
||||
{
|
||||
"id": "request-shutdown",
|
||||
"title": "Request shutdown",
|
||||
"needs": ["self-review"],
|
||||
"description": "Send shutdown request to Witness.\nWait for termination.\n\nThe polecat is now ready to be cleaned up.\nDo not exit directly - wait for Witness to kill the session."
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user