Commit Graph

3001 Commits

Author SHA1 Message Date
diesel
e956868a1b fix(goals): filter out wisp molecules from gt goals output
Some checks failed
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Failing after 17s
CI / Test (push) Failing after 1m30s
CI / Lint (push) Failing after 19s
CI / Integration Tests (push) Successful in 1m14s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled
Wisp molecules (gt-wisp-* IDs, mol-* titles) are transient operational
beads for witness/refinery/polecat patrol, not strategic goals that
need human attention. These are now filtered by default.

Add --include-wisp flag to show them when debugging.

Fixes gt-ysmj

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 22:12:59 -08:00
gastown/crew/kerosene
e5a356d8f1 feat: add bd tree to Key Commands in gt prime output
Some checks failed
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Failing after 17s
CI / Test (push) Failing after 1m34s
CI / Lint (push) Failing after 21s
CI / Integration Tests (push) Successful in 1m15s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled
- Add `bd tree <id>` to Key Commands in bd prime template (beads.go)
- Add `bd tree <issue>` to prime_output.go for mayor/polecat/crew roles
- Helps agents understand bead ancestry, siblings, and dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 19:58:35 -08:00
gastown/crew/octane
6ba77da805 feat(convoy): add epic filtering flags to convoy list
Some checks failed
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Failing after 17s
CI / Test (push) Failing after 1m29s
CI / Lint (push) Failing after 20s
CI / Integration Tests (push) Successful in 1m12s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled
Add three new flags for filtering convoys by epic relationship:
- --orphans: show only convoys without a parent epic
- --epic <id>: show only convoys under a specific epic
- --by-epic: group convoys by parent epic

These support the Goals Layer feature (Phase 3) for hierarchical
focus management.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 19:49:00 -08:00
nux
a7a2c7fc58 feat(goals): implement goals list with staleness computation
Implements gt goals command to show epics sorted by staleness × priority.

Features:
- List all open epics with staleness indicators (🟢/🟡/🔴)
- Sort by attention score (priority × staleness hours)
- Show specific goal details with description and linked convoys
- JSON output support
- Priority and status filtering

Staleness thresholds:
- 🟢 active: moved in last hour
- 🟡 stale: no movement for 1+ hours
- 🔴 stuck: no movement for 4+ hours

Closes: gt-vix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 19:47:12 -08:00
furiosa
c48e157a95 feat(cmd): add gt goals command skeleton
Create goals.go with basic command structure for viewing strategic
goals (epics) with staleness indicators. Includes --json, --status,
and --priority flags. Implementation stubs return not-yet-implemented
errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 19:46:14 -08:00
rictus
d68b14e035 feat(mayor): add delegation hierarchy guidance to role template
Add explicit guidance on the Mayor → Crew → Polecats delegation model:
- Crew are coordinators for epics/goals needing decomposition
- Polecats are executors for well-defined tasks
- Include decision framework table for work type routing

Closes: gt-9jd
2026-01-22 19:46:14 -08:00
kerosene
f65c4ecfc8 feat: add overseer experience commands (gt focus, gt attention)
Some checks failed
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Failing after 15s
CI / Test (push) Failing after 1m29s
CI / Lint (push) Failing after 19s
CI / Integration Tests (push) Successful in 1m14s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled
Implements the Overseer Experience epic (gt-k0kn):

- gt focus: Shows stalest high-priority goals, sorted by priority × staleness
- gt attention: Shows blocked items, PRs awaiting review, stuck workers
- gt status: Now includes GOALS and ATTENTION summary sections
- gt convoy list: Added --orphans, --epic, --by-epic flags

These commands reduce Mayor bottleneck by giving the overseer direct
visibility into system state without needing to ask Mayor.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 18:27:51 -08:00
rictus
41760bf464 feat(mayor): add delegation hierarchy guidance to role template
Some checks failed
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Failing after 18s
CI / Test (push) Failing after 1m30s
CI / Lint (push) Failing after 24s
CI / Integration Tests (push) Successful in 1m23s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled
Add explicit guidance on the Mayor → Crew → Polecats delegation model:
- Crew are coordinators for epics/goals needing decomposition
- Polecats are executors for well-defined tasks
- Include decision framework table for work type routing

Closes: gt-9jd
2026-01-22 17:38:02 -08:00
slit
8f804aefb5 docs(crew): add coordinator role guidance to crew template
Adds clear guidance that crew members are coordinators, not implementers:
- Lists 4 key responsibilities: Research, Decompose, Sling, Review
- Clarifies "goal-specific mayor" model - own outcomes via delegation
- Documents when to implement directly vs delegate (trivial fixes, spikes, etc.)

Closes: gt-gig

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 17:36:44 -08:00
nux
0fcbdee98b feat(sling): implement --convoy flag logic (gt-9o4)
Add --convoy flag to gt sling that allows adding an issue to an existing
convoy instead of creating a new one. When specified:
- Validates the convoy exists and is open
- Adds tracking relation between convoy and issue
- Skips auto-convoy creation

Changes:
- Add slingConvoy variable and --convoy flag registration
- Add addToExistingConvoy() helper function in sling_convoy.go
- Modify auto-convoy logic to check slingConvoy first

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 17:33:02 -08:00
furiosa
8dd3bfcd63 feat(sling): register --epic and --convoy flags
Add flag variable declarations and Cobra flag registrations for:
- --epic: link auto-created convoy to parent epic
- --convoy: add to existing convoy instead of creating new

Closes: gt-n3o

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 17:25:26 -08:00
99ba37e383 fix: enforce fresh context between molecule steps
Some checks failed
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Failing after 18s
CI / Test (push) Failing after 1m32s
CI / Lint (push) Failing after 20s
CI / Integration Tests (push) Successful in 1m14s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled
Change molecule step completion instructions to use `gt mol step done`
instead of `bd close`. This ensures polecats get fresh context between
each step, which is critical for multi-step review workflows like
shiny-enterprise where each refinement pass should have unbiased attention.

The `gt mol step done` command already:
1. Closes the step
2. Finds the next ready step
3. Respawns the pane for fresh context

But polecats were being instructed to use `bd close` directly, which
skipped the respawn and let them run through entire workflows in a
single session with accumulated context.

Updated:
- prime_molecule.go: step completion instructions
- mol-polecat-work.formula.toml
- mol-polecat-code-review.formula.toml
- mol-polecat-review-pr.formula.toml

Fixes: hq-0kx7ra
2026-01-22 15:38:39 -08:00
riker
6be7fdd76c fix(dog): properly set identity for dog sessions
Some checks failed
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Successful in 25s
CI / Test (push) Failing after 1m22s
CI / Lint (push) Failing after 16s
CI / Integration Tests (push) Successful in 1m9s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled
Three fixes to make dog dispatch work end-to-end:

1. Add BuildDogStartupCommand in loader.go
   - Similar to BuildPolecatStartupCommand/BuildCrewStartupCommand
   - Passes AgentName to AgentEnv so BD_ACTOR is exported in startup command

2. Use BuildDogStartupCommand in dog.go
   - Removes ineffective SetEnvironment calls (env vars set after shell starts
     don't propagate to already-running processes)

3. Add "dog" case in mail_identity.go detectSenderFromRole
   - Dogs now use BD_ACTOR for mail identity
   - Without this, dogs fell through to "overseer" and couldn't find their mail

Tested: dog alpha now correctly sees inbox as deacon/dogs/alpha

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 11:44:45 -08:00
riker
f0014bb21a fix(dog): spawn session and set BD_ACTOR for dog dispatch
Some checks failed
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Successful in 24s
CI / Test (push) Failing after 1m24s
CI / Lint (push) Failing after 16s
CI / Integration Tests (push) Successful in 1m9s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled
Recovered from reflog - these commits were lost during a rebase/force-push.

Dogs are directories with state files but no sessions. When `gt dog dispatch`
assigned work and sent mail, nothing executed because no session existed.

Changes:
1. Spawn tmux session after dispatch (gt-<town>-deacon-<dogname>)
2. Set BD_ACTOR=deacon/dogs/<name> so dogs can find their mail
3. Add dog case to AgentEnv for proper identity

Session spawn is non-blocking - if it fails, mail was sent and human can
manually start the session.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 11:26:47 -08:00
c9f844b477 feat(dog): add 'gt dog done' command for dogs to mark themselves idle
Some checks failed
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Successful in 21s
CI / Test (push) Failing after 1m28s
CI / Lint (push) Failing after 16s
CI / Integration Tests (push) Successful in 1m7s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled
Dogs can now reset their own state to idle after completing work:

  gt dog done        # Auto-detect from BD_ACTOR
  gt dog done alpha  # Explicit name

This solves the issue where dog sessions would complete work but remain in
"working" state because nothing processed the DOG_DONE mail. Now dogs can
explicitly mark themselves idle before handing off.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 08:34:29 -08:00
2a639ff999 fix(session): increase ClaudeStartTimeout from 60s to 120s
Some checks failed
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Successful in 22s
CI / Test (push) Failing after 1m23s
CI / Lint (push) Failing after 15s
CI / Integration Tests (push) Successful in 1m7s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled
Fixes intermittent 'timeout waiting for runtime prompt' errors that occur
when Claude takes longer than 60s to start under load or on slower machines.

Resolves: hq-j2wl

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 00:16:58 -08:00
eed8941126 feat(security): add GIT_AUTHOR_EMAIL per agent type
Phase 1 of agent security model: Set distinct email addresses for each
agent type to improve audit trail clarity.

Email format:
- Town-level: {role}@gastown.local (mayor, deacon, boot)
- Rig-level: {rig}-{role}@gastown.local (witness, refinery)
- Named agents: {rig}-{role}-{name}@gastown.local (polecat, crew)

This makes git log filtering by agent type trivial and provides a
foundation for per-agent key separation in future phases.

Refs: hq-biot
2026-01-22 00:16:58 -08:00
9f9b2376ea ci: disable block-internal-prs for fork workflow
We use PRs for human review before merging in our fork.
2026-01-22 00:16:58 -08:00
7fd073810d feat(mayor): add escalation check to startup protocol
Mayor now checks `gt escalate list` between hook and mail checks at startup.
This ensures pending escalations from other agents are handled promptly.

Other roles (witness, refinery, polecat, crew, deacon) are unaffected -
they create escalations but don't handle them at startup.
2026-01-22 00:16:58 -08:00
mayor
b158ff27c2 fix(hooks): allow tag pushes in pre-push hook
Tags are used for releases and shouldn't be blocked by the branch
restriction that prevents feature branch pushes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 23:07:44 -08:00
mayor
5cc2995345 chore(release): v0.5.0
All checks were successful
Release / goreleaser (push) Successful in 5m32s
Release / publish-npm (push) Has been skipped
Release / update-homebrew (push) Has been skipped
- Mail improvements: numeric index, hook alias, --body alias, bulk delete, parallel queries
- New aliases: gt bd, gt work, --comment, read
- OpenCode agent preset, config-based role system
- Deacon status line display, hook registry
- Squash merge in refinery
- Crew session stability fixes
- Many bug fixes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
v0.5.0
2026-01-21 23:05:00 -08:00
mayor
e57297cb1b fix(crew): don't kill pane processes when creating new session
KillPaneProcesses was being called on new sessions before respawn,
which killed the fresh shell and destroyed the pane. This caused
"can't find pane" errors on session creation.

Now KillPaneProcesses is only called when restarting in an existing
session where Claude/Node processes might be running and ignoring
SIGHUP. For new sessions, we just use respawn-pane directly.

Also added retry limit and error checking for the stale session
recovery path.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 22:46:00 -08:00
mayor
dff6c3fb3c feat: add aliases and deacon status line display
- Add 'bd' alias for 'gt bead' command
- Add 'work' alias for 'gt hook' command
- Show deacon icon in mayor status line when running

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 22:40:10 -08:00
mayor
fb4c415127 fix(crew): auto-recover from stale tmux pane references
When a session exists but its pane is gone (e.g., after account switch
or town reboot), 'gt crew at' now detects the "can't find pane" error
and automatically recreates the session instead of failing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 22:39:10 -08:00
dementus
b612df0463 feat(mail): add numeric index support to 'gt mail read'
Allow reading messages by their inbox position (e.g., 'gt mail read 3')
in addition to message ID. The inbox display now shows 1-based index
numbers for easy reference.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 21:55:07 -08:00
toast
785d9adfef feat(mail): add gt mail hook as alias for gt hook attach
Adds gt mail hook <mail-id> command that attaches a mail message to
the agents hook. This provides a more intuitive command path when
working with mail-based workflows.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 21:53:18 -08:00
capable
3d7b109395 feat(mail): add --body as alias for --message/-m in gt mail send
Users naturally try --body for the message body content (same semantic
field as --message but more precise - distinguishes body from subject).
Added as an alias following the same pattern as --address/--identity.

Closes: gt-bn9mt

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 21:52:19 -08:00
nux
b14835b140 fix(refinery): pass convoy ID to convoy check command
The runConvoyCheck function was running `gt convoy check` without
the convoy ID, which checked all open convoys. Now it passes the
specific convoy ID to check only the relevant convoy, as specified
in the requirements.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 21:51:21 -08:00
furiosa
35abe21c50 fix(convoy): pass specific convoy ID in ConvoyWatcher check
When an issue closes, the daemon ConvoyWatcher now passes the specific
convoy ID to gt convoy check instead of running check on all open convoys.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 21:48:32 -08:00
mayor
405d40ee4b fix(tmux): KillPaneProcesses must kill pane process itself, not just descendants
Claude Code has no descendants, so only killing descendants left orphans.
Now kills the pane PID itself with SIGTERM+SIGKILL after descendants.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 21:34:21 -08:00
gastown/crew/max
748fa73931 chore(formula): trim verbose witness-patrol description
Remove redundant routing rules and health check documentation
that was duplicating information available elsewhere.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 21:20:45 -08:00
gastown/crew/max
1dc31024ca feat(mail): accept multiple message IDs in delete command
Allow `gt mail delete` to accept multiple message IDs at once,
matching the existing behavior of archive, mark-read, and mark-unread.

Also adds --body as an alias for --message in mail reply.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 21:19:04 -08:00
mayor
94c2d71c13 fix(tmux): kill pane processes before all RespawnPane calls to prevent orphans
## Problem
Claude processes were accumulating as orphans, with 100+ processes piling up
daily. Every `gt handoff` (used dozens of times/hour by crew) left orphaned
processes because `tmux respawn-pane -k` only sends SIGHUP, which Node/Claude
ignores.

## Root Cause
Previous fixes (1043f00d, f89ac47f, 2feefd17, 1b036aad) were laser-focused on
specific symptoms (shutdown, setsid, done.go, molecule_step.go) but never did
a comprehensive audit of ALL RespawnPane call sites. handoff.go was never
fixed despite being the main source of orphans.

## Solution
Added KillPaneProcesses() call before every RespawnPane() in:
- handoff.go (self handoff and remote handoff)
- mayor.go (mayor restart)
- crew_at.go (new session and restart)

KillPaneProcesses explicitly kills all descendant processes with SIGTERM/SIGKILL
before respawning, preventing orphans regardless of SIGHUP handling.

molecule_step.go already had this fix from commit 1b036aad.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 21:09:30 -08:00
Adam Zionts
02390251fc feat: Add configurable polecat branch naming (#825)
feat: Add configurable polecat branch naming

Adds polecat_branch_template configuration for custom branch naming patterns.

Template variables supported:
- {user}: git config user.name  
- {year}/{month}: date (YY/MM format)
- {name}: polecat name
- {issue}: issue ID without prefix
- {description}: sanitized issue title
- {timestamp}: unique timestamp

Maintains backward compatibility - empty template uses existing format.
2026-01-21 20:53:12 -08:00
Julian Knutsen
0dfb0be368 fix(sling): auto-apply mol-polecat-work (#288) and fix wisp orphan lifecycle bug (#842) (#859)
fix(sling): auto-apply mol-polecat-work (#288) and fix wisp orphan lifecycle bug (#842)

Fixes the formula-on-bead pattern to hook the base bead instead of the wisp:
- Auto-apply mol-polecat-work when slinging bare beads to polecats
- Hook BASE bead with attached_molecule pointing to wisp  
- gt done now closes attached molecule before closing hooked bead
- Convoys complete properly when work finishes

Fixes #288, #842, #858
2026-01-21 20:52:26 -08:00
Steve Yegge
1feb48dd11 Merge pull request #460 from sauerdaniel/pr/shutdown-reliability
fix(shutdown): Improve gastown shutdown reliability
2026-01-21 20:33:54 -08:00
Steve Yegge
58d5226f30 Merge pull request #714 from boshu2/fix/mail-inbox-parallel
perf: parallelize mail inbox queries for ~6x speedup
2026-01-21 20:33:00 -08:00
mayor
c42b5db7ab fix(hook): normalize agent ID trailing slash in agentIDToBeadID (gt-az3jjb)
resolveSelfTarget returns "mayor/" with trailing slash per addressToIdentity
normalization, but agentIDToBeadID only checked for "mayor" without slash.

This caused `gt hook --clear` to fail with:
  Error: could not convert agent ID mayor/ to bead ID

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 19:51:19 -08:00
Roland Tritsch
2119841d57 fix(doctor): check patrol formulas instead of placeholder beads (#715)
Changes patrol-molecules-exist check to verify that patrol formulas
are accessible via `bd formula list` instead of looking for placeholder
molecule beads created by `bd create --type=molecule`.

## Problem

The check was looking for molecule-type beads with titles "Deacon Patrol",
"Witness Patrol", and "Refinery Patrol". These placeholder beads serve no
functional purpose because:

1. Patrols actually use `bd mol wisp mol-deacon-patrol` which cooks
   formulas inline (on-the-fly)
2. The formulas already exist at the town level in .beads/formulas/
3. The placeholder beads are never referenced by any patrol code

## Solution

- Check for formula names (mol-deacon-patrol, mol-witness-patrol,
  mol-refinery-patrol) instead of bead titles
- Use `bd formula list` instead of `bd list --type=molecule`
- Remove Fix() method that created unnecessary placeholder beads
- Update messages to reflect that formulas should exist in search paths

## Impact

- Check now verifies what patrols actually need (formulas)
- Eliminates creation of unnecessary placeholder beads
- More accurate health check for patrol system

Co-authored-by: Roland Tritsch <roland@ailtir.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-21 19:50:41 -08:00
Roland Tritsch
2514507a49 Fix GT_ROOT export for beads formula search compatibility (#718)
Problem:
- Gas Town sets GT_TOWN_ROOT environment variable
- Beads searches for formulas using GT_ROOT environment variable
- This naming inconsistency prevents beads from finding town-level formulas
- Result: `bd mol seed --patrol` fails in rigs, causing false doctor warnings

Solution:
Export both GT_TOWN_ROOT and GT_ROOT from `gt rig detect` command:
- Modified stdout output to export both variables (lines 66, 70)
- Updated cache storage format (lines 134, 136, 138)
- Updated unset statement for both variables (line 110)
- Updated command documentation (lines 33, 37)

Both variables point to the same town root path. This maintains backward
compatibility with Gas Town (GT_TOWN_ROOT) while enabling beads formula
search (GT_ROOT).

Testing:
- `gt rig detect .` now outputs both GT_TOWN_ROOT and GT_ROOT
- `bd mol seed --patrol` works correctly when GT_ROOT is set
- Formula search paths work as expected: town/.beads/formulas/ accessible

Related:
- Complements bd mol seed --patrol implementation (beads PR #1149)
- Complements patrol formula doctor check fix (gastown PR #715)

Co-authored-by: Roland Tritsch <roland@ailtir.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-21 19:50:38 -08:00
Roland Tritsch
e4ebd0784a Fix settings templates to use 'gt prime --hook' for session ID tracking (#719)
Both settings-autonomous.json and settings-interactive.json templates
were using bare 'gt prime' in SessionStart and PreCompact hooks, which
caused gt doctor to report warnings about missing --hook flag.

The --hook flag is required for proper session ID passthrough from
Claude Code. When called as a hook, 'gt prime --hook' reads session
metadata (session_id, transcript_path, source) from stdin JSON that
Claude Code provides.

Without --hook, session tracking breaks and gt doctor correctly warns:
"SessionStart uses bare 'gt prime' - add --hook flag or use session-start.sh"

This fix updates both template files to use 'gt prime --hook' in:
- SessionStart hooks (lines 12)
- PreCompact hooks (lines 23)

New installations will now generate settings.json files with the
correct format that passes gt doctor validation.

Co-authored-by: Roland Tritsch <roland@ailtir.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-21 19:50:35 -08:00
Julian Knutsen
1e97d1e637 Fix go-19z: updateAgentHookBead uses wrong directory for rig-level beads (#733)
When slinging work to an agent, updateAgentHookBead() was running
bd slot set from townRoot. But agent beads with rig-level prefixes
(e.g., go-) live in rig databases, not the town database. This caused
"issue not found" errors when trying to update the hook_bead slot.

Fix: Use beads.ResolveHookDir() to resolve the correct working directory
based on the agent bead's prefix before calling SetHookBead().

Co-authored-by: furiosa <spencer@atmosphere-aviation.com>
2026-01-21 19:32:13 -08:00
Louis Vranderick
7e5c3dd695 Add comprehensive tests for internal/dog package (#737) 2026-01-21 19:31:57 -08:00
aleiby
0cdcd0a20b fix(daemon): spawn Deacon immediately after killing stuck session (#729)
When checkDeaconHeartbeat detects a stuck Deacon and kills it, the code
relied on ensureDeaconRunning being called on the next heartbeat. However,
on the next heartbeat, checkDeaconHeartbeat exits early when it finds no
session (assuming ensureDeaconRunning already ran), creating a deadlock
where the Deacon is never restarted.

This fix calls ensureDeaconRunning immediately after the kill attempt,
regardless of success or failure, ensuring the Deacon is restarted
promptly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: mayor
Role: mayor
2026-01-21 19:31:38 -08:00
Joshua Vial
aba0a5069c fix(seance): add tests and fix race condition in session index (#864)
Co-authored-by: joshuavial <git@codewithjv.com>
2026-01-21 19:30:49 -08:00
aleiby
a8bedd2172 fix(costs): add event to BeadsCustomTypes constant (#731)
* fix(costs): add event to BeadsCustomTypes constant

The gt costs record command creates beads with --type=event, but "event"
was missing from the BeadsCustomTypes constant. This caused stop hooks
to fail with "invalid issue type: event" errors.

Also fixes gt doctor --fix to properly register the event type when
running on existing installations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(types): add message, molecule, gate, merge-request to BeadsCustomTypes

Extends PR #731 to include all custom types used by Gas Town:

- message: Mail system (gt mail send, mailbox, router)
- molecule: Work decomposition (patrol checks, gt swarm)
- gate: Async coordination (bd gate wait, park/resume)
- merge-request: Refinery MR processing (gt done, refinery)

Root cause: gt mail send was failing with "invalid issue type: message"
because message was never added to BeadsCustomTypes.

Also documents the origin/usage of each custom type in the constant.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: mayor
Role: mayor

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 19:11:43 -08:00
aleiby
b9f5797b9e fix(refinery): use role-specific runtime config for startup (#756) (#847)
Use ResolveRoleAgentConfig instead of LoadRuntimeConfig to properly
resolve role-specific agent settings (like ready_prompt_prefix) when
starting the refinery. This fixes timeout issues when role_agents.refinery
is configured with a non-default agent.

Also move AcceptBypassPermissionsWarning before WaitForRuntimeReady to
avoid a race condition where the bypass dialog can block prompt detection.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 19:11:39 -08:00
aleiby
5791cd7e34 feat(doctor): add auto-fix capability to SessionHookCheck (#857)
Add Fix() method to SessionHookCheck to automatically update
settings.json files when 'gt prime' is used without '--hook'.
This enables 'gt doctor --fix' to repair existing installations
that use bare 'gt prime' in SessionStart/PreCompact hooks.

Changes:
- Changed SessionHookCheck to embed FixableCheck instead of BaseCheck
- Added filesToFix cache populated during Run()
- Implemented Fix() method that parses JSON and replaces 'gt prime'
  with 'gt prime --hook' in command strings
- Uses json.Encoder with SetEscapeHTML(false) to preserve readable
  ampersands in command strings

Closes: gt-1tj0c

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 19:11:34 -08:00
The App Agency
3931d10af3 fix(dashboard): use registered rigs for merge queue instead of hardcoded repos (#863)
The FetchMergeQueue function was hardcoded to query PRs from
michaellady/roxas and michaellady/gastown, causing the dashboard
to show unrelated PRs regardless of which rigs are actually registered.

This fix:
- Adds townRoot to LiveConvoyFetcher to access workspace config
- Loads registered rigs from mayor/rigs.json dynamically
- Adds gitURLToRepoPath helper to convert git URLs (HTTPS/SSH) to
  owner/repo format for the gh CLI
- Updates comments to reflect the new behavior

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 19:11:29 -08:00
Advaya Krishna
d67aa0212c feat(refinery): use squash merge to eliminate redundant merge commits (#856)
Replace MergeNoFF with MergeSquash in the Refinery to preserve the original
conventional commit message (feat:/fix:) from polecat branches instead of
creating "Merge polecat/... into main" commits.

Changes:
- Add MergeSquash function to internal/git/git.go
- Add GetBranchCommitMessage helper to retrieve branch commit messages
- Update engineer.go doMerge to use squash merge with original message

Fixes #855

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 18:12:40 -08:00