Work Distribution
The Work Lifecycle
Every piece of work in Gas Town follows a defined lifecycle from creation to completion.
Work States
Exit States (Polecat Completion)
When a polecat finishes work, it exits in one of four states:
| State | Meaning | Next Action |
|---|---|---|
COMPLETED | Work done, MR submitted | Refinery processes merge |
ESCALATED | Hit blocker, needs human | Escalation routes to Mayor/Overseer |
DEFERRED | Paused, still open | Another agent can pick up later |
PHASE_COMPLETE | Phase done, waiting | Gate opens, next phase begins |
Work Assignment
The Sling Command
gt sling is the primary command for assigning work:
# Assign to a rig (auto-spawns polecat)
gt sling gt-abc12 myproject
# Assign to a specific agent
gt sling gt-abc12 myproject --agent cursor
# Assign multiple items
gt sling gt-abc12 gt-def34 myproject
What happens:
- Bead status changes to
hooked - Work attaches to target's hook
- Polecat spawns in the rig
- Polecat's startup hook finds the work
- Polecat begins execution
Hook Persistence
The hook is Gas Town's durability primitive. Work on a hook survives:
- Session restarts
- Context compaction
- Handoffs between sessions
- Agent crashes
# Check what's on your hook
gt hook
# Manually attach work
gt hook gt-abc12
# Remove from hook
gt unsling gt-abc12
The Propulsion Principle
"If it's on your hook, YOU RUN IT."
This is Gas Town's core work scheduling rule. When an agent starts a session:
- Check hook for attached work
- If work found → execute it immediately
- If no work → check inbox → wait for instructions
This creates automatic momentum — agents always know what to do.
Convoy Tracking
Convoys bundle related work for tracking:
# Create convoy from issues
gt convoy create "Feature X" gt-a1 gt-b2 gt-c3
# Check progress
gt convoy list
gt convoy show hq-cv-001
# Add more issues
gt convoy add hq-cv-001 gt-d4
# Find stranded convoys with ready work
gt convoy stranded
Convoys auto-close when all tracked issues complete.
Molecules: Structured Workflows
Molecules define multi-step workflows for agents. A molecule is an epic bead with child step beads that guide execution:
# Agents check their current steps
bd ready # Shows steps with no blockers
# Work through steps sequentially
bd update <step> --status=in_progress
# ... do the work ...
bd close <step>
bd ready # Next step appears
The standard polecat workflow molecule (mol-polecat-work) includes steps like:
- Load context and verify assignment
- Set up working branch
- Verify tests pass on main
- Implement the solution
- Self-review changes
- Run tests and verify coverage
- Clean up workspace
- Prepare work for review
- Submit work and self-clean
Molecules provide crash recovery — if an agent restarts, bd ready shows the next incomplete step, so work resumes from where it left off.
Cross-Rig Work
For work spanning multiple projects:
- Dogs handle infrastructure tasks across rigs
- Convoys track issues across multiple rigs
- Mayor coordinates cross-rig strategy
# Dogs handle infrastructure
gt dog list
# Prefix-based routing lets you reference any rig's beads
bd show gt-abc12 # Routes to gastown rig
bd show hq-abc # Routes to town-level beads