feat(roles): add config-based role definition system (Phase 1)

Replace role beads with embedded TOML config files for role definitions.
This is Phase 1 of gt-y1uvb - adds the config infrastructure without
yet switching the daemon to use it.

New files:
- internal/config/roles.go: RoleDefinition types, LoadRoleDefinition()
  with layered override resolution (builtin → town → rig)
- internal/config/roles/*.toml: 7 embedded role definitions
- internal/config/roles_test.go: unit tests

New command:
- gt role def <role>: displays effective role configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gastown/crew/max
2026-01-19 14:59:47 -08:00
committed by Steve Yegge
parent b8eb936219
commit 544cacf36d
10 changed files with 829 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
# Crew role definition
# Persistent user-managed workspaces. Multiple per rig.
role = "crew"
scope = "rig"
nudge = "Check your hook and mail, then act accordingly."
prompt_template = "crew.md.tmpl"
[session]
pattern = "gt-{rig}-crew-{name}"
work_dir = "{town}/{rig}/crew/{name}"
needs_pre_sync = true
start_command = "exec claude --dangerously-skip-permissions"
[env]
GT_ROLE = "crew"
GT_SCOPE = "rig"
[health]
ping_timeout = "30s"
consecutive_failures = 3
kill_cooldown = "5m"
stuck_threshold = "4h"

View File

@@ -0,0 +1,23 @@
# Deacon role definition
# Daemon beacon for heartbeats and monitoring. One per town.
role = "deacon"
scope = "town"
nudge = "Run 'gt prime' to check patrol status and begin heartbeat cycle."
prompt_template = "deacon.md.tmpl"
[session]
pattern = "hq-deacon"
work_dir = "{town}"
needs_pre_sync = false
start_command = "exec claude --dangerously-skip-permissions"
[env]
GT_ROLE = "deacon"
GT_SCOPE = "town"
[health]
ping_timeout = "30s"
consecutive_failures = 3
kill_cooldown = "5m"
stuck_threshold = "1h"

View File

@@ -0,0 +1,23 @@
# Dog role definition
# Town-level workers for cross-rig tasks. Dispatched by Deacon.
role = "dog"
scope = "town"
nudge = "Check your hook for work assignments."
prompt_template = "dog.md.tmpl"
[session]
pattern = "gt-dog-{name}"
work_dir = "{town}/deacon/dogs/{name}"
needs_pre_sync = false
start_command = "exec claude --dangerously-skip-permissions"
[env]
GT_ROLE = "dog"
GT_SCOPE = "town"
[health]
ping_timeout = "30s"
consecutive_failures = 3
kill_cooldown = "5m"
stuck_threshold = "2h"

View File

@@ -0,0 +1,23 @@
# Mayor role definition
# Global coordinator for cross-rig work. One per town.
role = "mayor"
scope = "town"
nudge = "Check mail and hook status, then act accordingly."
prompt_template = "mayor.md.tmpl"
[session]
pattern = "hq-mayor"
work_dir = "{town}"
needs_pre_sync = false
start_command = "exec claude --dangerously-skip-permissions"
[env]
GT_ROLE = "mayor"
GT_SCOPE = "town"
[health]
ping_timeout = "30s"
consecutive_failures = 3
kill_cooldown = "5m"
stuck_threshold = "1h"

View File

@@ -0,0 +1,23 @@
# Polecat role definition
# Ephemeral workers for batch work dispatch. Multiple per rig.
role = "polecat"
scope = "rig"
nudge = "Check your hook for work assignments."
prompt_template = "polecat.md.tmpl"
[session]
pattern = "gt-{rig}-{name}"
work_dir = "{town}/{rig}/polecats/{name}"
needs_pre_sync = true
start_command = "exec claude --dangerously-skip-permissions"
[env]
GT_ROLE = "polecat"
GT_SCOPE = "rig"
[health]
ping_timeout = "30s"
consecutive_failures = 3
kill_cooldown = "5m"
stuck_threshold = "2h"

View File

@@ -0,0 +1,23 @@
# Refinery role definition
# Merge queue processor with verification gates. One per rig.
role = "refinery"
scope = "rig"
nudge = "Run 'gt prime' to check merge queue and begin processing."
prompt_template = "refinery.md.tmpl"
[session]
pattern = "gt-{rig}-refinery"
work_dir = "{town}/{rig}/refinery/rig"
needs_pre_sync = true
start_command = "exec claude --dangerously-skip-permissions"
[env]
GT_ROLE = "refinery"
GT_SCOPE = "rig"
[health]
ping_timeout = "30s"
consecutive_failures = 3
kill_cooldown = "5m"
stuck_threshold = "2h"

View File

@@ -0,0 +1,23 @@
# Witness role definition
# Per-rig worker monitor with progressive nudging. One per rig.
role = "witness"
scope = "rig"
nudge = "Run 'gt prime' to check worker status and begin patrol cycle."
prompt_template = "witness.md.tmpl"
[session]
pattern = "gt-{rig}-witness"
work_dir = "{town}/{rig}/witness"
needs_pre_sync = false
start_command = "exec claude --dangerously-skip-permissions"
[env]
GT_ROLE = "witness"
GT_SCOPE = "rig"
[health]
ping_timeout = "30s"
consecutive_failures = 3
kill_cooldown = "5m"
stuck_threshold = "1h"