Digest: mol-deacon-patrol

Patrol C18: All healthy, quick cycle, no incidents


Digest: mol-deacon-patrol

Patrol cycle 20: All agents healthy, no incidents - HANDOFF THRESHOLD REACHED


Digest: mol-deacon-patrol

Patrol 13: All healthy.


Digest: mol-deacon-patrol

Patrol cycle 10: clean


Digest: mol-deacon-patrol

Patrol #15: Town idle. All agents healthy.


Digest: mol-deacon-patrol

Patrol cycle 20: Final full check - all healthy, preparing handoff


Digest: mol-deacon-patrol

Patrol cycle 8: all quiet


Digest: mol-deacon-patrol

Patrol cycle 13: quick check


Digest: mol-deacon-patrol

Patrol 95: all healthy


Digest: mol-deacon-patrol

Patrol 20: Final cycle, handoff threshold reached


Digest: mol-deacon-patrol

Patrol 13: quiet cycle, all healthy


Digest: mol-deacon-patrol

Patrol cycle 18: Healthy.


Digest: mol-deacon-patrol

Patrol 170: All healthy, furiosa still working


Test: mayor to crew

Testing mayor->crew mail


Test2

Another test


Digest: mol-deacon-patrol

Patrol cycle 6: quiet


Digest: mol-deacon-patrol

Patrol 1: All clear - inbox empty, mayor healthy, no active rigs


Digest: mol-deacon-patrol

Cycle 6: All healthy


Digest: mol-deacon-patrol

Patrol 41: All healthy, 3 convoys active, 1 dead session cleaned


Digest: mol-deacon-patrol

Patrol 9: all clear


Digest: mol-deacon-patrol

Patrol 87: All healthy


🤝 HANDOFF: Yank Go patrol from witness

## Task: gt-kh6q

Rip out the Go patrol logic from internal/witness/manager.go.

### What to Remove
All these patrol functions (lines 164-1125):
- run(), checkAndProcess(), healthCheck()
- handleStuckPolecat(), getNudgeCount(), recordNudge(), clearNudgeCount()
- processShutdownRequests(), verifyPolecatState()
- autoSpawnForReadyWork(), getActivePolecatCount(), isAlreadySpawned(), spawnPolecat()
- Plus all the helper functions they use

### What to Keep
- NewManager(), stateFile(), loadState(), saveState()
- Status(), Start() (simplified), Stop()
- Basic session management only

### Why
The mol-witness-patrol (in molecules_patrol.go) defines the steps.
Claude executes them. Go code shouldn't duplicate that logic.

### Context
- 5 MRs cleared (1 merged, 4 closed as superseded by ZFC rewrite)
- Main is clean and pushed
- mol-witness-patrol and mol-polecat-arm are defined and ready


POLECAT_STARTED furiosa

Issue: bd-0oqz
Session: gt-beads-furiosa


Digest: mol-deacon-patrol

Patrol 10: routine, all healthy


Digest: mol-deacon-patrol

Patrol 5: Healthy


Digest: mol-deacon-patrol

Patrol cycle 8: No messages, all healthy.


Digest: mol-deacon-patrol

Patrol 12: All clear


POLECAT_DONE Compactor

Exit: COMPLETED
Issue: bd-thgk
MR: bd-754r
Branch: polecat/Compactor


Digest: mol-deacon-patrol

Patrol cycle 1: Healthy. 3 rigs online, all witnesses/refineries running, 2 open PR convoys (140, 149), no orphans.


Digest: mol-deacon-patrol

Patrol 4: Quiet cycle. All healthy.


🚨 Incoming Swarm: 13 MRs

Heads up: 13 polecats are being dispatched for bug fixes, test coverage, and code quality improvements. Expect MRs to start arriving shortly.

Priority breakdown:
- P1: 5 issues (1 bug, 3 test coverage, 1 feature)
- P2: 4 issues (2 code quality, 1 feature, 1 polish)
- P3: 4 issues (2 code quality, 2 features)

Please prioritize reviewing P1 MRs first. This is a coordinated swarm so all should be independent work.


Digest: mol-deacon-patrol

Fixed critical bug: gt doctor --fix was killing active workers. Added session-aware stale lock detection.


Digest: mol-deacon-patrol

Patrol 18 complete: all healthy


POLECAT_STARTED dag

Issue: gt-xuzo
Session: gt-gastown-dag


Digest: mol-deacon-patrol

Patrol 15: routine, no incidents


Digest: mol-deacon-patrol

Patrol 5: town idle, all healthy


bd init --from-jsonl: Skip git history scan

## Problem

`bd init` scans git history to find all issues ever created, which:
- Resurrects deleted/compacted issues
- Takes a long time on large repos
- Defeats manual JSONL cleanup

## Solution

Add `bd init --from-jsonl` flag that:
1. Creates fresh database
2. Imports ONLY from current .beads/issues.jsonl
3. Skips git history scan entirely

## Use Case

After manually cleaning JSONL or receiving a clean JSONL from another source:
```bash
# Clean JSONL manually or via script
bd init --from-jsonl  # Use current JSONL as-is
```


Digest: mol-deacon-patrol

Patrol cycle 10: All quiet


Digest: mol-deacon-patrol

Patrol 1: 0 messages, all agents healthy, cleaned orphan session gt-boot


Digest: mol-deacon-patrol

Patrol cycle 15: Routine, all healthy - handing off


Digest: mol-deacon-patrol

Patrol cycle 15: All healthy


POLECAT_DONE valkyrie

Exit: COMPLETED
Issue: gt-h6eq.4
MR: gt-pia6
Branch: polecat/valkyrie


Digest: mol-deacon-patrol

Patrol cycle 2: all healthy, no callbacks, no orphans


Digest: mol-deacon-patrol

Patrol 10: halfway checkpoint, all systems nominal


Digest: mol-deacon-patrol

Patrol 1: All agents healthy. Closed 3 convoys (bd-odaaa, bd-7wr2w, bd-t17wa). Cleaned 39 stale wisps.


Digest: mol-deacon-patrol

Patrol cycle 19: Routine


Digest: mol-deacon-patrol

C116: All healthy


Digest: mol-deacon-patrol

Patrol complete: All agents healthy (restarted wyvern witness), cleaned 2 stale locks, no convoy/dep events


Digest: mol-deacon-patrol

Patrol 100: all healthy


Digest: mol-deacon-patrol

Patrol 13: all clear


Digest: mol-deacon-patrol

Patrol 17: OK


Digest: mol-deacon-patrol

Patrol #10: All healthy, halfway to handoff.


Digest: mol-deacon-patrol

Patrol cycle 10: Healthy.


Digest: mol-deacon-patrol

Patrol 8: Routine.


Digest: mol-deacon-patrol

Patrol 13: routine, all healthy


Digest: mol-deacon-patrol

Patrol cycle 15: All healthy. slit started. 9 polecats active.


P1 Bug: bd pin command broken in v0.32.0

Hey Dave,

bd pin is broken - it fails with 'invalid field for update: pinned'.

Repro:
  bd create 'test'
  bd pin <id>
  # Error: invalid field for update: pinned

This blocks gt mail send --pinned (for pinned handoff messages).

Issue: gt-zr0a

Thanks!
- Mayor

Already fixed in commit 5d2daf2e (v0.32.1)


Digest: mol-deacon-patrol

Patrol 20 - shift complete


🤝 HANDOFF: Remove .beads-wisp legacy cruft (gt-5klh)

## Issue: gt-5klh

Wisp simplification made wisps just a flag (Wisp=true) in the main .beads/ database.
But legacy .beads-wisp/ infrastructure still exists - and is breaking things (gt hook just failed trying to write to it!)

## Work plan:

1. **Start with Gas Town (gt)** in ~/gt/gastown/mayor/rig:
   - Delete internal/wisp/io.go
   - Remove initWispBeads() from internal/rig/manager.go
   - Fix gt hook command to not use .beads-wisp
   - Update docs/wisp-architecture.md

2. **Then Beads (bd)** in ~/gt/beads/crew/dave:
   - Simplify cmd/bd/doctor/wisp_check.go (query main DB, not directories)

3. **Filesystem cleanup**:
   - Delete all .beads-wisp/ directories
   - Remove from .gitignore files

4. **Verify**:
   - gt mail send --wisp works
   - gt hook works
   - bd sync filters wisps
   - mol squash/burn work

Start by grepping for .beads-wisp and wisp/ references in the gt codebase.


Digest: mol-deacon-patrol

Patrol 20: final patrol before context handoff


Digest: mol-deacon-patrol

Patrol cycle 7: Healthy.


Digest: mol-deacon-patrol

Patrol 1: All healthy. 3 rigs, 6 witnesses+refineries. Doctor fixed 1 orphan session + 8 agent beads.


Digest: mol-deacon-patrol

Patrol #18: All clear


Digest: mol-deacon-patrol

Patrol 2: Quiet cycle, no issues


Add gt whoami command

Add a 'gt whoami' command that shows the current agent's identity based on cwd detection. Should display role (mayor, deacon, witness, polecat), mail address, and home directory. Useful for debugging identity detection issues.


Digest: mol-deacon-patrol

Patrol 9: routine, all healthy


Test: new slash to polecat

Testing slash-based polecat address


Digest: mol-deacon-patrol

Patrol 16: Town quiet


MR Ready: Splitter (bd-rgyd)

Splitter completed. Split queries.go into modules. Branch: polecat/Splitter ready for merge.


Digest: mol-deacon-patrol

Patrol cycle 2: clean, all agents healthy, gastown refinery +1 pending


Digest: mol-deacon-patrol

Patrol cycle 14: All quiet, 3 rigs healthy


Digest: mol-deacon-patrol

Patrol 15: OK


Digest: mol-deacon-patrol

Patrol cycle 10: Full check - all healthy


POLECAT_DONE lima

Exit: COMPLETED
Issue: bd-05a8
MR: mr-1766558079-81fa101b
Branch: polecat/lima


Digest: mol-deacon-patrol

Patrol 32: routine, all healthy


Digest: mol-deacon-patrol

Patrol 81


Digest: mol-deacon-patrol

Cycle 16


Digest: mol-deacon-patrol

Patrol 8: Routine


Digest: mol-deacon-patrol

Patrol 17: Routine


Digest: mol-deacon-patrol

Patrol 17: Nominal


Digest: mol-deacon-patrol

Patrol 17: All clear


Digest: mol-deacon-patrol

Patrol cycle 10: Full health check passed, all rigs healthy


Digest: mol-deacon-patrol

Patrol cycle 2: All healthy. No changes from cycle 1.


Digest: mol-deacon-patrol

Patrol 12: quiet cycle


Digest: mol-deacon-patrol

Patrol cycle 11: Routine, all healthy


🤝 HANDOFF: Tech Debt Epic gt-5n2f

## Current State
Created epic gt-5n2f (Tech Debt: Code Review December 2024) with 11 child issues.

## Issues to Work (by priority)

### P2 - Start Here
- gt-ai1z: Detect cycles in molecule dependency graph (molecule.go:302)
- gt-7sqi: Extract common manager creation boilerplate (5 duplicated functions)
- gt-480b: Improve test coverage (cmd 6.8%, mail 3.6%, daemon 12.1%)

### P3 - Next
- gt-zhm5: Epic filtering TODO in witness/manager.go:688
- gt-xnql: Define constants for magic strings
- gt-cvfg: Use cmd.OutOrStdout in refinery
- gt-2xsh: Audit silent error handling patterns
- gt-2n6z: Inconsistent error wrapping patterns

### P4 - When Time Permits
- gt-nz6t: Remove unused style helper functions
- gt-92of: Split large files (800+ lines)
- gt-pbr3: Add godoc comments

## Recommended Approach
1. Start with gt-7sqi (manager boilerplate) - quick win, reduces duplication
2. Then gt-ai1z (cycle detection) - small focused task
3. Work through P3 issues as time allows

## Commands
- bd show gt-5n2f  # View epic with all children
- bd ready        # See unblocked work


Digest: mol-deacon-patrol

Patrol 1: No callbacks, no gates, all agents healthy, no orphans


📋 Work Assignment: Phase 3.1: Summary generation protocol

Issue: gt-3x0z.7
Title: Phase 3.1: Summary generation protocol
Priority: P1
Type: task

Description:
Define how agents generate summaries for squash.

## The Problem

Beads doesn't make AI calls (inversion of control). Gas Town agents must:
1. Generate their own summary before calling squash
2. Pass summary to bd squash command

## Summary Template

```
Task: <source issue title>
Action: <what was done - fix/implement/refactor/etc>
Outcome: <result - tests pass, committed, needs follow-up, etc>
Details: <1-2 sentences of specifics if needed>
```

## Example

```
Task: Fix lifecycle parser matching bug (gt-rixa)
Action: Reordered conditional checks in parseLifecycleRequest
Outcome: Tests passing, committed to polecat/furiosa
Details: The 'cycle' keyword was matching 'lifecycle:' prefix. Now checks restart/shutdown first, uses word boundary for cycle.
```

## Command

```bash
bd squash eph-abc123 --summary "Task: Fix lifecycle parser..."
```

## Workflow
1. Run `gt prime` to load polecat context
2. Run `bd sync --from-main` to get fresh beads
3. Work on your task, commit changes regularly
4. Run `bd close <issue-id>` when done
5. Run `bd sync` to push beads changes
6. Push code: `git push origin HEAD`
7. Run `gt done` to signal completion

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`
- Code is pushed to origin

The `gt done` command verifies these and signals the Witness.


Digest: mol-deacon-patrol

Patrol cycle 2: All agents healthy. Routine check, no incidents.


Digest: mol-deacon-patrol

Patrol #9: 3 polecats active. All healthy.


Digest: mol-deacon-patrol

Patrol 20: Final patrol before handoff


Digest: mol-deacon-patrol

Patrol cycle 2: Routine, no issues


Digest: mol-deacon-patrol

Patrol cycle 17: gastown/refinery restarted


Digest: mol-deacon-patrol

Patrol cycle 5: all quiet, agents healthy


📋 Work Assignment: Phase 1.4: Basic patrol runner in Deacon

Issue: gt-rana.4
Title: Phase 1.4: Basic patrol runner in Deacon
Priority: P1
Type: task

Description:
Deacon CLAUDE.md and prime context for patrol execution.

## Deacon Context
- Update Deacon CLAUDE.md with patrol instructions
- On wake: check pinned bead for attachment
- If attached: resume molecule from current step
- Execute steps, close each when done
- On final step: burn molecule, go naked

## gt prime Enhancement
- Detect if agent has attached molecule
- Show molecule progress in prime output
- Include patrol-specific instructions

Depends: gt-rana.3

## Workflow
1. Run `gt prime` to load polecat context
2. Run `bd sync --from-main` to get fresh beads
3. Work on your task, commit changes regularly
4. Run `bd close <issue-id>` when done
5. Run `bd sync` to push beads changes
6. Push code: `git push origin HEAD`
7. Run `gt done` to signal completion

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`
- Code is pushed to origin

The `gt done` command verifies these and signals the Witness.


Digest: mol-deacon-patrol

Patrol C22: All healthy


📋 Work Assignment: Deacon patrol wisps should use town beads, not gastown rig beads

Issue: gt-ci84
Title: Deacon patrol wisps should use town beads, not gastown rig beads
Priority: P1
Type: bug

Description:
## Problem

The deacon is a town-level role but stores patrol wisps in gastown/mayor/rig/.beads/ (see internal/cmd/prime.go:691). This fails for users who don't have the gastown rig installed.

## Correct Architecture

Deacon -> ~/gt/.beads-wisp/ (town-level, no rig dependency)

Town-level ephemeral work (deacon patrols) should use town wisp storage, just like rig-level ephemeral work (witness/refinery patrols) uses rig wisp storage.

## Implementation Tasks

### 1. Town Setup (gt install / gt town init)

- Create ~/gt/.beads-wisp/ directory during town initialization
- Initialize as git repo (for local commits, not synced)
- Add config.yaml with wisp: true
- Ensure .beads-wisp/ is gitignored at town level

Files:
- internal/cmd/install.go (or equivalent town init)
- internal/town/manager.go (if exists)

### 2. Rig Setup (gt rig init)

Already creates <rig>/.beads-wisp/ - verify this is working:
- internal/rig/manager.go:375 (beadsDir := filepath.Join(rigPath, ".beads-wisp"))
- internal/rig/manager.go:394 (ensureGitignoreEntry)

### 3. Deacon Code Fixes

Update deacon to use town wisp storage:
- internal/cmd/prime.go:691 - change rigBeadsDir to townWispDir
- internal/cmd/sling.go - route deacon wisps to town level
- internal/daemon/daemon.go - any deacon-specific wisp handling

### 4. gt doctor Checks

Add/update doctor checks for wisp directories:
- internal/doctor/wisp_check.go - already checks rig wisps
- Add TownWispCheck to verify ~/gt/.beads-wisp/ exists
- Add TownWispGitCheck to verify it is a valid git repo
- Update existing checks to handle both town and rig levels

Files:
- internal/doctor/wisp_check.go (extend for town level)
- internal/doctor/checks.go (register new checks)

### 5. Documentation

- docs/beads-data-plane.md - already updated with three-tier architecture
- Verify wisp-architecture.md reflects town-level wisps

## Testing

1. Fresh gt install should create ~/gt/.beads-wisp/
2. gt doctor should pass with no rig installed
3. Deacon patrol should work without gastown rig
4. gt sling patrol deacon/ --wisp should route to town wisps

## Workflow
1. Run `gt prime` to load polecat context
2. Work on your task, commit changes regularly
3. Run `bd close <issue-id>` when done
4. Run `bd sync` to push beads changes
5. Push code: `git push origin HEAD`
6. Run `gt done` to signal completion

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`
- Code is pushed to origin

The `gt done` command verifies these and signals the Witness.


Digest: mol-deacon-patrol

Patrol C17: All healthy, burned 20 stale wisps, no incidents


🤝 HANDOFF: Merge queue ready

Queue cleared. 13-polecat swarm incoming - fresh context ready for processing. Pre-existing beads integration tests fail (signal killed) - environment issue, not code.


📋 Work Assignment: Test issue 1 for displacement

Issue: gt-g2p7
Title: Test issue 1 for displacement
Priority: P3
Type: task

## Workflow
1. Run `gt prime` to load polecat context
2. Work on your task, commit changes regularly
3. Run `bd close <issue-id>` when done
4. Run `bd sync` to push beads changes
5. Push code: `git push origin HEAD`
6. Run `gt done` to signal completion

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`
- Code is pushed to origin

The `gt done` command verifies these and signals the Witness.


📋 Work Assignment: test pin fix

Issue: gt-k08o
Title: test pin fix
Priority: P2
Type: task

## Workflow
1. Run `gt prime` to load polecat context
2. Work on your task, commit changes regularly
3. Run `bd close <issue-id>` when done
4. Run `bd sync` to push beads changes
5. Push code: `git push origin HEAD`
6. Run `gt done` to signal completion

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`
- Code is pushed to origin

The `gt done` command verifies these and signals the Witness.


Digest: mol-deacon-patrol

Patrol 2: quiet cycle, all components healthy


Digest: mol-deacon-patrol

Patrol 4: Routine check, 2 convoys in progress, all agents healthy


Digest: mol-deacon-patrol

Patrol 34: All healthy


Digest: mol-deacon-patrol

Patrol cycle 16: All quiet


Digest: mol-deacon-patrol

Patrol cycle 16: healthy


Digest: mol-deacon-patrol

Patrol 15: Stable


Digest: mol-deacon-patrol

Patrol cycle 11: routine


Digest: mol-deacon-patrol

Patrol #12: routine


Digest: mol-deacon-patrol

Patrol 106: All healthy.


Digest: mol-deacon-patrol

Patrol cycle 15: all quiet


Digest: mol-deacon-patrol

Patrol cycle 2: All agents healthy, fixed refinery branch, 19 sessions


Digest: mol-deacon-patrol

Patrol cycle 16: routine, beads healthy


POLECAT_DONE rictus

Exit: COMPLETED
Issue: bd-indn
MR: bd-wp5j
Branch: polecat/rictus


Digest: mol-deacon-patrol

Patrol 6: 10 agents healthy


Role: crew

Crew Role Definition


Digest: mol-deacon-patrol

Patrol 16: All healthy


POLECAT_STARTED beads/furiosa

Issue: bd-0oqz
Session: gt-beads-furiosa


Digest: mol-deacon-patrol

Patrol cycle 9: Nominal


Digest: mol-deacon-patrol

Patrol 2: all healthy, no events


Digest: mol-deacon-patrol

Quiet patrol: no inbox, no convoys, all healthy


Digest: mol-deacon-patrol

Patrol 2: all healthy, no callbacks, no orphans


Digest: mol-deacon-patrol

Patrol 14: All clear


Digest: mol-deacon-patrol

Patrol cycle 19: All healthy


Work: Redesign session cost tracking: wisps to daily aggregates

Auto-created convoy tracking gt-cm900


Work: Add unit test for gitHasUncommittedBeadsChanges()

Auto-created convoy tracking bd-p7i2


Work: gt rig status: Show single-rig status summary

Auto-created convoy tracking gt-77teo


Work: Polecat lifecycle cleanup: stale worktrees and git tracking conflicts

Auto-created convoy tracking gt-v07fl


Work: Phase 2: Create town-level agent beads during gt install

Auto-created convoy tracking gt-qgmyz


Work: Remove vestigial state.json files from agent directories

Auto-created convoy tracking gt-3x0rd


Work: Clarify RecreateWithOptions as repair operation (not recycling)

Auto-created convoy tracking gt-l0lok


Work: gt mail search: Find messages by content

Auto-created convoy tracking gt-d46.4

Mail work completed in 918fcc3 and 092aa56


Work: Connection interface: Protocol for local/remote ops

Auto-created convoy tracking gt-f9x.7


Work: Refinery: Non-blocking delegation via bead-gates

Auto-created convoy tracking gt-hibbj


Work: BUG: gt rig shutdown doesn't kill tmux sessions

Auto-created convoy tracking bd-gxaf


Work: Update patrol formulas to use await-signal backoff

Auto-created convoy tracking gt-srm3y.2


Work: Review PR #140: docs(mayor) Add Polecat Operations section

Auto-created convoy tracking gt-9xhbf


Work: bd agent state fails when agent bead doesn't exist

Auto-created convoy tracking bd-vii9


Work: polecat nuke: Check if work is on main, not just 'pushed'

Auto-created convoy tracking gt-fo9iz


Work: gt sling: Support batch slinging multiple beads

Auto-created convoy tracking gt-ptnwl


Work: Phase 5: Close PR #50, update documentation

Auto-created convoy tracking gt-5st7b


Work: Review PR #91: extract town session helpers for DRY shutdown

Auto-created convoy tracking gt-zh330


Work: town handoff command (optional)

Auto-created convoy tracking gt-1le


Work: Remove gt polecat done/reset/finish commands (idle producers)

Auto-created convoy tracking gt-32d4a


Work: Review PR #908: feat(doctor) external hook managers

Auto-created convoy tracking bd-ffp5


Test convoy for add

Convoy tracking 0 issues


Work: Phase 1: Add hq- prefix agent bead ID helpers

Auto-created convoy tracking gt-y24km


P2 Bug Fixes

Convoy tracking 4 issues


Work: Add gt mail clear command for bulk inbox clearing

Auto-created convoy tracking gt-o0xbp


Work: Wire up gt costs record to Stop hook

Auto-created convoy tracking gt-ntzhc


Work: Implement formula features: Step.Condition and Step.Gate

Auto-created convoy tracking bd-7zka


Hookable mail beads

Convoy tracking 4 issues
Notify: mayor/


Work: Review PR #53: fix: Add retry logic for Enter key send in NudgeSession/NudgePane

Auto-created convoy tracking gt-tdeim


Work: Witness patrol wisp not respawning after completion

Auto-created convoy tracking gt-7vdqv


Work: GHI #885: Sync failure leaves local JSONL stale, causing inconsistent state

Auto-created convoy tracking bd-sxlt


Work: Review PR #953: Fix --due/--defer in daemon mode

Auto-created convoy tracking bd-piywi


Work: Cleanup stale .beads-wisp references in docs and formulas

Auto-created convoy tracking gt-d0h4e


Property Layer Lookup

Convoy tracking 1 issues

All tracked issues completed: gt-emh1c closed


Work: Migrate from .claude/commands/ to .claude/skills/ format

Auto-created convoy tracking gt-nqtqp


Test Convoy

Convoy tracking 1 issues


Work: Defer SQLite metadata updates until after git commit succeeds

Auto-created convoy tracking bd-usvv


Work: Review PR #16929: Respect --comment flag

Auto-created convoy tracking bd-c4nfq


Work: Refactor: Move Claude Code plugin to subdirectory (GH#985)

Auto-created convoy tracking bd-bmzg2


Work: Review PR #184: route rig beads to town

Auto-created convoy tracking gt-e90fu


Work: mol-sync-workspace: Add Refinery-specific inline conflict resolution guidance

Auto-created convoy tracking gt-p80pc


Work: test-sling-routing

Auto-created convoy tracking gt-viq0w


Gate Evaluation: Timer + GitHub Gates

Convoy tracking 2 issues


Work: Polecat hooks lost on session interruption

Auto-created convoy tracking gt-ttn3h


Work: GHI #891: close_reason field dropped during merge/sync

Auto-created convoy tracking bd-ne0h


Work: Fix: Global install leaves invalid hooks (GH#955)

Auto-created convoy tracking bd-jy5f6


Work: gt mail reply: Reply to messages

Auto-created convoy tracking gt-d46.5


Work: gt crew add should provision .claude/commands/

Auto-created convoy tracking gt-jhr85


Work: Fix: post-checkout hook inline import fails (GH#984)

Auto-created convoy tracking bd-vf63g


Work: gt convoy status: Show assignee and actual status for tracked issues

Auto-created convoy tracking gt-cbstf


Work: Cross-rig agent identity detection

Auto-created convoy tracking gt-nji95


Work: gt hook: cross-level hooks invisible (mayor cant see hooked rig beads)

Auto-created convoy tracking gt-g6ng2


Work: Review PR #98: improve rig name validation error message

Auto-created convoy tracking gt-zdbd8


Witness nuke fix

Convoy tracking 1 issues
Notify: mayor/


Work: GHI #880: Failures with exit status 128 due to path casing mismatch on macOS

Auto-created convoy tracking bd-3tqg


Work: Review PR #16228: Node 20 to 24 in devcontainer

Auto-created convoy tracking bd-w43xt


Work: Polecat: Conflict resolution workflow

Auto-created convoy tracking gt-si8rq.5


Property Layers Foundation

Convoy tracking 2 issues


Work: gt done: Capture session_id in issue close for CV attribution

Auto-created convoy tracking gt-nvz8b


Work: mol-sync-workspace: Fix 'commits ahead' in report for crew on main

Auto-created convoy tracking gt-9yz70


Work: Document polecat lifecycle clearly in onboarding and theory of operation

Auto-created convoy tracking gt-mhfpq


Work: Review PR #42: fix(done): detect default branch instead of hardcoding 'main'

Auto-created convoy tracking gt-awb9v


Work: Add 'spawn' as alias for 'start' subcommand across all roles

Auto-created convoy tracking gt-veswi


Work: Add minimum beads version dependency

Auto-created convoy tracking gt-im3fl


Work: gt sling hooks wrong issue - ID resolution or hook file bug

Auto-created convoy tracking gt-7m33w


Work: GHI #889: postinstall fails on Windows - zip being used by another process

Auto-created convoy tracking bd-5dlz


Work: Review PR #83: Update dependencies

Auto-created convoy tracking gt-nra8k


Work: Fix: bd show can't find issues bd list finds (GH#942)

Auto-created convoy tracking bd-odaaa


Work: Design escalation inbox for stuck workflows

Auto-created convoy tracking bd-0sgd


Work: Fix: Windows postinstall file lock race (GH#925)

Auto-created convoy tracking bd-xxl82


Daemon hardening

Convoy tracking 4 issues


Work: Autonomous agents idle at welcome screen after start

Auto-created convoy tracking gt-01jpg


Work: mol-sync-workspace: Move cleanup-worktrees earlier in step order

Auto-created convoy tracking gt-gqiwm


Work: TestIntegration fails due to db out of sync

Auto-created convoy tracking hq-0cgd3


Work: gt done --exit: Self-terminate polecat session after MR submission

Auto-created convoy tracking gt-lynar


Convoy-first workflow

Convoy tracking 2 issues
Notify: mayor/


Formula Molecules v1

Convoy tracking 7 issues
Notify: mayor/


Work: BUG: Refinery checks git ls-remote instead of gt mq list

Auto-created convoy tracking gt-hwm9j

Tracked issue gt-hwm9j completed - refinery template fixed


Work: CI: GitHub Actions workflow for integration tests

Auto-created convoy tracking gt-htlmp.5


Work: Remove StateIdle and idle polecat concept

Auto-created convoy tracking gt-ptwe1


Work: Refinery: Conflict-resolution task creation

Auto-created convoy tracking gt-si8rq.3


Work: Review PR #916: fix(doctor) metadata table query

Auto-created convoy tracking bd-q2b8


Work: gt crew start should infer rig from current directory

Auto-created convoy tracking gt-czltv


Work: bd cook creates gate beads for gate steps

Auto-created convoy tracking bd-4k3c


Work: Workspace doctor checks: Config, state, mail, Mayor, rigs

Auto-created convoy tracking gt-f9x.5


code-review: Comprehensive code review via parallel specialized reviewers.

E...

Formula convoy: code-review

Legs: 7
Rig: gastown
PR: #4


Work: Mayor notification levels (Do Not Disturb mode)

Auto-created convoy tracking gt-xmsme


Work: Witness cleanup leaves worktree behind

Auto-created convoy tracking gt-7uuye


Work: Witness checks wrong remote for merge verification

Auto-created convoy tracking gt-ncq26


Hanoi Demo Launch Prep

Convoy tracking 3 issues
Notify: mayor/


Work: Polecat session checkpoint for crash recovery

Auto-created convoy tracking gt-441j6


Work: Serialized conflict resolution via merge-slot gate

Auto-created convoy tracking gt-4u49x


Labels + Bug Fixes

Convoy tracking 3 issues


Work: BUG: gt swarm create uses non-existent --mol-type flag on bd update

Auto-created convoy tracking gt-zqt4d

Fixed in e7b9240 - removed non-existent --mol-type flag


Work: Fix: bd doctor false positive on thin shim hook (GH#969)

Auto-created convoy tracking bd-sabmf


Work: Add Windows-compatible file locking for daemon

Auto-created convoy tracking gt-5354h


Work: Audit and fix remaining gt-* references for town-level agents

Auto-created convoy tracking gt-5gkdq


Work: Fix sync.remote config not being respected (GH#872)

Auto-created convoy tracking bd-ypvj


Work: Opt-in template validation for issues

Auto-created convoy tracking bd-ou35


Release: minor version bump

Convoy tracking 1 issues


Work: Add validation config support

Auto-created convoy tracking bd-t7jq


Work: gt start --all leaves crew 'running' but 'dead'

Auto-created convoy tracking gt-ms8s4


Work: Fix: bd doctor doesn't detect lefthook jobs syntax (GH#981)

Auto-created convoy tracking bd-1258f


System Reliability

Convoy tracking 4 issues
Notify: mayor/


Work: BUG: gt sling updates bead status but doesn't create .hook file

Auto-created convoy tracking gt-6zzvi


Work: Review PR #16215: Fix broken links in plugin docs

Auto-created convoy tracking bd-z7w5p


Epic: Align agent/role beads (gt-4r1ph)

Convoy tracking 5 issues


Work: gt mq: Priority-ordered queue display and processing

Auto-created convoy tracking gt-si8rq.6


Work: Rig management commands for town startup/shutdown

Auto-created convoy tracking gt-yyht4


Work: Parallel refinery: reduce merge queue bottleneck

Auto-created convoy tracking gt-kgszr


Work: Clean up unused isFirstRig parameter in initAgentBeads

Auto-created convoy tracking gt-fugmy


Work: Add gate field to Step schema in formula types

Auto-created convoy tracking bd-4bt1


P2/P3 Bug and Refactor Sweep

Convoy tracking 11 issues


Work: Review PR #961: Fix daemon JSON output for dep

Auto-created convoy tracking bd-mydeg


Work: Design: MQ Priority Objective Function

Auto-created convoy tracking gt-si8rq.1


Work: Polecat hook not cleared after work completion

Auto-created convoy tracking gt-2wc1n


Work: gt mr: Add alias for merge request operations

Auto-created convoy tracking gt-t85hw


Work: Review PR #93: deploy SessionStart hooks in gt install

Auto-created convoy tracking gt-9tsym


Work: Cost tracking v2: Use beads instead of JSONL

Auto-created convoy tracking gt-f7jxr


Work: Fix: bd edit --wait editor issues (GH#987)

Auto-created convoy tracking bd-bd575


Work: gt mail archive/purge: Archive management

Auto-created convoy tracking gt-d46.3


Work: Review PR #960: Fix filepath.Rel sync error

Auto-created convoy tracking bd-fl9xb


Work: Add GUPP to non-polecat roles (Mayor, Deacon, Witness, Refinery)

Auto-created convoy tracking gt-zzpmt


Work: Include session ID in PropulsionNudge for /resume picker

Auto-created convoy tracking gt-u49zh


Work: Witness: Update polecat monitoring for ephemeral model

Auto-created convoy tracking gt-si8rq.9


Work: Deacon health checks too frequent - disturbs idle agents

Auto-created convoy tracking gt-brndh


Work: Fix daemon path mismatch on case-insensitive filesystems (GH#869)

Auto-created convoy tracking bd-oeeb


Work: Phase 4: Migration script for existing installations

Auto-created convoy tracking gt-nnub1


Work: Fix: SQLite WAL fails on WSL2 /mnt/c/ (GH#920)

Auto-created convoy tracking bd-dqmb1


Work: BUG: Daemon heartbeat too slow (10 min) for stuck agent detection

Auto-created convoy tracking gt-6y5o3

Tracked issue gt-6y5o3 completed - heartbeat reduced to 3 min


Work: BUG: Formula wisp create produces incomplete/broken molecule

Auto-created convoy tracking hq-84j7nd


Cross-rig identity detection

Convoy tracking 3 issues
Notify: mayor/


Work: Safeguard town root from accidental branch switches

Auto-created convoy tracking hq-1kwuj


Work: Review and test PR #975: sync --import-only fix

Auto-created convoy tracking bd-wcfeu


Work: Document asymmetric error handling in initTownAgentBeads

Auto-created convoy tracking gt-m39yd


Work: bd list: Add type aliases (mr→merge-request)

Auto-created convoy tracking gt-pvhsv


Work: Review PR #16199: Update documentation link

Auto-created convoy tracking bd-2cwz0


Work: Refinery: Implement mechanical rebase in-place

Auto-created convoy tracking gt-si8rq.2


Work: Validate rig names to reject hyphens and special characters

Auto-created convoy tracking gt-aeok5


Work: mol-sync-workspace: Split handle-dirty-state into focused steps

Auto-created convoy tracking gt-xhwlq


Work: Update polecat template: Use gt done --exit

Auto-created convoy tracking gt-x4ad3


Auto-created convoy tracking gt-cp9bt


Work: gt mail clear --all: Add flag for agent ergonomics

Auto-created convoy tracking gt-105q3


Gate-Aware Release

Convoy tracking 3 issues


Cost tracking performance improvements

Convoy tracking 4 issues
Notify: mayor/


Work: Review PR #16459: Fix broken doc link

Auto-created convoy tracking bd-tq3gx


Work: Extract Gas Town-specific issue types from beads core

Auto-created convoy tracking bd-i54l


Work: Add GH deployment artifacts (homebrew, npm)

Auto-created convoy tracking gt-ufep6


Property Layers Commands

Convoy tracking 4 issues

All 4 tracked issues completed (gt-vxv0u, gt-9gm9n, gt-68c46, gt-hhmkq)


Work: Add missing hq-dog-role to initTownAgentBeads

Auto-created convoy tracking gt-2jjry


Work: Set hook_bead at polecat spawn time, not after

Auto-created convoy tracking gt-h46pk


BUG: gt convoy create with count argument doesn't set convoy description

Convoy tracking 1 issues


Work: gt done fails in worktree: missing remote.origin.fetch config

Auto-created convoy tracking gt-0eh3r


Work: gt done --phase-complete: gastown changes for phase handoff

Auto-created convoy tracking bd-gxb4


Work: Review and merge PR #975: fix sync --import-only store nil

Auto-created convoy tracking bd-n0md6


Work: Witness lifecycle doesn't kill tmux sessions after POLECAT_DONE

Auto-created convoy tracking gt-g9ft5


Work: Review PR #52: fix: Close MR beads after successful merge from queue

Auto-created convoy tracking gt-ky1nt


Work: Review PR #910: fix(sync) persist sync branch

Auto-created convoy tracking bd-uncd


Watchdog Chain

Convoy tracking 7 issues


Work: Review PR #95: fix daemon init recommendation

Auto-created convoy tracking gt-05rgl


Test convoy

Convoy tracking 0 issues


Work: Stale Session ended events accumulating in beads

Auto-created convoy tracking gt-8tc1v


Work: Review PR #905: fix(update) prefix routing

Auto-created convoy tracking bd-wzve


Work: gt mail mark/delete: Basic message operations

Auto-created convoy tracking gt-d46.2


Work: Review PR #198: refinery use default_branch

Auto-created convoy tracking gt-hy9k5


Work: Review PR #16755: Fix PROMPT_PARTS with set -u

Auto-created convoy tracking bd-w05sg


Work: Fix: Issue blocker not in effect (GH#962)

Auto-created convoy tracking bd-5hjuz


Work: Tests fail due to .beads directory discovery escaping temp dirs

Auto-created convoy tracking bd-sfcq


Work: Add bd doctor check for JSONL/SQLite/git divergence

Auto-created convoy tracking bd-vjdt


Work: Exponential backoff for idle patrol agents

Auto-created convoy tracking gt-srm3y


Work: Review and merge PR #970: fix worktree path detection

Auto-created convoy tracking bd-l8xyv


Work: Harden bd daemon startup for reliable gt status

Auto-created convoy tracking gt-rapj1


Work: bd slot set doesn't support cross-beads prefix routing

Auto-created convoy tracking bd-hmeb


Work: Stranded convoy detection + feeding via dog dispatch

Auto-created convoy tracking gt-8otmd


Work: gt hook: Support viewing other agents' hooks

Auto-created convoy tracking gt-873o1


Work: Avoid double export when uncommitted JSONL detected

Auto-created convoy tracking bd-uuo9


Work: Change session naming from gt-{town}-{role} to gt-{role}-{town}

Auto-created convoy tracking gt-2meqm


Work: Review PR #149: fix(sling) cross-rig beads routing

Auto-created convoy tracking gt-4iflk


Work: Review and merge PR #980: gitignore sync state files

Auto-created convoy tracking bd-5o9k8


Work: Fix cross-worktree sync losing status changes (GH#865)

Auto-created convoy tracking bd-jple


Work: Missing failsafe: No circuit breaker for stuck agents

Auto-created convoy tracking gt-72cqu


Work: Review and merge PR #991: fix bd init Windows hang

Auto-created convoy tracking bd-z0v6f


Test convoy

Convoy tracking 0 issues
Notify: mayor/


Work: Review PR #87: add --no-daemon flag to mol bond

Auto-created convoy tracking gt-aboj4


Work: Detect uncommitted JSONL changes before sync operations

Auto-created convoy tracking bd-vd8e


Work: Fix template syntax in code-review.formula.toml (Handlebars vs Go)

Auto-created convoy tracking gt-2dndm


Work: Cost tracking v1: tmux scraping + ledger

Auto-created convoy tracking gt-nrpiq


Work: Fix: Windows daemons can't be stopped/killed (GH#992)

Auto-created convoy tracking bd-6ntrj


Work: Test: gt install creates correct structure

Auto-created convoy tracking gt-htlmp.2


Work: DOC: Add gt nudge guidance to mayor template

Auto-created convoy tracking hq-6h9w4o


Work: CLAUDE.md should be minimal, delegate to prime

Auto-created convoy tracking hq-uiov0


Work: Fix PR→MR terminology in internal workflow docs

Auto-created convoy tracking gt-xmy0y


Property Layers Status

Convoy tracking 1 issues


Work: Phase 4: Cross-Rig Bead Gates

Auto-created convoy tracking bd-w3rh


Pipeline Reliability

Convoy tracking 3 issues
Notify: mayor/


Work: Mayor session ID shows gt-mayor instead of hq-mayor

Auto-created convoy tracking gt-vcvyd


Preflight Checks

Convoy tracking 4 issues
Notify: mayor/


Work: Review PR #183: rig agent beads prefix

Auto-created convoy tracking gt-4kk8r


Work: Review PR #16605: ralph-wiggum nix/nixos fix

Auto-created convoy tracking bd-bur4u


Work: Review PR #16562: Portable shebang in ralph-wiggum

Auto-created convoy tracking bd-nqr5l


Rig management commands

Convoy tracking 5 issues


Work: Refinery gh:run gate auto-discovery

Auto-created convoy tracking bd-z6kw


Work: Review PR #917: fix(doctor) duplicate detection

Auto-created convoy tracking bd-abjn


Work: Fix: v0.46.0 breaks Gas Town type extraction (GH#941)

Auto-created convoy tracking bd-t17wa


Work: Rig doctor checks: Refinery health, clones, gitignore

Auto-created convoy tracking gt-f9x.6


Work: Fix: bd sync fails on fresh clone v0.46.0 (GH#963)

Auto-created convoy tracking bd-7wr2w


Work: GHI #888: Add flag aliases for dep add command to reduce Claude token waste

Auto-created convoy tracking bd-09kt


Work: Verify feed signal sources emit events

Auto-created convoy tracking gt-srm3y.3


Work: Fix: FOREIGN KEY constraint on bd create (GH#956)

Auto-created convoy tracking bd-3en6c


Work: Closed beads should auto-unhook or not show as hooked work

Auto-created convoy tracking gt-8w0r6


Work: BUG: gt sling creates agent bead in wrong database (prefix mismatch)

Auto-created convoy tracking gt-douxa


Work: gt done should verify commits ahead of main before MR

Auto-created convoy tracking gt-fpv2p


Work: Review PR #44: docs: Fix Quick Start to use gt mayor attach

Auto-created convoy tracking gt-3bm5x


Work: Review PR #51: fix: Use hq prefix for agent beads to match town beads database

Auto-created convoy tracking gt-xesj9


Work: Deacon patrol missing GitHub gate check and dispatch-gated steps

Auto-created convoy tracking gt-sfxpr


Work: Test: gt rig add initializes rig correctly

Auto-created convoy tracking gt-htlmp.3


Boot + Polish swarm

Convoy tracking 13 issues
Notify: mayor/


Work: Design Convoy formula

Auto-created convoy tracking gt-ubqeg.2


Work: Optimize convoy status: batch worker lookups

Auto-created convoy tracking gt-a40d8


Work: gt mail check: Check for new mail

Auto-created convoy tracking gt-d46.1


Work: Document polecat lifecycle (session/sandbox/slot layers)

Auto-created convoy tracking gt-bc6gm


Work: Fix: Daemon mode doesn't persist defer_until (GH#993)

Auto-created convoy tracking bd-dcu13


Work: test-routing

Auto-created convoy tracking gt-kdp02


Work: gt convoy list --tree: Show convoy + child status tree

Auto-created convoy tracking gt-quf4c


Work: Review PR #180: git init before beads

Auto-created convoy tracking gt-cnj9y


Work: gt handoff broken: unknown session type hq-mayor

Auto-created convoy tracking gt-h6rmm


Work: Fix flaky beads integration test (sync state issue)

Auto-created convoy tracking gt-5ww96


Work: Review PR #964: FK error regression tests

Auto-created convoy tracking bd-rivt3


Work: gt mail archive: accept multiple message IDs

Auto-created convoy tracking gt-ysvxq


Work: Consider TownBeadsPrefix constant for hq- prefix

Auto-created convoy tracking gt-3jnnu


Work: Code Review Convoy formula (first formula implementation)

Auto-created convoy tracking gt-ubqeg.1


Work: Extended addressing: Parse [machine:]rig/polecat

Auto-created convoy tracking gt-f9x.10


Work: Mass session death: improve crash logging

Auto-created convoy tracking hq-kt1o6


Pre-Launch Code Review

Convoy tracking 11 issues
Notify: mayor/


Work: Phase 3: Update agent bead lookups to use correct tier

Auto-created convoy tracking gt-eqptl


Work: Fix ga- prefix heresy: should be gt- for gastown agents

Auto-created convoy tracking gt-m46bb


Work: Witness sends HEALTH_OK mail to mayor on every deacon ping

Auto-created convoy tracking gt-xbjxp


Work: Review & merge PR #970: Fix worktree path detection

Auto-created convoy tracking bd-96e7v


Work: Add 'gt rig start <rig>' to start witness and refinery together

Auto-created convoy tracking gt-s7t1h


Digest: mol-deacon-patrol

Patrol #11: All healthy.


Digest: mol-deacon-patrol

Patrol #15: routine


Digest: mol-deacon-patrol

Patrol #17: Town idle.


POLECAT_DONE morsov

Exit: COMPLETED
Issue: bd-3sz0
MR: mr-1766562528-24e0103d
Branch: polecat/morsov


Digest: mol-deacon-patrol

Patrol cycle 15


Test message

Testing the new bd create based mail


🤝 HANDOFF: gt-z4bw - Refactor sling to hook+handoff

## Next Up: gt-z4bw

Refactor gt sling into two commands:
- `gt hook <bead>` - durability only (hang work on hook, survives restarts)
- `gt handoff <bead>` - hook + trigger restart

Key insight: 'sling' is too casual for something that triggers session death.

### Context
- Phase 1 (gt-qvn7.1) completed - slinging handoff works
- This refactor cleans up the naming before Phase 2

### Start
bd show gt-z4bw


Digest: mol-deacon-patrol

Patrol 99: All healthy. No incidents.


Digest: mol-deacon-patrol

Patrol 3: All agents healthy. No incidents.


Digest: mol-deacon-patrol

Patrol cycle 13: all healthy, no orphans


Digest: mol-deacon-patrol

Patrol 116: All healthy.


Digest: mol-deacon-patrol

Patrol cycle 3: All agents healthy


Digest: mol-deacon-patrol

P19: clear


Start work

Work on gt-ci84: Deacon patrol wisps should use town beads. Read the issue with 'bd show gt-ci84', implement the fix, test, commit, push, close the issue, then run 'gt done'.


Digest: mol-deacon-patrol

Patrol complete: no callbacks, all agents healthy, no orphans, no plugins


Digest: mol-deacon-patrol

Patrol 9: healthy


Digest: mol-deacon-patrol

Patrol cycle 19: all healthy, fixed 1 orphan


Digest: mol-deacon-patrol

Patrol 6: All healthy


📋 Work Assignment: Fix failing beads tests: TestIntegration and TestPolecatWorkMolecule

Issue: gt-7919
Title: Fix failing beads tests: TestIntegration and TestPolecatWorkMolecule
Priority: P1
Type: bug

## Workflow
1. Run `gt prime` to load polecat context
2. Work on your task, commit changes regularly
3. Run `bd close <issue-id>` when done
4. Run `bd sync` to push beads changes
5. Push code: `git push origin HEAD`
6. Run `gt done` to signal completion

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`
- Code is pushed to origin

The `gt done` command verifies these and signals the Witness.


🤝 HANDOFF: mol-witness-patrol Christmas Ornament complete

Completed gt-tnow.1 and gt-tnow.2:
- Updated WitnessPatrolMolecule() with Christmas Ornament pattern (9 steps)
- Created PolecatArmMolecule() for per-polecat inspection (5 steps)
- All tests passing, pushed to main

Remaining P2 work on gt-tnow epic:
- gt-tnow.3: Add witness plugin hook support
- gt-tnow.4: Integration test with live polecats

Other ready work: bd ready shows 8 remaining issues including
mol-gastown-boot, patrol parity, and template updates.


Digest: mol-deacon-patrol

Patrol 1: All agents healthy (3 rigs), cleaned 4 stale locks, deleted handoff message


POLECAT_STARTED nux

Issue: bd-49kw
Session: gt-beads-nux


Permanent test

Should NOT be wisp


POLECAT_STARTED gastown/furiosa

Issue: gt-o3is
Session: gt-gastown-furiosa


Digest: mol-deacon-patrol

Patrol cycle 16: clean


Digest: mol-deacon-patrol

Patrol 5: Healthy, processed polecat completion notice


Digest: mol-deacon-patrol

Patrol 10 complete: all healthy


📋 Work Assignment: Improve test coverage for internal/syncbranch (33.0% → 70%)

Issue: bd-io8c
Title: Improve test coverage for internal/syncbranch (33.0% → 70%)
Priority: P1
Type: task

Description:
Improve test coverage for internal/syncbranch package from 27% to 70%.

## Current State
- Coverage: 27.0%
- Files: syncbranch.go, worktree.go
- Tests: syncbranch_test.go (basic tests exist)

## Functions Needing Tests

### syncbranch.go (config management)
- [x] ValidateBranchName - has tests
- [ ] Get - needs store mock tests
- [ ] GetFromYAML - needs YAML parsing tests
- [ ] IsConfigured - needs file system tests
- [ ] IsConfiguredWithDB - needs DB path tests
- [ ] Set - needs store mock tests
- [ ] Unset - needs store mock tests

### worktree.go (git operations) - PRIORITY
- [ ] CommitToSyncBranch - needs git repo fixture tests
- [ ] PullFromSyncBranch - needs merge scenario tests
- [ ] CheckDivergence - needs ahead/behind tests
- [ ] ResetToRemote - needs reset scenario tests
- [ ] performContentMerge - needs 3-way merge tests
- [ ] extractJSONLFromCommit - needs git show tests
- [ ] hasChangesInWorktree - needs dirty state tests
- [ ] commitInWorktree - needs commit scenario tests

## Implementation Guide

1. **Use testutil fixtures:**
   ```go
   import "github.com/steveyegge/beads/internal/testutil/fixtures"

   func TestCommitToSyncBranch(t *testing.T) {
       repo := fixtures.NewGitRepo(t)
       defer repo.Cleanup()
       // ... test scenarios
   }
   ```

2. **Test scenarios for worktree.go:**
   - Clean commit (no conflicts)
   - Non-fast-forward push (diverged)
   - Merge conflict resolution
   - Empty changes (nothing to commit)

3. **Mock storage for syncbranch.go:**
   ```go
   store := memory.New()
   // Set up test config
   syncbranch.Set(ctx, store, "beads-sync")
   ```

## Success Criteria
- Coverage ≥ 70%
- All public functions have at least one test
- Edge cases covered for git operations
- Tests pass with `go test -race ./internal/syncbranch`

## Run Tests
```bash
go test -v -cover ./internal/syncbranch
go test -race ./internal/syncbranch
```

## Workflow
1. Run `gt prime` to load polecat context
2. Work on your task, commit changes regularly
3. Run `bd close <issue-id>` when done
4. Run `bd sync` to push beads changes
5. Push code: `git push origin HEAD`
6. Run `gt done` to signal completion

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`
- Code is pushed to origin

The `gt done` command verifies these and signals the Witness.


Digest: mol-deacon-patrol

Patrol C20: All healthy


Digest: mol-deacon-patrol

Patrol 1: No callbacks, 1 convoy pending, no gates, all agents healthy, no abandoned work, no dead sessions


Digest: mol-deacon-patrol

Patrol 74: All healthy. No incidents.


Digest: mol-deacon-patrol

Patrol cycle 20: Final cycle - all 3 rigs healthy


Digest: mol-deacon-patrol

Patrol cycle 20: All healthy - handoff


Digest: mol-deacon-patrol

Patrol C21: All healthy


Digest: mol-deacon-patrol

Patrol #15: All clear


Digest: mol-deacon-patrol

Cycle 7: All healthy


Test Convoy


Digest: mol-deacon-patrol

Patrol 3: All clear


Digest: mol-deacon-patrol

Patrol cycle 16: All healthy.


Digest: mol-deacon-patrol

Patrol C30: All healthy


Digest: mol-deacon-patrol

Patrol 16: quiet


crew Handoff


Digest: mol-deacon-patrol

Patrol cycle 108: All healthy


Digest: mol-deacon-patrol

Patrol 8: Idle


Digest: mol-deacon-patrol

Patrol 3: Healthy


🤝 HANDOFF: Ephemeral molecules - Tier 1 done, Tier 2 ready

Working on epic bd-2vh3: Ephemeral issue cleanup and history compaction

TIER 1 COMPLETE (bd-2vh3.2) - Committed d6ab9ab6
mol spawn now creates ephemeral issues by default. Added --persistent flag to opt out.
Files: template.go, mol.go, mol_spawn.go, mol_bond.go, mol_run.go

NEXT: TIER 2 (bd-2vh3.3) - bd mol squash command
- Use loadTemplateSubgraph() to get molecule children
- Generate digest (concatenate descriptions)
- Create non-ephemeral digest issue
- Delete ephemeral children

KEY RESOURCES:
- Design doc: history/EPHEMERAL_MOLECULES_DESIGN.md
- Epic: bd-2vh3 (has updated notes)
- HOP context: ~/gt/docs/hop/CONTEXT.md

Run bd dep tree bd-2vh3 to see task structure.


New feature request: Cross-rig deps (bd-d9mu)

Filed bd-d9mu for cross-rig external dependency support.

Low priority (P2) - just a nice-to-have for tracking deps between Gas Town and Beads.

Also: Thanks for finishing the chemistry commands! Gas Town will integrate them soon.


Deacon (daemon beacon) - receives mechanical heartbeats, runs town plugins and monitoring.

role_type: deacon
rig: null
agent_state: idle
hook_bead: null
role_bead: hq-deacon-role
cleanup_status: null
active_mr: null
notification_level: null


Role: deacon

Deacon Role Definition


Digest: mol-deacon-patrol

Patrol 52: All healthy


Digest: mol-deacon-patrol

Patrol 20: Final, all stable


Digest: mol-deacon-patrol

Patrol 7: All healthy.


Digest: mol-deacon-patrol

Patrol cycle 5: All quiet, 3 rigs healthy


Digest: mol-deacon-patrol

Patrol cycle 1: Restarted wyvern refinery (was stopped). All 3 witnesses healthy. 2 convoys remain open (hq-cv-rfhja, hq-cv-3gmsy tracking PR reviews). No orphans, no gates, no pending spawns.


Digest: mol-deacon-patrol

Patrol 8: nominal


Digest: mol-deacon-patrol

Patrol cycle 7: inbox clear, all 6 agents healthy, no orphans


📋 Work Assignment: Workaround for FastMCP outputSchema bug in Claude Code

Issue: bd-49kw
Title: Workaround for FastMCP outputSchema bug in Claude Code
Priority: P1
Type: bug

Description:
The beads MCP server (v0.23.1) successfully connects to Claude Code, but all tools fail to load with a schema validation error due to a bug in FastMCP 2.13.1.

Error: "Invalid literal value, expected \"object\"" in outputSchema.

Root Cause: FastMCP generates outputSchema with $ref at root level without "type": "object" for self-referential models (Issue).

Workaround: Use slash commands (/beads:ready) or wait for FastMCP fix.

## Workflow
1. Run `gt prime` to load polecat context
2. Work on your task, commit changes regularly
3. Run `bd close <issue-id>` when done
4. Run `bd sync` to push beads changes
5. Push code: `git push origin HEAD`
6. Run `gt done` to signal completion

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`
- Code is pushed to origin

The `gt done` command verifies these and signals the Witness.


Digest: mol-deacon-patrol

Patrol 120: All healthy.


Digest: mol-deacon-patrol

Patrol 3: all nominal


Digest: mol-deacon-patrol

Patrol 5: all healthy


Digest: mol-deacon-patrol

Patrol 5: Routine


Digest: mol-deacon-patrol

Patrol 11: Routine


Digest: mol-deacon-patrol

Patrol #3: all healthy, morsov done, zoey stopped


Digest: mol-deacon-patrol

Patrol 3: all healthy, no issues


Digest: mol-deacon-patrol

Patrol 12: inbox clear, all agents healthy, 2 convoys open


📋 Work Assignment: Split large cmd/bd files into logical modules

Issue: bd-u2sc.3
Title: Split large cmd/bd files into logical modules
Priority: P3
Type: task

Description:
Split large cmd/bd files into logical modules for maintainability.

## Current State
| File | Lines | Status |
|------|-------|--------|
| sync.go | 2203 | Too large |
| init.go | 1742 | Too large |
| show.go | 1419 | Too large |
| compact.go | 1190 | Borderline |

## Proposed Splits

### 1. sync.go (2203 lines) → 4 files

**sync.go** (~500 lines) - Main command and coordination
```go
var syncCmd = &cobra.Command{...}
func init() {...}
func doSync(...) {...}
```

**sync_export.go** (~400 lines) - Export operations
```go
func exportToJSONL(...)
func markDirtyAndScheduleFlush(...)
func flushPendingChanges(...)
```

**sync_import.go** (~500 lines) - Import operations
```go
func importFromJSONL(...)
func handleImportConflicts(...)
func mergeImportedIssues(...)
```

**sync_branch.go** (~400 lines) - Git branch operations
```go
func commitToSyncBranch(...)
func pullFromSyncBranch(...)
func handleSyncBranchDivergence(...)
```

### 2. init.go (1742 lines) → 3 files

**init.go** (~400 lines) - Main init command
```go
var initCmd = &cobra.Command{...}
func runInit(...)
func determinePrefix(...)
```

**init_wizard.go** (~500 lines) - Interactive setup
```go
func runContributorWizard(...)
func runTeamWizard(...)
func promptForConfig(...)
```

**init_hooks.go** (~400 lines) - Git hooks setup
```go
func installGitHooks(...)
func configureAutosync(...)
func setupMergeDriver(...)
```

### 3. show.go (1419 lines) → 3 files

**show.go** (~400 lines) - Main show command
```go
var showCmd = &cobra.Command{...}
func showIssue(...)
func showMultipleIssues(...)
```

**show_format.go** (~400 lines) - Output formatting
```go
func formatIssueText(...)
func formatIssueMarkdown(...)
func formatDependencyTree(...)
```

**show_threads.go** (~300 lines) - Thread/conversation display
```go
func showThread(...)
func formatThreadMessages(...)
```

### 4. compact.go (1190 lines) → 2 files

**compact.go** (~600 lines) - Main compact command
```go
var compactCmd = &cobra.Command{...}
func runCompact(...)
```

**compact_tiers.go** (~400 lines) - Tier-specific logic
```go
func compactTier1(...)
func compactTier2(...)
func squashWisps(...)
```

## Implementation Steps

1. **Start with sync.go** (largest file)
2. **Create new files** with same package declaration
3. **Move functions** maintaining related code together
4. **Update any file-local variables** that need to be shared
5. **Run tests** after each split:
   ```bash
   go test -short ./cmd/bd/...
   ```

## File Organization After Split
```
cmd/bd/
├── sync.go           (~500 lines)
├── sync_export.go    (~400 lines)
├── sync_import.go    (~500 lines)
├── sync_branch.go    (~400 lines)
├── init.go           (~400 lines)
├── init_wizard.go    (~500 lines)
├── init_hooks.go     (~400 lines)
├── show.go           (~400 lines)
├── show_format.go    (~400 lines)
├── show_threads.go   (~300 lines)
├── compact.go        (~600 lines)
└── compact_tiers.go  (~400 lines)
```

## Success Criteria
- No file > 600 lines
- All tests pass
- Related code stays together
- Clear file naming indicates purpose

## Workflow
1. Run `gt prime` to load polecat context
2. Work on your task, commit changes regularly
3. Run `bd close <issue-id>` when done
4. Run `bd sync` to push beads changes
5. Push code: `git push origin HEAD`
6. Run `gt done` to signal completion

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`
- Code is pushed to origin

The `gt done` command verifies these and signals the Witness.


POLECAT_STARTED valkyrie

Issue: gt-f9x.6
Session: gt-gastown-valkyrie


Digest: mol-deacon-patrol

Patrol 20: all nominal, handoff threshold reached


Digest: mol-deacon-patrol

Patrol 1: Inbox clear, all agents healthy, no orphans, 3 convoys pending


Digest: mol-deacon-patrol

Patrol 22: routine, all healthy


Digest: mol-deacon-patrol

Patrol cycle 1: Burned 114 abandoned wisps, all agents healthy


Digest: mol-deacon-patrol

Patrol 20: healthy


Digest: mol-deacon-patrol

Patrol 6: Warboy still at prompt, nudged to complete handoff


📋 Work Assignment: Witness session cycling and handoff

Issue: gt-eu9
Title: Witness session cycling and handoff
Priority: P1
Type: task

Description:
Add session cycling and handoff protocol to Witness CLAUDE.md template.

## Session Cycling Protocol

```markdown
## Session Cycling

Your context will fill over long swarms. Proactively cycle when:
- Running for many hours
- Losing track of which workers you've checked
- Responses getting slower
- About to start complex operation

### Handoff Protocol

1. **Capture current state**:
```bash
town list .           # Worker states
town all beads        # Pending verifications
town inbox            # Unprocessed messages
```

2. **Compose handoff note**:
```
[HANDOFF_TYPE]: witness_cycle
[TIMESTAMP]: <now>
[RIG]: <rig>

## Active Workers
<list workers and status>

## Pending Verifications
<workers signaled done but not verified>

## Recent Actions
<last 3-5 actions>

## Warnings/Notes
<anything next session should know>

## Next Steps
<what should happen next>
```

3. **Send handoff**:
```bash
town mail send <rig>/witness -s "Session Handoff" -m "<note>"
```

4. **Exit cleanly**: End session, daemon spawns fresh one.

### On Fresh Session Start

1. Check for handoff: `town inbox | grep "Session Handoff"`
2. If found, read it and resume from handoff state
3. If not found, do full status check
```

## Implementation

Add to WITNESS_CLAUDE.md template.

## Workflow
1. Run `gt prime` to load polecat context
2. Work on your task, commit changes regularly
3. Run `bd close <issue-id>` when done
4. Run `bd sync` to push beads changes
5. Push code: `git push origin HEAD`
6. Run `gt done` to signal completion

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`
- Code is pushed to origin

The `gt done` command verifies these and signals the Witness.


POLECAT_DONE furiosa

Exit: COMPLETED
Issue: bd-au0.6
MR: bd-8ca7
Branch: polecat/furiosa


Digest: mol-deacon-patrol

Patrol cycle 11: clean


Digest: mol-deacon-patrol

Patrol 167: All healthy


🤝 HANDOFF: Christmas Launch + Bug Fixes

## Session Summary

### Fixes Completed
1. **Namepool theme bug** (namepool.go:160) - Load() wasn't reading saved theme
2. **Lifecycle mail bug** (lifecycle.go) - Daemon was using bd mail, now uses gt mail
3. **Beads rig theme** - Set to 'minerals' (ruby, jade, obsidian, etc.)
4. **bd mol command** - Rebuilt and installed (codesign required)

### Christmas Launch Status
- **Phase 0** (beads-foundation): ✅ Complete
- **Phase 1** (polecat-loop): Ready to start
  - gt-9nf: Fresh polecats (unblocked)
  - gt-975: Molecule execution (unblocked)
  - gt-8v8: Refuse uncommitted work (done)

### Next Steps
1. Check bd-p5za for full launch plan
2. Start on gt-9nf or gt-975
3. Daemon is running (PID 90338)

Time: 2025-12-21T00:47:43-08:00


Digest: mol-deacon-patrol

Patrol 3: quiet cycle


POLECAT_DONE mike

Exit: COMPLETED
Issue: bd-0fvq
MR: mr-1766558035-3ebd9774
Branch: polecat/mike


POLECAT_DONE dementus

Exit: COMPLETED
Issue: bd-au0.8
MR: mr-1766562487-35107fe3
Branch: polecat/dementus


Dog: testdog5


SPAWN: angharad starting on gt-4eim

Polecat spawn notification.

Polecat: angharad
Issue: gt-4eim
Session: gt-gastown-angharad
Spawned by: mayor/

Please monitor this polecat's startup. When Claude is ready (you can see the prompt
in the tmux session), send a nudge to start working:

    tmux send-keys -t gt-gastown-angharad "Check your inbox with 'gt mail inbox' and begin working." Enter

The polecat has a work assignment in its inbox.


📋 Work Assignment: False positive detection by Kaspersky Antivirus (Trojan)

Issue: bd-t4u1
Title: False positive detection by Kaspersky Antivirus (Trojan)
Priority: P1
Type: task

Description:
Kaspersky Antivirus falsely detects beads (bd.exe v0.23.1) as a Trojan (PDM:Trojan.Win32.Generic) and removes it.
Event: Malicious object detected
Component: System Watcher
Object name: bd.exe

## Workflow
1. Run `gt prime` to load polecat context
2. Work on your task, commit changes regularly
3. Run `bd close <issue-id>` when done
4. Run `bd sync` to push beads changes
5. Run `gt done` to signal completion (branch stays local)

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`

The `gt done` command verifies these and signals the Witness.


Digest: mol-deacon-patrol

Patrol 20: All healthy, preparing handoff


Digest: mol-deacon-patrol

Patrol cycle 14: clean


Digest: mol-deacon-patrol

Patrol 14: routine, no incidents


POLECAT_STARTED gastown/keeper

Issue: gt-17r
Session: gt-gastown-keeper


📋 Work Assignment: bd template commands fail with daemon mode

Issue: bd-indn
Title: bd template commands fail with daemon mode
Priority: P2
Type: bug

Description:
The `bd template show` and `bd template instantiate` commands fail with 'Error loading template: no database connection' when daemon is running.

**Reproduction:**
```bash
bd daemon --start
bd template show bd-qqc  # Error: no database connection
bd template show bd-qqc --no-daemon  # Works
```

**Expected:** Template commands should work with daemon like other commands.

**Workaround:** Use `--no-daemon` flag.

**Location:** Likely in cmd/bd/template.go - daemon RPC path not implemented for template operations.

## Workflow
1. Run `gt prime` to load polecat context
2. Work on your task, commit changes regularly
3. Run `bd close <issue-id>` when done
4. Run `bd sync` to push beads changes
5. Run `gt done` to signal completion (branch stays local)

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`

The `gt done` command verifies these and signals the Witness.


Digest: mol-deacon-patrol

Patrol 175: All healthy, 4 polecats working


Digest: mol-deacon-patrol

Patrol 5: Quiet. All healthy.


Digest: mol-deacon-patrol

Patrol 2: all agents healthy, no issues


Digest: mol-deacon-patrol

Patrol complete: inbox cleared, all agents healthy, no orphans


Digest: mol-deacon-patrol

C118: All healthy


Digest: mol-deacon-patrol

Patrol 1: all agents healthy, no messages, doctor warnings persist (no --fix per directive)


Digest: mol-deacon-patrol

Patrol 2: Clean cycle, all healthy


SPAWN: nux starting on gt-iu23

Polecat spawn notification.

Polecat: nux
Issue: gt-iu23
Session: gt-gastown-nux
Spawned by: gastown/crew/max

Please monitor this polecat's startup. When Claude is ready (you can see the prompt
in the tmux session), send a nudge to start working:

    tmux send-keys -t gt-gastown-nux "Check your inbox with 'gt mail inbox' and begin working." Enter

The polecat has a work assignment in its inbox.


SPAWN: slit starting on gt-44wh

Polecat spawn notification.

Polecat: slit
Issue: gt-44wh
Session: gt-gastown-slit
Spawned by: gastown/crew/max

Please monitor this polecat's startup. When Claude is ready (you can see the prompt
in the tmux session), send a nudge to start working:

    tmux send-keys -t gt-gastown-slit "Check your inbox with 'gt mail inbox' and begin working." Enter

The polecat has a work assignment in its inbox.


🤝 HANDOFF: Wisp integration ready for patrol/workflow finalization

## Context

Steam engine metaphor is now documented. Terminology is set:
- **Proto** = fuel (workflow templates)
- **Wisp** = steam (transient execution traces)
- **Digest** = distillate (compressed permanent records)
- **Bond** = instantiate, **Burn** = discard, **Squash** = compress

## What's Done

1. Filed bd-ldb0 for Dave - rename ephemeral → wisp in beads codebase
2. Updated gt-3x0z epic with wisp terminology (12 children covering full integration)
3. Updated docs/architecture.md with:
   - Steam engine metaphor section
   - Wisp Molecules section (full workflow docs)
   - Updated polecat workflow to be molecule-first
4. Updated docs/vision.md with matching terminology

## What's Next

Dave is preparing the wisp release in beads. While that happens, we need to:

1. **Finalize wisp incorporation into patrols** - gt-rana patrol system needs wisp integration
   - Patrols = infinite wisp loops (execute → squash → sleep → repeat)
   - Each patrol iteration creates wisp molecule, squashes to digest
   - Full audit trail without ledger bloat

2. **Design the spawn → wisp workflow** - How gt spawn creates wisp molecules
   - Spawn receives issue + proto template
   - Bond creates wisp molecule from proto
   - Polecat executes wisp steps
   - Squash to digest before shutdown

3. **Review gt-3x0z children** for completeness:
   - Phase 1: Setup (wisp storage, schema)
   - Phase 2: Spawn Integration
   - Phase 3: Completion Flow (squash/burn)
   - Phase 4: Patrol Integration
   - Phase 5: Polish

## Key Beads

- gt-3x0z: Epic: Wisp Molecule Integration (12 children)
- gt-rana: Patrol System Implementation
- bd-ldb0: Rename ephemeral → wisp (for Dave)

## Files Changed

- docs/architecture.md - comprehensive wisp documentation
- docs/vision.md - steam engine metaphor and terminology

The foundation is laid. Time to finalize the design and unlock innovation.


Digest: mol-deacon-patrol

Patrol 96: quiet


Digest: mol-deacon-patrol

Patrol 4: All clear


Digest: mol-deacon-patrol

Patrol 9: town idle, all healthy


Digest: mol-deacon-patrol

Patrol complete: all agents healthy, no orphans


Digest: mol-deacon-patrol

Patrol 14: routine, preparing handoff


Digest: mol-deacon-patrol

Patrol 99: quiet


Test: new slash to mayor

Testing slash-based mayor address


Digest: mol-deacon-patrol

Patrol 20: final cycle before handoff


Digest: mol-deacon-patrol

Patrol 20: town idle, all healthy - handoff threshold


Digest: mol-deacon-patrol

Patrol 5: routine, all healthy


Digest: mol-deacon-patrol

Patrol #2: All clear


Digest: mol-deacon-patrol

Patrol cycle 9: All healthy


Digest: mol-deacon-patrol

Patrol 4: All agents healthy. No incidents.


Digest: mol-deacon-patrol

Patrol #17: routine


Digest: mol-deacon-patrol

Patrol 5: Town quiet


Digest: mol-deacon-patrol

Patrol 16: Swarm active.


Digest: mol-deacon-patrol

Patrol cycle 4: All healthy


LIFECYCLE: polecat requesting cycle

Lifecycle request from polecat.

Action: cycle
Time: 2025-12-20T23:31:52-08:00
Polecat: crew-max

Please verify state and execute lifecycle action.


Test: canonical address check

Testing if beads/crew/dave receives this


SPAWN: nux starting on gt-rp0k

Polecat spawn notification.

Polecat: nux
Issue: gt-rp0k
Session: gt-gastown-nux
Spawned by: gastown/crew/max

The Deacon will trigger this polecat when Claude is ready (WaitForClaudeReady).
The polecat's SessionStart hook runs gt prime, and work assignment is in its inbox.
Monitor for stuck/idle state after a few minutes.


Digest: mol-deacon-patrol

Cycle 17


Digest: mol-deacon-patrol

Patrol 13: healthy


📋 Work Assignment: Rig doctor checks: Refinery health, clones, gitignore

Issue: gt-f9x.6
Title: Rig doctor checks: Refinery health, clones, gitignore
Priority: P1
Type: task

Description:
Rig-level doctor checks.

## Checks

### RigIsGitRepo
- Verify .git/ directory exists
- Verify git status works
- Fix: Cannot auto-fix

### GitExcludeConfigured
- Check .git/info/exclude contains Gas Town dirs
- Required entries: polecats/ witness/ refinery/ mayor/
- Fix: Append missing entries

### WitnessExists
- Verify witness/ directory exists
- Verify witness/rig/ is a git clone
- Verify witness/mail/inbox.jsonl exists
- Fix: Create structure, clone repo

### RefineryExists
- Verify refinery/ directory exists
- Verify refinery/rig/ is a git clone
- Verify refinery/mail/inbox.jsonl exists
- Fix: Create structure, clone repo

### MayorCloneExists
- Verify mayor/ directory exists
- Verify mayor/rig/ is a git clone
- Fix: Create structure, clone repo

### PolecatClonesValid
- For each polecat in polecats/:
  - Verify is a git clone
  - Verify on polecat branch
  - Warn if has uncommitted changes
- Fix: Cannot auto-fix (data loss risk)

### BeadsConfigValid (if applicable)
- If .beads/ exists, verify bd commands work
- Check beads sync status
- Warn if out of sync
- Fix: Run bd sync

## Implementation

```go
var RigChecks = []Check{
    &RigIsGitRepoCheck{},
    &GitExcludeConfiguredCheck{},
    &WitnessExistsCheck{},
    &RefineryExistsCheck{},
    &MayorCloneExistsCheck{},
    &PolecatClonesValidCheck{},
    &BeadsConfigValidCheck{},
}
```

## Workflow
1. Run `gt prime` to load polecat context
2. Work on your task, commit changes regularly
3. Run `bd close <issue-id>` when done
4. Run `bd sync` to push beads changes
5. Push code: `git push origin HEAD`
6. Run `gt done` to signal completion

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`
- Code is pushed to origin

The `gt done` command verifies these and signals the Witness.


Digest: mol-deacon-patrol

Patrol 1: All healthy, no callbacks, clone divergence noted (zoey 53 behind)


Digest: mol-deacon-patrol

Cycle 280: All clear


Digest: mol-deacon-patrol

Patrol complete: checked inbox (empty), no pending spawns, no gates, 1 convoy still open, restarted wyvern witness (extraordinary action), cleaned 13 stale wisps


Digest: mol-deacon-patrol

Patrol #5: routine


POLECAT_STARTED slit

Issue: bd-0oqz
Session: gt-beads-slit


POLECAT_DONE Modular

Exit: COMPLETED
Issue: bd-u2sc.3
MR: bd-aq3s
Branch: polecat/Modular


Digest: mol-deacon-patrol

Patrol 4: accelerated routine, all healthy


Digest: mol-deacon-patrol

Patrol cycle 9: clean


Digest: mol-deacon-patrol

Patrol 8: Nominal


Digest: mol-deacon-patrol

Patrol 13: Quiet


📋 Work Assignment: Phase 1.2: Daemon attachment detection

Issue: gt-rana.2
Title: Phase 1.2: Daemon attachment detection
Priority: P1
Type: task

Description:
Daemon polls Deacon's pinned bead to detect naked state.

## Implementation
- Daemon knows Deacon's pinned bead ID
- Every heartbeat cycle: bd show <pinned> --json
- Parse attached_molecule field
- If null/empty: Deacon is naked

## Actions on Naked
- Spawn mol-deacon-patrol
- Attach to Deacon's pinned
- Nudge Deacon to start

## Failsafes
- Keepalive file monitoring
- Stale detection (>10min no progress)
- Force nudge on stale

Depends: gt-rana.1

## Workflow
1. Run `gt prime` to load polecat context
2. Run `bd sync --from-main` to get fresh beads
3. Work on your task, commit changes regularly
4. Run `bd close <issue-id>` when done
5. Run `bd sync` to push beads changes
6. Push code: `git push origin HEAD`
7. Run `gt done` to signal completion

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`
- Code is pushed to origin

The `gt done` command verifies these and signals the Witness.


POLECAT_DONE Gater

Exit: COMPLETED
Issue: bd-likt
MR: bd-x2bd
Branch: polecat/Gater


Digest: mol-deacon-patrol

Patrol 20 complete: all healthy, triggering handoff


Digest: mol-deacon-patrol

Patrol 6: Idle


📋 Work Assignment: Add daemon RPC support for gate commands

Issue: bd-likt
Title: Add daemon RPC support for gate commands
Priority: P3
Type: task

Description:
Add daemon RPC support for gate commands.

## Current State
Gate commands require --no-daemon flag because they use direct SQLite access:
- Gate create needs to write await_type, await_id, timeout_ns, waiters fields
- Gate wait needs to update waiters JSON array
- Daemon RPC doesnt have methods for these operations

## Implementation

### 1. Add RPC methods to internal/rpc/protocol.go

```go
// Gate operations
type GateCreateArgs struct {
    Title     string        \`json:"title"\`
    AwaitType string        \`json:"await_type"\`
    AwaitID   string        \`json:"await_id"\`
    Timeout   time.Duration \`json:"timeout"\`
    Waiters   []string      \`json:"waiters"\`
}

type GateCreateResult struct {
    Issue *types.Issue \`json:"issue"\`
}

type GateListArgs struct {
    All bool \`json:"all"\` // Include closed gates
}

type GateListResult struct {
    Gates []*types.Issue \`json:"gates"\`
}

type GateWaitArgs struct {
    GateID  string   \`json:"gate_id"\`
    Waiters []string \`json:"waiters"\` // Additional waiters to add
}

type GateWaitResult struct {
    Gate        *types.Issue \`json:"gate"\`
    AddedCount  int          \`json:"added_count"\`
}
```

### 2. Add handler methods to internal/daemon/rpc_handler.go

```go
func (h *RPCHandler) GateCreate(ctx context.Context, args *rpc.GateCreateArgs) (*rpc.GateCreateResult, error) {
    now := time.Now()
    gate := &types.Issue{
        Title:     args.Title,
        IssueType: types.TypeGate,
        Status:    types.StatusOpen,
        Priority:  1,
        Assignee:  "deacon/",
        Wisp:      true,
        AwaitType: args.AwaitType,
        AwaitID:   args.AwaitID,
        Timeout:   args.Timeout,
        Waiters:   args.Waiters,
        CreatedAt: now,
        UpdatedAt: now,
    }
    gate.ContentHash = gate.ComputeContentHash()

    if err := h.store.CreateIssue(ctx, gate, h.actor); err != nil {
        return nil, err
    }

    return &rpc.GateCreateResult{Issue: gate}, nil
}

func (h *RPCHandler) GateList(ctx context.Context, args *rpc.GateListArgs) (*rpc.GateListResult, error) {
    gateType := types.TypeGate
    filter := types.IssueFilter{IssueType: &gateType}
    if !args.All {
        openStatus := types.StatusOpen
        filter.Status = &openStatus
    }

    gates, err := h.store.SearchIssues(ctx, "", filter)
    if err != nil {
        return nil, err
    }

    return &rpc.GateListResult{Gates: gates}, nil
}

func (h *RPCHandler) GateWait(ctx context.Context, args *rpc.GateWaitArgs) (*rpc.GateWaitResult, error) {
    gate, err := h.store.GetIssue(ctx, args.GateID)
    if err != nil {
        return nil, err
    }
    if gate.IssueType != types.TypeGate {
        return nil, fmt.Errorf("%s is not a gate", args.GateID)
    }

    // Merge waiters (dedupe)
    waiterSet := make(map[string]bool)
    for _, w := range gate.Waiters {
        waiterSet[w] = true
    }
    added := 0
    for _, w := range args.Waiters {
        if !waiterSet[w] {
            gate.Waiters = append(gate.Waiters, w)
            waiterSet[w] = true
            added++
        }
    }

    if added > 0 {
        // Update via store
        updates := map[string]interface{}{
            "waiters": gate.Waiters,
        }
        if err := h.store.UpdateIssue(ctx, args.GateID, updates, h.actor); err != nil {
            return nil, err
        }
    }

    return &rpc.GateWaitResult{Gate: gate, AddedCount: added}, nil
}
```

### 3. Register methods in daemon

In internal/daemon/server.go, register the new methods:
```go
rpc.RegisterMethod("gate.create", h.GateCreate)
rpc.RegisterMethod("gate.list", h.GateList)
rpc.RegisterMethod("gate.wait", h.GateWait)
```

### 4. Add client methods to internal/rpc/client.go

```go
func (c *Client) GateCreate(ctx context.Context, args *GateCreateArgs) (*GateCreateResult, error) {
    var result GateCreateResult
    err := c.Call(ctx, "gate.create", args, &result)
    return &result, err
}

func (c *Client) GateList(ctx context.Context, args *GateListArgs) (*GateListResult, error) {
    var result GateListResult
    err := c.Call(ctx, "gate.list", args, &result)
    return &result, err
}

func (c *Client) GateWait(ctx context.Context, args *GateWaitArgs) (*GateWaitResult, error) {
    var result GateWaitResult
    err := c.Call(ctx, "gate.wait", args, &result)
    return &result, err
}
```

### 5. Update cmd/bd/gate.go to use daemon

```go
// In gateCreateCmd Run:
if daemonClient != nil {
    result, err := daemonClient.GateCreate(ctx, &rpc.GateCreateArgs{
        Title:     title,
        AwaitType: awaitType,
        AwaitID:   awaitID,
        Timeout:   timeout,
        Waiters:   notifyAddrs,
    })
    if err != nil {
        FatalError("gate create: %v", err)
    }
    gate = result.Issue
} else {
    // Existing direct store code
}
```

## Files to Modify

1. **internal/rpc/protocol.go** - Add Gate*Args/Result types
2. **internal/daemon/rpc_handler.go** - Add handler methods
3. **internal/daemon/server.go** - Register methods
4. **internal/rpc/client.go** - Add client methods
5. **cmd/bd/gate.go** - Use daemon client when available

## Testing

```bash
# Start daemon
bd daemon start

# Test via daemon (should work without --no-daemon)
bd gate create --await timer:5m --notify beads/dave
bd gate list
bd gate wait <id> --notify beads/alice

# Verify daemon handled it
bd daemons logs . | grep gate
```

## Success Criteria
- All gate commands work without --no-daemon
- Same behavior in daemon vs direct mode
- Waiters array updates correctly via RPC
- Tests pass for RPC gate operations

## Workflow
1. Run `gt prime` to load polecat context
2. Work on your task, commit changes regularly
3. Run `bd close <issue-id>` when done
4. Run `bd sync` to push beads changes
5. Push code: `git push origin HEAD`
6. Run `gt done` to signal completion

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`
- Code is pushed to origin

The `gt done` command verifies these and signals the Witness.


Digest: mol-deacon-patrol

Patrol 3: All healthy, cleaned gt-boot orphan, no incidents


SPAWN: ace starting on gt-qns0

Polecat spawn notification.

Polecat: ace
Issue: gt-qns0
Session: gt-gastown-ace
Spawned by: mayor/

Please monitor this polecat's startup. When Claude is ready (you can see the prompt
in the tmux session), send a nudge to start working:

    tmux send-keys -t gt-gastown-ace "Check your inbox with 'gt mail inbox' and begin working." Enter

The polecat has a work assignment in its inbox.


Digest: mol-deacon-patrol

Patrol 31: routine, all healthy


Digest: mol-deacon-patrol

Patrol 21: All agents healthy, 3 convoys active (Hanoi Demo, Boot+Polish, Messaging), no callbacks, no orphans


Digest: mol-deacon-patrol

Patrol 5: All healthy, beads MQ 5 pending


Digest: mol-deacon-patrol

Patrol cycle 2: All healthy, no incidents


Digest: mol-deacon-patrol

Patrol 16: routine


Digest: mol-deacon-patrol

Patrol 20: healthy - handoff time


Digest: mol-deacon-patrol

Patrol 10: Routine, halfway


Refinery Status: Queue Empty

Refinery checking in after reboot.

## Status
- Queue: Empty (0 pending)
- No polecat branches in remote
- Refinery running, ready to process

The 12 MQ items mentioned in your handoff are no longer present - queue appears to have been cleared during reboot.

Standing by for new MRs.


Digest: mol-deacon-patrol

Patrol 2: Quiet cycle, health OK


Digest: mol-deacon-patrol

Patrol C25: All healthy


🤝 HANDOFF: gt-zr0a bd pin bug fix

## Issue
gt-zr0a: bd pin command fails with 'invalid field for update: pinned'

## Root Cause
The `pinned` field is missing from `allowedUpdateFields` map in:
`~/gt/beads/crew/zoey/internal/storage/sqlite/queries.go:545`

## Fix (one line)
Add `"pinned": true,` to the allowedUpdateFields map around line 561:
```go
var allowedUpdateFields = map[string]bool{
    // ... existing fields ...
    "ephemeral": true,
    "pinned":    true,  // <-- ADD THIS LINE
}
```

## Files to edit
- `~/gt/beads/crew/zoey/internal/storage/sqlite/queries.go` (line ~561)

## Test
```bash
cd ~/gt/beads/crew/zoey
go build -o bd ./cmd/bd
./bd create --title="test pin" --type=task
./bd pin <id>  # Should succeed
./bd show <id>  # Should show pinned: true
```

## After fix
- Rebuild bd and install to ~/.local/bin/bd
- Close gt-zr0a


Digest: mol-deacon-patrol

Patrol 9: quiet cycle


Digest: mol-deacon-patrol

Patrol 86: Routine


BUG: Refinery checks git ls-remote instead of gt mq list

The refinery patrol checks 'git ls-remote origin | grep polecat' to see if there's work, but the merge queue is tracked in beads via 'gt mq list'. This caused 41 MRs to pile up while refinery reported 'Queue clear'.

Root cause: Refinery implementation is checking the wrong data source.

Fix: Change refinery patrol to use 'gt mq list <rig>' as the source of truth for pending merge requests.


Digest: mol-deacon-patrol

Patrol 18: Healthy


Digest: mol-deacon-patrol

Patrol cycle 6: all clear


Digest: mol-deacon-patrol

Patrol cycle 17: Routine


Digest: mol-deacon-patrol

Patrol cycle 19: All healthy.


Digest: mol-deacon-patrol

Patrol 102: All healthy. 3 rigs, 6 core agents. No incidents.


Digest: mol-deacon-patrol

Patrol cycle 20: Routine, handoff due


Digest: mol-deacon-patrol

Patrol 6: all clear


Digest: mol-deacon-patrol

Patrol 62: All healthy (3 rigs, 3 witnesses, 3 refineries), no orphans, 4 convoys active


Digest: mol-deacon-patrol

Patrol 13: nominal


Digest: mol-deacon-patrol

Patrol 2: Quick check, all healthy


Digest: mol-deacon-patrol

Patrol cycle 14: all clear


Digest: mol-deacon-patrol

Patrol 11: nominal


POLECAT_STARTED Modular

Issue: bd-u2sc.3
Session: gt-beads-Modular


Digest: mol-deacon-patrol

Patrol 9: all nominal


Digest: mol-deacon-patrol

Patrol C45: All healthy


Digest: mol-deacon-patrol

Cycle 62: All healthy, no incidents


SPAWN: rictus starting on gt-7923

Polecat spawn notification.

Polecat: rictus
Issue: gt-7923
Session: gt-gastown-rictus
Spawned by: gastown/crew/max

The Deacon will trigger this polecat when Claude is ready (WaitForClaudeReady).
The polecat's SessionStart hook runs gt prime, and work assignment is in its inbox.
Monitor for stuck/idle state after a few minutes.


Digest: mol-deacon-patrol

Patrol cycle 20: all quiet, handoff threshold reached


Digest: mol-deacon-patrol

Cycle 8


Digest: mol-deacon-patrol

Patrol 10: Healthy


Digest: mol-deacon-patrol

Patrol: All healthy, no incidents


Digest: mol-deacon-patrol

Patrol C72: routine, all healthy


Digest: mol-deacon-patrol

Patrol cycle 5: routine


Digest: mol-deacon-patrol

Patrol 92: all healthy


Digest: mol-deacon-patrol

Patrol 20: routine, all healthy, handoff threshold


Digest: mol-deacon-patrol

Patrol 8: All clear


Digest: mol-deacon-patrol

Patrol 1: all healthy, no orphans, 2 convoys active (PR#970, docs)


Digest: mol-deacon-patrol

Patrol cycle 3: All healthy, no incidents


📋 Work Assignment: Extend auto-continue to polecats (not just crew)

Issue: gt-rp0k
Title: Extend auto-continue to polecats (not just crew)
Priority: P1
Type: task

Description:
gt prime currently only outputs AUTO-CONTINUE MODE for crew workers.
Polecats with attached work should also auto-continue.

## Current behavior
outputCrewAttachmentStatus() in prime.go:
- Only runs for RoleCrew
- Outputs '→ AUTO-CONTINUE MODE' when attached work detected

## Desired behavior
- Rename to outputAttachmentStatus() or similar
- Run for RoleCrew AND RolePolecat
- Same directive: if attachment exists, work immediately

## The Propulsion Principle
'If you find something on your hook, YOU RUN IT.'

This applies to ALL workers, not just crew.

## Implementation
1. Extend role check in outputCrewAttachmentStatus()
2. Adjust assignee detection for polecats vs crew
3. Test with both worker types

## Workflow
1. Run `gt prime` to load polecat context
2. Work on your task, commit changes regularly
3. Run `bd close <issue-id>` when done
4. Run `bd sync` to push beads changes
5. Push code: `git push origin HEAD`
6. Run `gt done` to signal completion

## Handoff Protocol
Before signaling done, ensure:
- Git status is clean (no uncommitted changes)
- Issue is closed with `bd close`
- Beads are synced with `bd sync`
- Code is pushed to origin

The `gt done` command verifies these and signals the Witness.


New Assignment: gt-mzal.1

gt-lz13 blocked on missing beads features. Reassigning you to gt-mzal.1 (Define mol-gastown-boot proto structure). This is a design task - create the protomolecule definition for town bootstrap. Run: bd show gt-mzal.1


Digest: mol-deacon-patrol

Patrol cycle 1: checked inbox (0 msgs), health OK (all witnesses/refineries running), no plugins, no orphans, doctor 32/38 pass


Digest: mol-deacon-patrol

Patrol cycle 10: All healthy, gastown witness now monitoring furiosa+nux


Digest: mol-deacon-patrol

Patrol 2: All quiet, agents healthy


Digest: mol-deacon-patrol

Patrol 5: Town idle


Digest: mol-deacon-patrol

Patrol 5: quiet cycle


Digest: mol-deacon-patrol

Patrol 2: Routine check, all healthy, no changes


Digest: mol-deacon-patrol

Patrol cycle 4: Nominal


Digest: mol-deacon-patrol

Patrol 3: Nominal


Digest: mol-deacon-patrol

Patrol 3: All agents healthy, no incidents


Digest: mol-deacon-patrol

Patrol 27: town idle, all healthy


POLECAT_STARTED beads/Splitter

Issue: bd-rgyd
Session: gt-beads-Splitter


POLECAT_DONE dementus

Exit: COMPLETED
Issue: bd-au0.6
MR: mr-1766562341-a5653922
Branch: polecat/dementus


Digest: mol-deacon-patrol

Patrol cycle 5: clean


Digest: mol-deacon-patrol

Patrol 29: healthy


Digest: mol-deacon-patrol

Patrol 87: all healthy


Digest: mol-deacon-patrol

Cycle 8: healthy


Digest: mol-deacon-patrol

Patrol 12: Quick cycle.


🤝 HANDOFF: Two-level beads routing fix

## Summary
Reviewed max's mail overhaul. Found critical routing bug. Designed fix with Steve.

## Key Decision: Two-Level Model Only
- **Town** (`~/gt/.beads/`, prefix `hq-*`): All mail/coordination
- **Project** (`<rig>/crew/*/.beads/`): Project issues

Kill the rig-level (`~/gt/gastown/.beads/` gitignored) - unnecessary complexity.

## Critical Bug: gt-4qey
Mail routing is broken. `gt mail send` uses sender's CWD beads, not recipient's.
- Mayor sends to gastown/Toast → lands in HQ beads
- Toast checks their project beads → never sees it

**Fix**: `gt mail *` should ALWAYS use town root (`~/gt/.beads/`).

## New Feature Needed: gt file <rig>
For cross-rig issue filing:
```bash
gt file beads "Bug in parser" --type=bug --priority=1
```
gt knows all rigs → routes to correct project beads.

## Filed Issues
- **gt-4qey**: Cross-level mail routing broken (P1)
- **gt-bnik**: gt nudge should accept fuzzy session names (P3)

## Max's Work
Max committed mail refactoring (uses bd create/list instead of bd mail).
Pinned sorting done. But routing needs the fix above.

## Next Steps
1. Fix findMailWorkDir() to always use town root
2. Delete rig-level .beads/ directories
3. Add gt file <rig> command
4. Update docs to two-level model

-- Mayor


Digest: mol-deacon-patrol

Patrol cycle 5: quiet


Digest: mol-deacon-patrol

Patrol 2: all clear


Digest: mol-deacon-patrol

Patrol #3: routine, all healthy


Digest: mol-deacon-patrol

Patrol 14: Quiet


Digest: mol-deacon-patrol

Patrol cycle 12: All quiet


🤝 HANDOFF: gt-h6eq swarm complete, cleanup needed

## Session Summary

Successfully ran a 9-polecat swarm that delivered the entire gt-h6eq epic (hooks infrastructure).

### Merged to Main (10 commits)

- gt-h6eq.1: hook-singleton doctor check
- gt-h6eq.2: hook-attachment-valid check
- gt-h6eq.3: orphaned-attachments check
- gt-h6eq.4: stale-attachments check
- gt-h6eq.6: hook status in gt status
- gt-h6eq.7: gt mol attach-from-mail
- gt-h6eq.8: audit trail for detach
- gt-h6eq.9: role templates with hook-first protocol
- gt hooks command (list Claude Code hooks)
- gt broadcast command (nudge all workers)

### Cleanup Needed

1. **Idle polecat sessions** - 9 tmux sessions still running but idle:
   capable, dag, furiosa, keeper, morsov, nux, toast, valkyrie
   Run: gt shutdown gastown --polecats

2. **Close beads** - Some issues may not have been closed via bd:
   - Check bd list --open for gt-h6eq.* issues
   - Close any that are complete

3. **Unread mail** - 4 messages in inbox:
   - hq-32mg, hq-seyq: Test messages (can close)
   - hq-9fog: Code review task for bd-xo1o work (assign to polecat)
   - hq-jvwe: Handoff about lifecycle fixes (informational)

### System State

- Refinery: Processed all branches, queue empty
- Witness: Running
- Main branch: Clean, all work merged
- No polecat branches remaining

### Next Work Available

Run `bd ready` to see available issues. The code review task (hq-9fog) is high priority.


Digest: mol-deacon-patrol

Patrol 3: Town idle, all healthy


LIFECYCLE: gastown-crew-max requesting cycle

Lifecycle request from gastown-crew-max.

Action: cycle
Time: 2025-12-22T23:53:00-08:00

Please verify state and execute lifecycle action.


Digest: mol-deacon-patrol

Patrol complete: health OK, 1 dead session (giles), no orphans, context low


Digest: mol-deacon-patrol

Patrol #19: Town idle.


Digest: mol-deacon-patrol

Patrol cycle 25: Routine, all healthy.


Digest: mol-deacon-patrol

Patrol #12: 3 polecats active. Refinery processing (4 queued). All healthy.


Digest: mol-deacon-patrol

Patrol 15: quiet cycle, handoff initiated


Digest: mol-deacon-patrol

Patrol #1: 0 callbacks, all witnesses/refineries healthy, 0 orphans, clone divergence noted


Digest: mol-deacon-patrol

Patrol cycle 20: all clear


Digest: mol-deacon-patrol

Patrol 10: nominal


Digest: mol-deacon-patrol

Patrol 1: All agents healthy, no callbacks, 3 convoys open, no orphans


Digest: mol-deacon-patrol

Patrol cycle 18: quiet


Digest: mol-deacon-patrol

Patrol cycle 20: All healthy. 20-cycle threshold reached, handing off.


POLECAT_DONE nux

Exit: COMPLETED
Issue: gt-h6eq.3
MR: gt-f1ma
Branch: polecat/nux


Digest: mol-deacon-patrol

Patrol 16: town idle, all healthy


Polecat Work

Full polecat lifecycle from assignment to decommission.

This molecule enables nondeterministic idempotence for polecat work.
A polecat that crashes after any step can restart, read its molecule state,
and continue from the last completed step. No work is lost.

## Step: load-context
Run gt prime and bd prime. Verify issue assignment.
Check inbox for any relevant messages.

Read the assigned issue and understand the requirements.
Identify any blockers or missing information.

## Step: implement
Implement the solution. Follow codebase conventions.
File discovered work as new issues with bd create.

Make regular commits with clear messages.
Keep changes focused on the assigned issue.
Needs: load-context

## Step: self-review
Review your own changes. Look for:
- Bugs and edge cases
- Style issues
- Missing error handling
- Security concerns

Fix any issues found before proceeding.
Needs: implement

## Step: verify-tests
Run existing tests. Add new tests for new functionality.
Ensure adequate coverage.

```bash
go test ./...
```

Fix any test failures before proceeding.
Needs: implement

## Step: rebase-main
Rebase against main to incorporate any changes.
Resolve conflicts if needed.

```bash
git fetch origin main
git rebase origin/main
```

If there are conflicts, resolve them carefully and
continue the rebase.
Needs: self-review, verify-tests

## Step: submit-merge
Submit to merge queue. Create PR if needed.
Verify CI passes.

```bash
gt done  # Signal work ready for merge queue
```

If there are CI failures, fix them before proceeding.
Needs: rebase-main

## Step: update-handoff
Update handoff bead with final state.
File any remaining work as issues.

Document any important context for the next session
or for anyone reviewing the work.
Needs: submit-merge

## Step: request-shutdown
Send shutdown request to Witness.
Wait for termination.

The polecat is now ready to be cleaned up.
Do not exit directly - wait for Witness to kill the session.
Needs: update-handoff


Digest: mol-deacon-patrol

Patrol cycle 18: all quiet


Digest: mol-deacon-patrol

Patrol complete: all agents healthy, no orphans found


🤝 HANDOFF: Vision docs complete, furiosa working

## This Session

### Completed
- Created consolidated vision.md with 7 core innovations
- Added 'Gas Town is a Village' philosophy to architecture.md, README.md, role templates
- Fixed 'git clones' → 'git worktrees' terminology (16 files)
- Filed 7 beads for design gaps (gt-r6td, gt-mx6s, gt-ogpk, gt-cp2s, gt-dx5c, gt-8pcb, gt-s6dw)
- All changes pushed to main

### In Progress
- **Furiosa is working on gt-oiv0** (remove bd sync instruction from polecat startup)
- She was stuck at empty prompt, we nudged her, she's now active
- This is the tracer bullet for the polecat workflow

### Key Design Insights from Session
1. gt spawn should notify both Deacon AND Witness (gt-r6td)
2. Witness needs patrol wisp with polecat leases (gt-mx6s)
3. mol-polecat-lease proto needed for semaphore tracking (gt-cp2s)
4. Streams, not swarms - continuous flow model (gt-dx5c)

### Next Steps
1. Monitor furiosa completing gt-oiv0
2. Watch the Witness/Refinery process her completion
3. If workflow breaks, debug and fix
4. Then spawn more polecats on ready work

### Ready Work (bd ready shows 10 items)
See gt-oiv0 for the tracer bullet in progress.

### Context
- Daemon PID: 25400 (running)
- Furiosa session: gt-gastown-furiosa
- Christmas launch: 3 days


Digest: mol-deacon-patrol

Patrol cycle 1: All agents healthy, no incidents


Digest: mol-deacon-patrol

Patrol 10: town idle, all healthy


POLECAT_STARTED beads/Doctor

Issue: bd-ykd9
Session: gt-beads-Doctor


Digest: mol-deacon-patrol

Patrol cycle 5: All agents healthy


Digest: mol-deacon-patrol

Patrol cycle 2: All 3 witnesses and 3 refineries healthy. 1 convoy (hq-cv-5ck6y) tracking gt-emh1c. No orphan processes. No gates. No abandoned work.


Digest: mol-deacon-patrol

Patrol 3: Routine, all healthy


Digest: mol-deacon-patrol

Patrol 7: Healthy


Digest: mol-deacon-patrol

Patrol 12: All healthy


Digest: mol-deacon-patrol

Patrol cycle 36: Routine


Digest: mol-deacon-patrol

Cycle 18


Digest: mol-deacon-patrol

Patrol 2: All healthy, no callbacks


Digest: mol-deacon-patrol

Patrol 7: all healthy


Digest: mol-deacon-patrol

Patrol 6 complete: all healthy


Digest: mol-deacon-patrol

Patrol cycle 1: 0 messages, all agents healthy, no orphans, no convoys completed


Digest: mol-deacon-patrol

Patrol 3: quiet


Digest: mol-deacon-patrol

Patrol cycle 5: 17 running, all healthy


POLECAT_STARTED alpha

Issue: bd-6sm6
Session: gt-beads-alpha


Digest: mol-deacon-patrol

Patrol cycle 6: all agents healthy, cleaned 1 orphan


Digest: mol-deacon-patrol

Patrol 3: All agents healthy, no inbox, no orphans


Digest: mol-deacon-patrol

Patrol 19: Healthy


Digest: mol-deacon-patrol

P15 (3/4)


Digest: mol-deacon-patrol

Patrol 93: Routine


Digest: mol-deacon-patrol

Patrol cycle 12: quick check, healthy


Digest: mol-deacon-patrol

Patrol cycle 5: healthy, gastown queue drained to 0


Digest: mol-deacon-patrol

Patrol 7: Full status check - all agents healthy.


Digest: mol-deacon-patrol

Patrol 16 complete: all healthy


Digest: mol-deacon-patrol

Patrol C56: all healthy


🤝 HANDOFF: ZFC Cleanup progress on gt-gaxo

Completed 4 of 6 issues in gt-gaxo epic (ZFC Cleanup):

## Done This Session

1. **gt-gaxo.1**: Removed daemon heartbeat staleness logic
   - Deleted backoff.go entirely
   - Simplified pokeDeacon() to just send heartbeats
   - Removed pokeMayor, pokeWitnesses functions

2. **gt-gaxo.2**: Removed keepalive staleness thresholds
   - Deleted IsFresh(), IsStale(), IsVeryStale() methods
   - Keep only Age() for pure data

3. **gt-gaxo.3**: Removed doctor staleness detection
   - Deleted stale_check.go entirely
   - Removed from doctor registration

4. **gt-gaxo.6**: Removed lifecycle intent parsing
   - Changed from keyword matching on subject to structured body
   - Now expects JSON {"action": "cycle"} or simple "cycle" in body

## Commit

b681789 - refactor: ZFC cleanup - move Go heuristics to Deacon molecule
Total: -1,079 net lines removed

## Remaining Work (P2)

- gt-gaxo.4: Remove polecat state derivation from issue status
- gt-gaxo.5: Design Deacon molecule health-check step

## Context

The ZFC principle: Go should be message transport, not decision-maker.
All health checking, staleness detection, nudging belongs in Deacon molecule.
Claude executes molecule steps; Go just routes messages.


SPAWN: slit starting on gt-5xph

Polecat spawn notification.

Polecat: slit
Issue: gt-5xph
Session: gt-gastown-slit
Spawned by: gastown/crew/max

The Deacon will trigger this polecat when Claude is ready (WaitForClaudeReady).
The polecat's SessionStart hook runs gt prime, and work assignment is in its inbox.
Monitor for stuck/idle state after a few minutes.


Digest: mol-deacon-patrol

Patrol #6: routine


Digest: mol-deacon-patrol

## Molecule Execution Summary

**Molecule**: mol-deacon-patrol
**Steps**: 9

**Completed**: 9/9

---

### Steps

1. **[closed]** Evaluate pending async gates
   Evaluate pending async gates.

Gates are async coordination primitives that block until conditions are met.
The Deacon is responsible for monitoring gates and closing them when ready.

**Timer gates**...

2. **[closed]** Execute registered plugins
   Execute registered plugins.

Scan ~/gt/plugins/ for plugin directories. Each plugin has a plugin.md with YAML frontmatter defining its gate (when to run) and instructions (what to do).

See docs/deaco...

3. **[closed]** Clean dead sessions
   Clean dead sessions and orphaned state.

Run `gt doctor -v` to check for issues, then `gt doctor --fix` to clean up.

**⚠ CRITICAL: The Deacon NEVER kills crew workers or polecats!**

The orphan-...

4. **[closed]** Burn and respawn or loop
   Burn and let daemon respawn, or exit if context high.

Decision point at end of patrol cycle:

If context is LOW:
- Sleep briefly (avoid tight loop)
- Return to inbox-check step

If context is HIGH:
-...

5. **[closed]** Check Witness and Refinery health
   Check Witness and Refinery health for each rig.

**ZFC Principle**: You (Claude) make the judgment call about what is "stuck" or "unresponsive" - there are no hardcoded thresholds in Go. Read the sign...

6. **[closed]** Nudge newly spawned polecats
   Nudge newly spawned polecats that are ready for input.

When polecats are spawned, their Claude session takes 10-20 seconds to initialize. The spawn command returns immediately without waiting. This s...

7. **[closed]** Find abandoned work
   Find abandoned work.

Scan for orphaned state:
- Issues marked in_progress with no active polecat
- Polecats that stopped responding mid-work
- Merge queue entries with no polecat owner
- Wisp session...

8. **[closed]** Check own context limit
   Check own context limit.

The Deacon runs in a Claude session with finite context. Check if approaching the limit:

```bash
gt context --usage
```

If context is high (>80%), prepare for handoff:
- Su...

9. **[closed]** Handle callbacks from agents
   Handle callbacks from agents.

Check the Mayor's inbox for messages from:
- Witnesses reporting polecat status
- Refineries reporting merge results
- Polecats requesting help or escalation
- External ...


Digest: mol-deacon-patrol

Patrol cycle 9


Digest: mol-deacon-patrol

Patrol 83: quiet


Digest: mol-deacon-patrol

Patrol 19: all clear


Digest: mol-deacon-patrol

Patrol cycle 14: Healthy.


Digest: mol-deacon-patrol

Patrol 10: Quick cycle.


Digest: mol-deacon-patrol

Patrol #19: All clear


Digest: mol-deacon-patrol

Patrol cycle 3: all healthy, no orphans, gastown 14 pending, beads 8 pending


Digest: mol-deacon-patrol


Digest: mol-deacon-patrol

Patrol 20: all healthy, handoff threshold