From b15c7173d419a2fc50085ef6aefa7fd4c8e06fec Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Fri, 26 Dec 2025 23:46:47 -0800 Subject: [PATCH] chore: Drop JSON formula support, TOML only (gt-spt8v) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Delete all .formula.json files (TOML versions exist) - Update sling.go comment to say TOML only Note: Doc updates were prepared but those docs were deleted upstream in the recent refactoring. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../formulas/mol-deacon-patrol.formula.json | 54 --------------- .beads/formulas/mol-gastown-boot.formula.json | 62 ----------------- .../formulas/mol-polecat-lease.formula.json | 34 ---------- .beads/formulas/mol-polecat-work.formula.json | 36 ---------- .../formulas/mol-refinery-patrol.formula.json | 66 ------------------- .beads/formulas/rule-of-five.formula.json | 37 ----------- .beads/formulas/security-audit.formula.json | 50 -------------- .beads/formulas/shiny-enterprise.formula.json | 12 ---- .beads/formulas/shiny-secure.formula.json | 10 --- .beads/formulas/shiny.formula.json | 46 ------------- .beads/formulas/towers-of-hanoi.formula.json | 66 ------------------- internal/cmd/sling.go | 2 +- internal/templates/roles/deacon.md.tmpl | 18 ++++- 13 files changed, 17 insertions(+), 476 deletions(-) delete mode 100644 .beads/formulas/mol-deacon-patrol.formula.json delete mode 100644 .beads/formulas/mol-gastown-boot.formula.json delete mode 100644 .beads/formulas/mol-polecat-lease.formula.json delete mode 100644 .beads/formulas/mol-polecat-work.formula.json delete mode 100644 .beads/formulas/mol-refinery-patrol.formula.json delete mode 100644 .beads/formulas/rule-of-five.formula.json delete mode 100644 .beads/formulas/security-audit.formula.json delete mode 100644 .beads/formulas/shiny-enterprise.formula.json delete mode 100644 .beads/formulas/shiny-secure.formula.json delete mode 100644 .beads/formulas/shiny.formula.json delete mode 100644 .beads/formulas/towers-of-hanoi.formula.json diff --git a/.beads/formulas/mol-deacon-patrol.formula.json b/.beads/formulas/mol-deacon-patrol.formula.json deleted file mode 100644 index 50edb1c2..00000000 --- a/.beads/formulas/mol-deacon-patrol.formula.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "formula": "mol-deacon-patrol", - "description": "Mayor's daemon patrol loop.\n\nThe Deacon is the Mayor's background process that runs continuously, handling callbacks, monitoring rig health, and performing cleanup. Each patrol cycle runs these steps in sequence, then loops or exits.", - "version": 1, - "steps": [ - { - "id": "inbox-check", - "title": "Handle callbacks from agents", - "description": "Handle callbacks from agents.\n\nCheck the Mayor's inbox for messages from:\n- Witnesses reporting polecat status\n- Refineries reporting merge results\n- Polecats requesting help or escalation\n- External triggers (webhooks, timers)\n\n```bash\ngt mail inbox\n# For each message:\ngt mail read \n# Handle based on message type\n```\n\nCallbacks may spawn new polecats, update issue state, or trigger other actions." - }, - { - "id": "trigger-pending-spawns", - "title": "Nudge newly spawned polecats", - "needs": ["inbox-check"], - "description": "Nudge newly spawned polecats that are ready for input.\n\nWhen polecats are spawned, their Claude session takes 10-20 seconds to initialize. The spawn command returns immediately without waiting. This step finds spawned polecats that are now ready and sends them a trigger to start working.\n\n**ZFC-Compliant Observation** (AI observes AI):\n\n```bash\n# View pending spawns with captured terminal output\ngt deacon pending\n```\n\nFor each pending session, analyze the captured output:\n- Look for Claude's prompt indicator \"> \" at the start of a line\n- If prompt is visible, Claude is ready for input\n- Make the judgment call yourself - you're the AI observer\n\nFor each ready polecat:\n```bash\n# 1. Trigger the polecat\ngt nudge \"Begin.\"\n\n# 2. Clear from pending list\ngt deacon pending \n```\n\nThis triggers the UserPromptSubmit hook, which injects mail so the polecat sees its assignment.\n\n**Bootstrap mode** (daemon-only, no AI available):\nThe daemon uses `gt deacon trigger-pending` with regex detection. This ZFC violation is acceptable during cold startup when no AI agent is running yet." - }, - { - "id": "health-scan", - "title": "Check Witness and Refinery health", - "needs": ["trigger-pending-spawns"], - "description": "Check Witness and Refinery health for each rig.\n\n**ZFC Principle**: You (Claude) make the judgment call about what is \"stuck\" or \"unresponsive\" - there are no hardcoded thresholds in Go. Read the signals, consider context, and decide.\n\nFor each rig, run:\n```bash\ngt witness status \ngt refinery status \n```\n\n**Signals to assess:**\n\n| Component | Healthy Signals | Concerning Signals |\n|-----------|-----------------|-------------------|\n| Witness | State: running, recent activity | State: not running, no heartbeat |\n| Refinery | State: running, queue processing | Queue stuck, merge failures |\n\n**Tracking unresponsive cycles:**\n\nMaintain in your patrol state (persisted across cycles):\n```\nhealth_state:\n :\n witness:\n unresponsive_cycles: 0\n last_seen_healthy: \n refinery:\n unresponsive_cycles: 0\n last_seen_healthy: \n```\n\n**Decision matrix** (you decide the thresholds based on context):\n\n| Cycles Unresponsive | Suggested Action |\n|---------------------|------------------|\n| 1-2 | Note it, check again next cycle |\n| 3-4 | Attempt restart: gt witness restart |\n| 5+ | Escalate to Mayor with context |\n\n**Restart commands:**\n```bash\ngt witness restart \ngt refinery restart \n```\n\n**Escalation:**\n```bash\ngt mail send mayor/ -s \"Health: unresponsive\" \\\n -m \"Component has been unresponsive for N cycles. Restart attempts failed.\n Last healthy: \n Error signals:
\"\n```\n\nReset unresponsive_cycles to 0 when component responds normally." - }, - { - "id": "plugin-run", - "title": "Execute registered plugins", - "needs": ["health-scan"], - "description": "Execute registered plugins.\n\nScan ~/gt/plugins/ for plugin directories. Each plugin has a plugin.md with YAML frontmatter defining its gate (when to run) and instructions (what to do).\n\nSee docs/deacon-plugins.md for full documentation.\n\nGate types:\n- cooldown: Time since last run (e.g., 24h)\n- cron: Schedule-based (e.g., \"0 9 * * *\")\n- condition: Metric threshold (e.g., wisp count > 50)\n- event: Trigger-based (e.g., startup, heartbeat)\n\nFor each plugin:\n1. Read plugin.md frontmatter to check gate\n2. Compare against state.json (last run, etc.)\n3. If gate is open, execute the plugin\n\nPlugins marked parallel: true can run concurrently using Task tool subagents. Sequential plugins run one at a time in directory order.\n\nSkip this step if ~/gt/plugins/ does not exist or is empty." - }, - { - "id": "orphan-check", - "title": "Find abandoned work", - "needs": ["health-scan"], - "description": "Find abandoned work.\n\nScan for orphaned state:\n- Issues marked in_progress with no active polecat\n- Polecats that stopped responding mid-work\n- Merge queue entries with no polecat owner\n- Wisp sessions that outlived their spawner\n\n```bash\nbd list --status=in_progress\ngt polecats --all --orphan\n```\n\nFor each orphan:\n- Check if polecat session still exists\n- If not, mark issue for reassignment or retry\n- File incident beads if data loss occurred" - }, - { - "id": "session-gc", - "title": "Clean dead sessions", - "needs": ["orphan-check"], - "description": "Clean dead sessions and orphaned state.\n\nRun `gt doctor --fix` to handle all cleanup:\n\n```bash\n# Preview what needs cleaning\ngt doctor -v\n\n# Fix everything\ngt doctor --fix\n```\n\nThis handles:\n- **orphan-sessions**: Kill orphaned tmux sessions (gt-* not matching valid patterns)\n- **orphan-processes**: Kill orphaned Claude processes (no tmux parent)\n- **wisp-gc**: Garbage collect abandoned wisps (>1h old)\n\nAll cleanup is handled by doctor checks - no need to run separate commands." - }, - { - "id": "context-check", - "title": "Check own context limit", - "needs": ["session-gc"], - "description": "Check own context limit.\n\nThe Deacon runs in a Claude session with finite context. Check if approaching the limit:\n\n```bash\ngt context --usage\n```\n\nIf context is high (>80%), prepare for handoff:\n- Summarize current state\n- Note any pending work\n- Write handoff to molecule state\n\nThis enables the Deacon to burn and respawn cleanly." - }, - { - "id": "loop-or-exit", - "title": "Burn and respawn or loop", - "needs": ["context-check"], - "description": "Burn and let daemon respawn, or exit if context high.\n\nDecision point at end of patrol cycle:\n\nIf context is LOW:\n- Sleep briefly (avoid tight loop)\n- Return to inbox-check step\n\nIf context is HIGH:\n- Write state to persistent storage\n- Exit cleanly\n- Let the daemon orchestrator respawn a fresh Deacon\n\nThe daemon ensures Deacon is always running:\n```bash\n# Daemon respawns on exit\ngt daemon status\n```\n\nThis enables infinite patrol duration via context-aware respawning." - } - ] -} diff --git a/.beads/formulas/mol-gastown-boot.formula.json b/.beads/formulas/mol-gastown-boot.formula.json deleted file mode 100644 index 9e97e647..00000000 --- a/.beads/formulas/mol-gastown-boot.formula.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "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." - } - ] -} diff --git a/.beads/formulas/mol-polecat-lease.formula.json b/.beads/formulas/mol-polecat-lease.formula.json deleted file mode 100644 index f04a7e0f..00000000 --- a/.beads/formulas/mol-polecat-lease.formula.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "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, - "vars": { - "polecat": { - "required": true, - "description": "Name of the polecat" - }, - "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." - } - ] -} diff --git a/.beads/formulas/mol-polecat-work.formula.json b/.beads/formulas/mol-polecat-work.formula.json deleted file mode 100644 index abbd260d..00000000 --- a/.beads/formulas/mol-polecat-work.formula.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "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, - "vars": { - "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." - } - ] -} diff --git a/.beads/formulas/mol-refinery-patrol.formula.json b/.beads/formulas/mol-refinery-patrol.formula.json deleted file mode 100644 index 1902bfc7..00000000 --- a/.beads/formulas/mol-refinery-patrol.formula.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "formula": "mol-refinery-patrol", - "description": "Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**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", - "title": "Check refinery mail", - "description": "Check mail for MR submissions, escalations, messages.\n\n```bash\ngt mail inbox\n# Process any urgent items\n```\n\nHandle shutdown requests, escalations, and status queries." - }, - { - "id": "queue-scan", - "title": "Scan merge queue", - "needs": ["inbox-check"], - "description": "Fetch remote and identify polecat branches waiting.\n\n```bash\ngit fetch origin\ngit branch -r | grep polecat\ngt refinery queue \n```\n\nIf queue empty, skip to context-check step. Track branch list for this cycle." - }, - { - "id": "process-branch", - "title": "Process next branch", - "needs": ["queue-scan"], - "description": "Pick next branch. Rebase on current main.\n\n```bash\ngit checkout -b temp origin/\ngit rebase origin/main\n```\n\nIf rebase conflicts and unresolvable:\n- git rebase --abort\n- Notify polecat to fix and resubmit\n- Skip to loop-check for next branch" - }, - { - "id": "run-tests", - "title": "Run test suite", - "needs": ["process-branch"], - "description": "Run the test suite.\n\n```bash\ngo test ./...\n```\n\nTrack results: pass count, fail count, specific failures." - }, - { - "id": "handle-failures", - "title": "Handle test failures", - "needs": ["run-tests"], - "description": "**VERIFICATION GATE**: This step enforces the Beads Promise.\n\nIf tests PASSED: This step auto-completes. Proceed to merge.\n\nIf tests FAILED:\n1. Diagnose: Is this a branch regression or pre-existing on main?\n2. If branch caused it:\n - Abort merge\n - Notify polecat: \"Tests failing. Please fix and resubmit.\"\n - Skip to loop-check\n3. If pre-existing on main:\n - Option A: Fix it yourself (you're the Engineer!)\n - Option B: File a bead: bd create --type=bug --priority=1 --title=\"...\"\n\n**GATE REQUIREMENT**: You CANNOT proceed to merge-push without:\n- Tests passing, OR\n- Fix committed, OR\n- Bead filed for the failure\n\nThis is non-negotiable. Never disavow. Never \"note and proceed.\"" - }, - { - "id": "merge-push", - "title": "Merge and push to main", - "needs": ["handle-failures"], - "description": "Merge to main and push immediately.\n\n```bash\ngit checkout main\ngit merge --ff-only temp\ngit push origin main\ngit branch -d temp\ngit branch -D # Local delete (branches never go to origin)\n```\n\nMain has moved. Any remaining branches need rebasing on new baseline." - }, - { - "id": "loop-check", - "title": "Check for more work", - "needs": ["merge-push"], - "description": "More branches to process?\n\nIf yes: Return to process-branch with next branch.\nIf no: Continue to generate-summary.\n\nTrack: branches processed, branches skipped (with reasons)." - }, - { - "id": "generate-summary", - "title": "Generate handoff summary", - "needs": ["loop-check"], - "description": "Summarize this patrol cycle.\n\nInclude:\n- Branches processed (count, names)\n- Test results (pass/fail)\n- Issues filed (if any)\n- Branches skipped (with reasons)\n- Any escalations sent\n\nThis becomes the digest when the patrol is squashed." - }, - { - "id": "context-check", - "title": "Check own context limit", - "needs": ["generate-summary"], - "description": "Check own context usage.\n\nIf context is HIGH (>80%):\n- Write handoff summary\n- Prepare for burn/respawn\n\nIf context is LOW:\n- Can continue processing" - }, - { - "id": "burn-or-loop", - "title": "Burn and respawn or loop", - "needs": ["context-check"], - "description": "End of patrol cycle decision.\n\nIf queue non-empty AND context LOW:\n- Burn this wisp, start fresh patrol\n- Return to inbox-check\n\nIf queue empty OR context HIGH:\n- Burn wisp with summary digest\n- Exit (daemon will respawn if needed)" - } - ] -} diff --git a/.beads/formulas/rule-of-five.formula.json b/.beads/formulas/rule-of-five.formula.json deleted file mode 100644 index eccf7ac3..00000000 --- a/.beads/formulas/rule-of-five.formula.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "formula": "rule-of-five", - "type": "expansion", - "description": "Jeffrey Emanuel's discovery: LLM agents produce best work through 4-5 iterative refinements. Breadth-first exploration, then editorial passes.", - "version": 1, - "template": [ - { - "id": "{target}.draft", - "title": "Draft: {target.title}", - "description": "Initial attempt at: {target.description}. Don't aim for perfection. Get the shape right. Breadth over depth." - }, - { - "id": "{target}.refine-1", - "title": "Refine 1: Correctness", - "description": "First refinement pass. Focus: CORRECTNESS. Fix errors, bugs, mistakes. Is the logic sound?", - "needs": ["{target}.draft"] - }, - { - "id": "{target}.refine-2", - "title": "Refine 2: Clarity", - "description": "Second refinement pass. Focus: CLARITY. Can someone else understand this? Simplify. Remove jargon.", - "needs": ["{target}.refine-1"] - }, - { - "id": "{target}.refine-3", - "title": "Refine 3: Edge Cases", - "description": "Third refinement pass. Focus: EDGE CASES. What could go wrong? What's missing? Handle the unusual.", - "needs": ["{target}.refine-2"] - }, - { - "id": "{target}.refine-4", - "title": "Refine 4: Excellence", - "description": "Final polish. Focus: EXCELLENCE. This is the last pass. Make it shine. Is this something you'd be proud to ship?", - "needs": ["{target}.refine-3"] - } - ] -} diff --git a/.beads/formulas/security-audit.formula.json b/.beads/formulas/security-audit.formula.json deleted file mode 100644 index 13ac5c2f..00000000 --- a/.beads/formulas/security-audit.formula.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "formula": "security-audit", - "type": "aspect", - "description": "Cross-cutting security concern. Applies security scanning before and after implementation steps.", - "version": 1, - "pointcuts": [ - {"glob": "implement"}, - {"glob": "submit"} - ], - "advice": [ - { - "target": "implement", - "around": { - "before": [ - { - "id": "{step.id}-security-prescan", - "title": "Security prescan for {step.id}", - "description": "Pre-implementation security check. Review for secrets/credentials in scope. Check dependencies for known vulnerabilities." - } - ], - "after": [ - { - "id": "{step.id}-security-postscan", - "title": "Security postscan for {step.id}", - "description": "Post-implementation security scan. Scan new code for vulnerabilities (SAST). Check for hardcoded secrets. Review for OWASP Top 10 issues." - } - ] - } - }, - { - "target": "submit", - "around": { - "before": [ - { - "id": "{step.id}-security-prescan", - "title": "Security prescan for {step.id}", - "description": "Pre-submission security check. Final vulnerability scan before merge." - } - ], - "after": [ - { - "id": "{step.id}-security-postscan", - "title": "Security postscan for {step.id}", - "description": "Post-submission security verification. Confirm no new vulnerabilities introduced." - } - ] - } - } - ] -} diff --git a/.beads/formulas/shiny-enterprise.formula.json b/.beads/formulas/shiny-enterprise.formula.json deleted file mode 100644 index 63dc85e3..00000000 --- a/.beads/formulas/shiny-enterprise.formula.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "formula": "shiny-enterprise", - "type": "workflow", - "extends": ["shiny"], - "description": "Enterprise-grade engineering workflow. Shiny + Rule of Five expansion on implement step.", - "version": 1, - "compose": { - "expand": [ - {"target": "implement", "with": "rule-of-five"} - ] - } -} diff --git a/.beads/formulas/shiny-secure.formula.json b/.beads/formulas/shiny-secure.formula.json deleted file mode 100644 index 11d6ba44..00000000 --- a/.beads/formulas/shiny-secure.formula.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "formula": "shiny-secure", - "type": "workflow", - "description": "Shiny workflow with security audit aspect applied.", - "version": 1, - "extends": ["shiny"], - "compose": { - "aspects": ["security-audit"] - } -} diff --git a/.beads/formulas/shiny.formula.json b/.beads/formulas/shiny.formula.json deleted file mode 100644 index 17233641..00000000 --- a/.beads/formulas/shiny.formula.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "formula": "shiny", - "type": "workflow", - "description": "Engineer in a Box - the canonical right way. Design before you code. Review before you ship. Test before you submit.", - "version": 1, - "vars": { - "feature": { - "description": "The feature being implemented", - "required": true - }, - "assignee": { - "description": "Who is assigned to this work" - } - }, - "steps": [ - { - "id": "design", - "title": "Design {{feature}}", - "description": "Think carefully about architecture before writing code. Consider: How does this fit into the existing system? What are the edge cases? What could go wrong? Is there a simpler approach?" - }, - { - "id": "implement", - "title": "Implement {{feature}}", - "description": "Write the code for {{feature}}. Follow the design. Keep it simple. Don't gold-plate.", - "needs": ["design"] - }, - { - "id": "review", - "title": "Review implementation", - "description": "Review the implementation. Check for: Does it match the design? Are there obvious bugs? Is it readable and maintainable? Are there security concerns?", - "needs": ["implement"] - }, - { - "id": "test", - "title": "Test {{feature}}", - "description": "Write and run tests. Unit tests for new code, integration tests if needed, run the full test suite, fix any regressions.", - "needs": ["review"] - }, - { - "id": "submit", - "title": "Submit for merge", - "description": "Submit for merge. Final check: git status, git diff. Commit with clear message. Push and create PR.", - "needs": ["test"] - } - ] -} diff --git a/.beads/formulas/towers-of-hanoi.formula.json b/.beads/formulas/towers-of-hanoi.formula.json deleted file mode 100644 index 5ab2e43e..00000000 --- a/.beads/formulas/towers-of-hanoi.formula.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "formula": "towers-of-hanoi", - "description": "Solve Towers of Hanoi for {disks} disks. Generates 2^{disks} - 1 steps, each a trivial move operation. Demonstrates mechanical structure generation for arbitrarily long workflows.", - "version": 1, - "vars": { - "disks": { - "description": "Number of disks to solve", - "required": true - }, - "source_peg": { - "description": "Starting peg", - "default": "A" - }, - "target_peg": { - "description": "Target peg", - "default": "C" - }, - "auxiliary_peg": { - "description": "Helper peg", - "default": "B" - } - }, - "generate": { - "for-each": { - "var": "move_num", - "range": "1..2^{disks}" - }, - "step": { - "id": "move-{move_num}", - "description": "Move {computed_disk} from {computed_source} to {computed_target}. This is move {move_num} of {total_moves}. Simply execute the move - no decision needed.", - "needs": ["move-{move_num - 1}"], - "compute": { - "disk": "lowest_set_bit({move_num})", - "source": "peg_for_disk({disk}, {move_num}, 'source')", - "target": "peg_for_disk({disk}, {move_num}, 'target')" - } - } - }, - "steps": [ - { - "id": "setup", - "description": "Verify initial state: {disks} disks stacked on peg {source_peg}. All disks in order (largest on bottom)." - }, - { - "id": "solve", - "description": "Execute all {total_moves} moves to transfer tower from {source_peg} to {target_peg}.", - "needs": ["setup"] - }, - { - "id": "verify", - "description": "Verify final state: all {disks} disks now on peg {target_peg}. Tower intact, all moves were legal.", - "needs": ["solve"] - } - ], - "example_3_disk": { - "steps": [ - {"id": "move-1", "description": "Move disk 1 from A to C"}, - {"id": "move-2", "description": "Move disk 2 from A to B", "needs": ["move-1"]}, - {"id": "move-3", "description": "Move disk 1 from C to B", "needs": ["move-2"]}, - {"id": "move-4", "description": "Move disk 3 from A to C", "needs": ["move-3"]}, - {"id": "move-5", "description": "Move disk 1 from B to A", "needs": ["move-4"]}, - {"id": "move-6", "description": "Move disk 2 from B to C", "needs": ["move-5"]}, - {"id": "move-7", "description": "Move disk 1 from A to C", "needs": ["move-6"]} - ] - } -} diff --git a/internal/cmd/sling.go b/internal/cmd/sling.go index f0a8f03b..6c66deef 100644 --- a/internal/cmd/sling.go +++ b/internal/cmd/sling.go @@ -469,7 +469,7 @@ func resolveSelfTarget() (agentID string, pane string, hookRoot string, err erro } // verifyFormulaExists checks that the formula exists using bd formula show. -// Formulas can be formula files (.formula.json/.formula.toml). +// Formulas are TOML files (.formula.toml). func verifyFormulaExists(formulaName string) error { // Try bd formula show (handles all formula file formats) cmd := exec.Command("bd", "formula", "show", formulaName) diff --git a/internal/templates/roles/deacon.md.tmpl b/internal/templates/roles/deacon.md.tmpl index 41bc9513..f2fdd42b 100644 --- a/internal/templates/roles/deacon.md.tmpl +++ b/internal/templates/roles/deacon.md.tmpl @@ -162,6 +162,20 @@ This is the opposite of polecat work, which is persistent and auditable. | Witness | `gt--witness` | | Crew | `gt--` | +## Inbox Hygiene + +**CRITICAL**: Always delete messages after handling them. Messages accumulate if not cleared. + +```bash +gt mail inbox # Check inbox +gt mail read # Read message +# ... handle the message ... +gt mail delete # ALWAYS delete after handling +``` + +**Handoff messages** (`🤝 HANDOFF:`) are context notes from your previous session. +Read them for situational awareness, then delete immediately. + ## Lifecycle Request Handling When you receive lifecycle mail: @@ -183,8 +197,8 @@ gt mail read gt mayor stop gt mayor start -# Acknowledge -gt mail ack +# Delete the message +gt mail delete ``` ## Timer Callbacks