fix: Commit embedded formulas for go install @latest (#117)
* fix: Commit embedded formulas for go install @latest The internal/formula/formulas/ directory was gitignored, causing `go install github.com/steveyegge/gastown/cmd/gt@latest` to fail with: pattern formulas/*.formula.json: no matching files found The go:embed directive requires these files at build time, but go install @latest doesn't run go:generate. By committing the generated formulas, users can install directly without cloning. Maintainers should run `go generate ./...` after modifying .beads/formulas/ to keep the embedded copy in sync. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * ci: Add check for committed embedded formulas Adds a new CI job that: 1. Builds without running go:generate (catches missing formulas) 2. Verifies committed formulas match .beads/formulas/ source Also removes redundant go:generate steps from other jobs since formulas are now committed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: exclude towers-of-hanoi test formulas from embed These are durability stress test fixtures (pre-computed move sequences), not production formulas users need. Excluding them reduces embedded content by ~10K lines. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: gus <steve.yegge@gmail.com>
This commit is contained in:
committed by
GitHub
parent
4ffdc4fe40
commit
1e76bfd7ce
198
internal/formula/formulas/mol-town-shutdown.formula.toml
Normal file
198
internal/formula/formulas/mol-town-shutdown.formula.toml
Normal file
@@ -0,0 +1,198 @@
|
||||
description = """
|
||||
Full Gas Town shutdown and restart.
|
||||
|
||||
This is an idempotent shutdown - it stops Claude sessions but preserves
|
||||
polecat sandboxes and hooks. Polecats can resume their work after restart.
|
||||
|
||||
Use when you need to:
|
||||
- Reset all state for a fresh start
|
||||
- Recover from corrupted agent state
|
||||
- Prepare for maintenance or upgrades
|
||||
|
||||
Sling to Mayor when ready to reboot:
|
||||
gt sling mol-town-shutdown mayor
|
||||
"""
|
||||
formula = "mol-town-shutdown"
|
||||
type = "workflow"
|
||||
version = 2
|
||||
|
||||
[[steps]]
|
||||
id = "preflight-check"
|
||||
title = "Preflight safety check"
|
||||
description = """
|
||||
Scan for conditions that might make shutdown inadvisable.
|
||||
|
||||
```bash
|
||||
gt shutdown preflight
|
||||
```
|
||||
|
||||
This checks for:
|
||||
- **Uncommitted changes**: Polecats with dirty git status
|
||||
- **Unpushed commits**: Work that hasn't reached remote
|
||||
- **Active merges**: Refinery mid-merge (could corrupt state)
|
||||
- **Pending CI**: PRs waiting on GitHub Actions
|
||||
|
||||
Output is a report with warnings/blockers:
|
||||
|
||||
| Severity | Condition | Action |
|
||||
|----------|-----------|--------|
|
||||
| BLOCKER | Active merge in progress | Abort shutdown |
|
||||
| WARNING | Uncommitted polecat changes | List affected polecats |
|
||||
| WARNING | Unpushed commits | List repos needing push |
|
||||
| INFO | Pending CI runs | Note for awareness |
|
||||
|
||||
If blockers exist, STOP and resolve them first.
|
||||
If only warnings, decide whether to proceed (work will be preserved).
|
||||
"""
|
||||
|
||||
[[steps]]
|
||||
id = "stop-sessions"
|
||||
title = "Stop Claude sessions (preserve sandboxes)"
|
||||
needs = ["preflight-check"]
|
||||
description = """
|
||||
Kill Claude processes but leave polecat sandboxes intact.
|
||||
|
||||
```bash
|
||||
# Stop all polecat Claude sessions
|
||||
gt stop --all --preserve-sandbox
|
||||
|
||||
# Verify sandboxes still exist
|
||||
gt polecats --all --status
|
||||
```
|
||||
|
||||
What this does:
|
||||
- Kills tmux sessions running Claude
|
||||
- Leaves git clones untouched
|
||||
- Leaves hook files (pinned molecules) intact
|
||||
- Leaves uncommitted work in place
|
||||
|
||||
What this does NOT do:
|
||||
- Delete polecat directories
|
||||
- Remove hook attachments
|
||||
- Lose any git state
|
||||
|
||||
After restart, polecats can be respawned and will resume from their hooks.
|
||||
|
||||
Note: Crew workers are NOT stopped (they're user-managed).
|
||||
"""
|
||||
|
||||
[[steps]]
|
||||
id = "clear-inboxes"
|
||||
title = "Archive and clear inboxes"
|
||||
needs = ["stop-sessions"]
|
||||
description = """
|
||||
Archive and clear all agent inboxes across all rigs.
|
||||
|
||||
```bash
|
||||
# For each rig
|
||||
for rig in $(gt rigs --names); do
|
||||
gt mail clear $rig/witness --archive
|
||||
gt mail clear $rig/refinery --archive
|
||||
done
|
||||
|
||||
# Clear Mayor inbox
|
||||
gt mail clear mayor --archive
|
||||
```
|
||||
|
||||
Messages are archived to `.beads/mail-archive/` before deletion.
|
||||
Crew inboxes are NOT cleared (user manages those).
|
||||
"""
|
||||
|
||||
[[steps]]
|
||||
id = "stop-daemon"
|
||||
title = "Stop the daemon"
|
||||
needs = ["clear-inboxes"]
|
||||
description = """
|
||||
Stop the Gas Town daemon gracefully.
|
||||
|
||||
```bash
|
||||
gt daemon stop
|
||||
```
|
||||
|
||||
The daemon handles:
|
||||
- Heartbeat monitoring
|
||||
- Pending spawn triggers
|
||||
- Background coordination
|
||||
|
||||
It will be restarted in the final step.
|
||||
"""
|
||||
|
||||
[[steps]]
|
||||
id = "rotate-logs"
|
||||
title = "Rotate and archive logs"
|
||||
needs = ["stop-daemon"]
|
||||
description = """
|
||||
Rotate logs to prevent unbounded growth.
|
||||
|
||||
```bash
|
||||
# Rotate daemon logs
|
||||
gt daemon rotate-logs
|
||||
|
||||
# Clean up old session captures (but not current sandboxes)
|
||||
gt doctor --fix
|
||||
```
|
||||
|
||||
Old logs are moved to `~/gt/logs/archive/` with timestamps.
|
||||
"""
|
||||
|
||||
[[steps]]
|
||||
id = "sync-state"
|
||||
title = "Sync beads and push"
|
||||
needs = ["rotate-logs"]
|
||||
description = """
|
||||
Ensure all beads state is persisted.
|
||||
|
||||
```bash
|
||||
bd sync
|
||||
```
|
||||
|
||||
Note: We do NOT force-commit polecat work here. Their sandboxes
|
||||
are preserved with whatever state they had. They'll commit their
|
||||
own work when they resume.
|
||||
"""
|
||||
|
||||
[[steps]]
|
||||
id = "handoff-mayor"
|
||||
title = "Send Mayor handoff"
|
||||
needs = ["sync-state"]
|
||||
description = """
|
||||
Record shutdown context for the fresh Mayor session.
|
||||
|
||||
```bash
|
||||
gt mail send mayor -s "🤝 HANDOFF: Town shutdown complete" -m "
|
||||
Town shutdown completed. State preserved.
|
||||
|
||||
Polecat sandboxes: PRESERVED (will resume from hooks)
|
||||
Inboxes: ARCHIVED and cleared
|
||||
Daemon: STOPPED
|
||||
|
||||
Next steps:
|
||||
1. gt daemon start
|
||||
2. gt prime
|
||||
3. gt status (verify health)
|
||||
4. Resume operations or respawn polecats
|
||||
|
||||
Shutdown reason: {{shutdown_reason}}
|
||||
"
|
||||
```
|
||||
"""
|
||||
|
||||
[[steps]]
|
||||
id = "restart-daemon"
|
||||
title = "Restart daemon"
|
||||
needs = ["handoff-mayor"]
|
||||
description = """
|
||||
Start the daemon with fresh state.
|
||||
|
||||
```bash
|
||||
gt daemon start
|
||||
```
|
||||
|
||||
The daemon will:
|
||||
- Begin heartbeat monitoring
|
||||
- Watch for pending spawns
|
||||
- Resume background coordination
|
||||
|
||||
Polecats are NOT auto-respawned. Use `gt sling` or let Witness
|
||||
restart them based on their preserved hooks.
|
||||
"""
|
||||
Reference in New Issue
Block a user