docs/overview.md
This document provides a conceptual overview of Gas Town's architecture, focusing on the role taxonomy and how different agents interact.
As AI agents become central to engineering workflows, teams face new challenges:
Gas Town is an orchestration layer that treats AI agent work as structured data. Every action is attributed. Every agent has a track record. Every piece of work has provenance. See Why These Features for the full rationale, and Glossary for terminology.
Gas Town has several agent types, each with distinct responsibilities and lifecycles.
These roles manage the Gas Town system itself:
| Role | Description | Lifecycle |
|---|---|---|
| Mayor | Global coordinator at mayor/ | Singleton, persistent |
| Deacon | Background supervisor daemon (watchdog chain) | Singleton, persistent |
| Witness | Per-rig polecat lifecycle manager | One per rig, persistent |
| Refinery | Per-rig merge queue processor | One per rig, persistent |
These roles do actual project work:
| Role | Description | Lifecycle |
|---|---|---|
| Polecat | Worker with persistent identity, ephemeral sessions | Witness-managed (details) |
| Crew | Persistent worker with own clone | Long-lived, user-managed |
| Dog | Deacon helper for infrastructure tasks | Persistent identity, Deacon-managed |
A convoy (🚚) is how you track batched work in Gas Town. When you kick off work - even a single issue - create a convoy to track it.
# Create a convoy tracking some issues
gt convoy create "Feature X" gt-abc gt-def --notify overseer
# Check progress
gt convoy status hq-cv-abc
# Dashboard of active convoys
gt convoy list
Why convoys matter:
gt convoy list --all)The "swarm" is the set of workers currently assigned to a convoy's issues. When issues close, the convoy lands. See Convoys for details.
Both do project work, but with key differences:
| Aspect | Crew | Polecat |
|---|---|---|
| Lifecycle | Persistent (user controls) | Transient (Witness controls) |
| Monitoring | None | Witness watches, nudges, recycles |
| Work assignment | Human-directed or self-assigned | Slung via gt sling |
| Git state | Pushes to main directly | Works on branch, Refinery merges |
| Cleanup | Manual | Automatic on completion |
| Identity | <rig>/crew/<name> | <rig>/polecats/<name> |
When to use Crew:
When to use Polecats:
Dogs are NOT workers. This is a common misconception.
| Aspect | Dogs | Crew |
|---|---|---|
| Owner | Deacon | Human |
| Purpose | Infrastructure tasks | Project work |
| Scope | Narrow, focused utilities | General purpose |
| Lifecycle | Very short (single task) | Long-lived |
| Example | Boot (triages Deacon health) | Joe (fixes bugs, adds features) |
Dogs are the Deacon's helpers for system-level tasks:
If you need to do work in another rig, use worktrees, not dogs.
When a crew member needs to work on another rig:
Create a worktree in the target rig:
# gastown/crew/joe needs to fix a beads bug
gt worktree beads
# Creates ~/gt/beads/crew/gastown-joe/
# Identity preserved: BD_ACTOR = gastown/crew/joe
Directory structure:
~/gt/beads/crew/gastown-joe/ # joe from gastown working on beads
~/gt/gastown/crew/beads-wolf/ # wolf from beads working on gastown
For work that should be owned by the target rig:
# Create issue in target rig
bd create --prefix beads "Fix authentication bug"
# Create convoy and sling to target rig
gt convoy create "Auth fix" bd-xyz
gt sling bd-xyz beads
| Scenario | Approach |
|---|---|
| You need to fix something quick | Worktree |
| Work should appear in your CV | Worktree |
| Work should be done by target rig team | Dispatch |
| Infrastructure/system task | Let Deacon handle it |
The town root (~/gt/) contains infrastructure directories (mayor/, deacon/)
and per-project rigs. Each rig holds a bare repo (.repo.git/), a canonical beads
database (mayor/rig/.beads/), and agent directories (witness/, refinery/,
crew/, polecats/).
For the full directory tree, see architecture.md.
All work is attributed to the actor who performed it:
Git commits: Author: gastown/crew/joe <[email protected]>
Beads issues: created_by: gastown/crew/joe
Events: actor: gastown/crew/joe
Identity is preserved even when working cross-rig:
gastown/crew/joe working in ~/gt/beads/crew/gastown-joe/gastown/crew/joeAll Gas Town agents follow the same core principle:
If you find something on your hook, YOU RUN IT.
This applies regardless of role. The hook is your assignment. Execute it immediately without waiting for confirmation. Gas Town is a steam engine - agents are pistons.
Gas Town's attribution system enables objective model comparison by tracking
completion time, quality signals, and revision count per agent. Deploy different
models on similar tasks and compare outcomes with bd stats.
See Why These Features for details on work history and capability-based routing.