Skip to main content

System Overview

Components

Gas Town consists of five layers:

1. The Town (Workspace)

The town is the root directory (typically ~/gt/) containing all projects and coordination state. It holds:

  • Town-level beads database for cross-project tracking
  • Configuration and settings
  • Mayor and Deacon agent contexts
  • Daemon process state

2. Rigs (Project Containers)

Each rig wraps a git repository with the full agent infrastructure:

myproject/
├── .beads/ # Rig-level issue tracking (SQLite + JSONL export)
├── metadata.json # Rig configuration and identity
├── AGENTS.md # Agent role descriptions
├── refinery/ # Refinery merge queue processing
├── mayor/ # Mayor's coordination workspace
├── crew/ # Human developer workspaces
│ ├── dave/
│ └── emma/
├── witness/ # Rig-level health monitor
├── polecats/ # Ephemeral worker directories (git worktrees)
│ ├── toast/
│ └── alpha/
└── plugins/ # Rig-level plugins

3. Agents (Workers)

Seven agent roles form the hierarchy:

AgentScopeLifecyclePurpose
MayorTownPersistentGlobal coordination and strategy
DeaconTownPersistentHealth monitoring and lifecycle
WitnessPer-rigPersistentPolecat supervision
RefineryPer-rigPersistentMerge queue processing
PolecatsPer-rigEphemeralFeature work (self-cleaning)
CrewPer-rigManagedHuman developer workspaces
DogsTownReusableInfrastructure tasks

Additionally, the Boot dog is a special triage agent spawned by the Deacon to assess new work or problems.

4. Daemon (Scheduler)

A simple Go process that:

  • Sends periodic heartbeats to the Deacon
  • Processes lifecycle requests (start/stop agents)
  • Restarts sessions when requested
  • Polls external services (Discord, etc.)

The daemon is intentionally "dumb" — all intelligence lives in the agents.

5. Communication Layer

Agents communicate through:

  • Mail — Async message passing between agents
  • Nudge — Synchronous message delivery
  • Escalations — Priority-routed alerts
  • Hooks — Persistent work state attachment
  • Beads — Shared issue tracking state

Data Flow

Human gives Mayor instructions
→ Mayor creates beads + convoy
→ Mayor slings work to rigs
→ Polecats spawn and execute
→ Polecats submit MRs via gt done
→ Refinery processes merge queue
→ Code lands on main branch
→ Witness cleans up polecat sandbox
→ Convoy auto-closes when all done

State Management

All state is persisted in git or the filesystem:

StateStorageSurvives
Issues.beads/beads.db (SQLite)Everything
Issue export.beads/issues.jsonlEverything
Work hooksGit worktreesCrashes, restarts
MailFilesystem JSONLSession restarts
Configmetadata.json, .beads/config.yamlEverything
Agent contextCLAUDE.md filesEverything
Activity log.events.jsonlEverything