- Add title field to all steps (required by cook) - Use hardcoded 3-disk solution (9 steps) as working proof - Remove pseudo-syntax generate block (not implemented) - Version bump to 2 Tested: bd cook --dry-run passes, mol pour creates valid molecule, execution loop works (all 9 steps can be closed in sequence). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
106 lines
2.7 KiB
TOML
106 lines
2.7 KiB
TOML
description = """
|
|
AGENT EXECUTION PROTOCOL - Towers of Hanoi
|
|
|
|
PURPOSE: This is a durability proof, not computation. Steps are pre-computed.
|
|
Your job is to execute them mechanically, proving crash-recovery at scale.
|
|
|
|
EXECUTION LOOP:
|
|
1. Find current state: bd mol current <mol-id>
|
|
2. Find the next ready (unblocked) step
|
|
3. Close it: bd close <step-id>
|
|
4. Repeat until no ready steps remain
|
|
|
|
ON RESUME (after crash/restart/handoff):
|
|
- Same as fresh start. The molecule IS the state.
|
|
- Query `bd mol current <mol-id>`, continue from there.
|
|
- No memory of previous session needed.
|
|
|
|
DO:
|
|
- Close steps as fast as possible (they're trivial mechanical moves)
|
|
- Use `gt handoff` when context fills (proactive cycling)
|
|
- Trust the pre-computed solution - every move is already correct
|
|
|
|
DO NOT:
|
|
- Try to solve Hanoi yourself - moves are already computed
|
|
- Mark steps in_progress - just close them directly
|
|
- Ask for permission - this is GUPP territory, just execute
|
|
- Stop for human input - run autonomously until complete
|
|
|
|
MONITORING:
|
|
- Progress: Count closed children of the molecule
|
|
- For mega-molecules: Use convoy dashboard when available
|
|
- Completion: All steps closed = molecule complete
|
|
|
|
This proves Gas Town can execute arbitrarily long workflows with
|
|
nondeterministic idempotence - different sessions, same outcome.
|
|
"""
|
|
formula = "towers-of-hanoi"
|
|
version = 2
|
|
|
|
[vars]
|
|
[vars.source_peg]
|
|
default = "A"
|
|
description = "Starting peg"
|
|
[vars.target_peg]
|
|
default = "C"
|
|
description = "Target peg"
|
|
[vars.auxiliary_peg]
|
|
default = "B"
|
|
description = "Helper peg"
|
|
|
|
# 3-disk solution: 7 moves (2^3 - 1)
|
|
# Each step is a simple acknowledgment - the agent just closes it.
|
|
|
|
[[steps]]
|
|
id = "setup"
|
|
title = "Verify initial state"
|
|
description = "All 3 disks stacked on peg A. Largest on bottom."
|
|
|
|
[[steps]]
|
|
id = "move-1"
|
|
title = "Move disk 1: A → C"
|
|
description = "Move the smallest disk from peg A to peg C."
|
|
needs = ["setup"]
|
|
|
|
[[steps]]
|
|
id = "move-2"
|
|
title = "Move disk 2: A → B"
|
|
description = "Move disk 2 from peg A to peg B."
|
|
needs = ["move-1"]
|
|
|
|
[[steps]]
|
|
id = "move-3"
|
|
title = "Move disk 1: C → B"
|
|
description = "Move disk 1 from peg C to peg B."
|
|
needs = ["move-2"]
|
|
|
|
[[steps]]
|
|
id = "move-4"
|
|
title = "Move disk 3: A → C"
|
|
description = "Move the largest disk from peg A to peg C."
|
|
needs = ["move-3"]
|
|
|
|
[[steps]]
|
|
id = "move-5"
|
|
title = "Move disk 1: B → A"
|
|
description = "Move disk 1 from peg B to peg A."
|
|
needs = ["move-4"]
|
|
|
|
[[steps]]
|
|
id = "move-6"
|
|
title = "Move disk 2: B → C"
|
|
description = "Move disk 2 from peg B to peg C."
|
|
needs = ["move-5"]
|
|
|
|
[[steps]]
|
|
id = "move-7"
|
|
title = "Move disk 1: A → C"
|
|
description = "Move disk 1 from peg A to peg C."
|
|
needs = ["move-6"]
|
|
|
|
[[steps]]
|
|
id = "verify"
|
|
title = "Verify final state"
|
|
description = "All 3 disks now on peg C. Tower intact, all moves were legal."
|
|
needs = ["move-7"]
|