diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index d4669319f..9c387fa08 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -135,6 +135,7 @@ {"id":"bd-1hc40","title":"Blocking issue","status":"open","priority":1,"issue_type":"task","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T18:16:13.008593-08:00","created_by":"beads/crew/wolf","updated_at":"2026-01-11T18:16:13.008593-08:00"} {"id":"bd-1hu59","title":"Test failures: schema mismatch after owner field addition","description":"Pre-existing test failures detected during refinery patrol:\n\n1. cmd/bd: TestResolveProtoIDOrTitle - sql: expected 31 destination arguments in Scan, not 32\n2. internal/storage/sqlite: TestGetIssuesByLabel - same scan mismatch\n3. internal/storage/sqlite: TestMigrateContentHashColumn - no such column: owner\n\nRoot cause: The 'owner' field was added (ceb5769c) but tests/fixtures are not updated to match the new schema.\n\nFiles affected:\n- cmd/bd template tests\n- internal/storage/sqlite/labels_test.go\n- internal/storage/sqlite/migrations_test.go","status":"closed","priority":1,"issue_type":"bug","assignee":"beads/crew/emma","created_at":"2026-01-10T22:00:41.275253-08:00","created_by":"beads/refinery","updated_at":"2026-01-12T01:37:53.290357-08:00","closed_at":"2026-01-12T01:37:53.290357-08:00","close_reason":"Already fixed in 0de6b10a (add missing crystallizes column to SELECT queries)"} {"id":"bd-1juu","title":"Merge: obsidian-mjxeci6l","description":"branch: polecat/obsidian-mjxeci6l\ntarget: main\nsource_issue: obsidian-mjxeci6l\nrig: beads\nagent_bead: bd-beads-polecat-obsidian","status":"closed","priority":2,"issue_type":"merge-request","created_at":"2026-01-02T13:44:06.098083-08:00","created_by":"beads/polecats/obsidian","updated_at":"2026-01-02T17:14:50.490086-08:00","closed_at":"2026-01-02T17:14:50.490086-08:00","close_reason":"Orphaned MR - obsidian stopped (merged no-op), branch never pushed"} +{"id":"bd-1jw9u","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T22:04:22.397768-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-14T22:04:22.449848-08:00","closed_at":"2026-01-14T22:04:22.449848-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-1jylp","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T00:42:19.49972-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T00:42:19.562255-08:00","closed_at":"2026-01-11T00:42:19.562255-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-1l5vn","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T07:56:14.028903-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T07:56:14.071442-08:00","closed_at":"2026-01-11T07:56:14.071442-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-1l7cm","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-12T02:25:54.564703-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-12T02:25:54.620403-08:00","closed_at":"2026-01-12T02:25:54.620403-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} @@ -208,6 +209,7 @@ {"id":"bd-2e80","title":"Document shared memory test isolation pattern in test_helpers.go","description":"Tests were failing because :memory: creates a shared database across all tests. The fix is to use \"file::memory:?mode=memory\u0026cache=private\" for test isolation.\n\nShould document this pattern in test_helpers.go and potentially update newTestStore to use private memory by default.","status":"closed","priority":3,"issue_type":"chore","created_at":"2025-11-01T22:40:58.993496-07:00","updated_at":"2025-11-02T16:40:27.354652-08:00","closed_at":"2025-11-02T16:40:27.354654-08:00"} {"id":"bd-2e94","title":"Support --parent flag in daemon mode","description":"Added support for hierarchical child issue creation using --parent flag in daemon mode. Previously only worked in direct mode.","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-11-05T13:55:47.415771-08:00","updated_at":"2025-11-05T13:55:53.252342-08:00","closed_at":"2025-11-05T13:55:53.252342-08:00"} {"id":"bd-2em","title":"Expand checkHooksQuick to verify all hook versions","description":"Currently checkHooksQuick only checks post-merge hook version. Should also check pre-commit, pre-push, and post-checkout for completeness. Keep it lightweight but catch more outdated hooks.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-25T19:27:47.432243-08:00","updated_at":"2025-11-25T19:50:21.378464-08:00","closed_at":"2025-11-25T19:50:21.378464-08:00"} +{"id":"bd-2eoh2","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T21:57:52.768147-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-14T21:57:52.817152-08:00","closed_at":"2026-01-14T21:57:52.817152-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-2eoqm","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T19:24:33.405681-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T19:24:33.473536-08:00","closed_at":"2026-01-11T19:24:33.473536-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-2ep8","title":"Update CHANGELOG.md with release notes","description":"Add meaningful release notes to CHANGELOG.md describing what changed in 0.30.7","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-19T22:56:48.649053-08:00","updated_at":"2025-12-19T22:57:31.69559-08:00","closed_at":"2025-12-19T22:57:31.69559-08:00","dependencies":[{"issue_id":"bd-2ep8","depends_on_id":"bd-8pyn","type":"parent-child","created_at":"2025-12-19T22:56:48.650816-08:00","created_by":"stevey"},{"issue_id":"bd-2ep8","depends_on_id":"bd-rupw","type":"blocks","created_at":"2025-12-19T22:56:48.651136-08:00","created_by":"stevey"}]} {"id":"bd-2f0f","title":"Merge: obsidian-mjvtl03h","description":"branch: polecat/obsidian-mjvtl03h\ntarget: main\nsource_issue: obsidian-mjvtl03h\nrig: beads\nagent_bead: gt-beads-polecat-obsidian","status":"closed","priority":2,"issue_type":"merge-request","created_at":"2026-01-01T11:12:56.221323-08:00","created_by":"beads/polecats/obsidian","updated_at":"2026-01-01T15:48:48.262491-08:00","closed_at":"2026-01-01T15:48:48.262491-08:00","close_reason":"Branch already merged and deleted by previous refinery session"} @@ -287,7 +289,7 @@ {"id":"bd-3852","title":"Add orphan detection migration","description":"Create migration to detect orphaned children in existing databases. Query: SELECT id FROM issues WHERE id LIKE '%.%' AND substr(id, 1, instr(id || '.', '.') - 1) NOT IN (SELECT id FROM issues). Log results, let user decide action (delete orphans or convert to top-level).","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-04T12:32:30.727044-08:00","updated_at":"2025-12-21T21:00:05.041582-08:00","closed_at":"2025-12-21T21:00:05.041582-08:00"} {"id":"bd-396j","title":"GetBlockedIssues shows external deps as blocking even when satisfied","description":"GetBlockedIssues (ready.go:385-493) shows external:* refs in the blocked_by list but doesn't check if they're actually satisfied using CheckExternalDep.\n\nThis can be confusing - an issue shows as blocked by external:project:capability even if that capability has been shipped (closed issue with provides: label exists).\n\nOptions:\n1. Call CheckExternalDep for each external ref and filter satisfied ones from blocked_by\n2. Add a note in output indicating external deps need lazy resolution\n3. Document this is expected behavior (bd blocked shows all deps, bd ready shows resolved state)\n\nRelated: GetReadyWork correctly filters by external deps, but GetBlockedIssues doesn't.","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-12-21T23:45:05.286304-08:00","updated_at":"2025-12-22T21:48:38.086451-08:00","closed_at":"2025-12-22T21:48:38.086451-08:00","dependencies":[{"issue_id":"bd-396j","depends_on_id":"bd-zmmy","type":"discovered-from","created_at":"2025-12-21T23:45:05.286971-08:00","created_by":"daemon"}]} {"id":"bd-39o","title":"Rename last_import_hash metadata key to jsonl_content_hash","description":"The metadata key 'last_import_hash' is misleading because it's updated on both import AND export (sync.go:614, import.go:320).\n\nBetter names:\n- jsonl_content_hash (more accurate)\n- last_sync_hash (clearer intent)\n\nThis is a breaking change requiring migration of existing metadata values.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-20T21:31:07.568739-05:00","updated_at":"2025-12-09T18:38:37.675303471-05:00","closed_at":"2025-11-28T23:13:46.885978-08:00","dependencies":[{"issue_id":"bd-39o","depends_on_id":"bd-khnb","type":"blocks","created_at":"2025-11-20T21:31:07.5698-05:00","created_by":"daemon"}]} -{"id":"bd-39syr","title":"Digest: mol-refinery-patrol","description":"Patrol: empty queue, no branches to merge","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-13T19:55:29.685186-08:00","updated_at":"2026-01-13T19:55:29.685186-08:00","closed_at":"2026-01-13T19:55:29.685137-08:00","close_reason":"Squashed from 11 wisps","dependencies":[{"issue_id":"bd-39syr","depends_on_id":"bd-wisp-bwf","type":"parent-child","created_at":"2026-01-13T19:55:29.686239-08:00","created_by":"beads/refinery"}]} +{"id":"bd-39syr","title":"Digest: mol-refinery-patrol","description":"Patrol: empty queue, no branches to merge","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-13T19:55:29.685186-08:00","updated_at":"2026-01-13T19:55:29.685186-08:00","closed_at":"2026-01-13T19:55:29.685137-08:00","close_reason":"Squashed from 11 wisps"} {"id":"bd-3b2fe268","title":"Add fsnotify dependency to go.mod","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-28T16:20:02.429763-07:00","updated_at":"2025-12-14T12:12:46.499978-08:00","closed_at":"2025-11-06T19:27:34.921866-08:00"} {"id":"bd-3b7f","title":"Add tests for extracted modules","description":"Create tests for migrations.go, hash_ids.go, batch_ops.go, and validators.go","status":"closed","priority":1,"issue_type":"task","created_at":"2025-11-01T19:28:54.88933-07:00","updated_at":"2025-11-01T23:32:00.722607-07:00","closed_at":"2025-11-01T23:32:00.722613-07:00"} {"id":"bd-3bg","title":"Add performance optimization to hasJSONLChanged with mtime fast-path","description":"hasJSONLChanged() reads entire JSONL file to compute SHA256 hash on every check. For large databases (50MB+), this is expensive and called frequently by daemon.\n\nOptimization: Check mtime first as fast-path. Only compute hash if mtime changed. This catches git operations (mtime changes but content doesn't) while avoiding expensive hash computation in common case (mtime unchanged = content unchanged).\n\nPerformance impact: 99% of checks will use fast path, only git operations need slow path.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-11-20T21:31:04.577264-05:00","updated_at":"2025-11-20T21:33:31.499918-05:00","closed_at":"2025-11-20T21:33:31.499918-05:00","dependencies":[{"issue_id":"bd-3bg","depends_on_id":"bd-khnb","type":"blocks","created_at":"2025-11-20T21:31:04.578768-05:00","created_by":"daemon"}]} @@ -337,6 +339,7 @@ {"id":"bd-40a0","title":"bd doctor should check for multiple DBs, multiple JSONLs, daemon health","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-10-31T21:16:47.042913-07:00","updated_at":"2025-10-31T21:21:27.093525-07:00","closed_at":"2025-10-31T21:21:27.093525-07:00"} {"id":"bd-40c2","title":"bd init --from-jsonl: Skip git history scan","description":"## Problem\n\n`bd init` scans git history to find all issues ever created, which:\n- Resurrects deleted/compacted issues\n- Takes a long time on large repos\n- Defeats manual JSONL cleanup\n\n## Solution\n\nAdd `bd init --from-jsonl` flag that:\n1. Creates fresh database\n2. Imports ONLY from current .beads/issues.jsonl\n3. Skips git history scan entirely\n\n## Use Case\n\nAfter manually cleaning JSONL or receiving a clean JSONL from another source:\n```bash\n# Clean JSONL manually or via script\nbd init --from-jsonl # Use current JSONL as-is\n```\n\n(Moved from hq-c21fj)","status":"closed","priority":3,"issue_type":"feature","created_at":"2026-01-02T01:37:20.481211-08:00","created_by":"gastown/crew/joe","updated_at":"2026-01-02T12:41:30.784964-08:00","closed_at":"2026-01-02T12:41:30.784964-08:00","close_reason":"Duplicate of bd-c0b6"} {"id":"bd-40ceb","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-09T18:37:41.200328-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-09T18:37:41.240457-08:00","closed_at":"2026-01-09T18:37:41.240457-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} +{"id":"bd-40g5h","title":"Digest: mol-refinery-patrol","description":"Patrol: MQ empty, no branches to merge, inbox clear","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-15T07:55:34.227285-08:00","updated_at":"2026-01-15T07:55:34.227285-08:00","closed_at":"2026-01-15T07:55:34.227238-08:00","close_reason":"Squashed from 11 wisps","dependencies":[{"issue_id":"bd-40g5h","depends_on_id":"bd-wisp-daal","type":"parent-child","created_at":"2026-01-15T07:55:34.228359-08:00","created_by":"beads/refinery"}]} {"id":"bd-40pnp","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T19:58:21.282415-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T19:58:21.331823-08:00","closed_at":"2026-01-11T19:58:21.331823-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-411u","title":"Document BEADS_DIR pattern for multi-agent workspaces (Gas Town)","description":"Gas Town and similar multi-agent systems need to configure separate beads databases per workspace/rig, distinct from any project-level beads.\n\n## Use Case\n\nIn Gas Town:\n- Each 'rig' (managed project) has multiple agents (polecats, refinery, witness)\n- All agents in a rig should share a single beads database at the rig level\n- This should be separate from any .beads/ the project itself uses\n- The BEADS_DIR env var enables this\n\n## Documentation Needed\n\n1. Add a section to docs explaining BEADS_DIR for multi-agent setups\n2. Example: setting BEADS_DIR in agent startup scripts/hooks\n3. Clarify interaction with project-level .beads/ (BEADS_DIR takes precedence)\n\n## Current Support\n\nAlready implemented in internal/beads/beads.go:FindDatabasePath():\n- BEADS_DIR env var is checked first (preferred)\n- BEADS_DB env var still supported (deprecated)\n- Falls back to .beads/ search in tree\n\nJust needs documentation for the multi-agent workspace pattern.","status":"hooked","priority":3,"issue_type":"task","created_at":"2025-12-15T22:08:22.158027-08:00","updated_at":"2025-12-30T15:44:43.351778-08:00"} {"id":"bd-43xj","title":"Add thread-safety warning to git.ResetCaches() doc comment","description":"Code review finding from bd-7di fix.\n\nResetCaches() reassigns sync.Once values which is not thread-safe. While this is only used in tests (which are single-threaded), the function is exported and could be misused.\n\nAdd a warning comment:\n```go\n// ResetCaches resets all cached git information.\n// WARNING: Not thread-safe. Only call from single-threaded test contexts.\n```\n\nFile: internal/git/gitdir.go","status":"closed","priority":4,"issue_type":"task","created_at":"2025-12-25T22:08:51.125399-08:00","updated_at":"2025-12-25T22:43:54.508097-08:00","closed_at":"2025-12-25T22:43:54.508097-08:00"} @@ -428,6 +431,7 @@ {"id":"bd-51521","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-08T20:24:53.957149-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-08T20:24:53.991009-08:00","closed_at":"2026-01-08T20:24:53.991009-08:00","close_reason":"auto-closed session event"} {"id":"bd-51jl","title":"Feature P1","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-11-07T19:04:24.852171-08:00","updated_at":"2025-11-07T22:07:17.343481-08:00","closed_at":"2025-11-07T21:55:09.426728-08:00"} {"id":"bd-522oh","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-12T01:39:13.261534-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-12T01:39:13.32432-08:00","closed_at":"2026-01-12T01:39:13.32432-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} +{"id":"bd-52bnz","title":"Digest: mol-witness-patrol","description":"Patrol 5: all clear","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T21:50:07.380327-08:00","updated_at":"2026-01-14T21:50:07.380327-08:00","closed_at":"2026-01-14T21:50:07.380271-08:00","close_reason":"Squashed from 10 wisps","dependencies":[{"issue_id":"bd-52bnz","depends_on_id":"bd-wisp-6uxa","type":"parent-child","created_at":"2026-01-14T21:50:07.381575-08:00","created_by":"beads/witness"}]} {"id":"bd-5314bddf","title":"bd detect-pollution - Test pollution detector","description":"Detect test issues that leaked into production DB.\n\nPattern matching for:\n- Titles starting with 'test', 'benchmark', 'sample'\n- Sequential numbering (test-1, test-2)\n- Generic descriptions\n- Created in rapid succession\n\nOptional AI scoring for confidence.\n\nFiles: cmd/bd/detect_pollution.go (new)","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-28T14:48:17.466906-07:00","updated_at":"2025-12-14T12:12:46.500906-08:00","closed_at":"2025-11-06T19:27:11.75884-08:00"} {"id":"bd-533i","title":"Merge: quartz-mjxcafcl","description":"branch: polecat/quartz-mjxcafcl\ntarget: main\nsource_issue: quartz-mjxcafcl\nrig: beads\nagent_bead: bd-beads-polecat-quartz","status":"closed","priority":2,"issue_type":"merge-request","created_at":"2026-01-02T12:50:03.596749-08:00","created_by":"beads/polecats/quartz","updated_at":"2026-01-02T13:41:56.625175-08:00","closed_at":"2026-01-02T13:41:56.625175-08:00","close_reason":"Branches merged, cleaning up stale MR beads"} {"id":"bd-537e","title":"Add external_ref change tracking and auditing","description":"Currently we don't track when external_ref is added, removed, or changed. This would be useful for debugging and auditing.\n\nProposed features:\n- Log event when external_ref changes\n- Track in events table with old/new values\n- Add query to find issues where external_ref changed\n- Add metrics: issues with external_ref vs without\n\nUse cases:\n- Debugging import issues\n- Understanding which issues are externally managed\n- Auditing external system linkage\n\nRelated: bd-1022","status":"closed","priority":4,"issue_type":"feature","created_at":"2025-11-02T15:32:31.276883-08:00","updated_at":"2025-12-14T12:12:46.518748-08:00","closed_at":"2025-11-08T02:20:01.022406-08:00"} @@ -529,6 +533,7 @@ {"id":"bd-6a5z","title":"Add stale molecule check to bd doctor","description":"Extend bd doctor to detect stale molecules.\n\n**New check:**\n- Name: 'Stale Molecules'\n- Category: Workflow\n- Severity: Warning (don't fail overall check)\n\n**Detection:**\nReuse logic from bd mol stale command:\n- Find mols where Completed \u003e= Total but root is open\n- Filter to orphaned (not assigned, not pinned)\n- Extra weight if blocking other work\n\n**Output:**\n```\n⚠ Stale Molecules\n Found 2 complete-but-unclosed molecules:\n - bd-xyz: Version bump v0.36.0 (blocking 1 issue)\n - bd-uvw: Old patrol (not blocking)\n Fix: bd close \u003cid\u003e or bd mol squash \u003cid\u003e\n```\n\n**--fix behavior:**\n- Auto-close stale mols (with reason 'Auto-closed by bd doctor')\n- Or prompt interactively with -i flag\n\nDepends on: bd mol stale command","status":"closed","priority":3,"issue_type":"task","created_at":"2025-12-24T18:23:24.549941-08:00","updated_at":"2025-12-25T12:42:50.288442-08:00","closed_at":"2025-12-25T12:42:50.288442-08:00","dependencies":[{"issue_id":"bd-6a5z","depends_on_id":"bd-anv2","type":"blocks","created_at":"2025-12-24T18:23:48.682552-08:00","created_by":"daemon"}]} {"id":"bd-6ada971e","title":"Create cmd/bd/daemon_event_loop.go (~200 LOC)","description":"Implement runEventDrivenLoop to replace polling ticker. Coordinate FileWatcher, mutation events, debouncer. Include health check ticker (60s) for daemon validation.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-28T16:20:02.429383-07:00","updated_at":"2025-10-30T17:12:58.220612-07:00","closed_at":"2025-10-28T12:30:44.067036-07:00"} {"id":"bd-6b4jr","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-13T12:09:02.30696-08:00","created_by":"beads/refinery","updated_at":"2026-01-13T12:09:02.37693-08:00","closed_at":"2026-01-13T12:09:02.37693-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} +{"id":"bd-6bdy5","title":"Digest: mol-witness-patrol","description":"Patrol 1: all clear - no polecats, refinery running, deacon stopped, inbox empty","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T21:47:07.986196-08:00","updated_at":"2026-01-14T21:47:07.986196-08:00","closed_at":"2026-01-14T21:47:07.986131-08:00","close_reason":"Squashed from 10 wisps","dependencies":[{"issue_id":"bd-6bdy5","depends_on_id":"bd-wisp-od5d","type":"parent-child","created_at":"2026-01-14T21:47:07.987341-08:00","created_by":"beads/witness"}]} {"id":"bd-6bebe013","title":"Rapid 1","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-29T19:11:57.404437-07:00","updated_at":"2025-12-14T12:12:46.521877-08:00","closed_at":"2025-11-07T23:18:52.368766-08:00"} {"id":"bd-6c68","title":"bd info shows 'auto_start_disabled' even when daemon is crashed/missing","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-31T21:08:03.385681-07:00","updated_at":"2025-11-01T19:13:43.819004-07:00","closed_at":"2025-11-01T19:13:43.819004-07:00","dependencies":[{"issue_id":"bd-6c68","depends_on_id":"bd-2752a7a2","type":"discovered-from","created_at":"2025-10-31T21:08:03.387045-07:00","created_by":"stevey"}]} {"id":"bd-6cxz","title":"Fix MCP tools failing to load in Claude Code (GH#346)","description":"Fix FastMCP schema generation bug by refactoring `Issue` model to avoid recursion.\n \n - Refactored `Issue` in `models.py` to use `LinkedIssue` for dependencies/dependents.\n - Restored missing `Mail*` models to `models.py`.\n - Fixed `tests/test_mail.py` mock assertion.\n \n Fixes GH#346.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-11-20T18:53:40.229801-05:00","updated_at":"2025-11-20T18:53:44.280296-05:00","closed_at":"2025-11-20T18:53:44.280296-05:00"} @@ -554,6 +559,7 @@ {"id":"bd-6p86l","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-13T12:51:33.217144-08:00","created_by":"beads/refinery","updated_at":"2026-01-13T12:51:33.288137-08:00","closed_at":"2026-01-13T12:51:33.288137-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-6pc","title":"Implement bd pin/unpin commands","description":"Add 'bd pin \u003cid\u003e' and 'bd unpin \u003cid\u003e' commands to toggle the pinned status of issues. Should support multiple IDs like other bd commands.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-18T23:33:28.292937-08:00","updated_at":"2025-12-19T17:43:35.713398-08:00","closed_at":"2025-12-19T00:35:31.612589-08:00","dependencies":[{"issue_id":"bd-6pc","depends_on_id":"bd-0vg","type":"blocks","created_at":"2025-12-18T23:33:56.119852-08:00","created_by":"daemon"},{"issue_id":"bd-6pc","depends_on_id":"bd-7h5","type":"blocks","created_at":"2025-12-18T23:34:07.352848-08:00","created_by":"daemon"}]} {"id":"bd-6pni","title":"bd doctor --fix should auto-fix prefix mismatch errors","description":"When bd doctor --fix encounters a prefix mismatch during DB-JSONL sync fix, it fails without offering to use --rename-on-import.\n\n**Current behavior:**\n```\nFixing DB-JSONL Sync...\n→ Importing from JSONL...\nError importing: import failed: exit status 1\nImport failed: prefix mismatch detected: database uses 'bd-' but found issues with prefixes: [beads- (2 issues) test- (10 issues)]\n```\n\n**Expected behavior:**\n- Detect that the mismatched prefixes are all tombstones\n- Auto-apply --rename-on-import since tombstones with wrong prefixes are pollution\n- Or prompt: 'Found 21 issues with wrong prefixes (all tombstones). Remove them? [Y/n]'\n\n**Context:** Prefix pollution typically comes from contributor PRs that used different test prefixes. These are always safe to remove when they're tombstones.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-12-15T17:28:45.508654-08:00","updated_at":"2025-12-16T00:54:56.458264-08:00","closed_at":"2025-12-16T00:54:56.458264-08:00"} +{"id":"bd-6q2vn","title":"Digest: mol-refinery-patrol","description":"Patrol cycle: merge queue empty, no branches processed","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-15T11:50:42.018569-08:00","updated_at":"2026-01-15T11:50:42.018569-08:00","closed_at":"2026-01-15T11:50:42.018521-08:00","close_reason":"Squashed from 11 wisps","dependencies":[{"issue_id":"bd-6q2vn","depends_on_id":"bd-wisp-mnd3","type":"parent-child","created_at":"2026-01-15T11:50:42.019607-08:00","created_by":"beads/refinery"}]} {"id":"bd-6ql2z","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-08T20:32:29.623883-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-08T20:32:29.66296-08:00","closed_at":"2026-01-08T20:32:29.66296-08:00","close_reason":"auto-closed session event"} {"id":"bd-6rl","title":"Merge3Way public API does not expose TTL parameter","description":"The public Merge3Way() function in merge.go does not allow callers to configure the tombstone TTL. It hard-codes the default via merge3WayWithTTL(). While merge3WayWithTTL() exists, it is unexported (lowercase). This means the CLI and tests cannot configure TTL at merge time. Use cases: testing with different TTL values, per-repository TTL configuration, debugging with short TTL, supporting --ttl flag in bd merge command (mentioned in design doc bd-zvg). Recommendation: Export Merge3WayWithTTL (rename to uppercase). Files: internal/merge/merge.go:77, 292-298","status":"closed","priority":3,"issue_type":"feature","created_at":"2025-12-05T16:36:15.756814-08:00","updated_at":"2025-12-25T22:45:32.157938-08:00","closed_at":"2025-12-25T22:45:32.157938-08:00"} {"id":"bd-6s61","title":"Version Bump: {{version}}","description":"Release checklist for version {{version}}. This molecule ensures all release steps are completed properly.","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-12-19T22:55:42.487701-08:00","updated_at":"2026-01-04T23:41:06.944519-08:00","closed_at":"2026-01-04T23:41:06.944519-08:00","close_reason":"Cleanup: stale molecule","labels":["molecule","template"],"deleted_at":"2025-12-24T16:25:31.251346-08:00","deleted_by":"daemon","delete_reason":"delete","original_type":"epic"} @@ -701,6 +707,7 @@ {"id":"bd-873k","title":"Merge: jasper-mjxcarqd","description":"branch: polecat/jasper-mjxcarqd\ntarget: main\nsource_issue: jasper-mjxcarqd\nrig: beads\nagent_bead: bd-beads-polecat-jasper","status":"closed","priority":2,"issue_type":"merge-request","created_at":"2026-01-02T12:49:27.658037-08:00","created_by":"beads/polecats/jasper","updated_at":"2026-01-02T13:41:56.626743-08:00","closed_at":"2026-01-02T13:41:56.626743-08:00","close_reason":"Branches merged, cleaning up stale MR beads"} {"id":"bd-879d","title":"Test issue 1","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-02T09:44:12.538697729Z","updated_at":"2025-11-02T09:45:20.76214671Z","closed_at":"2025-11-02T09:45:20.76214671Z","dependencies":[{"issue_id":"bd-879d","depends_on_id":"bd-d3e5","type":"discovered-from","created_at":"2025-11-02T09:44:22.103468321Z","created_by":"mrdavidlaing"}]} {"id":"bd-87a0","title":"Publish @beads/bd package to npm registry","description":"Publish the npm package to the public npm registry:\n\n## Prerequisites\n- npm account created\n- Organization @beads created (or use different namespace)\n- npm login completed locally\n- Package tested locally (bd-f282 completed)\n\n## Publishing steps\n1. Verify package.json version matches current bd version\n2. Run npm pack and inspect tarball contents\n3. Test installation from tarball one more time\n4. Run npm publish --access public\n5. Verify package appears on https://www.npmjs.com/package/@beads/bd\n6. Test installation from registry: npm install -g @beads/bd\n\n## Post-publish\n- Add npm badge to README.md\n- Update CHANGELOG.md with npm package release\n- Announce in release notes\n\n## Note\n- May need to choose different name if @beads namespace unavailable\n- Alternative: beads-cli, bd-cli, or unscoped beads-issue-tracker","status":"closed","priority":1,"issue_type":"task","created_at":"2025-11-02T23:40:25.263569-08:00","updated_at":"2025-11-03T10:39:41.772338-08:00","closed_at":"2025-11-03T10:39:41.772338-08:00","dependencies":[{"issue_id":"bd-87a0","depends_on_id":"bd-febc","type":"parent-child","created_at":"2025-11-02T23:40:33.014043-08:00","created_by":"daemon"}]} +{"id":"bd-88qiq","title":"Digest: mol-witness-patrol","description":"Patrol 6: all clear","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T21:50:36.184078-08:00","updated_at":"2026-01-14T21:50:36.184078-08:00","closed_at":"2026-01-14T21:50:36.184029-08:00","close_reason":"Squashed from 10 wisps","dependencies":[{"issue_id":"bd-88qiq","depends_on_id":"bd-wisp-du8r","type":"parent-child","created_at":"2026-01-14T21:50:36.18519-08:00","created_by":"beads/witness"}]} {"id":"bd-8900f145","title":"Testing event-driven mode!","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-29T15:28:33.564871-07:00","updated_at":"2025-10-30T17:12:58.186325-07:00","closed_at":"2025-10-29T19:12:54.43368-07:00"} {"id":"bd-8931","title":"Daemon gets stuck when auto-import blocked by git conflicts","description":"CRITICAL: The daemon enters a corrupt state that breaks RPC commands when auto-import is triggered but git pull fails due to uncommitted changes.\n\nImpact: This is a data integrity and usability issue that could cause users to lose trust in Beads. The daemon silently fails for certain commands while appearing healthy.\n\nReproduction:\n1. Make local changes to issues (creates uncommitted .beads/beads.jsonl)\n2. Remote has updates (JSONL newer, triggers auto-import)\n3. Daemon tries to pull but fails: 'cannot pull with rebase: You have unstaged changes'\n4. Daemon enters bad state - 'bd show' and other commands return EOF\n5. 'bd list' still works, daemon process is running, no errors logged\n\nTechnical details:\n- Auto-import check runs in handleRequest() before processing RPC commands\n- When import is blocked, it appears to corrupt daemon state\n- Likely: deadlock, unclosed transaction, or storage handle corruption\n- Panic recovery (server_lifecycle_conn.go:183) didn't catch anything - not a panic\n\nRequired fix:\n- Auto-import must not block RPC command execution\n- Handle git pull failures gracefully without corrupting state\n- Consider: skip auto-import if git is dirty, queue import for later, or use separate goroutine\n- Add timeout/circuit breaker for import operations\n- Log clear warnings when auto-import is skipped\n\nWithout this fix, users in collaborative environments will frequently encounter mysterious EOF errors that require daemon restarts.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-11-02T17:15:25.181425-08:00","updated_at":"2025-12-14T12:12:46.564936-08:00","closed_at":"2025-11-03T12:08:12.949064-08:00","dependencies":[{"issue_id":"bd-8931","depends_on_id":"bd-1048","type":"blocks","created_at":"2025-11-02T17:15:25.181857-08:00","created_by":"stevey"}]} {"id":"bd-8972j","title":"Session ended: gt-beads-crew-wolf","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-10T12:31:47.178724-08:00","created_by":"beads/crew/wolf","updated_at":"2026-01-10T12:31:47.21488-08:00","closed_at":"2026-01-10T12:31:47.21488-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} @@ -736,6 +743,7 @@ {"id":"bd-8och0","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-09T00:45:27.251991-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-09T00:45:27.289355-08:00","closed_at":"2026-01-09T00:45:27.289355-08:00","close_reason":"auto-closed session event"} {"id":"bd-8oqpg","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-08T20:44:24.827026-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-08T20:44:24.864433-08:00","closed_at":"2026-01-08T20:44:24.864433-08:00","close_reason":"auto-closed session event"} {"id":"bd-8p422","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-13T15:04:21.478203-08:00","created_by":"beads/refinery","updated_at":"2026-01-13T15:04:21.557401-08:00","closed_at":"2026-01-13T15:04:21.557401-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} +{"id":"bd-8p7we","title":"Session ended: gt-beads-beads/witness","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T21:53:11.317888-08:00","created_by":"beads/witness","updated_at":"2026-01-14T21:53:11.370743-08:00","closed_at":"2026-01-14T21:53:11.370743-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-8pd8h","title":"Session ended: gt-beads-crew-dave","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-08T23:04:41.030912-08:00","created_by":"beads/crew/dave","updated_at":"2026-01-08T23:04:41.065974-08:00","closed_at":"2026-01-08T23:04:41.065974-08:00","close_reason":"auto-closed session event"} {"id":"bd-8ph6","title":"Support Ubuntu 20.04 LTS (glibc compatibility issue)","description":"Starting at v0.22, precompiled binaries require GLIBC 2.32+ which is not available on Ubuntu 20.04 LTS (Focal Fossa). Ubuntu 20.04 has GLIBC 2.31.\n\nError:\n```\nbd: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bd)\nbd: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by bd)\n```\n\nCurrent workarounds:\n1. Upgrade to Ubuntu 22.04+\n2. Build from source: `go build -o bd ./cmd/bd/`\n\nRoot cause: Go 1.24+ runtime requires newer glibc. CGO is already disabled in .goreleaser.yml.\n\nPossible solutions:\n- Pin Go version to 1.21 or 1.22 for releases\n- Use Docker/cross-compile with older build environment\n- Provide separate build for older distros\n- Document minimum requirements clearly","notes":"Decision: Document minimum requirements in README instead of pinning Go version.\n\nRationale:\n- Ubuntu 20.04 LTS standard support ended April 2025 (already EOL)\n- Pinning Go prevents security fixes, performance improvements, and new features\n- Users on EOL distros can upgrade OS or build from source\n- Added Requirements section to README with clear glibc 2.32+ requirement","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-07T14:25:47.055357-08:00","updated_at":"2025-11-07T14:30:15.755733-08:00","closed_at":"2025-11-07T14:30:15.755733-08:00"} {"id":"bd-8po3j","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-12T01:21:16.103784-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-12T01:21:16.165641-08:00","closed_at":"2026-01-12T01:21:16.165641-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} @@ -745,7 +753,7 @@ {"id":"bd-8r9k9","title":"Test issue 0","status":"open","priority":0,"issue_type":"task","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T18:16:10.663136-08:00","created_by":"beads/crew/wolf","updated_at":"2026-01-11T18:16:10.663136-08:00"} {"id":"bd-8rd","title":"Migration and onboarding for multi-repo","description":"Create migration tools, wizards, and documentation to help users adopt multi-repo workflow, with special focus on OSS contributor onboarding and team adoption scenarios.","status":"closed","priority":2,"issue_type":"epic","created_at":"2025-11-04T11:22:13.491033-08:00","updated_at":"2025-11-07T16:08:24.951261-08:00","closed_at":"2025-11-07T16:03:09.75064-08:00","dependencies":[{"issue_id":"bd-8rd","depends_on_id":"bd-4ms","type":"parent-child","created_at":"2025-11-04T11:22:21.858002-08:00","created_by":"daemon"}]} {"id":"bd-8rssb","title":"Session ended: gt-beads-crew-fang","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-07T21:33:52.477938-08:00","created_by":"beads/crew/fang","updated_at":"2026-01-09T21:15:40.694317-08:00","closed_at":"2026-01-09T21:15:40.694317-08:00","close_reason":"Stale session ended events"} -{"id":"bd-8s7pl","title":"Digest: mol-refinery-patrol","description":"Patrol: queue empty, no branches processed, main unchanged","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T21:32:45.395237-08:00","updated_at":"2026-01-14T21:32:45.395237-08:00","closed_at":"2026-01-14T21:32:45.395191-08:00","close_reason":"Squashed from 11 wisps","dependencies":[{"issue_id":"bd-8s7pl","depends_on_id":"bd-wisp-c0xv","type":"parent-child","created_at":"2026-01-14T21:32:45.396297-08:00","created_by":"beads/refinery"}]} +{"id":"bd-8s7pl","title":"Digest: mol-refinery-patrol","description":"Patrol: queue empty, no branches processed, main unchanged","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T21:32:45.395237-08:00","updated_at":"2026-01-14T21:32:45.395237-08:00","closed_at":"2026-01-14T21:32:45.395191-08:00","close_reason":"Squashed from 11 wisps"} {"id":"bd-8sphq","title":"Session ended: gt-beads-beads/witness","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T21:36:32.440254-08:00","created_by":"beads/witness","updated_at":"2026-01-14T21:36:32.539535-08:00","closed_at":"2026-01-14T21:36:32.539535-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-8uwdi","title":"Session ended: gt-beads-crew-dave","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-10T19:29:09.223322-08:00","created_by":"beads/crew/dave","updated_at":"2026-01-10T19:29:09.26506-08:00","closed_at":"2026-01-10T19:29:09.26506-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-8v2","title":"Add {{version}} to versionChanges in info.go","description":"Add new entry at TOP of versionChanges in cmd/bd/info.go with release notes from CHANGELOG.md. Must do before bump-version.sh --commit.","status":"tombstone","priority":1,"issue_type":"task","created_at":"2025-12-18T22:43:00.482846-08:00","updated_at":"2025-12-24T16:25:30.231077-08:00","dependencies":[{"issue_id":"bd-8v2","depends_on_id":"bd-qqc","type":"parent-child","created_at":"2025-12-18T22:43:16.496649-08:00","created_by":"daemon"},{"issue_id":"bd-8v2","depends_on_id":"bd-kyo","type":"blocks","created_at":"2025-12-18T22:43:20.69619-08:00","created_by":"daemon"}],"deleted_at":"2025-12-24T16:25:30.231077-08:00","deleted_by":"daemon","delete_reason":"delete","original_type":"task"} @@ -776,10 +784,11 @@ {"id":"bd-96142dec","title":"Add fallback to polling on watcher failure","description":"Detect fsnotify.NewWatcher() errors and log warning. Auto-switch to polling mode with 5s ticker. Add BEADS_WATCHER_FALLBACK env var to control behavior.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-28T16:20:02.428439-07:00","updated_at":"2025-10-30T17:12:58.220378-07:00","closed_at":"2025-10-28T19:23:43.595916-07:00"} {"id":"bd-968f","title":"Add unit tests for config modes","description":"Test all four orphan_handling modes: strict (fails), resurrect (creates tombstone), skip (logs warning), allow (imports orphan). Verify error messages and logging output for each mode.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-11-04T12:32:21.367129-08:00","updated_at":"2025-11-05T00:44:27.948775-08:00","closed_at":"2025-11-05T00:44:27.948777-08:00"} {"id":"bd-96e7v","title":"Review \u0026 merge PR #970: Fix worktree path detection","description":"dispatched_by: beads/crew/emma\n\n## Task\nReview and merge PR #970 from shendsaliaga.\n\n## PR Summary\nFixes `bd migrate sync` failing with 'fatal: not a git repository' when run from within a git worktree (bare repo setups).\n\n**Two bugs fixed:**\n1. Used GetGitDir() instead of GetGitCommonDir() for worktree creation path\n2. strings.Index found wrong '/worktrees/' in user paths - changed to LastIndex\n\n## Review Checklist\n- [ ] Code review: changes look correct (GetGitDir → GetGitCommonDir)\n- [ ] Verify tests pass: `go test ./...`\n- [ ] Verify lint passes: `golangci-lint run ./...`\n- [ ] Merge the PR: `gh pr merge 970 --repo steveyegge/beads --squash`\n\n## PR Link\nhttps://github.com/steveyegge/beads/pull/970\n\n## Easy-Win Criteria Met\n- Bug fix with clear reproduction and solution\n- Small focused change (26 additions, 8 deletions)\n- Well-documented with before/after examples","status":"closed","priority":2,"issue_type":"task","assignee":"beads/crew/fang","created_at":"2026-01-09T00:49:19.730696-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-09T18:32:04.025314-08:00","closed_at":"2026-01-09T18:32:04.025314-08:00","close_reason":"PR #970 merged"} +{"id":"bd-97uoh","title":"Digest: mol-witness-patrol","description":"Patrol 7: all clear","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T21:51:59.044812-08:00","updated_at":"2026-01-14T21:51:59.044812-08:00","closed_at":"2026-01-14T21:51:59.044756-08:00","close_reason":"Squashed from 10 wisps","dependencies":[{"issue_id":"bd-97uoh","depends_on_id":"bd-wisp-9nv5","type":"parent-child","created_at":"2026-01-14T21:51:59.045923-08:00","created_by":"beads/witness"}]} {"id":"bd-97zdo","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-12T23:45:05.15218-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-12T23:45:05.224528-08:00","closed_at":"2026-01-12T23:45:05.224528-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-9826b69a","title":"CRDT-based architecture for guaranteed convergence (v2.0)","description":"## Vision\nRedesign beads around Conflict-Free Replicated Data Types (CRDTs) to provide mathematical guarantees for N-way collision resolution at arbitrary scale.\n\n## Current Limitations\n- Content-hash based collision resolution fails at 5+ clones\n- Non-deterministic convergence in multi-round scenarios\n- UNIQUE constraint violations during rename operations\n- No formal proof of convergence properties\n\n## CRDT Benefits\n- Provably convergent (Strong Eventual Consistency)\n- Commutative/Associative/Idempotent operations\n- No coordination required between clones\n- Scales to 100+ concurrent workers\n- Well-understood mathematical foundations\n\n## Proposed Architecture\n\n### 1. UUID-Based IDs\nReplace sequential IDs with UUIDs:\n- Current: bd-1c63eb84, bd-9063acda, bd-4d80b7b1\n- CRDT: bd-a1b2c3d4-e5f6-7890-abcd-ef1234567890\n- Human aliases maintained separately: #42 maps to UUID\n\n### 2. Last-Write-Wins (LWW) Elements\nEach field becomes an LWW register:\n- title: (timestamp, clone_id, value)\n- status: (timestamp, clone_id, value)\n- Deterministic conflict resolution via Lamport timestamp + clone_id tiebreaker\n\n### 3. Operation Log\nTrack all operations as CRDT ops:\n- CREATE(uuid, timestamp, clone_id, fields)\n- UPDATE(uuid, field, timestamp, clone_id, value)\n- DELETE(uuid, timestamp, clone_id) - tombstone, not hard delete\n\n### 4. Sync as Merge\nSyncing becomes merging two CRDT states:\n- No merge conflicts possible\n- Deterministic merge function\n- Guaranteed convergence\n\n## Implementation Phases\n\n### Phase 1: Research \u0026 Design (4 weeks)\n- Study existing CRDT implementations (Automerge, Yjs, Loro)\n- Design schema for CRDT-based issue tracking\n- Prototype LWW-based Issue CRDT\n- Benchmark performance vs current system\n\n### Phase 2: Parallel Implementation (6 weeks)\n- Implement CRDT storage layer alongside SQLite\n- Build conversion tools: SQLite ↔ CRDT\n- Maintain backward compatibility with v1.x format\n- Migration path for existing databases\n\n### Phase 3: Testing \u0026 Validation (4 weeks)\n- Formal verification of convergence properties\n- Stress testing with 100+ clone scenario\n- Performance profiling and optimization\n- Documentation and examples\n\n### Phase 4: Migration \u0026 Rollout (4 weeks)\n- Release v2.0-beta with CRDT backend\n- Gradual migration from v1.x\n- Monitoring and bug fixes\n- Final v2.0 release\n\n## Risks \u0026 Mitigations\n\n**Risk 1: Performance overhead**\n- Mitigation: Benchmark early, optimize hot paths\n- CRDTs can be slower than append-only logs\n- May need compaction strategy\n\n**Risk 2: Storage bloat**\n- Mitigation: Implement operation log compaction\n- Tombstone garbage collection for deleted issues\n- Periodic snapshots to reduce log size\n\n**Risk 3: Breaking changes**\n- Mitigation: Maintain v1.x compatibility layer\n- Gradual migration tools\n- Dual-mode operation during transition\n\n**Risk 4: Complexity**\n- Mitigation: Use battle-tested CRDT libraries\n- Comprehensive documentation\n- Clear migration guide\n\n## Success Criteria\n- 100-clone collision test passes without failures\n- Formal proof of convergence properties\n- Performance within 2x of current system\n- Zero manual conflict resolution required\n- Backward compatible with v1.x databases\n\n## Timeline\n18-20 weeks total (4-5 months)\n\n## References\n- Automerge: https://automerge.org\n- Yjs: https://docs.yjs.dev\n- Loro: https://loro.dev\n- CRDT theory: Shapiro et al, A comprehensive study of CRDTs\n- Related issues: bd-0dcea000, bd-4d7fca8a, bd-6221bdcd","status":"closed","priority":3,"issue_type":"feature","created_at":"2025-10-29T20:48:00.267736-07:00","updated_at":"2025-10-31T20:06:44.60536-07:00","closed_at":"2025-10-31T20:06:44.60536-07:00"} {"id":"bd-987a","title":"bd mol run: panic slice bounds out of range in mol_run.go:130","description":"## Problem\nbd mol run panics after successfully creating the molecule:\n\n```\n✓ Molecule running: created 9 issues\n Root issue: gt-i4lo (pinned, in_progress)\n Assignee: stevey\n\nNext steps:\n bd ready # Find unblocked work in this molecule\npanic: runtime error: slice bounds out of range [:8] with length 7\n\ngoroutine 1 [running]:\nmain.runMolRun(0x1014fc0c0, {0x140001e0f80, 0x1, 0x10089daad?})\n /Users/stevey/gt/beads/crew/dave/cmd/bd/mol_run.go:130 +0xc38\n```\n\n## Reproduction\n```bash\nbd --no-daemon mol run gt-lwuu --var issue=gt-test123\n```\nWhere gt-lwuu is a mol-polecat-work proto with 8 child steps.\n\n## Impact\nThe molecule IS created successfully - the panic happens after creation when formatting the \"Next steps\" output.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-12-21T21:48:55.396018-08:00","updated_at":"2025-12-21T22:57:46.827469-08:00","closed_at":"2025-12-21T22:57:46.827469-08:00"} -{"id":"bd-989ju","title":"Digest: mol-refinery-patrol","description":"Patrol complete: MQ empty, 0 branches merged, main synced to 9e639da5","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T20:42:42.146136-08:00","updated_at":"2026-01-14T20:42:42.146136-08:00","closed_at":"2026-01-14T20:42:42.146089-08:00","close_reason":"Squashed from 11 wisps","dependencies":[{"issue_id":"bd-989ju","depends_on_id":"bd-wisp-boc","type":"parent-child","created_at":"2026-01-14T20:42:42.147203-08:00","created_by":"beads/refinery"}]} +{"id":"bd-989ju","title":"Digest: mol-refinery-patrol","description":"Patrol complete: MQ empty, 0 branches merged, main synced to 9e639da5","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T20:42:42.146136-08:00","updated_at":"2026-01-14T20:42:42.146136-08:00","closed_at":"2026-01-14T20:42:42.146089-08:00","close_reason":"Squashed from 11 wisps"} {"id":"bd-98b4","title":"Merge: onyx-1767138516448","description":"branch: polecat/onyx-1767138516448\ntarget: main\nsource_issue: onyx-1767138516448\nrig: beads","status":"closed","priority":2,"issue_type":"merge-request","created_at":"2025-12-30T16:17:51.539362-08:00","created_by":"beads/polecats/onyx","updated_at":"2025-12-30T18:12:30.974128-08:00","closed_at":"2025-12-30T18:11:07.907737-08:00"} {"id":"bd-98c4e1fa","title":"Event-driven daemon architecture","description":"Replace 5-second polling sync loop with event-driven architecture that reacts instantly to changes. Eliminates stale data issues while reducing CPU ~60%. Key components: FileWatcher (fsnotify), Debouncer (500ms), RPC mutation events, optional git hooks. Target latency: \u003c500ms (vs 5000ms). See event_driven_daemon.md for full design.","notes":"## Implementation Progress\n\n**Completed:**\n1. ✅ Mutation events infrastructure (bd-143 equivalent)\n - MutationEvent channel in RPC server\n - Events emitted for all write operations: create, update, close, label add/remove, dep add/remove, comment add\n - Non-blocking emission with dropped event counter\n\n2. ✅ FileWatcher with fsnotify (bd-b0c7f7ef related)\n - Watches .beads/issues.jsonl and .git/refs/heads\n - 500ms debounce\n - Polling fallback if fsnotify unavailable\n\n3. ✅ Debouncer (bd-144 equivalent)\n - 500ms debounce for both export and import triggers\n - Thread-safe trigger/cancel\n\n4. ✅ Separate export-only and import-only functions\n - createExportFunc(): exports + optional commit/push (no pull/import)\n - createAutoImportFunc(): pull + import (no export)\n - Target latency \u003c500ms achieved by avoiding full sync\n\n5. ✅ Dropped events safety net (bd-eef03e0a related)\n - Atomic counter tracks dropped mutation events\n - 60-second health check triggers export if events were dropped\n - Prevents silent data loss from event storms\n\n**Still Needed:**\n- Platform-specific tests (bd-69bce74a)\n- Integration test for mutation→export latency (bd-140)\n- Unit tests for FileWatcher (bd-b0c7f7ef)\n- Unit tests for Debouncer (bd-144)\n- Event storm stress test (bd-eef03e0a)\n- Documentation update (bd-142)\n\n**Next Steps:**\nAdd comprehensive test coverage before enabling events mode by default.","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-10-29T21:19:36.203436-07:00","updated_at":"2025-10-30T17:12:58.197875-07:00","closed_at":"2025-10-29T15:53:34.022335-07:00"} {"id":"bd-98c4e1fa.1","title":"Update AGENTS.md with event-driven mode","description":"Document BEADS_DAEMON_MODE env var. Explain opt-in during Phase 1. Add troubleshooting for watcher failures.","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-29T23:05:13.986452-07:00","updated_at":"2025-10-31T20:36:49.381832-07:00","dependencies":[{"issue_id":"bd-98c4e1fa.1","depends_on_id":"bd-98c4e1fa","type":"parent-child","created_at":"2025-10-29T21:19:36.206187-07:00","created_by":"import-remap"},{"issue_id":"bd-98c4e1fa.1","depends_on_id":"bd-0e1f2b1b","type":"parent-child","created_at":"2025-10-31T19:38:09.131439-07:00","created_by":"stevey"}]} @@ -818,6 +827,7 @@ {"id":"bd-9qajq","title":"gt sling crew auto-picks random crew worker (violates crew model)","description":"## Problem\n\n`gt sling bd-xxx crew` auto-dispatches to a random crew worker. This violates the crew model:\n\n- **Crew** = persistent, human-managed workspaces. Human decides who gets what work.\n- **Polecats** = transient worker pool. Auto-dispatch makes sense.\n\nCurrent behavior interrupts crew workers unexpectedly, which is the antithesis of what crew are for.\n\n## Expected Behavior\n\nEither:\n1. Require explicit crew worker name: `gt sling bd-xxx crew/fang` (no auto-pick)\n2. Or reject `gt sling ... crew` entirely - crew assignment should be manual\n\n## Workaround\n\nAssign beads manually with `bd update --assignee` and send mail.","status":"open","priority":2,"issue_type":"bug","owner":"steve.yegge@gmail.com","created_at":"2026-01-12T01:36:45.62829-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-12T01:36:45.62829-08:00"} {"id":"bd-9qj5","title":"Merge: bd-c7y5","description":"branch: polecat/toast\ntarget: main\nsource_issue: bd-c7y5\nrig: beads","status":"closed","priority":2,"issue_type":"merge-request","created_at":"2025-12-23T20:45:02.626929-08:00","updated_at":"2025-12-23T21:21:57.699742-08:00","closed_at":"2025-12-23T21:21:57.699742-08:00"} {"id":"bd-9rlfh","title":"Digest: mol-witness-patrol","description":"Patrol 1: No polecats, no cleanup wisps, no mail. Refinery running. Clean cycle.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T20:30:12.778966-08:00","updated_at":"2026-01-14T20:30:12.778966-08:00","closed_at":"2026-01-14T20:30:12.77892-08:00","close_reason":"Squashed from 10 wisps"} +{"id":"bd-9rt8a","title":"Session ended: gt-beads-beads/witness","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T21:43:03.287233-08:00","created_by":"beads/witness","updated_at":"2026-01-14T21:43:03.349696-08:00","closed_at":"2026-01-14T21:43:03.349696-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-9rw1","title":"Support P-prefix priority format (P0-P4) in create and update commands","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-11-05T13:56:04.796826-08:00","updated_at":"2025-11-05T13:56:08.157061-08:00","closed_at":"2025-11-05T13:56:08.157061-08:00"} {"id":"bd-9sj15","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T05:18:00.038245-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T05:18:00.100943-08:00","closed_at":"2026-01-11T05:18:00.100943-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-9szg","title":"Test prefix bd","status":"tombstone","priority":2,"issue_type":"task","created_at":"2025-12-27T14:24:41.470665-08:00","created_by":"stevey","updated_at":"2025-12-27T14:24:50.420887-08:00","deleted_at":"2025-12-27T14:24:50.420887-08:00","deleted_by":"daemon","delete_reason":"delete","original_type":"task"} @@ -841,7 +851,7 @@ {"id":"bd-a4b5","title":"Implement git worktree management","description":"Create git worktree lifecycle management for separate beads branch.\n\nTasks:\n- Create internal/git/worktree.go\n- Implement CreateBeadsWorktree(branch, path)\n- Implement RemoveBeadsWorktree(path)\n- Implement CheckWorktreeHealth(path)\n- Configure sparse checkout (only .beads/)\n- Implement SyncJSONLToWorktree()\n- Handle worktree errors gracefully\n- Auto-cleanup on config change\n\nEstimated effort: 3-4 days","status":"closed","priority":1,"issue_type":"task","created_at":"2025-11-02T15:22:35.56423-08:00","updated_at":"2025-12-14T12:12:46.566838-08:00","closed_at":"2025-11-04T11:10:23.533055-08:00","dependencies":[{"issue_id":"bd-a4b5","depends_on_id":"bd-a101","type":"parent-child","created_at":"2025-11-02T15:22:48.359843-08:00","created_by":"stevey"}]} {"id":"bd-a5251b1a","title":"Test RPC mutation event","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-29T19:08:03.315443-07:00","updated_at":"2025-10-31T12:00:43.177494-07:00","closed_at":"2025-10-31T12:00:43.177494-07:00"} {"id":"bd-a557","title":"Issue 1 to reopen","status":"closed","priority":1,"issue_type":"task","created_at":"2025-11-22T14:57:44.500801209-05:00","updated_at":"2025-11-22T14:57:44.500801209-05:00","closed_at":"2025-11-07T21:57:59.910467-08:00"} -{"id":"bd-a5h9d","title":"Digest: mol-refinery-patrol","description":"Patrol complete: queue empty, no branches to merge","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T20:30:53.330404-08:00","updated_at":"2026-01-14T20:30:53.330404-08:00","closed_at":"2026-01-14T20:30:53.33035-08:00","close_reason":"Squashed from 11 wisps","dependencies":[{"issue_id":"bd-a5h9d","depends_on_id":"bd-wisp-6kr","type":"parent-child","created_at":"2026-01-14T20:30:53.331475-08:00","created_by":"beads/refinery"}]} +{"id":"bd-a5h9d","title":"Digest: mol-refinery-patrol","description":"Patrol complete: queue empty, no branches to merge","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T20:30:53.330404-08:00","updated_at":"2026-01-14T20:30:53.330404-08:00","closed_at":"2026-01-14T20:30:53.33035-08:00","close_reason":"Squashed from 11 wisps"} {"id":"bd-a62m","title":"Update version to 0.33.2 in version.go","description":"Edit cmd/bd/version.go line 17:\n\n```go\nVersion = \"0.33.2\"\n```\n\nVerify with: `grep 'Version =' cmd/bd/version.go`","status":"tombstone","priority":1,"issue_type":"task","created_at":"2025-12-21T16:10:13.760384-08:00","updated_at":"2025-12-21T17:29:31.791368-08:00","deleted_at":"2025-12-21T17:29:31.791368-08:00","deleted_by":"batch delete","delete_reason":"batch delete","original_type":"task"} {"id":"bd-a854","title":"Break run-bump-script into individual version-update steps","description":"dispatched_by: gastown/crew/max\n\nReplace the monolithic `run-bump-script` step with individual steps for each file:\n\n## Steps to Create\n\n1. **bump-version-go** - Update cmd/bd/version.go\n```bash\nsed -i \"\" \"s/Version = \\\"[^\\\"]*\\\"/Version = \\\"{{version}}\\\"/\" cmd/bd/version.go\n```\n\n2. **bump-plugin-json** - Update .claude-plugin/*.json\n```bash\njq \".version = \\\"{{version}}\\\"\" .claude-plugin/plugin.json \u003e tmp \u0026\u0026 mv tmp .claude-plugin/plugin.json\njq \".plugins[0].version = \\\"{{version}}\\\"\" .claude-plugin/marketplace.json \u003e tmp \u0026\u0026 mv tmp .claude-plugin/marketplace.json\n```\n\n3. **bump-mcp-python** - Update MCP package\n```bash\nsed -i \"\" \"s/version = \\\"[^\\\"]*\\\"/version = \\\"{{version}}\\\"/\" integrations/beads-mcp/pyproject.toml\nsed -i \"\" \"s/__version__ = \\\"[^\\\"]*\\\"/__version__ = \\\"{{version}}\\\"/\" integrations/beads-mcp/src/beads_mcp/__init__.py\n```\n\n4. **bump-npm-package** - Update npm package\n```bash\njq \".version = \\\"{{version}}\\\"\" npm-package/package.json \u003e tmp \u0026\u0026 mv tmp npm-package/package.json\n```\n\n5. **bump-hook-templates** - Update hook versions\n```bash\nfor f in cmd/bd/templates/hooks/*; do\n sed -i \"\" \"s/# bd-hooks-version: .*/# bd-hooks-version: {{version}}/\" \"$f\"\ndone\n```\n\n6. **bump-readme** - Update README badge\n```bash\nsed -i \"\" \"s/Alpha (v[^)]*)/Alpha (v{{version}})/\" README.md\n```\n\n7. **stamp-changelog** - Add date to [Unreleased]\n```bash\nDATE=$(date +%Y-%m-%d)\nsed -i \"\" \"s/## \\[Unreleased\\]/## [Unreleased]\\n\\n## [{{version}}] - $DATE/\" CHANGELOG.md\n```\n\n## Notes\n- Each step should have `needs` pointing to the previous step\n- Commands should work on both macOS and Linux (may need platform detection)\n- The existing update-changelog step handles content; stamp-changelog just adds the date","status":"closed","priority":1,"issue_type":"task","assignee":"beads/crew/dave","created_at":"2026-01-07T00:45:28.971662-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-07T21:37:51.5555-08:00","closed_at":"2026-01-07T21:37:51.5555-08:00","close_reason":"Replaced run-bump-script with 7 individual steps in beads-release.formula.toml: bump-version-go, bump-plugin-json, bump-mcp-python, bump-npm-package, bump-hook-templates, bump-readme, stamp-changelog. Each step has explicit commands and verify steps. Removed outdated JSON formula.","dependencies":[{"issue_id":"bd-a854","depends_on_id":"bd-z8xz","type":"parent-child","created_at":"2026-01-07T00:45:40.458262-08:00","created_by":"beads/crew/emma"}]} {"id":"bd-a9699011","title":"GH#146: No color showing in terminal for some users","description":"User reports color not working in macOS (Taho 26.0.1) with iTerm 3.6.4 and Terminal.app, despite color working elsewhere in terminal. Python rich and printf escape codes work.\n\nNeed to investigate:\n- Is NO_COLOR env var set?\n- Terminal type detection?\n- fatih/color library configuration\n- Does bd list show colors? bd ready? bd init?\n- What's the output of: echo $TERM, echo $NO_COLOR","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-10-24T22:26:36.22163-07:00","updated_at":"2025-12-14T12:12:46.555685-08:00","closed_at":"2025-11-08T00:54:40.47956-08:00"} @@ -951,7 +961,7 @@ {"id":"bd-be7a","title":"Create npm package structure with package.json","description":"Set up initial npm package structure for @beads/bd:\n\n## Files to create\n- npm/package.json - Package metadata, dependencies, scripts\n- npm/bin/bd - CLI wrapper script that invokes native binary\n- npm/.gitignore - Ignore downloaded binaries\n- npm/README.md - Installation and usage instructions\n\n## package.json structure\n- Name: @beads/bd (scoped package)\n- Main: index.js (exports binary path)\n- Bin: bin/bd (CLI entry point)\n- Scripts: postinstall (download binary)\n- Keywords: issue-tracker, cli, beads, bd\n- License: MIT\n\n## Bin wrapper\nSimple Node.js script that:\n- Spawns native binary with child_process.spawn\n- Passes through all arguments and stdio\n- Exits with binary's exit code","status":"closed","priority":1,"issue_type":"task","created_at":"2025-11-02T23:39:47.416779-08:00","updated_at":"2025-11-03T10:31:45.381258-08:00","closed_at":"2025-11-03T10:31:45.381258-08:00","dependencies":[{"issue_id":"bd-be7a","depends_on_id":"bd-febc","type":"parent-child","created_at":"2025-11-02T23:40:32.923859-08:00","created_by":"daemon"}]} {"id":"bd-beads-crew-dave","title":"Crew worker dave in beads - human-managed persistent workspace.","description":"Crew worker dave in beads - human-managed persistent workspace.\n\nrole_type: crew\nrig: beads\nagent_state: idle\nhook_bead: null\nrole_bead: gt-crew-role\ncleanup_status: null","status":"open","priority":2,"issue_type":"agent","created_at":"2025-12-30T23:14:04.538389-08:00","created_by":"deacon","updated_at":"2026-01-14T20:43:29.30819-08:00"} {"id":"bd-beads-crew-emma","title":"Crew worker emma in beads - human-managed persistent workspace.","description":"Crew worker emma in beads - human-managed persistent workspace.\n\nrole_type: crew\nrig: beads\nagent_state: idle\nhook_bead: null\nrole_bead: gt-crew-role\ncleanup_status: null","status":"open","priority":2,"issue_type":"agent","created_at":"2025-12-30T23:14:04.604042-08:00","created_by":"deacon","updated_at":"2026-01-12T01:39:30.40061-08:00"} -{"id":"bd-beads-crew-fang","title":"Crew worker fang in beads - human-managed persistent workspace.","description":"Crew worker fang in beads - human-managed persistent workspace.\n\nrole_type: crew\nrig: beads\nagent_state: idle\nhook_bead: null\nrole_bead: gt-crew-role\ncleanup_status: null","status":"open","priority":2,"issue_type":"agent","created_at":"2025-12-30T23:14:04.672037-08:00","created_by":"deacon","updated_at":"2026-01-13T19:34:48.321438-08:00"} +{"id":"bd-beads-crew-fang","title":"Crew worker fang in beads - human-managed persistent workspace.","description":"Crew worker fang in beads - human-managed persistent workspace.\n\nrole_type: crew\nrig: beads\nagent_state: idle\nhook_bead: null\nrole_bead: gt-crew-role\ncleanup_status: null","status":"open","priority":2,"issue_type":"agent","created_at":"2025-12-30T23:14:04.672037-08:00","created_by":"deacon","updated_at":"2026-01-14T21:47:55.111501-08:00"} {"id":"bd-beads-crew-gastown-dennis","title":"Crew worker gastown-dennis in beads - human-managed persistent workspace.","description":"Crew worker gastown-dennis in beads - human-managed persistent workspace.\n\nrole_type: crew\nrig: beads\nagent_state: idle\nhook_bead: null\nrole_bead: hq-crew-role\ncleanup_status: null\nactive_mr: null\nnotification_level: null","status":"open","priority":2,"issue_type":"agent","owner":"steve.yegge@gmail.com","created_at":"2026-01-12T23:40:23.718735-08:00","created_by":"gastown/crew/joe","updated_at":"2026-01-12T23:40:23.861462-08:00","labels":["gt:agent"]} {"id":"bd-beads-crew-giles","title":"Crew worker giles in beads - human-managed persistent workspace.","description":"Crew worker giles in beads - human-managed persistent workspace.\n\nrole_type: crew\nrig: beads\nagent_state: idle\nhook_bead: null\nrole_bead: gt-crew-role\ncleanup_status: null\nactive_mr: null\nnotification_level: null","status":"open","priority":2,"issue_type":"agent","created_at":"2026-01-04T11:22:11.009942-08:00","created_by":"mayor","updated_at":"2026-01-13T20:58:28.353309-08:00"} {"id":"bd-beads-crew-grip","title":"Crew worker grip in beads - human-managed persistent workspace.","description":"Crew worker grip in beads - human-managed persistent workspace.\n\nrole_type: crew\nrig: beads\nagent_state: idle\nhook_bead: null\nrole_bead: gt-crew-role\ncleanup_status: has_stash\nactive_mr: bd-78rlo\nnotification_level: null","status":"open","priority":2,"issue_type":"agent","created_at":"2025-12-30T23:14:04.739788-08:00","created_by":"deacon","updated_at":"2026-01-13T19:41:00.790255-08:00"} @@ -1135,6 +1145,7 @@ {"id":"bd-d9mu","title":"Cross-rig external dependency support","description":"Support dependencies on issues in other rigs/repos.\n\n## Use Case\n\nGas Town issues often depend on Beads issues (and vice versa). Currently we use labels like `external:beads/bd-xxx` as documentation, but:\n- `bd blocked` doesn't recognize external deps\n- `bd ready` doesn't filter them out\n- No way to query cross-rig status\n\n## Proposed UX\n\n### Adding external deps\n```bash\n# New syntax for bd dep add\nbd dep add gt-a07f external:beads:bd-kwjh\n\n# Or maybe cleaner\nbd dep add gt-a07f --external beads:bd-kwjh\n```\n\n### Showing blocked status\n```bash\nbd blocked\n# → gt-a07f blocked by external:beads:bd-kwjh (unverified)\n\n# With optional cross-rig query\nbd blocked --resolve-external\n# → gt-a07f blocked by external:beads:bd-kwjh (closed) ← unblocked!\n```\n\n### Storage\nCould use:\n- Special dependency type: `type: external`\n- Label convention: `external:rig:id`\n- New field: `external_deps: [\"beads:bd-kwjh\"]`\n\n## Implementation Notes\n\nCross-rig queries would need:\n- Known rig locations (config or discovery)\n- Read-only beads access to external rigs\n- Caching to avoid repeated queries\n\nFor MVP, just recognizing external deps and marking them as 'unverified' blockers would be valuable.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-12-22T02:27:23.892706-08:00","updated_at":"2025-12-22T22:32:49.261551-08:00","closed_at":"2025-12-22T22:32:49.261551-08:00"} {"id":"bd-da96-baseline-lint","title":"Baseline quality gate failure: lint","description":"The lint quality gate is failing on the baseline (main branch).\n\nThis blocks the executor from claiming work until fixed.\n\nError: golangci-lint failed: exit status 1\n\nOutput:\n```\ncmd/bd/search.go:39:12: Error return value of `cmd.Help` is not checked (errcheck)\n\t\t\tcmd.Help()\n\t\t\t ^\ncmd/bd/clean.go:118:15: G304: Potential file inclusion via variable (gosec)\n\tfile, err := os.Open(gitignorePath)\n\t ^\ncmd/bd/doctor/gitignore.go:98:12: G306: Expect WriteFile permissions to be 0600 or less (gosec)\n\tif err := os.WriteFile(gitignorePath, []byte(GitignoreTemplate), 0644); err != nil {\n\t ^\ncmd/bd/merge.go:121:16: G204: Subprocess launched with variable (gosec)\n\t\t\tgitRmCmd := exec.Command(\"git\", \"rm\", \"-f\", \"--quiet\", fullPath)\n\t\t\t ^\ncmd/bd/doctor.go:167:20: `cancelled` is a misspelling of `canceled` (misspell)\n\t\tfmt.Println(\"Fix cancelled.\")\n\t\t ^\ncmd/bd/flush_manager.go:139:42: `cancelling` is a misspelling of `canceling` (misspell)\n\t\t// Send shutdown request FIRST (before cancelling context)\n\t\t ^\ncmd/bd/flush_manager.go:261:15: `cancelled` is a misspelling of `canceled` (misspell)\n\t\t\t// Context cancelled (shouldn't normally happen)\n\t\t\t ^\ncmd/bd/flush_manager.go:269:55: (*FlushManager).performFlush - result 0 (error) is always nil (unparam)\nfunc (fm *FlushManager) performFlush(fullExport bool) error {\n ^\n8 issues:\n* errcheck: 1\n* gosec: 3\n* misspell: 3\n* unparam: 1\n\n```","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-11-21T10:17:25.963791-05:00","updated_at":"2025-11-21T10:25:33.537845-05:00","closed_at":"2025-11-21T10:25:33.53596-05:00"} {"id":"bd-db72","title":"Upgrade local Homebrew installation","description":"Upgrade bd via Homebrew:\n\n```bash\nbrew update\nbrew upgrade bd\n/opt/homebrew/bin/bd version # Verify shows 0.33.2\n```","status":"tombstone","priority":1,"issue_type":"task","created_at":"2025-12-21T16:10:13.760552-08:00","updated_at":"2025-12-21T17:29:31.791368-08:00","deleted_at":"2025-12-21T17:29:31.791368-08:00","deleted_by":"batch delete","delete_reason":"batch delete","original_type":"task"} +{"id":"bd-dcahx","title":"Add 'gt cat \u003cbead-id\u003e' alias to display bead content","description":"## Desire Path\n\n**Tried:** `gt cat bd-pr-sheriff`\n\n**Got:** Error - 'cat' is aliased to 'polecat', which doesn't handle bead IDs\n\n**Expected:** Display the bead's content (title, description, status, etc.) - like `bd show \u003cid\u003e` but via gt\n\n**Why it's a desire path:** Unix users expect `cat` to display content. When working with beads through gt, `gt cat \u003cbead-id\u003e` is the natural command to \"show me this bead.\" It follows the pattern of `cat file.txt` → `gt cat bd-xyz`.\n\n**Workaround:** `bd show \u003cbead-id\u003e --json`\n\n**Suggested implementation:** Add `cat` as a gt subcommand (or alias) that detects bead IDs (bd-*) and calls `bd show`.","status":"open","priority":3,"issue_type":"feature","owner":"steve.yegge@gmail.com","created_at":"2026-01-15T12:10:47.953009-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-15T12:10:57.790157-08:00","labels":["desire-path"]} {"id":"bd-dcd6f14b","title":"Batch test 4","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-29T15:29:02.053523-07:00","updated_at":"2025-10-31T12:00:43.182861-07:00","closed_at":"2025-10-31T12:00:43.182861-07:00"} {"id":"bd-dcu13","title":"Fix: Daemon mode doesn't persist defer_until (GH#993)","description":"dispatched_by: beads/crew/dave\n\nGitHub issue #993. Daemon mode isn't persisting the defer_until value properly.","status":"closed","priority":1,"issue_type":"bug","assignee":"beads/polecats/opal","created_at":"2026-01-09T22:19:57.234366-08:00","created_by":"beads/crew/dave","updated_at":"2026-01-10T16:39:37.680006-08:00","closed_at":"2026-01-10T16:39:37.680006-08:00","close_reason":"Already fixed in current code. The fix was applied in commits 370b9463 (GH#950) and 4486e0e7 (GH#952). The issue was reported because the user's installed binary was outdated. Testing confirms defer_until is correctly persisted in daemon mode with the current codebase."} {"id":"bd-dd3vs","title":"bd sync fails on git status in worktrees","description":"This bug is already fixed in main (commit 3298c45e) but not yet released. \n\nThe installed bd v0.47.0 doesn't have the fix for redirect + sync-branch incompatibility. Building from source fixes the issue.\n\nRoot cause: gitHasUncommittedBeadsChanges() was not properly detecting the redirect and was running git status without the -C flag, causing 'path is outside repository' error.\n\nFix: commit 3298c45e 'fix(sync): handle redirect + sync-branch incompatibility (bd-wayc3)' - adds proper redirect detection and skips sync-branch operations for redirected clones.","status":"closed","priority":2,"issue_type":"bug","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T21:02:51.497002-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-14T21:17:16.938032-08:00","closed_at":"2026-01-14T21:17:16.938034-08:00"} @@ -1191,6 +1202,7 @@ {"id":"bd-dxtc","title":"Test daemon RPC delete handler","description":"Add tests for the daemon-side RPC delete handler that processes delete requests from clients.\n\n## What needs testing\n- Daemon's Delete RPC handler implementation\n- Processing delete requests from RPC clients\n- Cascade deletion at daemon level\n- Force deletion at daemon level\n- Dry-run mode validation\n- Error responses to clients\n- Dependency validation before deletion\n- Tombstone creation via daemon\n\n## Test scenarios\n1. Delete single issue via RPC\n2. Delete multiple issues via RPC\n3. Cascade deletion of dependents\n4. Force delete with orphaned dependents\n5. Dry-run returns what would be deleted without actual deletion\n6. Error: invalid issue IDs\n7. Error: insufficient permissions\n8. Error: dependency blocks deletion (without force/cascade)\n\n## Related\n- Parent epic: bd-kyll\n- Original issue: bd-7z4","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-18T13:08:33.532111042-07:00","updated_at":"2025-12-23T23:48:47.399582-08:00","closed_at":"2025-12-23T23:48:47.399582-08:00","dependencies":[{"issue_id":"bd-dxtc","depends_on_id":"bd-kyll","type":"parent-child","created_at":"2025-12-18T13:08:33.534367367-07:00","created_by":"mhwilkie"}]} {"id":"bd-dywj3","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T22:34:59.667155-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T22:34:59.733536-08:00","closed_at":"2026-01-11T22:34:59.733536-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-dyy","title":"Review PR #513: fix hooks install docs","description":"Review and merge PR #513 from aspiers. This PR fixes incorrect docs for how to install git hooks - updates README to use bd hooks install instead of removed install.sh. Simple 1-line change. URL: https://github.com/anthropics/beads/pull/513","status":"tombstone","priority":2,"issue_type":"task","created_at":"2025-12-13T08:15:14.838772+11:00","updated_at":"2025-12-25T01:21:01.952723-08:00","deleted_at":"2025-12-25T01:21:01.952723-08:00","deleted_by":"batch delete","delete_reason":"batch delete","original_type":"task"} +{"id":"bd-dyyq9","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T22:11:36.400749-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-14T22:11:36.453854-08:00","closed_at":"2026-01-14T22:11:36.453854-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-dzryf","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-13T14:59:05.076458-08:00","created_by":"beads/refinery","updated_at":"2026-01-13T14:59:05.14616-08:00","closed_at":"2026-01-13T14:59:05.14616-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-dzuvc","title":"Digest: mol-refinery-patrol","description":"Empty queue patrol - no branches waiting to merge","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-11T03:40:42.491766-08:00","updated_at":"2026-01-11T03:40:42.491766-08:00","closed_at":"2026-01-11T03:40:42.491714-08:00","close_reason":"Squashed from 11 wisps"} {"id":"bd-e044","title":"Add mermaid output format for bd dep tree","description":"Add visual dependency graph output using Mermaid format for better visualization of issue relationships.\n\nExample usage:\n bd dep tree --format mermaid \u003cissue-id\u003e\n bd dep tree --format mermaid bd-42 \u003e graph.md\n\nThis would output Mermaid syntax that can be rendered in GitHub, documentation sites, or Mermaid live editor.\n\nImplementation notes:\n- Add --format flag to dep tree command\n- Support 'text' (default) and 'mermaid' formats\n- Mermaid graph should show issue IDs, titles, and dependency types\n- Consider using flowchart LR or graph TD syntax","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-11-03T18:10:18.978383-08:00","updated_at":"2025-11-03T20:55:06.696363-08:00","closed_at":"2025-11-03T20:55:06.69637-08:00"} @@ -1264,7 +1276,7 @@ {"id":"bd-eysh","title":"Test refile v2","description":"Testing improved refile","status":"closed","priority":3,"issue_type":"task","created_at":"2025-12-31T13:00:22.994648-08:00","created_by":"beads/crew/grip","updated_at":"2025-12-31T13:00:30.637161-08:00","closed_at":"2025-12-31T13:00:30.637161-08:00","close_reason":"Refiled to gt-w66v4"} {"id":"bd-eyto","title":"Time-dependent tests may be flaky near TTL boundary","description":"Several tombstone merge tests use time.Now() to create test data: time.Now().Add(-24 * time.Hour), time.Now().Add(-60 * 24 * time.Hour), etc. While these work reliably in practice (24h vs 30d TTL has large margin), they could theoretically be flaky if: 1) Tests run slowly, 2) System clock changes during test, 3) TTL constants change. Recommendation: Consider using a fixed reference time or time injection for deterministic tests. Lower priority since current margin is large. Files: internal/merge/merge_test.go:1337-1338, 1352-1353, 1548-1549, 1590-1591","status":"hooked","priority":3,"issue_type":"task","created_at":"2025-12-05T16:37:02.348143-08:00","updated_at":"2025-12-30T15:44:43.36321-08:00"} {"id":"bd-ezpaw","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T21:38:43.191922-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T21:38:43.258402-08:00","closed_at":"2026-01-11T21:38:43.258402-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} -{"id":"bd-ezsnt","title":"Review PR #1091: fix doctor project-level settings detection","description":"dispatched_by: beads/crew/emma\n\nReview and merge PR #1091 from jamesmacaulay.\n\n**PR**: https://github.com/steveyegge/beads/pull/1091\n\n**Summary**: Fix isBeadsPluginInstalled() and hasClaudeHooks() to check project-level settings (.claude/settings.json and .claude/settings.local.json) in addition to user-level settings.\n\n**Easy-win criteria met**: Bug fix with clear reproduction, tests added, follows existing patterns.\n\n**Review checklist**:\n1. Verify tests pass locally\n2. Check code follows existing patterns\n3. Verify the fix addresses the issue described\n4. Approve and merge if everything looks good","status":"hooked","priority":2,"issue_type":"task","assignee":"beads/crew/wolf","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T20:42:14.932433-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-14T20:42:30.962793-08:00"} +{"id":"bd-ezsnt","title":"Review PR #1091: fix doctor project-level settings detection","description":"dispatched_by: beads/crew/emma\n\nReview and merge PR #1091 from jamesmacaulay.\n\n**PR**: https://github.com/steveyegge/beads/pull/1091\n\n**Summary**: Fix isBeadsPluginInstalled() and hasClaudeHooks() to check project-level settings (.claude/settings.json and .claude/settings.local.json) in addition to user-level settings.\n\n**Easy-win criteria met**: Bug fix with clear reproduction, tests added, follows existing patterns.\n\n**Review checklist**:\n1. Verify tests pass locally\n2. Check code follows existing patterns\n3. Verify the fix addresses the issue described\n4. Approve and merge if everything looks good","status":"closed","priority":2,"issue_type":"task","assignee":"beads/crew/wolf","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T20:42:14.932433-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-14T21:49:18.840397-08:00","closed_at":"2026-01-14T21:49:18.840397-08:00","close_reason":"PR #1091 was merged"} {"id":"bd-f0d9bcf2","title":"Batch test 1","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-29T15:29:01.795728-07:00","updated_at":"2025-10-31T12:00:43.184078-07:00","closed_at":"2025-10-31T12:00:43.184078-07:00"} {"id":"bd-f0n","title":"Git history fallback missing timeout - could hang on large repos","description":"## Problem\n\nThe git commands in `checkGitHistoryForDeletions` have no timeout. On large repos with extensive history, `git log --all -S` or `git log --all -G` can take a very long time (minutes).\n\n## Location\n`internal/importer/importer.go:899` and `:930`\n\n## Impact\n- Import could hang indefinitely\n- User has no feedback that git search is running\n- No way to cancel except killing the process\n\n## Fix\nAdd context with timeout to git commands:\n\n```go\nctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)\ndefer cancel()\ncmd := exec.CommandContext(ctx, \"git\", ...)\n```\n\nAlso consider adding a `--since` flag to bound the git history search.","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-25T12:48:24.388639-08:00","updated_at":"2025-11-25T15:04:53.669714-08:00","closed_at":"2025-11-25T15:04:53.669714-08:00"} {"id":"bd-f0pj4","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-12T23:36:14.758388-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-12T23:36:14.823993-08:00","closed_at":"2026-01-12T23:36:14.823993-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} @@ -1338,6 +1350,7 @@ {"id":"bd-fjth5","title":"Refactor: Use types.MaxHierarchyDepth constant for fallback default","description":"The GH#995 fix added fallback defaults in two places:\n\n- internal/storage/sqlite/hash_ids.go:58: `maxDepth = 3 // fallback default`\n- internal/storage/memory/memory.go:1606: `maxDepth = 3 // fallback default`\n\nThese duplicate the value from types.MaxHierarchyDepth (internal/types/id_generator.go:92).\n\nShould reference the constant instead of hardcoding 3 to maintain single source of truth.\n\nLow priority - cosmetic improvement.","status":"open","priority":3,"issue_type":"task","created_at":"2026-01-10T13:36:08.122138-08:00","created_by":"beads/crew/fang","updated_at":"2026-01-10T13:36:08.122138-08:00","labels":["refactor"]} {"id":"bd-fjuf","title":"Work on gt-8tmz.10: Rename Engineer in Box to Shiny. Rena...","description":"Work on gt-8tmz.10: Rename Engineer in Box to Shiny. Rename mol-engineer-in-box references to mol-shiny or just 'shiny'. Update docs and code in internal/formula/ and .beads/formulas/. When done: 1) bd close gt-8tmz.10, 2) bd sync, 3) git push, 4) gt mq submit","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-25T19:26:18.426959-08:00","updated_at":"2025-12-25T19:30:19.947382-08:00","closed_at":"2025-12-25T19:30:19.947382-08:00"} {"id":"bd-fkdw","title":"Update bash-agent example with Agent Mail integration","description":"Add Agent Mail integration to examples/bash-agent/agent.sh using curl for HTTP calls.\n\nAcceptance Criteria:\n- Health check function using curl\n- Reserve issue before claiming\n- Send notifications on status change\n- Release on completion\n- Graceful degradation if curl fails\n- No bash errors when Agent Mail unavailable\n\nFile: examples/bash-agent/agent.sh","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-07T22:42:28.722048-08:00","updated_at":"2025-11-08T01:09:25.900138-08:00","closed_at":"2025-11-08T01:09:25.900138-08:00","dependencies":[{"issue_id":"bd-fkdw","depends_on_id":"bd-m9th","type":"blocks","created_at":"2025-11-07T23:04:01.398259-08:00","created_by":"daemon"}]} +{"id":"bd-fknlg","title":"Digest: mol-refinery-patrol","description":"Patrol complete: MQ empty, no branches to merge","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-15T07:05:23.984571-08:00","updated_at":"2026-01-15T07:05:23.984571-08:00","closed_at":"2026-01-15T07:05:23.984518-08:00","close_reason":"Squashed from 11 wisps","dependencies":[{"issue_id":"bd-fknlg","depends_on_id":"bd-wisp-o70h","type":"parent-child","created_at":"2026-01-15T07:05:23.985668-08:00","created_by":"beads/refinery"}]} {"id":"bd-fkp68","title":"Digest: mol-refinery-patrol","description":"Patrol: queue empty, no work processed","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-10T23:37:26.823421-08:00","updated_at":"2026-01-10T23:37:26.823421-08:00","closed_at":"2026-01-10T23:37:26.823378-08:00","close_reason":"Squashed from 11 wisps"} {"id":"bd-fl9xb","title":"Review PR #960: Fix filepath.Rel sync error","description":"dispatched_by: beads/crew/emma\n\nReview and verify PR #960 (steveyegge/beads)\n\nPR: https://github.com/steveyegge/beads/pull/960\nAuthor: peterkc\nFixes: #959\n\nFixes bd sync failing with filepath.Rel error when dbPath is relative.\n- gh pr view 960 --repo steveyegge/beads\n- gh pr diff 960 --repo steveyegge/beads\n- If good: gh pr merge 960 --repo steveyegge/beads --squash","status":"closed","priority":2,"issue_type":"task","assignee":"beads/crew/giles","created_at":"2026-01-08T14:30:23.843917-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-08T14:37:19.657459-08:00","closed_at":"2026-01-08T14:37:19.657459-08:00","close_reason":"PR #960 reviewed and merged. Fix ensures dbPath is always absolute via CanonicalizePath, preventing filepath.Rel errors in sync-branch mode."} {"id":"bd-fmdy","title":"Merge: bd-kzda","description":"branch: polecat/toast\ntarget: main\nsource_issue: bd-kzda\nrig: beads","status":"closed","priority":3,"issue_type":"merge-request","created_at":"2025-12-23T00:27:28.952413-08:00","updated_at":"2025-12-23T01:33:25.731326-08:00","closed_at":"2025-12-23T01:33:25.731326-08:00"} @@ -1364,6 +1377,7 @@ {"id":"bd-g2ymd","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-13T19:11:27.21259-08:00","created_by":"beads/refinery","updated_at":"2026-01-13T19:11:27.282838-08:00","closed_at":"2026-01-13T19:11:27.282838-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-g3ey","title":"bd sync --import-only doesn't update DB mtime causing bd doctor false warning","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-11-08T15:18:16.761052+01:00","updated_at":"2025-11-08T15:58:37.147425-08:00","closed_at":"2025-11-08T13:12:01.718252-08:00"} {"id":"bd-g4b4","title":"bd close hooks: context check and notifications","description":"Add hook system to bd close for notifications and custom actions.\n\n## Scope (MVP)\n\nImplement **command hooks only** for bd close. Deferred: notify, webhook types.\n\n## Implementation\n\n### 1. Config Schema\n\nAdd to internal/configfile/config.go:\n\n```go\ntype HooksConfig struct {\n OnClose []HookEntry `yaml:\"on_close,omitempty\"`\n}\n\ntype HookEntry struct {\n Command string `yaml:\"command\"` // Shell command to run\n Name string `yaml:\"name,omitempty\"` // Optional display name\n}\n```\n\nAdd `Hooks HooksConfig` field to Config struct.\n\n### 2. Hook Execution\n\nCreate internal/hooks/close_hooks.go:\n\n```go\nfunc RunCloseHooks(ctx context.Context, cfg *configfile.Config, issue *types.Issue) error {\n for _, hook := range cfg.Hooks.OnClose {\n cmd := exec.CommandContext(ctx, \"sh\", \"-c\", hook.Command)\n cmd.Env = append(os.Environ(),\n \"BEAD_ID=\"+issue.ID,\n \"BEAD_TITLE=\"+issue.Title,\n \"BEAD_TYPE=\"+string(issue.IssueType),\n \"BEAD_PRIORITY=\"+strconv.Itoa(issue.Priority),\n \"BEAD_CLOSE_REASON=\"+issue.CloseReason,\n )\n cmd.Stdout = os.Stdout\n cmd.Stderr = os.Stderr\n if err := cmd.Run(); err \\!= nil {\n // Log warning but dont fail the close\n fmt.Fprintf(os.Stderr, \"Warning: close hook %q failed: %v\\n\", hook.Name, err)\n }\n }\n return nil\n}\n```\n\n### 3. Integration Point\n\nIn cmd/bd/close.go, after successful close:\n\n```go\n// Run close hooks\nif cfg := configfile.Load(); cfg \\!= nil {\n hooks.RunCloseHooks(ctx, cfg, closedIssue)\n}\n```\n\n### 4. Example Config\n\n```yaml\n# .beads/config.yaml\nhooks:\n on_close:\n - name: show-next\n command: bd ready --limit 1\n - name: context-check \n command: echo \"Issue $BEAD_ID closed. Check context if nearing limit.\"\n```\n\n## Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| BEAD_ID | Issue ID (e.g., bd-abc1) |\n| BEAD_TITLE | Issue title |\n| BEAD_TYPE | Issue type (task, bug, feature, etc.) |\n| BEAD_PRIORITY | Priority (0-4) |\n| BEAD_CLOSE_REASON | Close reason if provided |\n\n## Testing\n\nAdd test in internal/hooks/close_hooks_test.go:\n- Test hook execution with mock config\n- Test env vars are set correctly\n- Test hook failure doesnt block close\n\n## Files to Create/Modify\n\n1. **Create:** internal/hooks/close_hooks.go\n2. **Create:** internal/hooks/close_hooks_test.go \n3. **Modify:** internal/configfile/config.go (add HooksConfig)\n4. **Modify:** cmd/bd/close.go (call RunCloseHooks)\n5. **Modify:** docs/CONFIG.md (document hooks config)\n\n## Out of Scope (Future)\n\n- notify hook type (gt mail integration)\n- webhook type (HTTP POST)\n- on_create, on_update hooks\n- Hook timeout configuration\n- Parallel hook execution","status":"closed","priority":3,"issue_type":"feature","created_at":"2025-12-22T17:03:56.183461-08:00","updated_at":"2025-12-23T13:38:15.898746-08:00","closed_at":"2025-12-23T13:38:15.898746-08:00","dependencies":[{"issue_id":"bd-g4b4","depends_on_id":"bd-iz5t","type":"parent-child","created_at":"2025-12-23T12:44:07.811793-08:00","created_by":"daemon"}]} +{"id":"bd-g5l1x","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T21:58:19.579083-08:00","created_by":"beads/refinery","updated_at":"2026-01-14T21:58:19.632374-08:00","closed_at":"2026-01-14T21:58:19.632374-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-g5p7","title":"Extract duplicated validation logic from CLI commands","description":"~150 lines of identical validation logic duplicated between cmd_create.go and cmd_update.go\n\nDuplication found:\n- validateBeadFields(): 2 identical copies (50+ lines each) \n- parseTimeWithDefault(): 2 identical copies (30 lines each)\n- Flag definitions: 15+ duplicate registrations\n\nSolution: Extract to shared packages:\n- internal/validation/bead.go - Centralized validation\n- internal/utils/time.go - Consolidate time parsing (already exists)\n- cmd/bd/flags.go - Shared flag registration\n\nImpact: Changes require touching 2+ files; high risk of inconsistency; steep learning curve\n\nEffort: 4-6 hours","status":"closed","priority":0,"issue_type":"task","created_at":"2025-11-16T14:51:10.159953-08:00","updated_at":"2025-11-21T10:01:44.281231-05:00","closed_at":"2025-11-20T20:39:34.426726-05:00"} {"id":"bd-g5q9","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-07T17:31:24.24289-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-07T17:31:24.27373-08:00","closed_at":"2026-01-07T17:31:24.27373-08:00","close_reason":"auto-closed session event"} {"id":"bd-g66dq","title":"beads-metadata sync branch deleted from origin","description":"The beads-metadata remote tracking branch was deleted from origin, causing bd sync to fail. The local worktree at .git/beads-worktrees/beads-metadata/ has uncommitted changes but cannot push because the upstream is gone.\n\nError: git status in worktree shows 'Your branch is based on origin/beads-metadata, but the upstream is gone.'\n\nInvestigation needed:\n- Was beads-metadata intentionally replaced by beads-sync?\n- Should the sync config be updated to use a different branch?\n- The deleted branch was shown during git fetch --prune","status":"closed","priority":1,"issue_type":"bug","owner":"steve.yegge@gmail.com","created_at":"2026-01-13T10:42:47.379061-08:00","created_by":"beads/refinery","updated_at":"2026-01-13T12:50:42.884405-08:00","closed_at":"2026-01-13T12:50:42.884405-08:00","close_reason":"Resolved: beads-metadata branch intentionally deleted and replaced by beads-sync. Worktree cleaned up."} @@ -1501,7 +1515,6 @@ {"id":"bd-i5zq3","title":"Assigned issue","status":"open","priority":1,"issue_type":"task","assignee":"testuser","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T18:16:13.648845-08:00","created_by":"beads/crew/wolf","updated_at":"2026-01-11T18:16:13.648845-08:00"} {"id":"bd-i63qd","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-12T00:24:57.008528-08:00","created_by":"beads/refinery","updated_at":"2026-01-12T00:24:57.078803-08:00","closed_at":"2026-01-12T00:24:57.078803-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-i6fx4","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-10T12:44:57.191053-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-10T12:44:57.245416-08:00","closed_at":"2026-01-10T12:44:57.245416-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} -{"id":"bd-i6jjv","title":"Digest: mol-witness-patrol","description":"Patrol 5: all clear","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T21:01:32.699731-08:00","updated_at":"2026-01-14T21:01:32.699731-08:00","closed_at":"2026-01-14T21:01:32.699687-08:00","close_reason":"Squashed from 10 wisps"} {"id":"bd-i6lc4","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T21:09:12.693523-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T21:09:12.761759-08:00","closed_at":"2026-01-11T21:09:12.761759-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-i7a6","title":"Test actor flag","status":"closed","priority":4,"issue_type":"task","created_at":"2025-12-26T20:47:28.470006-08:00","updated_at":"2025-12-28T09:26:06.084894-08:00","closed_at":"2025-12-28T09:26:06.084894-08:00"} {"id":"bd-i8zab","title":"Batch wisp deletion in deleteSessionCostWisps","description":"## Problem\n\n`deleteSessionCostWisps()` (internal/cmd/costs.go:1188) burns wisps one at a time in a loop. This creates O(n) subprocess calls for deletion.\n\n## Location\n\ninternal/cmd/costs.go:1143-1191\n\n## Solution\n\nCheck if `bd mol burn` supports multiple IDs. If so, collect IDs and burn in one call.\nIf not, consider adding batch support to bd.","status":"closed","priority":3,"issue_type":"task","assignee":"beads/polecats/quartz","created_at":"2026-01-08T22:55:15.514066-08:00","created_by":"mayor","updated_at":"2026-01-09T00:25:53.94924-08:00","closed_at":"2026-01-09T00:25:53.94924-08:00","close_reason":"Implemented batch wisp deletion in bd mol burn and updated deleteSessionCostWisps to use it"} @@ -1556,6 +1569,7 @@ {"id":"bd-iybw9","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-13T16:19:23.149493-08:00","created_by":"beads/refinery","updated_at":"2026-01-13T16:19:23.224338-08:00","closed_at":"2026-01-13T16:19:23.224338-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-iye7","title":"Add path normalization to getMultiRepoJSONLPaths()","description":"From bd-xo6b code review: getMultiRepoJSONLPaths() does not handle non-standard paths correctly.\n\nProblems:\n- No tilde expansion: ~/repos/foo treated as literal path\n- No absolute path conversion: ../other-repo breaks if working directory changes\n- No duplicate detection: If Primary=. and Additional=[.], same JSONL processed twice\n- No empty string handling: Empty paths create invalid /.beads/issues.jsonl\n\nImpact:\nConfig with tilde or relative paths will fail\n\nFix needed:\n1. Use filepath.Abs() for all paths\n2. Add tilde expansion via os.UserHomeDir()\n3. Deduplicate paths (use map to track seen paths)\n4. Filter out empty strings\n5. Validate paths exist and are readable\n\nFiles:\n- cmd/bd/deletion_tracking.go:333-358 (getMultiRepoJSONLPaths function)","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-11-06T19:31:51.882743-08:00","updated_at":"2025-11-06T19:35:41.246311-08:00","closed_at":"2025-11-06T19:35:41.246311-08:00","dependencies":[{"issue_id":"bd-iye7","depends_on_id":"bd-xo6b","type":"discovered-from","created_at":"2025-11-06T19:32:12.267906-08:00","created_by":"daemon"}]} {"id":"bd-iz5t","title":"Swarm: 13 beads backlog issues for polecat execution","description":"## Swarm Overview\n\n13 issues prepared for parallel polecat execution. All issues have been enhanced with concrete implementation guidance, file lists, and success criteria.\n\n## Issue List\n\n### Bug (1) - HIGH PRIORITY\n| ID | Priority | Title |\n|----|----------|-------|\n| bd-phtv | P1 | Pinned field overwritten by subsequent commands |\n\n### Test Coverage (3)\n| ID | Package | Target |\n|----|---------|--------|\n| bd-io8c | internal/syncbranch | 27% → 70% |\n| bd-thgk | internal/compact | 17% → 70% |\n| bd-tvu3 | internal/beads | 48% → 70% |\n\n### Code Quality (3)\n| ID | Task |\n|----|------|\n| bd-qioh | FatalError pattern standardization |\n| bd-rgyd | Split queries.go (1704 lines → 5 files) |\n| bd-u2sc.3 | Split cmd/bd files (sync/init/show/compact) |\n\n### Features (4)\n| ID | Task |\n|----|------|\n| bd-au0.5 | Search date/priority filters |\n| bd-ykd9 | Doctor --fix auto-repair |\n| bd-g4b4 | Close hooks system |\n| bd-likt | Gate daemon RPC |\n\n### Polish (2)\n| ID | Task |\n|----|------|\n| bd-4qfb | Doctor output formatting |\n| bd-u2sc.4 | slog structured logging |\n\n## Issue Details\n\nAll issues have been enhanced with:\n- Concrete file lists to modify\n- Code snippets and patterns\n- Success criteria\n- Test commands\n\nRun `bd show \u003cid\u003e` for full details on any issue.\n\n## Execution Notes\n\n- All issues are independent (no blockers between them)\n- bd-phtv (P1 bug) should get priority - affects bd pin functionality\n- Test coverage tasks are straightforward but time-consuming\n- File split tasks (bd-rgyd, bd-u2sc.3) are mechanical but important\n\n## Completed During Prep\n\n- bd-ucgz (P2 bug) - Fixed inline: external deps orphan check (commit f2db0a1d)\n- Moved 5 gastown issues out of beads backlog (gt-dh65, gt-ng6g, gt-fqcz, gt-gswn, gt-rw2z)\n- Deferred 4 premature/post-1.0 issues\n- Closed bd-udsi epic (core implementation complete)","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-12-23T12:43:58.427835-08:00","updated_at":"2025-12-23T20:26:50.629471-08:00","closed_at":"2025-12-23T20:26:50.629471-08:00"} +{"id":"bd-j0hfd","title":"Digest: mol-refinery-patrol","description":"Patrol: queue empty, 0 branches merged, standing by","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T23:25:34.2923-08:00","updated_at":"2026-01-14T23:25:34.2923-08:00","closed_at":"2026-01-14T23:25:34.292243-08:00","close_reason":"Squashed from 11 wisps","dependencies":[{"issue_id":"bd-j0hfd","depends_on_id":"bd-wisp-cjtp","type":"parent-child","created_at":"2026-01-14T23:25:34.293404-08:00","created_by":"beads/refinery"}]} {"id":"bd-j0tr","title":"Phase 1.3: Basic TOON read/write operations","description":"Add basic TOON read/write operations to bdt executable. Implement create, list, and show commands that use the internal/toon package for encoding/decoding to TOON format.\n\n## Subtasks\n1. Implement bdt create command - Create issues and serialize to TOON format\n2. Implement bdt list command - Read issues.toon and display all issues\n3. Implement bdt show command - Display single issue by ID\n4. Add file I/O operations for issues.toon\n5. Integrate internal/toon package (EncodeTOON, DecodeJSON)\n6. Write tests for create, list, show operations\n\n## Files to Create/Modify\n- cmd/bdt/create.go - Create command\n- cmd/bdt/list.go - List command \n- cmd/bdt/show.go - Show command\n- cmd/bdt/storage.go - File I/O helper\n\n## Success Criteria\n- bdt create \"Issue title\" creates and saves to issues.toon\n- bdt list displays all issues in human-readable format\n- bdt list --json shows JSON output\n- bdt show \u003cid\u003e displays single issue\n- Issues round-trip correctly: create → list → show\n- All tests passing with \u003e80% coverage","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-19T12:59:54.270296918-07:00","updated_at":"2025-12-19T13:09:00.196045685-07:00","closed_at":"2025-12-19T13:09:00.196045685-07:00"} {"id":"bd-j0wik","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T20:45:58.568977-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-14T20:45:58.643876-08:00","closed_at":"2026-01-14T20:45:58.643876-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-j2dvn","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T05:24:31.461566-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T05:24:31.522918-08:00","closed_at":"2026-01-11T05:24:31.522918-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} @@ -1654,6 +1668,7 @@ {"id":"bd-kuul2","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T20:46:59.969883-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-14T20:47:00.021198-08:00","closed_at":"2026-01-14T20:47:00.021198-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-kvus","title":"bd sync fails when .beads/redirect points to different repo","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-12-31T11:36:35.614607-08:00","created_by":"gastown/crew/max","updated_at":"2025-12-31T13:31:39.491734-08:00","closed_at":"2025-12-31T13:31:39.491734-08:00","close_reason":"Duplicate of bd-e2q9 (fixed in same commit)","comments":[{"id":8,"issue_id":"bd-kvus","author":"gastown/crew/max","text":"## Problem\n\nWhen `.beads/redirect` points to a different repository (e.g., `../../mayor/rig/.beads`), `bd sync` fails with:\n\n```\nError: committing to sync branch: failed to check for changes in worktree: git status failed in worktree: exit status 128\n```\n\n## Root Cause\n\n`bd sync` uses `getBeadsWorktreePath()` which calculates the worktree path based on the **source** repo's `.git` directory, not the **target** repo after following the redirect.\n\nFor example:\n- Running from: `/gastown/crew/max` \n- Redirect points to: `../../mayor/rig/.beads`\n- bd looks for worktree at: `/gastown/crew/max/.git/beads-worktrees/beads-sync` (wrong)\n- Should look at: `/gastown/mayor/rig/.git/beads-worktrees/beads-sync` (correct)\n\n## Reproduction\n\n```bash\n# From a clone with redirect\ncd /Users/stevey/gt/gastown/crew/max\ncat .beads/redirect # Shows ../../mayor/rig/.beads\nbd sync # Fails with exit status 128\n\n# Workaround: run from redirect target\ncd /Users/stevey/gt/gastown/mayor/rig\nbd sync # Works\n```\n\n## Fix\n\nIn `internal/syncbranch/worktree.go`, `getBeadsWorktreePath()` should resolve the redirect first and use the target repo's git directory for worktree operations.","created_at":"2025-12-31T19:36:51Z"}]} {"id":"bd-kvwf","title":"Merge: quartz-1767142008267","description":"branch: polecat/quartz-1767142008267\ntarget: main\nsource_issue: quartz-1767142008267\nrig: beads","status":"closed","priority":2,"issue_type":"merge-request","created_at":"2025-12-30T16:50:35.727954-08:00","created_by":"beads/polecats/quartz","updated_at":"2025-12-30T18:12:30.969887-08:00","closed_at":"2025-12-30T18:11:07.891839-08:00"} +{"id":"bd-kwin2","title":"Digest: mol-refinery-patrol","description":"Patrol cycle: MQ empty, no branches to merge","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T23:07:06.900887-08:00","updated_at":"2026-01-14T23:07:06.900887-08:00","closed_at":"2026-01-14T23:07:06.900822-08:00","close_reason":"Squashed from 11 wisps","dependencies":[{"issue_id":"bd-kwin2","depends_on_id":"bd-wisp-uw1x","type":"parent-child","created_at":"2026-01-14T23:07:06.902008-08:00","created_by":"beads/refinery"}]} {"id":"bd-kwjh","title":"Wisp storage: ephemeral molecule tracking","description":"Implement ephemeral molecule storage for patrol cycles.\n\n## Architecture\n\nWisps are ephemeral molecules stored in `.beads-wisps/` (gitignored).\nWhen squashed, they create digests in permanent `.beads/`.\n\n**Storage is per-rig, not per-role**: Witness and Refinery share mayor/rig's \n`.beads-wisps/` since they execute from that context.\n\n## Design Doc\nSee: gastown/mayor/rig/docs/wisp-architecture.md\n\n## Key Requirements\n\n1. **Ephemeral storage**: `.beads-wisps/` directory, gitignored\n2. **Bond with --wisp**: Creates in wisps instead of permanent\n3. **Squash**: Deletes wisp, creates digest in permanent beads\n4. **Burn**: Deletes wisp, no digest\n5. **Wisp commands**: `bd wisp list`, `bd wisp gc`\n\n## Storage Locations\n\n| Context | Location |\n|---------|----------|\n| Rig (Deacon, Witness, Refinery) | mayor/rig/.beads-wisps/ |\n| Polecat (if used) | polecats/\u003cname\u003e/.beads-wisps/ |\n\n## Children (to be created)\n- bd mol bond --wisp flag\n- .beads-wisps/ storage backend\n- bd mol squash handles wisp to permanent\n- bd wisp list command\n- bd wisp gc command (orphan cleanup)","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-12-21T23:34:47.188806-08:00","updated_at":"2025-12-22T01:12:53.965768-08:00","closed_at":"2025-12-22T01:12:53.965768-08:00"} {"id":"bd-kwjh.1","title":".beads-ephemeral/ storage backend","description":"Implement ephemeral storage layer for wisps.\n\n## Requirements\n- New storage location: .beads-ephemeral/issues.jsonl (sibling to .beads/)\n- Gitignored by default (add to .beads/.gitignore)\n- Same JSONL format as regular beads\n- Config option: ephemeral.directory (relative path)\n- ephemeral.enabled config flag\n\n## Storage Behavior\n- Ephemeral issues have `ephemeral: true` field\n- No sync to remote (local only)\n- No daemon tracking needed (transient)\n\n## Implementation\n- Add EphemeralStore in storage package\n- Initialize on demand when --ephemeral flag used\n- Share Issue struct, just different storage path","status":"tombstone","priority":1,"issue_type":"task","created_at":"2025-12-22T00:06:46.706026-08:00","updated_at":"2025-12-22T00:08:26.009875-08:00","dependencies":[{"issue_id":"bd-kwjh.1","depends_on_id":"bd-kwjh","type":"parent-child","created_at":"2025-12-22T00:06:46.706461-08:00","created_by":"daemon"}],"deleted_at":"2025-12-22T00:08:26.009875-08:00","deleted_by":"daemon","delete_reason":"delete","original_type":"task"} {"id":"bd-kwjh.2","title":".beads-ephemeral/ storage backend","description":"Implement ephemeral storage layer for wisps.\n\n## Requirements\n- New storage location: .beads-ephemeral/issues.jsonl (sibling to .beads/)\n- Gitignored by default (add to .beads/.gitignore)\n- Same JSONL format as regular beads\n- Config option: ephemeral.directory (relative path)\n- ephemeral.enabled config flag\n\n## Storage Behavior\n- Ephemeral issues have ephemeral: true field\n- No sync to remote (local only)\n- No daemon tracking needed (transient)\n\n## Implementation\n- Add EphemeralStore in storage package\n- Initialize on demand when --ephemeral flag used\n- Share Issue struct, just different storage path","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-22T00:06:56.248345-08:00","updated_at":"2025-12-22T00:13:51.281427-08:00","closed_at":"2025-12-22T00:13:51.281427-08:00","dependencies":[{"issue_id":"bd-kwjh.2","depends_on_id":"bd-kwjh","type":"parent-child","created_at":"2025-12-22T00:06:56.248725-08:00","created_by":"daemon"}]} @@ -1924,6 +1939,7 @@ {"id":"bd-njs96","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T09:09:29.792196-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T09:09:29.852959-08:00","closed_at":"2026-01-11T09:09:29.852959-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-nkqx","title":"bd swarm validate command","description":"Add bd swarm validate to check epic structure for swarming.\n\n## Context\nBefore running a swarm, we need to validate the epic structure:\n- Are dependencies correct (not inverted)?\n- Are there orphaned issues?\n- Is the DAG well-formed?\n\nThe Ready Front model (not phases!) means dependencies define execution order.\nCommon mistake: 'Phase 1 before Phase 2' → inverted deps.\nCorrect thinking: 'Phase 2 needs Phase 1' → bd dep add phase2 phase1\n\n## Implementation\n1. New command: bd swarm validate \u003cepic-id\u003e\n2. Walk the dependency DAG from epic children\n3. Detect issues:\n - Root issues with no dependents (orphans?)\n - Leaf issues depending on nothing (missing deps?)\n - Cycles (impossible)\n - Disconnected subgraphs\n4. Report:\n - Ready fronts (waves of parallel work)\n - Estimated worker-sessions\n - Max parallelism\n - Warnings for potential issues\n\n## Reference\n~/gt/docs/swarm-architecture.md - 'The Ready Front Model' section\n\n## Acceptance\n- bd swarm validate \u003cepic\u003e runs\n- Reports ready fronts accurately\n- Warns about structural issues\n- Returns success/failure exit code","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-28T19:11:08.788203-08:00","created_by":"mayor","updated_at":"2025-12-28T19:34:57.218009-08:00","closed_at":"2025-12-28T19:34:57.218009-08:00"} {"id":"bd-nl2","title":"No logging/debugging for tombstone resurrection events","description":"Per the design document bd-zvg Open Question 1: Should resurrection log a warning? Recommendation was Yes. Currently, when an expired tombstone loses to a live issue (resurrection), there is no logging or debugging output. This makes it hard to understand why an issue reappeared. Recommendation: Add optional debug logging when resurrection occurs, e.g., Issue bd-abc resurrected (tombstone expired). Files: internal/merge/merge.go:359-366, 371-378, 400-405, 410-415","status":"closed","priority":4,"issue_type":"feature","created_at":"2025-12-05T16:36:52.27525-08:00","updated_at":"2025-12-30T18:12:30.964926-08:00","closed_at":"2025-12-30T15:57:06.707152-08:00","close_reason":"Implemented debug logging for tombstone resurrection events. Added debug parameter to Merge3WayWithTTL and all 4 resurrection code paths now log 'Issue \u003cid\u003e resurrected (tombstone expired)' when debug mode is enabled."} +{"id":"bd-nl45j","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T21:59:40.79136-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-14T21:59:40.840157-08:00","closed_at":"2026-01-14T21:59:40.840157-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-nl8z","title":"Documentation","description":"Complete documentation for Agent Mail integration to enable adoption.","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-11-07T22:42:37.969636-08:00","updated_at":"2025-11-08T03:09:48.253476-08:00","closed_at":"2025-11-08T02:34:57.887891-08:00","dependencies":[{"issue_id":"bd-nl8z","depends_on_id":"bd-wfmw","type":"blocks","created_at":"2025-11-07T22:42:37.970621-08:00","created_by":"daemon"}]} {"id":"bd-nlcp","title":"bd doctor: check redirect files for worktree clones","description":"When running in a worktree/clone that should have a redirect (e.g., crew/george, polecats/*), bd doctor should verify:\n\n1. The redirect file exists\n2. The redirect target is valid and accessible\n3. The target has a working beads.db\n\nThis helps catch setup issues when cloning to a new machine where `gt crew add` might not have created the redirect properly.\n\nExample checks:\n- If cwd contains /crew/ or /polecats/, expect a redirect file\n- Warn if redirect is missing: 'Missing redirect - run gt crew add or create .beads/redirect'\n- Warn if redirect target doesn't exist or has no DB","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-01-07T01:10:23.242392-08:00","created_by":"gastown/crew/george","updated_at":"2026-01-07T01:11:21.829012-08:00","closed_at":"2026-01-07T01:11:21.829012-08:00","close_reason":"Refiled as gastown issue - gt doctor, not bd doctor"} {"id":"bd-nlzv","title":"bd show --short flag for compact output","description":"## Request\nAdd a `--short` flag to `bd show` for compact, one-line output per issue.\n\n## Use Case\nWhen checking multiple issues quickly:\n```bash\nbd show bd-nkqx --short \u0026\u0026 bd show bd-oxgi --short\n```\n\nCurrently fails with \"unknown flag: --short\"\n\n## Expected Output\nSomething like:\n```\nbd-nkqx [closed] P1 task: Validate swarm schema design\nbd-oxgi [closed] P1 task: Add mol_type schema field to beads\n```\n\n## Format Suggestion\n`\u003cid\u003e [\u003cstatus\u003e] \u003cpriority\u003e \u003ctype\u003e: \u003ctitle\u003e`\n\nOptional: include blocker count if any, e.g. `(blocked by 2)`","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-12-28T21:26:18.955592-08:00","created_by":"mayor","updated_at":"2025-12-28T21:35:06.006865-08:00","closed_at":"2025-12-28T21:35:06.006865-08:00"} @@ -1944,7 +1960,7 @@ {"id":"bd-nurq","title":"Implement bd mol current command","description":"Show what molecule the agent should currently be working on. Referenced by gt-um6q, gt-lz13. Needed for molecule navigation workflow in templates.","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-12-23T00:17:54.069983-08:00","updated_at":"2025-12-23T01:23:59.523404-08:00","closed_at":"2025-12-23T01:23:59.523404-08:00"} {"id":"bd-nv1z","title":"Fix PR→MR terminology in internal workflow docs","description":"Polecats create MRs (merge requests), not PRs. Fix these references:\n\n- docs/reference.md:326 - 'review PRs' → 'review MRs'\n- docs/INSTALLING.md:187 - 'PR review' → 'MR review'\n\nPRs are external GitHub concept. MRs are internal Gas Town workflow.","status":"closed","priority":1,"issue_type":"bug","created_at":"2026-01-04T22:13:03.636757-08:00","created_by":"mayor","updated_at":"2026-01-04T22:13:13.932166-08:00","closed_at":"2026-01-04T22:13:13.932166-08:00","close_reason":"Wrong rig - recreating in gastown"} {"id":"bd-nv4g","title":"Add pre-sync validation hook","description":"Future: Hook integration to run bd lint before sync, respecting config settings.","status":"closed","priority":4,"issue_type":"task","created_at":"2026-01-01T11:19:11.00402-08:00","created_by":"beads/crew/grip","updated_at":"2026-01-02T00:04:24.394347-08:00","closed_at":"2026-01-02T00:04:24.394347-08:00","close_reason":"Pre-sync validation hook already implemented; added comprehensive tests","dependencies":[{"issue_id":"bd-nv4g","depends_on_id":"bd-ou35","type":"parent-child","created_at":"2026-01-01T11:19:22.791249-08:00","created_by":"beads/crew/grip"},{"issue_id":"bd-nv4g","depends_on_id":"bd-t7jq","type":"blocks","created_at":"2026-01-01T11:19:24.008812-08:00","created_by":"beads/crew/grip"}]} -{"id":"bd-nvo29","title":"Digest: mol-refinery-patrol","description":"Patrol complete: MQ empty, no merges needed","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-13T19:08:26.226382-08:00","updated_at":"2026-01-13T19:08:26.226382-08:00","closed_at":"2026-01-13T19:08:26.22632-08:00","close_reason":"Squashed from 11 wisps","dependencies":[{"issue_id":"bd-nvo29","depends_on_id":"bd-wisp-49c","type":"parent-child","created_at":"2026-01-13T19:08:26.227421-08:00","created_by":"beads/refinery"}]} +{"id":"bd-nvo29","title":"Digest: mol-refinery-patrol","description":"Patrol complete: MQ empty, no merges needed","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-13T19:08:26.226382-08:00","updated_at":"2026-01-13T19:08:26.226382-08:00","closed_at":"2026-01-13T19:08:26.22632-08:00","close_reason":"Squashed from 11 wisps"} {"id":"bd-nyeic","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-12T18:17:08.48375-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-12T18:17:08.530051-08:00","closed_at":"2026-01-12T18:17:08.530051-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-nyfs","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-07T17:36:53.212509-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-07T17:36:53.246778-08:00","closed_at":"2026-01-07T17:36:53.246778-08:00","close_reason":"auto-closed session event"} {"id":"bd-nzafo","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-08T17:53:00.803689-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-08T17:53:00.840604-08:00","closed_at":"2026-01-08T17:53:00.840604-08:00","close_reason":"auto-closed session event"} @@ -1994,7 +2010,6 @@ {"id":"bd-otli","title":"Wait for CI to pass","description":"Monitor GitHub Actions - all checks must pass before release artifacts are built","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-19T22:56:03.022281-08:00","updated_at":"2025-12-20T00:49:51.928591-08:00","closed_at":"2025-12-20T00:25:52.635223-08:00","dependencies":[{"issue_id":"bd-otli","depends_on_id":"bd-6s61","type":"parent-child","created_at":"2025-12-19T22:56:15.097564-08:00","created_by":"daemon"},{"issue_id":"bd-otli","depends_on_id":"bd-7tuu","type":"blocks","created_at":"2025-12-19T22:56:23.360436-08:00","created_by":"daemon"}]} {"id":"bd-otyh","title":"Agent bead prefix mismatch: gt- vs bd- for beads polecat agents","description":"When spawning polecats in beads rig, gt sling tries to create agent beads with gt-beads-polecat-* prefix, but beads requires bd- prefix. Warning: 'issue ID gt-beads-polecat-obsidian does not match configured prefix bd'. Agent beads should use the rig's configured prefix.","status":"closed","priority":3,"issue_type":"bug","created_at":"2025-12-30T00:13:42.570237-08:00","created_by":"mayor","updated_at":"2025-12-30T18:12:30.982503-08:00","closed_at":"2025-12-30T16:57:00.673794-08:00","close_reason":"Fixed in gastown commit 05b1f30. Agent beads now use the rig's configured prefix from routes.jsonl instead of hardcoding 'gt-'. Modified polecat/manager.go and prime.go to look up the correct prefix."} {"id":"bd-ou35","title":"Opt-in template validation for issues","description":"## Summary\n\nAdd optional validation that issues include required sections based on type, without making it mandatory by default.\n\n## Background\n\nGH#821 proposed mandatory template validation, but that's too draconian for quick capture workflows. Instead, provide opt-in validation through multiple mechanisms.\n\n## Design\n\n### 1. `bd lint` command\n\nCheck issues for missing recommended sections:\n\n```bash\nbd lint # Lint all open issues\nbd lint bd-xxx # Lint specific issue\nbd lint --fix # Interactive: prompt to add missing sections\n```\n\nOutput:\n```\nbd-abc [bug]: Missing \"## Steps to Reproduce\"\nbd-def [task]: Missing \"## Acceptance Criteria\"\n\n2 issues with warnings\n```\n\n### 2. `--validate` flag on `bd create`\n\nOpt-in strict mode at creation time:\n\n```bash\nbd create -t bug --validate -d \"...\" # Fails if missing required sections\nbd create -t bug -d \"...\" # Succeeds (current behavior)\n```\n\n### 3. Section requirements by type\n\n| Type | Recommended Sections |\n|------|---------------------|\n| Bug | Steps to Reproduce, Acceptance Criteria |\n| Task/Feature | Acceptance Criteria |\n| Epic | Success Criteria |\n| Chore/Message | None |\n\nNote: \"Workaround\" dropped from GH#821 - not always applicable.\n\n### 4. Config option (future)\n\n```json\n// .beads/config.json\n{\n \"validation\": {\n \"on_create\": \"warn\" | \"error\" | \"none\",\n \"on_sync\": \"warn\" | \"error\" | \"none\"\n }\n}\n```\n\n### 5. Hook integration (future)\n\nPre-sync hook could run `bd lint` and warn/block based on config.\n\n## Implementation Order\n\n1. Add `RequiredSections()` to IssueType (internal/types)\n2. Add `ValidateTemplate()` function (internal/validation)\n3. Implement `bd lint` command\n4. Add `--validate` flag to `bd create`\n5. (Future) Config file support\n6. (Future) Hook integration\n\n## Acceptance Criteria\n\n- [ ] `bd lint` reports missing sections without blocking\n- [ ] `bd lint \u003cid\u003e` works on single issue\n- [ ] `bd create --validate` enforces sections\n- [ ] `bd create` without flag works as today\n- [ ] Clear, actionable error messages\n\n## References\n\n- GH#821: Original proposal (will close referencing this epic)","status":"closed","priority":3,"issue_type":"epic","created_at":"2026-01-01T11:18:04.828755-08:00","created_by":"beads/crew/grip","updated_at":"2026-01-04T15:22:08.707597-08:00","closed_at":"2026-01-01T19:25:09.99215-08:00","close_reason":"All P3 acceptance criteria complete. P4 items (config, hooks) are future work."} -{"id":"bd-ouaee","title":"Digest: mol-refinery-patrol","description":"Patrol cycle: merge queue empty, no branches processed","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-13T20:21:19.085494-08:00","updated_at":"2026-01-13T20:21:19.085494-08:00","closed_at":"2026-01-13T20:21:19.085452-08:00","close_reason":"Squashed from 11 wisps","dependencies":[{"issue_id":"bd-ouaee","depends_on_id":"bd-wisp-e99","type":"parent-child","created_at":"2026-01-13T20:21:19.086504-08:00","created_by":"beads/refinery"}]} {"id":"bd-ov1","title":"Doctor: exclude merge artifacts from 'multiple JSONL' warning","description":"## Problem\n`bd doctor` warns about 'Multiple JSONL files found' when merge artifact files exist:\n```\nJSONL Files: Multiple JSONL files found: beads.base.jsonl, beads.left.jsonl, issues.jsonl ⚠\n```\n\nThis is confusing because these aren't real issue JSONL files - they're temporary snapshots for deletion tracking.\n\n## Fix\nExclude known merge artifact patterns from the multiple-JSONL warning:\n\n```go\n// In doctor JSONL check\nskipPatterns := map[string]bool{\n \"beads.base.jsonl\": true,\n \"beads.left.jsonl\": true, \n \"beads.right.jsonl\": true,\n}\n```\n\n## Files\n- cmd/bd/doctor/ (JSONL check logic)","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-11-28T17:06:26.266097-08:00","updated_at":"2025-12-02T17:11:19.747094858-05:00","closed_at":"2025-11-28T21:52:13.632029-08:00"} {"id":"bd-ov1u","title":"Clean repo cruft: bd_new, @AGENTS.md, state.json","description":"Remove tracked cruft:\n- git rm bd_new (31MB old binary)\n- git rm @AGENTS.md (duplicate, was 'removed' but still tracked)\n- Add state.json to .gitignore, git rm --cached state.json\n- Consider moving history/EPHEMERAL_MOLECULES_DESIGN.md to docs/ or removing","status":"closed","priority":2,"issue_type":"chore","assignee":"beads/polecats/obsidian","created_at":"2026-01-01T11:09:49.833027-08:00","created_by":"mayor","updated_at":"2026-01-01T11:12:22.320022-08:00","closed_at":"2026-01-01T11:12:22.320022-08:00","close_reason":"Removed bd_new (31MB) and @AGENTS.md. state.json already gitignored, history/EPHEMERAL_MOLECULES_DESIGN.md did not exist."} {"id":"bd-ovfoz","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-08T20:12:32.02034-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-08T20:12:32.055007-08:00","closed_at":"2026-01-08T20:12:32.055007-08:00","close_reason":"auto-closed session event"} @@ -2021,7 +2036,9 @@ {"id":"bd-p76kv","title":"bd list can hang indefinitely due to missing timeouts","description":"dispatched_by: gastown/crew/max\n\n## Problem\n\nWhen `bd list` hangs, it can block forever due to missing timeouts at multiple layers:\n\n### 1. No timeout in gastown's `runBdCommand` \n**File:** `internal/mail/bd.go:42-54`\n```go\ncmd := exec.Command(\"bd\", args...)\nif err := cmd.Run(); err != nil { // Waits forever!\n```\nIf `bd` hangs for any reason, gt commands hang forever.\n\n### 2. No timeout in RPC request processing (beads daemon)\n**File:** `internal/rpc/server_routing_validation_diagnostics.go:262-264`\n```go\nfunc (s *Server) reqCtx(_ *Request) context.Context {\n return context.Background() // No deadline!\n}\n```\nIf a database query hangs, the RPC handler hangs forever.\n\n### 3. Mutex starvation potential\n`SearchIssues` takes a read lock on `reconnectMu`, while `reconnect()` takes a write lock. With Go's RWMutex, if there's a steady stream of readers, the writer can starve indefinitely.\n\n## Evidence\n\nObserved stuck processes running for 13+ hours:\n```\nbd list --type message --label cc:mayor/ --status open --json\nbd list --type message --label cc:mayor --status open --json\n```\n\nThe SQLite `busy_timeout` (30s) should have caused failures, not hangs. The processes were likely stuck on the Go `reconnectMu` mutex or a blocked daemon.\n\n## Proposed Fixes\n\n1. **Add timeout to daemon request processing** - Use `context.WithTimeout` in `reqCtx()` (e.g., 60 seconds)\n2. **Consider request timeout propagation** from client to server\n3. **Review reconnectMu usage** for potential starvation scenarios\n\nNote: The gastown side (`runBdCommand`) also needs a fix, but that's a separate repo.","status":"closed","priority":2,"issue_type":"bug","assignee":"beads/crew/dave","created_at":"2026-01-10T11:56:34.750531-08:00","created_by":"gastown/crew/max","updated_at":"2026-01-10T23:44:36.578483-08:00","closed_at":"2026-01-10T23:44:36.578483-08:00","close_reason":"Fixed in commit 69dae103. reqCtx() now applies requestTimeout (30s default) to context, preventing indefinite hangs."} {"id":"bd-p7i2","title":"Add unit test for gitHasUncommittedBeadsChanges()","description":"The new helper function from bd-vd8e needs unit tests in sync_git_test.go to verify:\n- Returns false when no changes\n- Returns true for M (modified)\n- Returns true for A (added)\n- Returns false for ?? (untracked)\n- Returns false for D (deleted)\n\nPart of GH#885 follow-up.","status":"closed","priority":2,"issue_type":"task","assignee":"beads/polecats/ruby","created_at":"2026-01-04T16:15:53.96425-08:00","created_by":"beads/crew/fang","updated_at":"2026-01-04T16:20:40.004117-08:00","closed_at":"2026-01-04T16:20:40.004117-08:00","close_reason":"Added parseGitStatusForBeadsChanges helper function and 14 unit tests covering: empty status, modified (staged/unstaged/both), added, untracked, deleted, renamed, copied, and edge cases"} {"id":"bd-p98lw","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T22:38:37.50559-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T22:38:37.571613-08:00","closed_at":"2026-01-11T22:38:37.571613-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} +{"id":"bd-pag09","title":"Session ended: gt-beads-beads/witness","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T21:43:13.800342-08:00","created_by":"beads/witness","updated_at":"2026-01-14T21:43:13.883269-08:00","closed_at":"2026-01-14T21:43:13.883269-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-par1","title":"doctor: improve messaging for detection-only hook managers","description":"When bd doctor detects hook managers we can't fully check (pre-commit, overcommit, yorkie, simple-git-hooks), the current warning suggests they're broken. Change to informational: 'pre-commit detected, cannot verify bd integration' rather than implying misconfiguration.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-05T19:19:08.98544-08:00","created_by":"beads/crew/giles","updated_at":"2026-01-05T21:06:05.953116-08:00","closed_at":"2026-01-05T21:06:05.953116-08:00","close_reason":"Implemented - detection-only managers now show informational message"} +{"id":"bd-pb9j8","title":"Digest: mol-witness-patrol","description":"Patrol 8: all clear, gt mail killed","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T21:52:45.032091-08:00","updated_at":"2026-01-14T21:52:45.032091-08:00","closed_at":"2026-01-14T21:52:45.032031-08:00","close_reason":"Squashed from 10 wisps","dependencies":[{"issue_id":"bd-pb9j8","depends_on_id":"bd-wisp-4bnj","type":"parent-child","created_at":"2026-01-14T21:52:45.033269-08:00","created_by":"beads/witness"}]} {"id":"bd-pbcie","title":"Review and merge PR #1037: Ensure daemon lock dir exists (fixes crash)","description":"dispatched_by: beads/crew/emma","status":"closed","priority":1,"issue_type":"bug","assignee":"beads/crew/dave","owner":"steve.yegge@gmail.com","created_at":"2026-01-12T16:35:31.644672-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-12T16:38:47.39244-08:00","closed_at":"2026-01-12T16:38:47.39244-08:00","close_reason":"PR #1037 already merged. Fix ensures daemon lock directory exists before creating lock file, preventing stack overflow on deep workspace paths."} {"id":"bd-pbfib","title":"Session ended: gt-beads-crew-fang","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-09T22:57:42.09645-08:00","created_by":"beads/crew/fang","updated_at":"2026-01-09T22:57:42.133588-08:00","closed_at":"2026-01-09T22:57:42.133588-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-pbh","title":"Release v0.30.4","description":"## Version Bump Workflow\n\nCoordinating release from 0.30.3 to 0.30.4.\n\n### Components Updated\n- Go CLI (cmd/bd/version.go)\n- Claude Plugin (.claude-plugin/*.json)\n- MCP Server (integrations/beads-mcp/)\n- npm Package (npm-package/package.json)\n- Git hooks (cmd/bd/templates/hooks/)\n\n### Release Channels\n- GitHub Releases (GoReleaser)\n- PyPI (beads-mcp)\n- npm (@beads/cli)\n- Homebrew (homebrew-beads tap)\n","status":"tombstone","priority":1,"issue_type":"epic","created_at":"2025-12-17T21:19:10.926133-08:00","updated_at":"2025-12-25T01:21:01.952723-08:00","labels":["release","v0.30.4","workflow"],"deleted_at":"2025-12-25T01:21:01.952723-08:00","deleted_by":"batch delete","delete_reason":"batch delete","original_type":"epic"} @@ -2157,6 +2174,7 @@ {"id":"bd-r4sn","title":"Phase 2.5: TOON-based daemon sync","description":"Implement TOON-native daemon sync (replaces JSONL sync machinery).\n\n## Overview\nDaemon sync is the final integration point. Replace export/import/merge machinery with TOON-native sync, building on deletion tracking (2.3) and merge optimization (2.4).\n\n## Required Work\n\n### 2.5.1 TOON-based Daemon Sync\n- [ ] Understand current JSONL sync machinery (export.go, import.go, merge.go)\n- [ ] Replace export step with TOON encoding (EncodeTOON)\n- [ ] Replace import step with TOON decoding (DecodeTOON)\n- [ ] Replace merge step with TOON-aware 3-way merge\n- [ ] Update daemon auto-sync to read/write TOON\n- [ ] Verify 5-second debounce still works\n\n### 2.5.2 Deletion Sync Integration\n- [ ] Load deletions.toon during import phase\n- [ ] Apply deletions after merging issues\n- [ ] Ensure deletion TTL respects daemon schedule\n\n### 2.5.3 Testing\n- [ ] Unit tests for daemon sync with TOON\n- [ ] Integration tests with actual daemon operations\n- [ ] Multi-clone sync scenarios with concurrent edits\n- [ ] Performance comparison with JSONL sync\n- [ ] Long-running daemon stability tests\n\n## Success Criteria\n- Daemon reads/writes TOON format (not JSONL)\n- Sync latency comparable to JSONL (\u003c100ms)\n- All 70+ tests passing\n- bdt commands work seamlessly with daemon\n- Multi-clone sync scenarios work correctly","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-19T14:43:20.33132177-07:00","updated_at":"2025-12-21T14:42:25.274362-08:00","closed_at":"2025-12-21T14:42:25.274362-08:00","dependencies":[{"issue_id":"bd-r4sn","depends_on_id":"bd-uz8r","type":"blocks","created_at":"2025-12-19T14:43:20.347724699-07:00","created_by":"daemon"},{"issue_id":"bd-r4sn","depends_on_id":"bd-uwkp","type":"blocks","created_at":"2025-12-19T14:43:20.355379309-07:00","created_by":"daemon"}]} {"id":"bd-r53nt","title":"Issue 2","status":"open","priority":1,"issue_type":"task","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T18:16:14.587222-08:00","created_by":"beads/crew/wolf","updated_at":"2026-01-11T18:16:14.587222-08:00"} {"id":"bd-r5p6e","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T19:34:11.310835-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T19:34:11.374457-08:00","closed_at":"2026-01-11T19:34:11.374457-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} +{"id":"bd-r5uc6","title":"Digest: mol-refinery-patrol","description":"Patrol: queue empty, 0 branches merged, no issues","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T23:40:17.532306-08:00","updated_at":"2026-01-14T23:40:17.532306-08:00","closed_at":"2026-01-14T23:40:17.519254-08:00","close_reason":"Squashed from 11 wisps","dependencies":[{"issue_id":"bd-r5uc6","depends_on_id":"bd-wisp-8kdp","type":"parent-child","created_at":"2026-01-14T23:40:17.533438-08:00","created_by":"beads/refinery"}]} {"id":"bd-r6a","title":"Redesign workflow system: templates as native Beads","description":"## Problem\n\nThe current workflow system (YAML templates in cmd/bd/templates/workflows/) is architecturally flawed:\n\n1. **Out-of-band data plane** - YAML files are a parallel system outside Beads itself\n2. **Heavyweight DSL** - YAML is gross; even TOML would have been better, but neither is ideal\n3. **Not graph-native** - Beads IS already a dependency graph with priorities, so why reinvent it?\n4. **Can't use bd commands on templates** - They're opaque YAML, not viewable/editable Beads\n\n## The Right Design\n\n**Templates should be Beads themselves.**\n\nA \"workflow template\" should be:\n- An epic marked as a template (via label, type, or prefix like `tpl-`)\n- Child issues with dependencies between them (using normal bd dep)\n- Titles and descriptions containing `{{variable}}` placeholders\n- Normal priorities that control serialization order\n\n\"Instantiation\" becomes:\n1. Clone the template subgraph (epic + children + dependencies)\n2. Substitute variables in titles/descriptions\n3. Generate new IDs for all cloned issues\n4. Return the new epic ID\n\n## Benefits\n\n- **No YAML** - Templates are just Beads\n- **Use existing tools** - `bd show`, `bd edit`, `bd dep` work on templates\n- **Graph-native** - Dependencies are real Beads dependencies\n- **Simpler codebase** - Remove all the YAML parsing/workflow code\n- **Composable** - Templates can reference other templates\n\n## Tasks\n\n1. Delete the YAML workflow system code (revert recent push + remove existing workflow code)\n2. Design template marking convention (label? type? id prefix?)\n3. Implement `bd template create` or `bd clone --as-template`\n4. Implement `bd template instantiate \u003ctemplate-id\u003e --var key=value`\n5. Migrate version-bump workflow to native Beads template\n6. Update documentation","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-12-17T22:41:57.359643-08:00","updated_at":"2025-12-18T17:42:26.000769-08:00","closed_at":"2025-12-18T13:47:04.632525-08:00"} {"id":"bd-r6a.1","title":"Revert/remove YAML workflow system","description":"Revert the recent commit and remove all YAML workflow code:\n\n1. `git revert aae8407a` (the commit we just pushed with workflow fixes)\n2. Remove `cmd/bd/templates/workflows/` directory\n3. Remove workflow.go or gut it to minimal stub\n4. Remove WorkflowTemplate types from internal/types/workflow.go\n5. Remove any workflow-related RPC handlers\n\nKeep only minimal scaffolding if needed for the new template system.","status":"tombstone","priority":0,"issue_type":"task","created_at":"2025-12-17T22:42:07.339684-08:00","updated_at":"2025-12-25T01:21:01.952723-08:00","dependencies":[{"issue_id":"bd-r6a.1","depends_on_id":"bd-r6a","type":"parent-child","created_at":"2025-12-17T22:42:07.340117-08:00","created_by":"daemon"}],"deleted_at":"2025-12-25T01:21:01.952723-08:00","deleted_by":"batch delete","delete_reason":"batch delete","original_type":"task"} {"id":"bd-r6a.2","title":"Implement subgraph cloning with variable substitution","description":"Core implementation of template instantiation:\n\n1. Add `bd template instantiate \u003ctemplate-id\u003e [--var key=value]...` command\n2. Implement subgraph loading:\n - Load template epic\n - Recursively load all children (and their children)\n - Load all dependencies between issues in the subgraph\n3. Implement variable substitution:\n - Scan titles and descriptions for `{{name}}` patterns\n - Replace with provided values\n - Error on missing required variables (or prompt interactively)\n4. Implement cloning:\n - Generate new IDs for all issues\n - Create cloned issues with substituted text\n - Remap and create dependencies\n5. Return the new epic ID\n\nConsider adding `--dry-run` flag to preview what would be created.","status":"tombstone","priority":1,"issue_type":"task","created_at":"2025-12-17T22:43:25.179848-08:00","updated_at":"2025-12-25T01:21:01.952723-08:00","dependencies":[{"issue_id":"bd-r6a.2","depends_on_id":"bd-r6a","type":"parent-child","created_at":"2025-12-17T22:43:25.180286-08:00","created_by":"daemon"},{"issue_id":"bd-r6a.2","depends_on_id":"bd-r6a.1","type":"blocks","created_at":"2025-12-17T22:44:03.15413-08:00","created_by":"daemon"}],"deleted_at":"2025-12-25T01:21:01.952723-08:00","deleted_by":"batch delete","delete_reason":"batch delete","original_type":"task"} @@ -2233,6 +2251,7 @@ {"id":"bd-sal9","title":"bd mol current: soft cursor showing current/next step","description":"Add bd mol current command for molecule navigation orientation.\n\n## Usage\n\nbd mol current [mol-id]\n\nIf mol-id given, show status for that molecule.\nIf not given, infer from in_progress issues assigned to current agent.\n\n## Output\n\nYou're working on molecule gt-abc (Feature X)\n\n [done] gt-abc.1: Design\n [done] gt-abc.2: Scaffold \n [done] gt-abc.3: Implement\n [current] gt-abc.4: Write tests [in_progress] \u003c- YOU ARE HERE\n [pending] gt-abc.5: Documentation\n [pending] gt-abc.6: Exit decision\n\nProgress: 3/6 steps complete\n\n## Key behaviors\n- Shows full molecule structure with status indicators\n- Highlights current in_progress step\n- If no in_progress, highlights first ready step\n- Works without explicit cursor tracking (inferred from state)\n\n## Implementation notes\n- Query children of mol-id\n- Sort by dependency order\n- Find first in_progress or first ready\n- Format with status indicators\n\n## Gas Town integration\n- gt-lz13: Update templates with nav workflow\n- gt-um6q: Update docs with nav workflow","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-12-22T17:03:30.245964-08:00","updated_at":"2025-12-22T17:36:31.936007-08:00","closed_at":"2025-12-22T17:36:31.936007-08:00"} {"id":"bd-sc57","title":"Production Readiness (Optional)","description":"Enable multi-machine deployments with containerization and monitoring.","status":"closed","priority":3,"issue_type":"epic","created_at":"2025-11-07T22:43:31.527617-08:00","updated_at":"2025-11-08T01:06:12.904671-08:00","closed_at":"2025-11-08T01:06:12.904671-08:00","dependencies":[{"issue_id":"bd-sc57","depends_on_id":"bd-wfmw","type":"blocks","created_at":"2025-11-07T22:43:31.528743-08:00","created_by":"daemon"},{"issue_id":"bd-sc57","depends_on_id":"bd-pdjb","type":"blocks","created_at":"2025-11-07T22:43:31.529193-08:00","created_by":"daemon"}]} {"id":"bd-sco6","title":"Emit issue title with dep/label mutation events","description":"When dependencies or labels are added, mutations are emitted without title/assignee:\n\n```go\ns.emitMutation(MutationUpdate, depArgs.FromID, \"\", \"\") // server_labels_deps_comments.go:68\ns.emitMutation(MutationUpdate, issueID, \"\", \"\") // server_labels_deps_comments.go:101\n```\n\nThis causes bd activity (and gt feed) to show less informative entries like:\n```\n[20:42:17] → gt-4ntnq updated\n```\n\nInstead of:\n```\n[20:42:17] → gt-4ntnq updated · Pipeline Reliability: Fix work loss...\n```\n\n**Fix**: Look up issue title in dep/label handlers before emitting mutation. This adds one extra DB read per dep/label operation, but these are infrequent enough that it's acceptable.\n\n**Related**: gt feed now deduplicates rapid updates in gastown commit (to be pushed).","status":"closed","priority":3,"issue_type":"bug","created_at":"2025-12-30T21:13:31.574249-08:00","created_by":"gastown/crew/joe","updated_at":"2025-12-30T21:21:45.081602-08:00","closed_at":"2025-12-30T21:21:45.081602-08:00","close_reason":"Added lookupIssueMeta helper; mutation events now include title/assignee for dep/label/comment operations"} +{"id":"bd-se6d2","title":"Digest: mol-witness-patrol","description":"Patrol 2: all clear","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T21:47:59.727414-08:00","updated_at":"2026-01-14T21:47:59.727414-08:00","closed_at":"2026-01-14T21:47:59.727365-08:00","close_reason":"Squashed from 10 wisps","dependencies":[{"issue_id":"bd-se6d2","depends_on_id":"bd-wisp-npqz","type":"parent-child","created_at":"2026-01-14T21:47:59.72847-08:00","created_by":"beads/witness"}]} {"id":"bd-sfcq","title":"Tests fail due to .beads directory discovery escaping temp dirs","description":"ACTUAL FIX NEEDED: Tests in internal/beads/beads_test.go and internal/syncbranch/syncbranch_test.go find /Users/stevey/gt/beads/mayor/rig/.beads instead of temp test directories.\n\nThe fix is to set BEADS_DB env var in tests to a temp path BEFORE calling FindDatabasePath(). Example:\n\n t.Setenv(\"BEADS_DB\", filepath.Join(tmpDir, \".beads/beads.db\"))\n\nThis prevents the upward directory walk from escaping the temp directory.\n\nNOT the fix: Session parameter changes (already done, doesn't help).","status":"closed","priority":1,"issue_type":"bug","assignee":"beads/polecats/onyx","created_at":"2026-01-01T15:50:04.141197-08:00","created_by":"beads/refinery","updated_at":"2026-01-01T16:28:16.308292-08:00","closed_at":"2026-01-01T16:24:45.907692-08:00","close_reason":"Fixed: added missing session parameter to two CloseIssue calls in daemon mode"} {"id":"bd-sh4c","title":"Improve test coverage for cmd/bd/setup (28.4% → 50%)","description":"The setup package has only 28.4% test coverage. Setup commands are critical for first-time user experience.\n\nCurrent coverage: 28.4%\nTarget coverage: 50%","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-13T20:43:04.409346-08:00","updated_at":"2025-12-23T22:37:13.494999-08:00","closed_at":"2025-12-23T22:37:13.494999-08:00"} {"id":"bd-si4g","title":"Verify release artifacts","description":"Check GitHub releases page - binaries for darwin/linux/windows should be available","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-19T22:56:04.183029-08:00","updated_at":"2025-12-20T00:49:51.92894-08:00","closed_at":"2025-12-20T00:25:52.720816-08:00","dependencies":[{"issue_id":"bd-si4g","depends_on_id":"bd-6s61","type":"parent-child","created_at":"2025-12-19T22:56:15.173619-08:00","created_by":"daemon"},{"issue_id":"bd-si4g","depends_on_id":"bd-otli","type":"blocks","created_at":"2025-12-19T22:56:23.428507-08:00","created_by":"daemon"}]} @@ -2246,6 +2265,7 @@ {"id":"bd-sojqc","title":"Session ended: gt-beads-crew-grip","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-09T23:08:24.273721-08:00","created_by":"beads/crew/grip","updated_at":"2026-01-09T23:08:24.308524-08:00","closed_at":"2026-01-09T23:08:24.308524-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-spmx","title":"Investigation \u0026 Proof of Concept","description":"Validate that MCP Agent Mail works as expected and delivers promised benefits before committing to full integration.","notes":"POC completed successfully:\n✅ bd-muls: Server installed and tested\n✅ bd-27xm: MCP tool execution issues resolved\n✅ [deleted:bd-6hji]: File reservation collision prevention validated\n✅ bd-htfk: Latency benchmarking shows 20-50x improvement\n✅ bd-pmuu: ADR 002 created documenting integration decision\n\nResults validate Agent Mail benefits:\n- Collision prevention works (exclusive file reservations)\n- Latency: \u003c100ms (vs 2000-5000ms git sync)\n- Lightweight deployment (\u003c50MB memory)\n- Optional/non-intrusive integration approach validated\n\nNext: bd-wfmw (Integration Layer Implementation)","status":"closed","priority":0,"issue_type":"epic","created_at":"2025-11-07T22:41:37.13757-08:00","updated_at":"2025-11-08T03:12:04.154114-08:00","closed_at":"2025-11-08T00:06:20.731732-08:00"} {"id":"bd-sqdb3","title":"Session ended: gt-beads-witness","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T20:36:10.819016-08:00","created_by":"beads/witness","updated_at":"2026-01-14T20:36:10.905505-08:00","closed_at":"2026-01-14T20:36:10.905505-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} +{"id":"bd-srb6d","title":"Digest: mol-refinery-patrol","description":"Patrol: queue empty, 0 branches merged, standing by","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-15T07:14:12.76899-08:00","updated_at":"2026-01-15T07:14:12.76899-08:00","closed_at":"2026-01-15T07:14:12.768938-08:00","close_reason":"Squashed from 11 wisps","dependencies":[{"issue_id":"bd-srb6d","depends_on_id":"bd-wisp-qqyn","type":"parent-child","created_at":"2026-01-15T07:14:12.770071-08:00","created_by":"beads/refinery"}]} {"id":"bd-srhu","title":"Merge: jasper-mk04cv5s","description":"branch: polecat/jasper-mk04cv5s\ntarget: main\nsource_issue: jasper-mk04cv5s\nrig: beads\nagent_bead: bd-beads-polecat-jasper\nretry_count: 0\nlast_conflict_sha: null\nconflict_task_id: null","status":"closed","priority":2,"issue_type":"merge-request","created_at":"2026-01-04T11:27:04.224933-08:00","created_by":"beads/polecats/jasper","updated_at":"2026-01-05T19:45:43.989296-08:00","closed_at":"2026-01-05T19:45:43.989296-08:00","close_reason":"Branch deleted, already merged"} {"id":"bd-srsk","title":"Gate eval: Add error visibility for gh CLI failures","description":"Currently evalGHRunGate and evalGHPRGate silently swallow errors when the gh CLI fails (lines 738-741, 780-783 in gate.go).\n\nThis makes debugging difficult - if gh isn't installed, auth fails, or network issues occur, gates silently stall forever with no indication of why.\n\nOptions:\n1. Add debug logging when gh fails\n2. Return error info in the skipped list for aggregate reporting\n3. Add a --verbose flag to gate eval that shows failures\n\nLow priority since the fail-safe behavior (don't close gate on error) is correct.","status":"closed","priority":3,"issue_type":"task","created_at":"2025-12-25T23:13:11.718635-08:00","updated_at":"2026-01-02T18:35:49.165014-08:00","closed_at":"2026-01-02T18:35:49.165014-08:00","close_reason":"Fixed in commit 3c5b7414 (bd-oos3). Error visibility now implemented in bd gate check - errors are printed to stderr with fail icon."} {"id":"bd-srwk","title":"bd export should detect and prevent stale database exports","description":"## Problem\n\nWhen `bd export` is run with a stale database (older than issues.jsonl), it silently overwrites the JSONL file with stale data, causing data loss.\n\n## What Happened (vc project)\n\n1. Agent A created 4 new issues and exported to issues.jsonl (commit 99a9d58)\n2. Agent A closed an issue and exported again (commit 58b4613) - JSONL now has 4 epics\n3. Agent B had stale database (from before step 1)\n4. Agent B worked on unrelated issue and exported (commit 0609233)\n5. Agent B's export **overwrote issues.jsonl**, removing the 4 epics created by Agent A\n6. Required manual recovery by re-exporting from Agent A's correct database\n\n## Expected Behavior\n\n`bd export` should detect that the database is stale and either:\n- **Refuse to export** with error message explaining the issue\n- **Warn prominently** and require explicit --force flag to override\n- **Auto-import first** to sync database before exporting\n\n## How to Detect Staleness\n\nCompare modification times (similar to VC's ValidateDatabaseFreshness):\n1. Check .db, .db-wal, .db-shm timestamps (use newest for WAL mode)\n2. Check issues.jsonl timestamp\n3. If JSONL is newer by \u003e1 second: database is stale\n\n## Suggested Fix\n\nAdd staleness check in `bd export`:\n\n```go\nfunc Export(dbPath, jsonlPath string, force bool) error {\n // Check if database is stale\n if !force {\n if err := checkDatabaseFreshness(dbPath, jsonlPath); err != nil {\n return fmt.Errorf(\"database is stale: %w\\n\" +\n \"Run 'bd import %s' first to sync, or use --force to override\",\n err, jsonlPath)\n }\n }\n \n // Proceed with export...\n}\n```\n\n## Impact\n\n- **Severity**: High (silent data loss)\n- **Frequency**: Happens in multi-agent workflows when agents don't sync\n- **Workaround**: Manual recovery (re-export from correct database)\n\n## References\n\n- VC issue tracker: commits 58b4613 -\u003e 0609233 -\u003e c41c638\n- VC has similar check: `storage.ValidateDatabaseFreshness()`\n- Tolerance: 1 second (handles filesystem timestamp precision)","notes":"Fixed with ID-based comparison instead of just count. Now detects:\n1. DB has fewer issues than JSONL (count check)\n2. DB has different issues than JSONL (ID comparison)\n\nBoth scenarios now properly refuse export unless --force is used.\n\nImplementation uses getIssueIDsFromJSONL() to build a set of IDs from JSONL, then checks if any JSONL IDs are missing from DB. Shows specific missing issue IDs in error message.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-11-07T19:39:24.172154-08:00","updated_at":"2025-11-07T20:05:13.649736-08:00","closed_at":"2025-11-07T19:58:43.300177-08:00"} @@ -2280,6 +2300,7 @@ {"id":"bd-tbz3","title":"bd init UX Improvements","description":"bd init leaves users with incomplete setup, requiring manual bd doctor --fix. Issues found: (1) git hooks not installed if user declines prompt, (2) no auto-migration when CLI is upgraded, (3) stale merge driver configs from old versions. Fix by making bd init more robust with better defaults and auto-migration.","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-11-21T23:16:00.333543-08:00","updated_at":"2025-12-23T04:20:51.88847-08:00","closed_at":"2025-12-23T04:20:51.88847-08:00"} {"id":"bd-tcvh","title":"Test prefix beads","status":"tombstone","priority":2,"issue_type":"task","created_at":"2025-12-27T14:24:41.707092-08:00","created_by":"stevey","updated_at":"2025-12-27T14:24:50.421598-08:00","deleted_at":"2025-12-27T14:24:50.421598-08:00","deleted_by":"daemon","delete_reason":"delete","original_type":"task"} {"id":"bd-td72y","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-12T01:40:31.1931-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-12T01:40:31.256858-08:00","closed_at":"2026-01-12T01:40:31.256858-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} +{"id":"bd-te5by","title":"Digest: mol-witness-patrol","description":"Patrol 4: all clear","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T21:49:19.168919-08:00","updated_at":"2026-01-14T21:49:19.168919-08:00","closed_at":"2026-01-14T21:49:19.168869-08:00","close_reason":"Squashed from 10 wisps","dependencies":[{"issue_id":"bd-te5by","depends_on_id":"bd-wisp-jdh3","type":"parent-child","created_at":"2026-01-14T21:49:19.170029-08:00","created_by":"beads/witness"}]} {"id":"bd-tf108","title":"Session ended: gt-beads-witness","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-12T16:42:51.959951-08:00","created_by":"beads/witness","updated_at":"2026-01-12T16:42:52.030675-08:00","closed_at":"2026-01-12T16:42:52.030675-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-tfczz","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T19:48:31.557461-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T19:48:31.624887-08:00","closed_at":"2026-01-11T19:48:31.624887-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-tggf","title":"Code Health Review Dec 2025: Technical Debt Cleanup","description":"Epic grouping technical debt identified in the Dec 16, 2025 code health review.\n\n## Overall Health Grade: B (Solid foundation, needs cleanup)\n\n### P1 (High Priority):\n- bd-74w1: Consolidate duplicate path-finding utilities\n- [deleted:bd-b6xo]: Remove/fix ClearDirtyIssues() race condition\n- [deleted:bd-b3og]: Fix TestImportBugIntegration deadlock\n\n### P2 (Medium Priority):\n- bd-05a8: Split large files (doctor.go, sync.go)\n- bd-qioh: Standardize error handling patterns\n- bd-rgyd: Split queries.go (1586 lines)\n- bd-9g1z: Fix/remove TestFindJSONLPathDefault\n\n### P3 (Low Priority):\n- bd-ork0: Add comments to 30+ ignored errors\n- bd-4nqq: Remove dead test code in info_test.go\n- bd-dhza: Reduce global state in main.go\n\n## Key Areas:\n1. Code duplication in path utilities\n2. Large monolithic files (5 files \u003e1000 lines)\n3. Global state (25+ variables, 3 deprecated)\n4. Silent error suppression (30+ instances)\n5. Test gaps and dead test code\n6. Atomicity risks in batch operations","status":"closed","priority":2,"issue_type":"epic","created_at":"2025-12-16T18:18:58.115507-08:00","updated_at":"2025-12-30T18:12:30.962234-08:00","closed_at":"2025-12-30T16:59:51.322347-08:00","close_reason":"All technical debt cleanup tasks completed: path utilities consolidated, large files split, error handling standardized, dead test code removed, global state reduced, ignored errors documented","dependencies":[{"issue_id":"bd-tggf","depends_on_id":"bd-74w1","type":"blocks","created_at":"2025-12-22T21:00:21.429274-08:00","created_by":"daemon"},{"issue_id":"bd-tggf","depends_on_id":"bd-05a8","type":"blocks","created_at":"2025-12-22T21:00:21.501589-08:00","created_by":"daemon"},{"issue_id":"bd-tggf","depends_on_id":"bd-9g1z","type":"blocks","created_at":"2025-12-22T21:00:21.571116-08:00","created_by":"daemon"},{"issue_id":"bd-tggf","depends_on_id":"bd-qioh","type":"blocks","created_at":"2025-12-22T21:00:21.640589-08:00","created_by":"daemon"},{"issue_id":"bd-tggf","depends_on_id":"bd-rgyd","type":"blocks","created_at":"2025-12-22T21:00:21.710912-08:00","created_by":"daemon"},{"issue_id":"bd-tggf","depends_on_id":"bd-4nqq","type":"blocks","created_at":"2025-12-22T21:00:21.781914-08:00","created_by":"daemon"},{"issue_id":"bd-tggf","depends_on_id":"bd-dhza","type":"blocks","created_at":"2025-12-22T21:00:21.852-08:00","created_by":"daemon"},{"issue_id":"bd-tggf","depends_on_id":"bd-ork0","type":"blocks","created_at":"2025-12-22T21:00:21.930168-08:00","created_by":"daemon"}]} @@ -2399,6 +2420,7 @@ {"id":"bd-v8ku","title":"bd: Add town-level activity signal in PersistentPreRun","description":"Add activity signaling to beads so Gas Town daemon can detect bd usage.\n\nIn cmd/bd/main.go PersistentPreRun, add a call to write activity to\nthe Gas Town daemon directory if running inside a Gas Town workspace.\n\nThe signal file is ~/gt/daemon/activity.json (or detected town root).\n\nFormat:\n{\n \"last_command\": \"bd create ...\",\n \"actor\": \"gastown/crew/max\",\n \"timestamp\": \"2025-12-26T19:30:00Z\"\n}\n\nShould be best-effort (silent failure) to avoid breaking bd outside Gas Town.\n\nCross-rig ref: gastown gt-ws8ol (Deacon exponential backoff epic)","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-26T19:25:13.537055-08:00","updated_at":"2025-12-26T19:28:44.919491-08:00","closed_at":"2025-12-26T19:28:44.919491-08:00"} {"id":"bd-v988p","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-13T20:11:10.560894-08:00","created_by":"beads/refinery","updated_at":"2026-01-13T20:11:10.633289-08:00","closed_at":"2026-01-13T20:11:10.633289-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-v9kd2","title":"Session ended: gt-beads-witness","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-08T18:22:02.116594-08:00","created_by":"beads/witness","updated_at":"2026-01-08T18:22:02.153947-08:00","closed_at":"2026-01-08T18:22:02.153947-08:00","close_reason":"auto-closed session event"} +{"id":"bd-v9tb8","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T22:08:32.029709-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-14T22:08:32.081983-08:00","closed_at":"2026-01-14T22:08:32.081983-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-vaj0q","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-13T19:28:41.283376-08:00","created_by":"beads/refinery","updated_at":"2026-01-13T19:28:41.353077-08:00","closed_at":"2026-01-13T19:28:41.353077-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-vavh","title":"Fix row iterator resource leak in recursive dependency queries","description":"Critical resource leak in findAllDependentsRecursive() where rows.Close() is called AFTER early return on error, never executing.\n\nLocation: internal/storage/sqlite/sqlite.go:1131-1136\n\nProblem: \n- rows.Close() placed after return statement\n- On scan error, iterator never closed\n- Can exhaust SQLite connections under moderate load\n\nFix: Move defer rows.Close() to execute on all code paths\n\nImpact: Connection exhaustion during dependency traversal","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-11-16T14:50:55.881698-08:00","updated_at":"2025-11-16T15:03:55.009607-08:00","closed_at":"2025-11-16T15:03:55.009607-08:00"} {"id":"bd-vcec","title":"postinstall fails on Windows: zip locked by Defender (GH#889)","description":"npm install fails on Windows because the zip file is locked when Expand-Archive runs. Fixed by adding retry loop with exponential backoff.","status":"closed","priority":2,"issue_type":"bug","created_at":"2026-01-04T12:26:43.264589-08:00","created_by":"beads/crew/grip","updated_at":"2026-01-04T12:27:15.417741-08:00","closed_at":"2026-01-04T12:27:15.417741-08:00","close_reason":"Fixed in 1a87d96d - added retry loop with exponential backoff"} @@ -2409,6 +2431,7 @@ {"id":"bd-vd8e","title":"Detect uncommitted JSONL changes before sync operations","description":"Part of GH#885 fix: pre-flight safety check.\n\nAdd detection at sync start:\n1. Check if .beads/issues.jsonl has uncommitted changes in git\n2. If so, this indicates a previous sync failed after export but before commit\n3. Force a fresh export cycle to reconcile state\n\nImplementation:\n- Add gitHasUnstagedBeadsChanges() helper\n- Call in sync pre-flight checks (sync.go ~line 159)\n- If detected, warn user and force re-export\n\nThis catches the failure mode early before it compounds.","status":"closed","priority":1,"issue_type":"task","assignee":"beads/crew/fang","created_at":"2026-01-04T13:53:24.808788-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-04T15:10:56.883507-08:00","closed_at":"2026-01-04T15:10:56.883507-08:00","close_reason":"Implemented: gitHasUncommittedBeadsChanges() helper + pre-flight check in sync.go","dependencies":[{"issue_id":"bd-vd8e","depends_on_id":"bd-pnx2","type":"parent-child","created_at":"2026-01-04T13:53:55.823237-08:00","created_by":"beads/crew/emma"}]} {"id":"bd-vdegl","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-13T19:32:52.767096-08:00","created_by":"beads/refinery","updated_at":"2026-01-13T19:32:52.844575-08:00","closed_at":"2026-01-13T19:32:52.844575-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-vdw4","title":"Enhancement: bd swarm status accepts swarm molecule ID","description":"Currently `bd swarm status` only accepts an epic ID.\n\nWould be more intuitive to also accept the swarm molecule ID and follow the relates-to link to find the epic:\n\n```bash\nbd swarm status bd-swarm-xyz # Follow link to epic, show status\nbd swarm status bd-epic-123 # Direct epic lookup (current behavior)\n```\n\nDetect by checking if the issue has mol_type=swarm.","status":"closed","priority":3,"issue_type":"task","created_at":"2025-12-28T21:38:20.692476-08:00","created_by":"beads/crew/dave","updated_at":"2025-12-28T22:05:10.112717-08:00","closed_at":"2025-12-28T22:05:10.112717-08:00","dependencies":[{"issue_id":"bd-vdw4","depends_on_id":"bd-2ubv","type":"parent-child","created_at":"2025-12-28T21:38:44.809594-08:00","created_by":"daemon"}]} +{"id":"bd-vf0w9","title":"Digest: mol-witness-patrol","description":"Patrol 3: all clear","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T21:48:28.886207-08:00","updated_at":"2026-01-14T21:48:28.886207-08:00","closed_at":"2026-01-14T21:48:28.886157-08:00","close_reason":"Squashed from 10 wisps","dependencies":[{"issue_id":"bd-vf0w9","depends_on_id":"bd-wisp-zc6z","type":"parent-child","created_at":"2026-01-14T21:48:28.8873-08:00","created_by":"beads/witness"}]} {"id":"bd-vf63g","title":"Fix: post-checkout hook inline import fails (GH#984)","description":"dispatched_by: beads/crew/dave\n\nGitHub issue #984. post-checkout hook fails with 'no database store available for inline import'.","status":"closed","priority":1,"issue_type":"bug","created_at":"2026-01-09T22:20:10.356282-08:00","created_by":"beads/crew/dave","updated_at":"2026-01-10T20:57:09.382572-08:00","closed_at":"2026-01-10T16:52:59.64351-08:00","close_reason":"Fixed by using setter functions in PersistentPreRun to sync cmdCtx with globals"} {"id":"bd-vfidp","title":"Session ended: gt-beads-crew-wolf","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-12T17:30:48.304872-08:00","created_by":"beads/crew/wolf","updated_at":"2026-01-12T17:30:48.370399-08:00","closed_at":"2026-01-12T17:30:48.370399-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-vgi5","title":"Push version bump to GitHub","description":"git push origin main - triggers CI but no release yet.","status":"tombstone","priority":1,"issue_type":"task","created_at":"2025-12-18T22:43:05.363604-08:00","updated_at":"2025-12-24T16:25:30.019895-08:00","dependencies":[{"issue_id":"bd-vgi5","depends_on_id":"bd-qqc","type":"parent-child","created_at":"2025-12-18T22:43:16.87736-08:00","created_by":"daemon"},{"issue_id":"bd-vgi5","depends_on_id":"bd-3ggb","type":"blocks","created_at":"2025-12-18T22:43:21.078208-08:00","created_by":"daemon"}],"deleted_at":"2025-12-24T16:25:30.019895-08:00","deleted_by":"daemon","delete_reason":"delete","original_type":"task"} @@ -2456,6 +2479,7 @@ {"id":"bd-w654","title":"Merge: quartz-1767082908528","description":"branch: polecat/quartz-1767082908528\ntarget: main\nsource_issue: quartz-1767082908528\nrig: beads","status":"closed","priority":2,"issue_type":"merge-request","created_at":"2025-12-30T00:24:52.846909-08:00","created_by":"beads/polecats/quartz","updated_at":"2025-12-30T00:54:59.720022-08:00","closed_at":"2025-12-30T00:54:59.720022-08:00","close_reason":"Branch polecat/quartz-1767082908528 no longer exists on remote"} {"id":"bd-w662z","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-10T16:21:00.574006-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-10T16:21:00.642384-08:00","closed_at":"2026-01-10T16:21:00.642384-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-w68o3","title":"Session ended: gt-beads-crew-dave","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-12T19:42:00.78869-08:00","created_by":"beads/crew/dave","updated_at":"2026-01-12T19:42:00.856587-08:00","closed_at":"2026-01-12T19:42:00.856587-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} +{"id":"bd-w6eiu","title":"Digest: mol-refinery-patrol","description":"Patrol cycle complete: queue empty, no branches processed","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-15T11:58:15.312765-08:00","updated_at":"2026-01-15T11:58:15.312765-08:00","closed_at":"2026-01-15T11:58:15.312709-08:00","close_reason":"Squashed from 11 wisps","dependencies":[{"issue_id":"bd-w6eiu","depends_on_id":"bd-wisp-6g0x","type":"parent-child","created_at":"2026-01-15T11:58:15.313843-08:00","created_by":"beads/refinery"}]} {"id":"bd-w6g4w","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T05:00:27.420661-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T05:00:27.46446-08:00","closed_at":"2026-01-11T05:00:27.46446-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-w7wex","title":"bd mol cook: create gate beads for gate steps","description":"When cooking a molecule, if a step has a gate field:\n\n1. Create a gate bead with ID: \u003cmol-id\u003e.gate-\u003cstep-id\u003e\n2. Set await_type from step gate field\n3. Set await_id from step gate_hint (or empty for auto-discovery)\n4. Set timeout from step timeout field\n5. Gate bead starts with status=open\n\nThe gate bead implicitly blocks the step. Step cannot proceed until gate closes.\n\nParent: bd-ka761","status":"closed","priority":1,"issue_type":"task","created_at":"2026-01-08T20:53:57.201927-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-08T21:09:25.120036-08:00","closed_at":"2026-01-08T21:09:25.120036-08:00","close_reason":"Already implemented: createGateIssue() in cook.go creates gate beads with ID format \u003cmol-id\u003e.gate-\u003cstep-id\u003e, sets await_type/await_id/timeout. collectSteps() adds gate as blocking dependency. Tests in cook_test.go verify all functionality.","dependencies":[{"issue_id":"bd-w7wex","depends_on_id":"bd-ka761","type":"parent-child","created_at":"2026-01-08T20:54:04.024526-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-w7wex","depends_on_id":"bd-7m0d2","type":"blocks","created_at":"2026-01-08T20:54:11.62344-08:00","created_by":"beads/crew/emma"}]} {"id":"bd-w8g0","title":"test pin issue","status":"tombstone","priority":2,"issue_type":"task","created_at":"2025-12-20T22:44:27.963361-08:00","updated_at":"2025-12-20T22:44:57.977229-08:00","deleted_at":"2025-12-20T22:44:57.977229-08:00","deleted_by":"daemon","delete_reason":"delete","original_type":"task"} @@ -2525,20 +2549,21 @@ {"id":"bd-wisp-3q2","title":"Bump version in README badge","description":"Update the Alpha version badge in README.md.\n\n```bash\n# macOS\nsed -i '' 's/Alpha (v[^)]*)/Alpha (v0.47.1)/' README.md\n\n# Linux\nsed -i 's/Alpha (v[^)]*)/Alpha (v0.47.1)/' README.md\n```\n\nVerify:\n```bash\ngrep 'Alpha (v' README.md\n```\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T03:17:16.709865-08:00","updated_at":"2026-01-12T03:20:47.641709-08:00","closed_at":"2026-01-12T03:20:47.641709-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-3q2","depends_on_id":"bd-wisp-5j5","type":"parent-child","created_at":"2026-01-12T03:17:16.728148-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-3q2","depends_on_id":"bd-wisp-iii","type":"blocks","created_at":"2026-01-12T03:17:16.768053-08:00","created_by":"beads/crew/emma"}],"ephemeral":true} {"id":"bd-wisp-3th","title":"Mechanical rebase","description":"Pick next branch from queue. Attempt mechanical rebase on current main.\n\n**Step 1: Checkout and attempt rebase**\n```bash\ngit checkout -b temp origin/\u003cpolecat-branch\u003e\ngit rebase origin/main\n```\n\n**Step 2: Check rebase result**\n\nThe rebase exits with:\n- Exit code 0: Success - proceed to run-tests\n- Exit code 1 (conflicts): Conflict detected - proceed to Step 3\n\nTo detect conflict state after rebase fails:\n```bash\n# Check if we're in a conflicted rebase state\nls .git/rebase-merge 2\u003e/dev/null \u0026\u0026 echo \"CONFLICT_STATE\"\n```\n\n**Step 3: Handle conflicts (if any)**\n\nIf rebase SUCCEEDED (exit code 0):\n- Skip to run-tests step (continue normal merge flow)\n\nIf rebase FAILED with conflicts:\n\n1. **Abort the rebase** (DO NOT leave repo in conflicted state):\n```bash\ngit rebase --abort\n```\n\n2. **Record conflict metadata**:\n```bash\n# Capture main SHA for reference\nMAIN_SHA=$(git rev-parse origin/main)\nBRANCH_SHA=$(git rev-parse origin/\u003cpolecat-branch\u003e)\n```\n\n3. **Create conflict-resolution task**:\n```bash\nbd create --type=task --priority=1 --title=\"Resolve merge conflicts: \u003coriginal-issue-title\u003e\" --description=\"## Conflict Resolution Required\n\nOriginal MR: \u003cmr-bead-id\u003e\nBranch: \u003cpolecat-branch\u003e\nOriginal Issue: \u003cissue-id\u003e\nConflict with main at: ${MAIN_SHA}\nBranch SHA: ${BRANCH_SHA}\n\n## Instructions\n1. Clone/checkout the branch\n2. Rebase on current main: git rebase origin/main\n3. Resolve conflicts\n4. Force push: git push -f origin \u003cbranch\u003e\n5. Close this task when done\n\nThe MR will be re-queued for processing after conflicts are resolved.\"\n```\n\n4. **Skip this MR** (do NOT delete branch or close MR bead):\n- Leave branch intact for conflict resolution\n- Leave MR bead open (will be re-processed after resolution)\n- Continue to loop-check for next branch\n\n**CRITICAL**: Never delete a branch that has conflicts. The branch contains\nthe original work and must be preserved for conflict resolution.\n\nTrack: rebase result (success/conflict), conflict task ID if created.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T01:27:11.195849-08:00","updated_at":"2026-01-12T01:27:49.20498-08:00","closed_at":"2026-01-12T01:27:49.20498-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-3th","depends_on_id":"bd-wisp-9jv","type":"blocks","created_at":"2026-01-12T01:27:11.220471-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-3wz","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"closed","priority":2,"issue_type":"epic","created_at":"2026-01-13T19:58:45.316006-08:00","updated_at":"2026-01-13T20:03:02.211535-08:00","closed_at":"2026-01-13T20:03:02.211535-08:00","close_reason":"Patrol complete: queue empty, no branches to merge"} +{"id":"bd-wisp-400h","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-15T07:16:59.18984-08:00","updated_at":"2026-01-15T07:16:59.18984-08:00","ephemeral":true} {"id":"bd-wisp-42u0","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:23.561611-08:00","updated_at":"2026-01-14T21:33:23.561611-08:00","dependencies":[{"issue_id":"bd-wisp-42u0","depends_on_id":"bd-wisp-9gxz","type":"parent-child","created_at":"2026-01-14T21:33:23.565712-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-45k1","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:22.273539-08:00","updated_at":"2026-01-14T21:33:22.273539-08:00","dependencies":[{"issue_id":"bd-wisp-45k1","depends_on_id":"bd-wisp-qzai","type":"parent-child","created_at":"2026-01-14T21:33:22.418635-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-45k1","depends_on_id":"bd-wisp-7b1q","type":"blocks","created_at":"2026-01-14T21:33:22.585187-08:00","created_by":"beads/witness"}],"ephemeral":true} -{"id":"bd-wisp-49c","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-13T19:07:19.755269-08:00","updated_at":"2026-01-13T19:07:19.755269-08:00"} {"id":"bd-wisp-4b4r","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n```bash\n# Check if refinery session exists\ngt session status \u003crig\u003e/refinery\n\n# Check for pending merge requests\nbd list --type=merge-request --status=open\n```\n\nIf MRs waiting AND refinery not running:\n```bash\ngt session start \u003crig\u003e/refinery\ngt mail send \u003crig\u003e/refinery -s \"PATROL: Wake up\" -m \"Merge requests in queue. Please process.\"\n```\n\nIf refinery running but queue stale (\u003e30 min), send nudge.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:12.607074-08:00","updated_at":"2026-01-14T20:56:12.607074-08:00","dependencies":[{"issue_id":"bd-wisp-4b4r","depends_on_id":"bd-wisp-q3lk","type":"parent-child","created_at":"2026-01-14T20:56:12.622907-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-4bnj","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:51:59.206349-08:00","updated_at":"2026-01-14T21:52:07.99206-08:00","ephemeral":true} {"id":"bd-wisp-4dy1","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:16.031664-08:00","updated_at":"2026-01-14T21:33:16.031664-08:00","dependencies":[{"issue_id":"bd-wisp-4dy1","depends_on_id":"bd-wisp-pkh5","type":"parent-child","created_at":"2026-01-14T21:33:16.181623-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-4dy1","depends_on_id":"bd-wisp-ji8q","type":"blocks","created_at":"2026-01-14T21:33:16.337728-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-4gp","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n```bash\n# Check if refinery session exists\ngt session status \u003crig\u003e/refinery\n\n# Check for pending merge requests\nbd list --type=merge-request --status=open\n```\n\nIf MRs waiting AND refinery not running:\n```bash\ngt session start \u003crig\u003e/refinery\ngt mail send \u003crig\u003e/refinery -s \"PATROL: Wake up\" -m \"Merge requests in queue. Please process.\"\n```\n\nIf refinery running but queue stale (\u003e30 min), send nudge.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T20:55:09.579791-08:00","updated_at":"2026-01-14T20:55:25.906929-08:00","closed_at":"2026-01-14T20:55:25.906929-08:00","close_reason":"Closed","ephemeral":true} {"id":"bd-wisp-4i8","title":"Await CI: release.yml completion","description":"Gate step: Wait for GitHub Actions release workflow to complete.\n\nThis gate blocks until the release.yml workflow run succeeds.\nThe Refinery auto-discovers the workflow run triggered by v0.47.1\nand closes this gate when it completes.\n\nExpected time: 5-10 minutes\n\nThe gate monitors:\n- Build artifacts (all platforms)\n- Test suite pass\n- npm publish\n- PyPI publish\n\nIf the workflow fails, this gate remains open and requires manual intervention.\n","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-12T03:17:16.712017-08:00","updated_at":"2026-01-12T03:17:16.712017-08:00","dependencies":[{"issue_id":"bd-wisp-4i8","depends_on_id":"bd-wisp-5j5","type":"parent-child","created_at":"2026-01-12T03:17:16.735155-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-4i8","depends_on_id":"bd-wisp-82n","type":"blocks","created_at":"2026-01-12T03:17:16.737183-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-4i8","depends_on_id":"bd-wisp-03g","type":"blocks","created_at":"2026-01-12T03:17:16.786856-08:00","created_by":"beads/crew/emma"}],"ephemeral":true} {"id":"bd-wisp-4iuz","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n```bash\n# Check if refinery session exists\ngt session status \u003crig\u003e/refinery\n\n# Check for pending merge requests\nbd list --type=merge-request --status=open\n```\n\nIf MRs waiting AND refinery not running:\n```bash\ngt session start \u003crig\u003e/refinery\ngt mail send \u003crig\u003e/refinery -s \"PATROL: Wake up\" -m \"Merge requests in queue. Please process.\"\n```\n\nIf refinery running but queue stale (\u003e30 min), send nudge.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:10.187107-08:00","updated_at":"2026-01-14T21:33:10.187107-08:00","dependencies":[{"issue_id":"bd-wisp-4iuz","depends_on_id":"bd-wisp-7q1d","type":"parent-child","created_at":"2026-01-14T21:33:10.210697-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-4iuz","depends_on_id":"bd-wisp-7yt3","type":"blocks","created_at":"2026-01-14T21:33:10.303079-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-4jeo","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:12.608194-08:00","updated_at":"2026-01-14T20:56:12.608194-08:00","dependencies":[{"issue_id":"bd-wisp-4jeo","depends_on_id":"bd-wisp-q3lk","type":"parent-child","created_at":"2026-01-14T20:56:12.641858-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-4jeo","depends_on_id":"bd-wisp-pcgf","type":"blocks","created_at":"2026-01-14T20:56:12.699208-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-4qx","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"closed","priority":2,"issue_type":"epic","assignee":"beads/refinery","created_at":"2026-01-10T23:19:39.804733-08:00","updated_at":"2026-01-10T23:26:02.8044-08:00","closed_at":"2026-01-10T23:26:02.8044-08:00","close_reason":"Patrol complete: queue empty, no branches to merge","ephemeral":true} +{"id":"bd-wisp-4r8n","title":"Generate handoff summary","description":"Summarize this patrol cycle.\n\n**VERIFICATION**: Before generating summary, confirm for each merged branch:\n- [ ] MERGED mail was sent to witness\n- [ ] MR bead was closed\n- [ ] MERGE_READY mail archived\n\nIf any notifications or archiving were missed, do them now!\n\nInclude in summary:\n- Branches merged (count, names)\n- MERGED mails sent (count - should match branches merged)\n- MR beads closed (count - should match branches merged)\n- MERGE_READY mails archived (count - should match branches merged)\n- Test results (pass/fail)\n- Branches with conflicts (count, names)\n- Conflict-resolution tasks created (IDs)\n- Issues filed (if any)\n- Any escalations sent\n\n**Conflict tracking is important** for monitoring MQ health. If many branches\nconflict, it may indicate main is moving too fast or branches are too stale.\n\nThis becomes the digest when the patrol is squashed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:02:45.432227-08:00","updated_at":"2026-01-15T08:02:45.432227-08:00","dependencies":[{"issue_id":"bd-wisp-4r8n","depends_on_id":"bd-wisp-puaa","type":"parent-child","created_at":"2026-01-15T08:02:45.624935-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-4r8n","depends_on_id":"bd-wisp-ok70","type":"blocks","created_at":"2026-01-15T08:02:45.903952-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-4tmn","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:13.63649-08:00","updated_at":"2026-01-14T20:56:13.63649-08:00","dependencies":[{"issue_id":"bd-wisp-4tmn","depends_on_id":"bd-wisp-0l5p","type":"parent-child","created_at":"2026-01-14T20:56:13.67578-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-4tmn","depends_on_id":"bd-wisp-xmlw","type":"blocks","created_at":"2026-01-14T20:56:13.743125-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-4utc","title":"Process pending cleanup wisps","description":"Process cleanup wisps (exception handling for dirty polecats).\n\nIn the ephemeral model, cleanup wisps are only created when a polecat has\ndirty state (uncommitted changes, unpushed commits) that prevented immediate\nnuke. Most polecats are nuked immediately on POLECAT_DONE and never create wisps.\n\n```bash\n# Find all cleanup wisps\nbd list --wisp --labels=cleanup --status=open\n```\n\nIf no wisps, skip this step (most common case in ephemeral model).\n\nFor each cleanup wisp, investigate and resolve the dirty state:\n\n## State: pending (needs investigation)\n\n1. **Extract polecat name** from wisp title/labels\n\n2. **Diagnose the problem**:\n```bash\ncd polecats/\u003cname\u003e\ngit status # What's uncommitted?\ngit stash list # Any stashed work?\ngit log origin/main..HEAD # Any unpushed commits?\n```\n\n3. **Resolution options**:\n - **Uncommitted changes**: Commit and push, then nuke\n - **Stashed work**: Pop and commit, or discard if not valuable\n - **Unpushed commits**: Push to origin, then nuke\n - **All valuable work lost**: Escalate to Mayor for recovery\n\n4. **If resolvable locally**: Fix and nuke\n```bash\n# Example: push unpushed commits\ngit push origin HEAD\n\n# Then nuke\ngt polecat nuke \u003cname\u003e\n\n# Close the wisp\nbd close \u003cwisp-id\u003e --reason \"Resolved: pushed commits, nuked\"\n```\n\n5. **If needs escalation**: Send RECOVERY_NEEDED to Mayor\n```bash\ngt mail send mayor/ -s \"RECOVERY_NEEDED \u003crig\u003e/\u003cpolecat\u003e\" \\\n -m \"Cleanup Status: \u003cstatus\u003e\nBranch: \u003cbranch\u003e\nIssue: \u003cissue-id\u003e\n\nCannot auto-resolve. Please advise.\"\n```\nLeave wisp open until Mayor resolves.\n\n## State: merge-requested (legacy, rare)\n\nThis state was used before the ephemeral model. If found, the polecat is\nwaiting for a MERGED signal. The inbox-check step handles these.\n\n**Parallelism**: Use Task tool subagents to process multiple cleanups concurrently.\nEach cleanup is independent - perfect for parallel execution.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:13.619717-08:00","updated_at":"2026-01-14T21:33:13.619718-08:00","dependencies":[{"issue_id":"bd-wisp-4utc","depends_on_id":"bd-wisp-7dag","type":"parent-child","created_at":"2026-01-14T21:33:13.637161-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-4utc","depends_on_id":"bd-wisp-madp","type":"blocks","created_at":"2026-01-14T21:33:13.760707-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-540","title":"Update CHANGELOG.md","description":"Write the [Unreleased] section with all changes for 0.45.0.\n\nFormat: Keep a Changelog (https://keepachangelog.com)\n\nSections:\n- ### Added\n- ### Changed\n- ### Fixed\n- ### Documentation\n\nThe bump script will stamp the date automatically.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T20:07:32.256772-08:00","updated_at":"2026-01-06T20:09:49.901996-08:00","closed_at":"2026-01-06T20:09:49.901996-08:00","close_reason":"CHANGELOG.md updated with 0.45.0 changes","dependencies":[{"issue_id":"bd-wisp-540","depends_on_id":"bd-wisp-9jo","type":"blocks","created_at":"2026-01-06T20:07:32.273791-08:00","created_by":"beads/crew/dave"}]} -{"id":"bd-wisp-56di","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T21:06:22.983259-08:00","updated_at":"2026-01-14T21:06:22.983259-08:00","ephemeral":true} {"id":"bd-wisp-5dph","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:27.573279-08:00","updated_at":"2026-01-14T21:33:27.573279-08:00","dependencies":[{"issue_id":"bd-wisp-5dph","depends_on_id":"bd-wisp-opv7","type":"parent-child","created_at":"2026-01-14T21:33:27.577482-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-5g39","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:10.188192-08:00","updated_at":"2026-01-14T21:33:10.188192-08:00","dependencies":[{"issue_id":"bd-wisp-5g39","depends_on_id":"bd-wisp-7q1d","type":"parent-child","created_at":"2026-01-14T21:33:10.240419-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-5g39","depends_on_id":"bd-wisp-xp53","type":"blocks","created_at":"2026-01-14T21:33:10.335495-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-5ilx","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:12.460196-08:00","updated_at":"2026-01-14T21:33:12.460196-08:00","dependencies":[{"issue_id":"bd-wisp-5ilx","depends_on_id":"bd-wisp-8e8q","type":"parent-child","created_at":"2026-01-14T21:33:12.501471-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-5ilx","depends_on_id":"bd-wisp-dwq8","type":"blocks","created_at":"2026-01-14T21:33:12.615302-08:00","created_by":"beads/witness"}],"ephemeral":true} @@ -2552,18 +2577,23 @@ {"id":"bd-wisp-60x","title":"Preflight: Check git status \u0026 auto-stash","description":"Ensure working tree is clean before starting release.\n\n```bash\ngit status --short\n```\n\n**Handling uncommitted changes:**\n\nIf changes are in release-related files (CHANGELOG, version files), you may want to:\n- Include them in the release commit\n- Or stash and apply after version bump\n\nIf changes are in **non-release files** (e.g., .beads/config.yaml, .claude/settings.json, local configs):\n```bash\n# Auto-stash non-release files\ngit stash push -m \"pre-release: non-release changes\" -- .beads/ .claude/ *.local* .env*\n\n# Verify working tree is now clean (or only has release files)\ngit status --short\n```\n\n**Important:** The bump script may fail if non-release files are modified. Always stash:\n- `.beads/` directory (local config)\n- `.claude/` directory (agent settings)\n- Any `.local`, `.env`, or personal config files\n\nAfter release completes, restore with:\n```bash\ngit stash pop\n```\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T03:17:16.706064-08:00","updated_at":"2026-01-12T03:18:19.285076-08:00","closed_at":"2026-01-12T03:18:19.285076-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-60x","depends_on_id":"bd-wisp-5j5","type":"parent-child","created_at":"2026-01-12T03:17:16.716027-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-60x","depends_on_id":"bd-wisp-3ii","type":"blocks","created_at":"2026-01-12T03:17:16.745775-08:00","created_by":"beads/crew/emma"}],"ephemeral":true} {"id":"bd-wisp-64um","title":"Ping Deacon for health check","description":"Send WITNESS_PING to Deacon for second-order monitoring.\n\nThe Witness fleet collectively monitors Deacon health - this prevents the\n\"who watches the watchers\" problem. If Deacon dies, Witnesses detect it.\n\n**Step 1: Send ping**\n```bash\ngt mail send deacon/ -s \"WITNESS_PING \u003crig\u003e\" -m \"Rig: \u003crig\u003e\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: \u003ccycle-number\u003e\"\n```\n\n**Step 2: Check Deacon health**\n```bash\n# Check Deacon agent bead for last_activity\nbd list --type=agent --json | jq '.[] | select(.description | contains(\"deacon\"))'\n```\n\nLook at the `last_activity` timestamp. If stale (\u003e5 minutes since last update):\n- Deacon may be dead or stuck\n\n**Step 3: Escalate if needed**\n```bash\n# If Deacon appears down\ngt mail send mayor/ -s \"ALERT: Deacon appears unresponsive\" -m \"No Deacon activity for \u003e5 minutes.\nLast seen: \u003ctimestamp\u003e\nWitness: \u003crig\u003e/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:23.563958-08:00","updated_at":"2026-01-14T21:33:23.563958-08:00","dependencies":[{"issue_id":"bd-wisp-64um","depends_on_id":"bd-wisp-9gxz","type":"parent-child","created_at":"2026-01-14T21:33:23.681644-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-64um","depends_on_id":"bd-wisp-uhif","type":"blocks","created_at":"2026-01-14T21:33:23.856112-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-66z","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nInbox should contain ONLY:\n- Unprocessed MERGE_READY messages (will process next cycle)\n- Active work items\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- PATROL: Wake up that was acknowledged → archive\n- HELP/Blocked that was handled → archive\n- MERGE_READY where merge completed but archive was missed → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Check for orphaned MR beads**\n\nLook for open MR beads with no corresponding branch:\n```bash\nbd list --type=merge-request --status=open\n```\n\nFor each open MR bead:\n1. Check if branch exists: `git ls-remote origin refs/heads/\u003cbranch\u003e`\n2. If branch gone, verify work is on main: `git log origin/main --oneline | grep \"\u003csource_issue\u003e\"`\n3. If work on main → close MR with reason \"Merged (verified on main)\"\n4. If work NOT on main → investigate before closing:\n - Check source_issue validity (should be gt-xxxxx, not branch name)\n - Search reflog/dangling commits if possible\n - If unverifiable, close with reason \"Unverifiable - no audit trail\"\n - File bead if this indicates lost work\n\n**NEVER close an MR bead without verifying the work landed or is unrecoverable.**\n\n**Goal**: Inbox should have ≤3 active messages at end of cycle.\nKeep only: pending MRs in queue.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-12T02:44:24.392901-08:00","updated_at":"2026-01-12T02:44:24.392901-08:00","dependencies":[{"issue_id":"bd-wisp-66z","depends_on_id":"bd-wisp-ec4","type":"parent-child","created_at":"2026-01-12T02:44:24.402169-08:00","created_by":"beads/refinery"}]} +{"id":"bd-wisp-67nc","title":"Generate handoff summary","description":"Summarize this patrol cycle.\n\n**VERIFICATION**: Before generating summary, confirm for each merged branch:\n- [ ] MERGED mail was sent to witness\n- [ ] MR bead was closed\n- [ ] MERGE_READY mail archived\n\nIf any notifications or archiving were missed, do them now!\n\nInclude in summary:\n- Branches merged (count, names)\n- MERGED mails sent (count - should match branches merged)\n- MR beads closed (count - should match branches merged)\n- MERGE_READY mails archived (count - should match branches merged)\n- Test results (pass/fail)\n- Branches with conflicts (count, names)\n- Conflict-resolution tasks created (IDs)\n- Issues filed (if any)\n- Any escalations sent\n\n**Conflict tracking is important** for monitoring MQ health. If many branches\nconflict, it may indicate main is moving too fast or branches are too stale.\n\nThis becomes the digest when the patrol is squashed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:09:52.701034-08:00","updated_at":"2026-01-15T08:09:52.701034-08:00","dependencies":[{"issue_id":"bd-wisp-67nc","depends_on_id":"bd-wisp-llul","type":"parent-child","created_at":"2026-01-15T08:09:52.903919-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-67nc","depends_on_id":"bd-wisp-rdax","type":"blocks","created_at":"2026-01-15T08:09:53.193473-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-68xk","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:27.575404-08:00","updated_at":"2026-01-14T21:33:27.575404-08:00","dependencies":[{"issue_id":"bd-wisp-68xk","depends_on_id":"bd-wisp-opv7","type":"parent-child","created_at":"2026-01-14T21:33:27.696755-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-68xk","depends_on_id":"bd-wisp-g1i4","type":"blocks","created_at":"2026-01-14T21:33:27.910028-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-69bq","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:19.157144-08:00","updated_at":"2026-01-14T20:56:19.157144-08:00","dependencies":[{"issue_id":"bd-wisp-69bq","depends_on_id":"bd-wisp-i1rf","type":"parent-child","created_at":"2026-01-14T20:56:19.160982-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-6byh","title":"Ping Deacon for health check","description":"Send WITNESS_PING to Deacon for second-order monitoring.\n\nThe Witness fleet collectively monitors Deacon health - this prevents the\n\"who watches the watchers\" problem. If Deacon dies, Witnesses detect it.\n\n**Step 1: Send ping**\n```bash\ngt mail send deacon/ -s \"WITNESS_PING \u003crig\u003e\" -m \"Rig: \u003crig\u003e\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: \u003ccycle-number\u003e\"\n```\n\n**Step 2: Check Deacon health**\n```bash\n# Check Deacon agent bead for last_activity\nbd list --type=agent --json | jq '.[] | select(.description | contains(\"deacon\"))'\n```\n\nLook at the `last_activity` timestamp. If stale (\u003e5 minutes since last update):\n- Deacon may be dead or stuck\n\n**Step 3: Escalate if needed**\n```bash\n# If Deacon appears down\ngt mail send mayor/ -s \"ALERT: Deacon appears unresponsive\" -m \"No Deacon activity for \u003e5 minutes.\nLast seen: \u003ctimestamp\u003e\nWitness: \u003crig\u003e/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:13.636845-08:00","updated_at":"2026-01-14T20:56:13.636845-08:00","dependencies":[{"issue_id":"bd-wisp-6byh","depends_on_id":"bd-wisp-0l5p","type":"parent-child","created_at":"2026-01-14T20:56:13.683034-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-6byh","depends_on_id":"bd-wisp-4tmn","type":"blocks","created_at":"2026-01-14T20:56:13.75125-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-6fb","title":"Check refinery mail","description":"Check mail for MERGE_READY submissions, escalations, and messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**MERGE_READY**:\nA polecat's work is ready for merge. Extract details and track for processing.\n\n```bash\n# Parse MERGE_READY message body:\n# Branch: \u003cbranch\u003e\n# Issue: \u003cissue-id\u003e\n# Polecat: \u003cpolecat-name\u003e\n# MR: \u003cmr-bead-id\u003e\n# Verified: clean git state, issue closed\n\n# Track in your merge queue for this patrol cycle:\n# - Branch name\n# - Issue ID\n# - Polecat name (REQUIRED for MERGED notification)\n# - MR bead ID (REQUIRED for closing after merge)\n```\n\n**IMPORTANT**: You MUST track the polecat name, MR bead ID, AND message ID - you will need them\nin merge-push step to send MERGED notification, close the MR bead, and archive the mail.\n\nMark as read. The work will be processed in queue-scan/process-branch.\n**Do NOT archive yet** - archive after merge/reject decision in merge-push step.\n\n**PATROL: Wake up**:\nWitness detected MRs waiting but refinery idle. Acknowledge and archive:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HELP / Blocked**:\nAssess and respond. If you can't help, escalate to Mayor.\nArchive after handling:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Check for in-flight merges.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: pending MRs in queue. Inbox should be near-empty.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T00:34:44.778123-08:00","updated_at":"2026-01-12T00:34:59.807466-08:00","closed_at":"2026-01-12T00:34:59.807466-08:00","close_reason":"No messages in inbox","ephemeral":true} -{"id":"bd-wisp-6kr","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T20:29:43.602157-08:00","updated_at":"2026-01-14T20:29:43.602157-08:00","ephemeral":true} +{"id":"bd-wisp-6g0x","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"closed","priority":2,"issue_type":"epic","assignee":"beads/refinery","created_at":"2026-01-15T11:56:21.227403-08:00","updated_at":"2026-01-15T12:01:52.361501-08:00","closed_at":"2026-01-15T12:01:52.361501-08:00","close_reason":"Closed","ephemeral":true} +{"id":"bd-wisp-6ogr","title":"Burn and respawn or loop","description":"End of patrol cycle decision.\n\n**Step 1: Estimate remaining context**\n\nAsk yourself:\n- Have I processed many branches this cycle?\n- Is the conversation getting long?\n- Am I starting to lose track of earlier context?\n\nRule of thumb: If you've done 3+ merges or processed significant cleanup work,\nit's time for a fresh session.\n\n**Step 2: Decision tree**\n\nIf queue non-empty AND context LOW:\n- Squash this wisp to digest\n- Spawn fresh patrol wisp\n- Return to inbox-check\n\nIf queue empty OR context HIGH OR good stopping point:\n- Squash wisp with summary digest\n- Use `gt handoff` for clean session transition:\n\n```bash\ngt handoff -s \"Patrol complete\" -m \"Merged X branches, Y tests passed.\nQueue: empty/N remaining\nNext: [any notes for successor]\"\n```\n\n**Why gt handoff?**\n- Sends handoff mail to yourself with context\n- Respawns with fresh Claude instance\n- SessionStart hook runs gt prime\n- Successor picks up from your hook\n\n**DO NOT just exit.** Always use `gt handoff` for proper lifecycle.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:02:45.433418-08:00","updated_at":"2026-01-15T08:02:45.433418-08:00","dependencies":[{"issue_id":"bd-wisp-6ogr","depends_on_id":"bd-wisp-puaa","type":"parent-child","created_at":"2026-01-15T08:02:45.706438-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-6ogr","depends_on_id":"bd-wisp-s44c","type":"blocks","created_at":"2026-01-15T08:02:45.993679-08:00","created_by":"beads/refinery"}],"ephemeral":true} +{"id":"bd-wisp-6uxa","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:49:19.336012-08:00","updated_at":"2026-01-14T21:49:29.204604-08:00","ephemeral":true} {"id":"bd-wisp-6xn","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T20:53:33.935796-08:00","updated_at":"2026-01-14T20:54:14.248657-08:00","closed_at":"2026-01-14T20:54:14.248657-08:00","close_reason":"Closed","ephemeral":true} {"id":"bd-wisp-70gf","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:24.873404-08:00","updated_at":"2026-01-14T21:33:24.873404-08:00","dependencies":[{"issue_id":"bd-wisp-70gf","depends_on_id":"bd-wisp-srhi","type":"parent-child","created_at":"2026-01-14T21:33:25.038499-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-70gf","depends_on_id":"bd-wisp-crv5","type":"blocks","created_at":"2026-01-14T21:33:25.225795-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-73ys","title":"Process pending cleanup wisps","description":"Process cleanup wisps (exception handling for dirty polecats).\n\nIn the ephemeral model, cleanup wisps are only created when a polecat has\ndirty state (uncommitted changes, unpushed commits) that prevented immediate\nnuke. Most polecats are nuked immediately on POLECAT_DONE and never create wisps.\n\n```bash\n# Find all cleanup wisps\nbd list --wisp --labels=cleanup --status=open\n```\n\nIf no wisps, skip this step (most common case in ephemeral model).\n\nFor each cleanup wisp, investigate and resolve the dirty state:\n\n## State: pending (needs investigation)\n\n1. **Extract polecat name** from wisp title/labels\n\n2. **Diagnose the problem**:\n```bash\ncd polecats/\u003cname\u003e\ngit status # What's uncommitted?\ngit stash list # Any stashed work?\ngit log origin/main..HEAD # Any unpushed commits?\n```\n\n3. **Resolution options**:\n - **Uncommitted changes**: Commit and push, then nuke\n - **Stashed work**: Pop and commit, or discard if not valuable\n - **Unpushed commits**: Push to origin, then nuke\n - **All valuable work lost**: Escalate to Mayor for recovery\n\n4. **If resolvable locally**: Fix and nuke\n```bash\n# Example: push unpushed commits\ngit push origin HEAD\n\n# Then nuke\ngt polecat nuke \u003cname\u003e\n\n# Close the wisp\nbd close \u003cwisp-id\u003e --reason \"Resolved: pushed commits, nuked\"\n```\n\n5. **If needs escalation**: Send RECOVERY_NEEDED to Mayor\n```bash\ngt mail send mayor/ -s \"RECOVERY_NEEDED \u003crig\u003e/\u003cpolecat\u003e\" \\\n -m \"Cleanup Status: \u003cstatus\u003e\nBranch: \u003cbranch\u003e\nIssue: \u003cissue-id\u003e\n\nCannot auto-resolve. Please advise.\"\n```\nLeave wisp open until Mayor resolves.\n\n## State: merge-requested (legacy, rare)\n\nThis state was used before the ephemeral model. If found, the polecat is\nwaiting for a MERGED signal. The inbox-check step handles these.\n\n**Parallelism**: Use Task tool subagents to process multiple cleanups concurrently.\nEach cleanup is independent - perfect for parallel execution.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:53:02.114576-08:00","updated_at":"2026-01-14T21:53:02.114576-08:00","dependencies":[{"issue_id":"bd-wisp-73ys","depends_on_id":"bd-wisp-si5o","type":"parent-child","created_at":"2026-01-14T21:53:02.143689-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-73ys","depends_on_id":"bd-wisp-doad","type":"blocks","created_at":"2026-01-14T21:53:02.367765-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-74vw","title":"Process pending cleanup wisps","description":"Process cleanup wisps (exception handling for dirty polecats).\n\nIn the ephemeral model, cleanup wisps are only created when a polecat has\ndirty state (uncommitted changes, unpushed commits) that prevented immediate\nnuke. Most polecats are nuked immediately on POLECAT_DONE and never create wisps.\n\n```bash\n# Find all cleanup wisps\nbd list --wisp --labels=cleanup --status=open\n```\n\nIf no wisps, skip this step (most common case in ephemeral model).\n\nFor each cleanup wisp, investigate and resolve the dirty state:\n\n## State: pending (needs investigation)\n\n1. **Extract polecat name** from wisp title/labels\n\n2. **Diagnose the problem**:\n```bash\ncd polecats/\u003cname\u003e\ngit status # What's uncommitted?\ngit stash list # Any stashed work?\ngit log origin/main..HEAD # Any unpushed commits?\n```\n\n3. **Resolution options**:\n - **Uncommitted changes**: Commit and push, then nuke\n - **Stashed work**: Pop and commit, or discard if not valuable\n - **Unpushed commits**: Push to origin, then nuke\n - **All valuable work lost**: Escalate to Mayor for recovery\n\n4. **If resolvable locally**: Fix and nuke\n```bash\n# Example: push unpushed commits\ngit push origin HEAD\n\n# Then nuke\ngt polecat nuke \u003cname\u003e\n\n# Close the wisp\nbd close \u003cwisp-id\u003e --reason \"Resolved: pushed commits, nuked\"\n```\n\n5. **If needs escalation**: Send RECOVERY_NEEDED to Mayor\n```bash\ngt mail send mayor/ -s \"RECOVERY_NEEDED \u003crig\u003e/\u003cpolecat\u003e\" \\\n -m \"Cleanup Status: \u003cstatus\u003e\nBranch: \u003cbranch\u003e\nIssue: \u003cissue-id\u003e\n\nCannot auto-resolve. Please advise.\"\n```\nLeave wisp open until Mayor resolves.\n\n## State: merge-requested (legacy, rare)\n\nThis state was used before the ephemeral model. If found, the polecat is\nwaiting for a MERGED signal. The inbox-check step handles these.\n\n**Parallelism**: Use Task tool subagents to process multiple cleanups concurrently.\nEach cleanup is independent - perfect for parallel execution.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:24.87062-08:00","updated_at":"2026-01-14T21:33:24.87062-08:00","dependencies":[{"issue_id":"bd-wisp-74vw","depends_on_id":"bd-wisp-srhi","type":"parent-child","created_at":"2026-01-14T21:33:24.894874-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-74vw","depends_on_id":"bd-wisp-c1oh","type":"blocks","created_at":"2026-01-14T21:33:25.079406-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-75w4","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:13.622673-08:00","updated_at":"2026-01-14T21:33:13.622673-08:00","dependencies":[{"issue_id":"bd-wisp-75w4","depends_on_id":"bd-wisp-7dag","type":"parent-child","created_at":"2026-01-14T21:33:13.746918-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-75w4","depends_on_id":"bd-wisp-nuw0","type":"blocks","created_at":"2026-01-14T21:33:13.876673-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-7b1q","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:22.273154-08:00","updated_at":"2026-01-14T21:33:22.273154-08:00","dependencies":[{"issue_id":"bd-wisp-7b1q","depends_on_id":"bd-wisp-qzai","type":"parent-child","created_at":"2026-01-14T21:33:22.400662-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-7b1q","depends_on_id":"bd-wisp-2tym","type":"blocks","created_at":"2026-01-14T21:33:22.566151-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-7dag","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T21:33:13.618575-08:00","updated_at":"2026-01-14T21:33:13.618575-08:00","ephemeral":true} {"id":"bd-wisp-7gh5","title":"Ping Deacon for health check","description":"Send WITNESS_PING to Deacon for second-order monitoring.\n\nThe Witness fleet collectively monitors Deacon health - this prevents the\n\"who watches the watchers\" problem. If Deacon dies, Witnesses detect it.\n\n**Step 1: Send ping**\n```bash\ngt mail send deacon/ -s \"WITNESS_PING \u003crig\u003e\" -m \"Rig: \u003crig\u003e\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: \u003ccycle-number\u003e\"\n```\n\n**Step 2: Check Deacon health**\n```bash\n# Check Deacon agent bead for last_activity\nbd list --type=agent --json | jq '.[] | select(.description | contains(\"deacon\"))'\n```\n\nLook at the `last_activity` timestamp. If stale (\u003e5 minutes since last update):\n- Deacon may be dead or stuck\n\n**Step 3: Escalate if needed**\n```bash\n# If Deacon appears down\ngt mail send mayor/ -s \"ALERT: Deacon appears unresponsive\" -m \"No Deacon activity for \u003e5 minutes.\nLast seen: \u003ctimestamp\u003e\nWitness: \u003crig\u003e/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:14.68579-08:00","updated_at":"2026-01-14T20:56:14.68579-08:00","dependencies":[{"issue_id":"bd-wisp-7gh5","depends_on_id":"bd-wisp-7mjs","type":"parent-child","created_at":"2026-01-14T20:56:14.73854-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-7gh5","depends_on_id":"bd-wisp-5pc6","type":"blocks","created_at":"2026-01-14T20:56:14.816954-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-7maa","title":"Check refinery mail","description":"Check mail for MERGE_READY submissions, escalations, and messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**MERGE_READY**:\nA polecat's work is ready for merge. Extract details and track for processing.\n\n```bash\n# Parse MERGE_READY message body:\n# Branch: \u003cbranch\u003e\n# Issue: \u003cissue-id\u003e\n# Polecat: \u003cpolecat-name\u003e\n# MR: \u003cmr-bead-id\u003e\n# Verified: clean git state, issue closed\n\n# Track in your merge queue for this patrol cycle:\n# - Branch name\n# - Issue ID\n# - Polecat name (REQUIRED for MERGED notification)\n# - MR bead ID (REQUIRED for closing after merge)\n```\n\n**IMPORTANT**: You MUST track the polecat name, MR bead ID, AND message ID - you will need them\nin merge-push step to send MERGED notification, close the MR bead, and archive the mail.\n\nMark as read. The work will be processed in queue-scan/process-branch.\n**Do NOT archive yet** - archive after merge/reject decision in merge-push step.\n\n**PATROL: Wake up**:\nWitness detected MRs waiting but refinery idle. Acknowledge and archive:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HELP / Blocked**:\nAssess and respond. If you can't help, escalate to Mayor.\nArchive after handling:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Check for in-flight merges.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: pending MRs in queue. Inbox should be near-empty.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-15T08:09:52.697646-08:00","updated_at":"2026-01-15T08:11:07.40922-08:00","closed_at":"2026-01-15T08:11:07.40922-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-7maa","depends_on_id":"bd-wisp-llul","type":"parent-child","created_at":"2026-01-15T08:09:52.702971-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-7mjs","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T20:56:14.682862-08:00","updated_at":"2026-01-14T20:56:14.682862-08:00","ephemeral":true} {"id":"bd-wisp-7q1d","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T21:33:10.185597-08:00","updated_at":"2026-01-14T21:33:10.185597-08:00","ephemeral":true} {"id":"bd-wisp-7qw","title":"Push to main","description":"Push the release commit to origin.\n\n```bash\ngit push origin main\n```\n\nIf rejected, someone else pushed. Pull, rebase, try again.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T20:07:32.257955-08:00","updated_at":"2026-01-06T20:12:28.230572-08:00","closed_at":"2026-01-06T20:12:28.230572-08:00","close_reason":"Pushed to main","dependencies":[{"issue_id":"bd-wisp-7qw","depends_on_id":"bd-wisp-cf3","type":"blocks","created_at":"2026-01-06T20:07:32.279279-08:00","created_by":"beads/crew/dave"}]} @@ -2577,7 +2607,8 @@ {"id":"bd-wisp-8dwf","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:10.189603-08:00","updated_at":"2026-01-14T21:33:10.189603-08:00","dependencies":[{"issue_id":"bd-wisp-8dwf","depends_on_id":"bd-wisp-7q1d","type":"parent-child","created_at":"2026-01-14T21:33:10.282268-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-8dwf","depends_on_id":"bd-wisp-iqcu","type":"blocks","created_at":"2026-01-14T21:33:10.379904-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-8e8q","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T21:33:12.458262-08:00","updated_at":"2026-01-14T21:33:12.458262-08:00","ephemeral":true} {"id":"bd-wisp-8erf","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n```bash\n# Check if refinery session exists\ngt session status \u003crig\u003e/refinery\n\n# Check for pending merge requests\nbd list --type=merge-request --status=open\n```\n\nIf MRs waiting AND refinery not running:\n```bash\ngt session start \u003crig\u003e/refinery\ngt mail send \u003crig\u003e/refinery -s \"PATROL: Wake up\" -m \"Merge requests in queue. Please process.\"\n```\n\nIf refinery running but queue stale (\u003e30 min), send nudge.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:22.271257-08:00","updated_at":"2026-01-14T21:33:22.271257-08:00","dependencies":[{"issue_id":"bd-wisp-8erf","depends_on_id":"bd-wisp-qzai","type":"parent-child","created_at":"2026-01-14T21:33:22.310747-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-8erf","depends_on_id":"bd-wisp-0uqe","type":"blocks","created_at":"2026-01-14T21:33:22.473259-08:00","created_by":"beads/witness"}],"ephemeral":true} -{"id":"bd-wisp-8ke","title":"Run test suite","description":"Run the test suite.\n\n```bash\ngo test ./...\n```\n\nTrack results: pass count, fail count, specific failures.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T00:34:44.77926-08:00","updated_at":"2026-01-12T00:35:15.898241-08:00","closed_at":"2026-01-12T00:35:15.898241-08:00","close_reason":"Skipped - no branches in queue","dependencies":[{"issue_id":"bd-wisp-8ke","depends_on_id":"bd-wisp-s9j","type":"blocks","created_at":"2026-01-12T00:34:44.806934-08:00","created_by":"beads/refinery"}],"ephemeral":true} +{"id":"bd-wisp-8kdp","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"closed","priority":2,"issue_type":"epic","created_at":"2026-01-14T23:36:30.245674-08:00","updated_at":"2026-01-14T23:39:44.662696-08:00","closed_at":"2026-01-14T23:39:44.662696-08:00","close_reason":"Patrol complete: queue empty, 0 branches merged","ephemeral":true} +{"id":"bd-wisp-8ke","title":"Run test suite","description":"Run the test suite.\n\n```bash\ngo test ./...\n```\n\nTrack results: pass count, fail count, specific failures.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T00:34:44.77926-08:00","updated_at":"2026-01-12T00:35:15.898241-08:00","closed_at":"2026-01-12T00:35:15.898241-08:00","close_reason":"Skipped - no branches in queue","ephemeral":true} {"id":"bd-wisp-8lbl","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:03:42.744637-08:00","updated_at":"2026-01-14T21:03:47.454499-08:00","ephemeral":true} {"id":"bd-wisp-8m1","title":"Verify PyPI package","description":"Confirm PyPI package published.\n\n```bash\npip index versions beads-mcp 2\u003e/dev/null | head -3\n```\n\nOr check: https://pypi.org/project/beads-mcp/\n\nShould show 0.47.1.\n\nNote: PyPI may have a small propagation delay (1-2 min).\n","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-12T03:17:16.713223-08:00","updated_at":"2026-01-12T03:17:16.713223-08:00","dependencies":[{"issue_id":"bd-wisp-8m1","depends_on_id":"bd-wisp-5j5","type":"parent-child","created_at":"2026-01-12T03:17:16.740912-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-8m1","depends_on_id":"bd-wisp-4i8","type":"blocks","created_at":"2026-01-12T03:17:16.796067-08:00","created_by":"beads/crew/emma"}],"ephemeral":true} {"id":"bd-wisp-905j","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:27.576197-08:00","updated_at":"2026-01-14T21:33:27.576197-08:00","dependencies":[{"issue_id":"bd-wisp-905j","depends_on_id":"bd-wisp-opv7","type":"parent-child","created_at":"2026-01-14T21:33:27.74364-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-905j","depends_on_id":"bd-wisp-lbn0","type":"blocks","created_at":"2026-01-14T21:33:27.95848-08:00","created_by":"beads/witness"}],"ephemeral":true} @@ -2586,13 +2617,14 @@ {"id":"bd-wisp-99t","title":"Gate: gh:run release.yml","description":"Async gate for step await-ci","status":"closed","priority":2,"issue_type":"gate","created_at":"2026-01-06T20:07:32.258514-08:00","updated_at":"2026-01-06T20:17:28.461889-08:00","closed_at":"2026-01-06T20:17:28.461889-08:00","close_reason":"Release workflow completed successfully"} {"id":"bd-wisp-9b0","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"closed","priority":2,"issue_type":"epic","assignee":"beads/refinery","created_at":"2026-01-10T18:35:46.606209-08:00","updated_at":"2026-01-10T18:41:19.369613-08:00","closed_at":"2026-01-10T18:41:19.369613-08:00","close_reason":"Closed","ephemeral":true} {"id":"bd-wisp-9bu0","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:16.878618-08:00","updated_at":"2026-01-14T20:56:16.878618-08:00","dependencies":[{"issue_id":"bd-wisp-9bu0","depends_on_id":"bd-wisp-qc3z","type":"parent-child","created_at":"2026-01-14T20:56:16.882432-08:00","created_by":"beads/witness"}],"ephemeral":true} -{"id":"bd-wisp-9ej","title":"Merge and push to main","description":"Merge to main and push. CRITICAL: Notifications come IMMEDIATELY after push.\n\n**Step 1: Merge and Push**\n```bash\ngit checkout main\ngit merge --ff-only temp\ngit push origin main\n```\n\n⚠️ **STOP HERE - DO NOT PROCEED UNTIL STEPS 2-3 COMPLETE**\n\n**Step 2: Send MERGED Notification (REQUIRED - DO THIS IMMEDIATELY)**\n\nRIGHT NOW, before any cleanup, send MERGED mail to Witness:\n\n```bash\ngt mail send \u003crig\u003e/witness -s \"MERGED \u003cpolecat-name\u003e\" -m \"Branch: \u003cbranch\u003e\nIssue: \u003cissue-id\u003e\nMerged-At: $(date -u +%Y-%m-%dT%H:%M:%SZ)\"\n```\n\nThis signals the Witness to nuke the polecat worktree. WITHOUT THIS NOTIFICATION,\nPOLECAT WORKTREES ACCUMULATE INDEFINITELY AND THE LIFECYCLE BREAKS.\n\n**Step 3: Close MR Bead (REQUIRED - DO THIS IMMEDIATELY)**\n\n⚠️ **VERIFICATION BEFORE CLOSING**: Confirm the work is actually on main:\n```bash\n# Get the commit message/issue from the branch\ngit log origin/main --oneline | grep \"\u003cissue-id\u003e\"\n# OR verify the commit SHA is on main:\ngit branch --contains \u003ccommit-sha\u003e | grep main\n```\n\nIf work is NOT on main, DO NOT close the MR bead. Investigate first.\n\n```bash\nbd close \u003cmr-bead-id\u003e --reason \"Merged to main at $(git rev-parse --short HEAD)\"\n```\n\nThe MR bead ID was in the MERGE_READY message or find via:\n```bash\nbd list --type=merge-request --status=open | grep \u003cpolecat-name\u003e\n```\n\n**VALIDATION**: The MR bead's source_issue should be a valid bead ID (gt-xxxxx),\nnot a branch name. If source_issue contains a branch name, flag for investigation.\n\n**Step 4: Archive the MERGE_READY mail (REQUIRED)**\n```bash\ngt mail archive \u003cmerge-ready-message-id\u003e\n```\nThe message ID was tracked when you processed inbox-check.\n\n**Step 5: Cleanup (only after Steps 2-4 confirmed)**\n```bash\ngit branch -d temp\ngit push origin --delete \u003cpolecat-branch\u003e\n```\n\n**VERIFICATION GATE**: You CANNOT proceed to loop-check without:\n- [x] MERGED mail sent to witness\n- [x] MR bead closed\n- [x] MERGE_READY mail archived\n\nIf you skipped notifications or archiving, GO BACK AND DO THEM NOW.\n\nMain has moved. Any remaining branches need rebasing on new baseline.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T00:34:44.779884-08:00","updated_at":"2026-01-12T00:35:17.476883-08:00","closed_at":"2026-01-12T00:35:17.476883-08:00","close_reason":"Skipped - no branches in queue","dependencies":[{"issue_id":"bd-wisp-9ej","depends_on_id":"bd-wisp-tkf","type":"blocks","created_at":"2026-01-12T00:34:44.811787-08:00","created_by":"beads/refinery"}],"ephemeral":true} +{"id":"bd-wisp-9ej","title":"Merge and push to main","description":"Merge to main and push. CRITICAL: Notifications come IMMEDIATELY after push.\n\n**Step 1: Merge and Push**\n```bash\ngit checkout main\ngit merge --ff-only temp\ngit push origin main\n```\n\n⚠️ **STOP HERE - DO NOT PROCEED UNTIL STEPS 2-3 COMPLETE**\n\n**Step 2: Send MERGED Notification (REQUIRED - DO THIS IMMEDIATELY)**\n\nRIGHT NOW, before any cleanup, send MERGED mail to Witness:\n\n```bash\ngt mail send \u003crig\u003e/witness -s \"MERGED \u003cpolecat-name\u003e\" -m \"Branch: \u003cbranch\u003e\nIssue: \u003cissue-id\u003e\nMerged-At: $(date -u +%Y-%m-%dT%H:%M:%SZ)\"\n```\n\nThis signals the Witness to nuke the polecat worktree. WITHOUT THIS NOTIFICATION,\nPOLECAT WORKTREES ACCUMULATE INDEFINITELY AND THE LIFECYCLE BREAKS.\n\n**Step 3: Close MR Bead (REQUIRED - DO THIS IMMEDIATELY)**\n\n⚠️ **VERIFICATION BEFORE CLOSING**: Confirm the work is actually on main:\n```bash\n# Get the commit message/issue from the branch\ngit log origin/main --oneline | grep \"\u003cissue-id\u003e\"\n# OR verify the commit SHA is on main:\ngit branch --contains \u003ccommit-sha\u003e | grep main\n```\n\nIf work is NOT on main, DO NOT close the MR bead. Investigate first.\n\n```bash\nbd close \u003cmr-bead-id\u003e --reason \"Merged to main at $(git rev-parse --short HEAD)\"\n```\n\nThe MR bead ID was in the MERGE_READY message or find via:\n```bash\nbd list --type=merge-request --status=open | grep \u003cpolecat-name\u003e\n```\n\n**VALIDATION**: The MR bead's source_issue should be a valid bead ID (gt-xxxxx),\nnot a branch name. If source_issue contains a branch name, flag for investigation.\n\n**Step 4: Archive the MERGE_READY mail (REQUIRED)**\n```bash\ngt mail archive \u003cmerge-ready-message-id\u003e\n```\nThe message ID was tracked when you processed inbox-check.\n\n**Step 5: Cleanup (only after Steps 2-4 confirmed)**\n```bash\ngit branch -d temp\ngit push origin --delete \u003cpolecat-branch\u003e\n```\n\n**VERIFICATION GATE**: You CANNOT proceed to loop-check without:\n- [x] MERGED mail sent to witness\n- [x] MR bead closed\n- [x] MERGE_READY mail archived\n\nIf you skipped notifications or archiving, GO BACK AND DO THEM NOW.\n\nMain has moved. Any remaining branches need rebasing on new baseline.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T00:34:44.779884-08:00","updated_at":"2026-01-12T00:35:17.476883-08:00","closed_at":"2026-01-12T00:35:17.476883-08:00","close_reason":"Skipped - no branches in queue","ephemeral":true} {"id":"bd-wisp-9gxz","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T21:33:23.560866-08:00","updated_at":"2026-01-14T21:33:23.560866-08:00","ephemeral":true} {"id":"bd-wisp-9jo","title":"Review changes since last release","description":"Understand what's being released.\n\n```bash\ngit log $(git describe --tags --abbrev=0)..HEAD --oneline\n```\n\nCategorize changes:\n- Features (feat:)\n- Fixes (fix:)\n- Breaking changes\n- Documentation\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T20:07:32.256572-08:00","updated_at":"2026-01-06T20:08:55.146264-08:00","closed_at":"2026-01-06T20:08:55.146264-08:00","close_reason":"Reviewed 34 commits since v0.44.0","dependencies":[{"issue_id":"bd-wisp-9jo","depends_on_id":"bd-wisp-z85","type":"blocks","created_at":"2026-01-06T20:07:32.273034-08:00","created_by":"beads/crew/dave"}]} -{"id":"bd-wisp-9jv","title":"Scan merge queue","description":"Check the beads merge queue - this is the SOURCE OF TRUTH for pending merges.\n\n```bash\ngit fetch --prune origin\ngt mq list \u003crig\u003e\n```\n\nThe beads MQ tracks all pending merge requests. Do NOT rely on `git branch -r | grep polecat`\nas branches may exist without MR beads, or MR beads may exist for already-merged work.\n\nIf queue empty, skip to context-check step.\n\nFor each MR in the queue, verify the branch still exists:\n```bash\ngit branch -r | grep \u003cbranch\u003e\n```\n\nIf branch doesn't exist for a queued MR:\n- Close the MR bead: `bd close \u003cmr-id\u003e --reason \"Branch no longer exists\"`\n- Remove from processing queue\n\nTrack verified MR list for this cycle.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T01:27:11.195527-08:00","updated_at":"2026-01-12T01:27:42.447313-08:00","closed_at":"2026-01-12T01:27:42.447313-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-9jv","depends_on_id":"bd-wisp-q7n","type":"blocks","created_at":"2026-01-12T01:27:11.218511-08:00","created_by":"beads/refinery"}],"ephemeral":true} +{"id":"bd-wisp-9jv","title":"Scan merge queue","description":"Check the beads merge queue - this is the SOURCE OF TRUTH for pending merges.\n\n```bash\ngit fetch --prune origin\ngt mq list \u003crig\u003e\n```\n\nThe beads MQ tracks all pending merge requests. Do NOT rely on `git branch -r | grep polecat`\nas branches may exist without MR beads, or MR beads may exist for already-merged work.\n\nIf queue empty, skip to context-check step.\n\nFor each MR in the queue, verify the branch still exists:\n```bash\ngit branch -r | grep \u003cbranch\u003e\n```\n\nIf branch doesn't exist for a queued MR:\n- Close the MR bead: `bd close \u003cmr-id\u003e --reason \"Branch no longer exists\"`\n- Remove from processing queue\n\nTrack verified MR list for this cycle.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T01:27:11.195527-08:00","updated_at":"2026-01-12T01:27:42.447313-08:00","closed_at":"2026-01-12T01:27:42.447313-08:00","close_reason":"Closed","ephemeral":true} {"id":"bd-wisp-9ka","title":"Commit release","description":"Stage and commit all version changes.\n\n```bash\ngit add -A\ngit commit -m \"chore: Bump version to 0.45.0\"\n```\n\nReview the commit to ensure all expected files are included.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T20:07:32.257545-08:00","updated_at":"2026-01-06T20:11:53.72207-08:00","closed_at":"2026-01-06T20:11:53.72207-08:00","close_reason":"Release committed","dependencies":[{"issue_id":"bd-wisp-9ka","depends_on_id":"bd-wisp-v0n","type":"blocks","created_at":"2026-01-06T20:07:32.277252-08:00","created_by":"beads/crew/dave"}]} {"id":"bd-wisp-9kb","title":"Update info.go versionChanges","description":"Add entry to versionChanges in cmd/bd/info.go.\n\nThis powers `bd info --whats-new` for agents.\n\n```go\n\"0.45.0\": {\n \"summary\": \"Brief description\",\n \"changes\": []string{\n \"Key change 1\",\n \"Key change 2\",\n },\n},\n```\n\nFocus on workflow-impacting changes agents need to know.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T20:07:32.256963-08:00","updated_at":"2026-01-06T20:10:31.456687-08:00","closed_at":"2026-01-06T20:10:31.456687-08:00","close_reason":"info.go versionChanges updated for 0.45.0","dependencies":[{"issue_id":"bd-wisp-9kb","depends_on_id":"bd-wisp-540","type":"blocks","created_at":"2026-01-06T20:07:32.27459-08:00","created_by":"beads/crew/dave"}]} {"id":"bd-wisp-9lg","title":"Update info.go versionChanges","description":"Add entry to versionChanges in cmd/bd/info.go.\n\nThis powers `bd info --whats-new` for agents.\n\n```go\n\"0.47.1\": {\n \"summary\": \"Brief description\",\n \"changes\": []string{\n \"Key change 1\",\n \"Key change 2\",\n },\n},\n```\n\nFocus on workflow-impacting changes agents need to know.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T03:17:16.707988-08:00","updated_at":"2026-01-12T03:19:48.160044-08:00","closed_at":"2026-01-12T03:19:48.160044-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-9lg","depends_on_id":"bd-wisp-5j5","type":"parent-child","created_at":"2026-01-12T03:17:16.722132-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-9lg","depends_on_id":"bd-wisp-je0","type":"blocks","created_at":"2026-01-12T03:17:16.754969-08:00","created_by":"beads/crew/emma"}],"ephemeral":true} +{"id":"bd-wisp-9nv5","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:50:36.354557-08:00","updated_at":"2026-01-14T21:50:41.895575-08:00","ephemeral":true} {"id":"bd-wisp-9rw9","title":"Check timer gates for expiration","description":"Check for expired timer gates and escalate as needed.\n\nTimer gates are async wait conditions with a timeout. When the timeout expires,\nthe gate should be escalated to the overseer for human intervention.\n\n**Step 1: Run timer gate check**\n```bash\nbd gate check --type=timer --escalate\n```\n\nThis command:\n1. Finds all open gate issues with await_type=timer\n2. Checks if `now \u003e created_at + timeout`\n3. Escalates expired gates via `gt escalate` (HIGH severity)\n4. Reports summary of gate status\n\n**Step 2: Review output**\n\nIf expired gates were found and escalated:\n- The escalation creates an audit trail bead\n- Overseer will be notified via mail\n- Gate remains open until manually resolved\n\nIf no expired gates:\n- Continue patrol normally\n\n**Note**: Timer gates do NOT auto-close on expiration. They escalate.\nThis ensures human oversight of timeout conditions.\n\n**Parallelism**: This is a single command, no parallel execution needed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:13.620878-08:00","updated_at":"2026-01-14T21:33:13.620878-08:00","dependencies":[{"issue_id":"bd-wisp-9rw9","depends_on_id":"bd-wisp-7dag","type":"parent-child","created_at":"2026-01-14T21:33:13.678109-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-9rw9","depends_on_id":"bd-wisp-sf2g","type":"blocks","created_at":"2026-01-14T21:33:13.803375-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-9sq","title":"Release complete","description":"Release v0.45.0 is complete!\n\nSummary:\n- All version files updated\n- Git tag pushed\n- CI artifacts built (via gate)\n- npm and PyPI packages verified\n- Local installation updated\n- Daemons restarted\n\nOptional next steps:\n- Announce on social media\n- Update documentation site\n- Close related milestone\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T20:07:32.259643-08:00","updated_at":"2026-01-06T20:18:20.109063-08:00","closed_at":"2026-01-06T20:18:20.109063-08:00","close_reason":"Release v0.45.0 complete","dependencies":[{"issue_id":"bd-wisp-9sq","depends_on_id":"bd-wisp-bkf","type":"blocks","created_at":"2026-01-06T20:07:32.292316-08:00","created_by":"beads/crew/dave"}]} {"id":"bd-wisp-9tqb","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:13.637803-08:00","updated_at":"2026-01-14T20:56:13.637804-08:00","dependencies":[{"issue_id":"bd-wisp-9tqb","depends_on_id":"bd-wisp-0l5p","type":"parent-child","created_at":"2026-01-14T20:56:13.697926-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-9tqb","depends_on_id":"bd-wisp-xa5i","type":"blocks","created_at":"2026-01-14T20:56:13.767605-08:00","created_by":"beads/witness"}],"ephemeral":true} @@ -2606,25 +2638,24 @@ {"id":"bd-wisp-alhv","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:13.621243-08:00","updated_at":"2026-01-14T21:33:13.621243-08:00","dependencies":[{"issue_id":"bd-wisp-alhv","depends_on_id":"bd-wisp-7dag","type":"parent-child","created_at":"2026-01-14T21:33:13.691924-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-alhv","depends_on_id":"bd-wisp-9rw9","type":"blocks","created_at":"2026-01-14T21:33:13.817824-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-apf","title":"Check refinery mail","description":"Check mail for MERGE_READY submissions, escalations, and messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**MERGE_READY**:\nA polecat's work is ready for merge. Extract details and track for processing.\n\n```bash\n# Parse MERGE_READY message body:\n# Branch: \u003cbranch\u003e\n# Issue: \u003cissue-id\u003e\n# Polecat: \u003cpolecat-name\u003e\n# MR: \u003cmr-bead-id\u003e\n# Verified: clean git state, issue closed\n\n# Track in your merge queue for this patrol cycle:\n# - Branch name\n# - Issue ID\n# - Polecat name (REQUIRED for MERGED notification)\n# - MR bead ID (REQUIRED for closing after merge)\n```\n\n**IMPORTANT**: You MUST track the polecat name, MR bead ID, AND message ID - you will need them\nin merge-push step to send MERGED notification, close the MR bead, and archive the mail.\n\nMark as read. The work will be processed in queue-scan/process-branch.\n**Do NOT archive yet** - archive after merge/reject decision in merge-push step.\n\n**PATROL: Wake up**:\nWitness detected MRs waiting but refinery idle. Acknowledge and archive:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HELP / Blocked**:\nAssess and respond. If you can't help, escalate to Mayor.\nArchive after handling:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Check for in-flight merges.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: pending MRs in queue. Inbox should be near-empty.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-11T14:50:43.332033-08:00","updated_at":"2026-01-11T15:06:13.099965-08:00","closed_at":"2026-01-11T15:06:13.099965-08:00","close_reason":"Inbox empty, no messages","ephemeral":true} {"id":"bd-wisp-az0","title":"Verify CHANGELOG completeness","description":"Ensure CHANGELOG captures ALL commits since the last release.\n\n**Step 1: Count commits since last tag**\n```bash\nLAST_TAG=$(git describe --tags --abbrev=0)\nCOMMIT_COUNT=$(git rev-list $LAST_TAG..HEAD --count)\necho \"Commits since $LAST_TAG: $COMMIT_COUNT\"\n```\n\n**Step 2: List all commits with their messages**\n```bash\ngit log $LAST_TAG..HEAD --oneline --no-merges\n```\n\n**Step 3: Cross-reference with CHANGELOG**\nOpen CHANGELOG.md and verify every significant commit is documented in [Unreleased].\n\n**Red flags for stale CHANGELOG:**\n- If CHANGELOG was last modified days ago but there are recent commits\n- If commit count seems high but [Unreleased] section is sparse\n- If PR titles in commits don't match CHANGELOG entries\n\n```bash\n# Check when CHANGELOG was last modified\ngit log -1 --format=\"%ar\" -- CHANGELOG.md\n\n# Compare to latest commit date\ngit log -1 --format=\"%ar\"\n```\n\n**If CHANGELOG is stale:**\n1. Review all commits since last tag\n2. Add missing entries to appropriate sections (Added/Changed/Fixed)\n3. Group related changes\n4. Focus on user-facing changes and breaking changes\n\nDon't proceed until CHANGELOG is complete - it's the release notes!\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T03:17:16.707361-08:00","updated_at":"2026-01-12T03:19:17.323602-08:00","closed_at":"2026-01-12T03:19:17.323602-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-az0","depends_on_id":"bd-wisp-5j5","type":"parent-child","created_at":"2026-01-12T03:17:16.720147-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-az0","depends_on_id":"bd-wisp-nys","type":"blocks","created_at":"2026-01-12T03:17:16.751444-08:00","created_by":"beads/crew/emma"}],"ephemeral":true} +{"id":"bd-wisp-b4cm","title":"Burn and respawn or loop","description":"End of patrol cycle decision.\n\n**Step 1: Estimate remaining context**\n\nAsk yourself:\n- Have I processed many branches this cycle?\n- Is the conversation getting long?\n- Am I starting to lose track of earlier context?\n\nRule of thumb: If you've done 3+ merges or processed significant cleanup work,\nit's time for a fresh session.\n\n**Step 2: Decision tree**\n\nIf queue non-empty AND context LOW:\n- Squash this wisp to digest\n- Spawn fresh patrol wisp\n- Return to inbox-check\n\nIf queue empty OR context HIGH OR good stopping point:\n- Squash wisp with summary digest\n- Use `gt handoff` for clean session transition:\n\n```bash\ngt handoff -s \"Patrol complete\" -m \"Merged X branches, Y tests passed.\nQueue: empty/N remaining\nNext: [any notes for successor]\"\n```\n\n**Why gt handoff?**\n- Sends handoff mail to yourself with context\n- Respawns with fresh Claude instance\n- SessionStart hook runs gt prime\n- Successor picks up from your hook\n\n**DO NOT just exit.** Always use `gt handoff` for proper lifecycle.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:09:52.702389-08:00","updated_at":"2026-01-15T08:09:52.702389-08:00","dependencies":[{"issue_id":"bd-wisp-b4cm","depends_on_id":"bd-wisp-llul","type":"parent-child","created_at":"2026-01-15T08:09:52.989748-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-b4cm","depends_on_id":"bd-wisp-drno","type":"blocks","created_at":"2026-01-15T08:09:53.283446-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-be1","title":"Release complete","description":"Release v0.47.1 is complete!\n\nSummary:\n- All version files updated\n- Git tag pushed\n- CI artifacts built (via gate)\n- npm and PyPI packages verified\n- Local installation updated\n- Daemons restarted\n\nOptional next steps:\n- Announce on social media\n- Update documentation site\n- Close related milestone\n","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-12T03:17:16.714128-08:00","updated_at":"2026-01-12T03:17:16.714128-08:00","dependencies":[{"issue_id":"bd-wisp-be1","depends_on_id":"bd-wisp-5j5","type":"parent-child","created_at":"2026-01-12T03:17:16.744595-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-be1","depends_on_id":"bd-wisp-08w","type":"blocks","created_at":"2026-01-12T03:17:16.812973-08:00","created_by":"beads/crew/emma"}],"ephemeral":true} {"id":"bd-wisp-bkf","title":"Restart daemons","description":"Restart bd daemons to pick up new version.\n\n```bash\nbd daemons killall\n```\n\nDaemons will auto-restart with new version on next bd command.\n\nVerify:\n```bash\nbd daemons list\n```\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T20:07:32.259461-08:00","updated_at":"2026-01-06T20:18:20.108169-08:00","closed_at":"2026-01-06T20:18:20.108169-08:00","close_reason":"Release v0.45.0 complete","dependencies":[{"issue_id":"bd-wisp-bkf","depends_on_id":"bd-wisp-fm4","type":"blocks","created_at":"2026-01-06T20:07:32.290802-08:00","created_by":"beads/crew/dave"}]} -{"id":"bd-wisp-bmc","title":"Check for more work","description":"More branches to process?\n\n**Entry paths:**\n- Normal: After successful merge-push\n- Conflict-skip: After process-branch created conflict-resolution task\n\nIf yes: Return to process-branch with next branch.\nIf no: Continue to generate-summary.\n\n**Track for this cycle:**\n- branches_merged: count and names of successfully merged branches\n- branches_conflict: count and names of branches skipped due to conflicts\n- conflict_tasks: IDs of conflict-resolution tasks created\n\nThis tracking feeds into generate-summary for the patrol digest.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T00:34:44.780188-08:00","updated_at":"2026-01-12T00:35:19.408028-08:00","closed_at":"2026-01-12T00:35:19.408028-08:00","close_reason":"Queue was empty - no loop needed","dependencies":[{"issue_id":"bd-wisp-bmc","depends_on_id":"bd-wisp-9ej","type":"blocks","created_at":"2026-01-12T00:34:44.814328-08:00","created_by":"beads/refinery"}],"ephemeral":true} -{"id":"bd-wisp-boc","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"closed","priority":2,"issue_type":"epic","assignee":"beads/refinery","created_at":"2026-01-14T20:40:48.923525-08:00","updated_at":"2026-01-14T20:49:02.341861-08:00","closed_at":"2026-01-14T20:49:02.341861-08:00","close_reason":"Patrol complete: MQ empty, no merges needed","ephemeral":true} +{"id":"bd-wisp-bmar","title":"Mechanical rebase","description":"Pick next branch from queue. Attempt mechanical rebase on current main.\n\n**Step 1: Checkout and attempt rebase**\n```bash\ngit checkout -b temp origin/\u003cpolecat-branch\u003e\ngit rebase origin/main\n```\n\n**Step 2: Check rebase result**\n\nThe rebase exits with:\n- Exit code 0: Success - proceed to run-tests\n- Exit code 1 (conflicts): Conflict detected - proceed to Step 3\n\nTo detect conflict state after rebase fails:\n```bash\n# Check if we're in a conflicted rebase state\nls .git/rebase-merge 2\u003e/dev/null \u0026\u0026 echo \"CONFLICT_STATE\"\n```\n\n**Step 3: Handle conflicts (if any)**\n\nIf rebase SUCCEEDED (exit code 0):\n- Skip to run-tests step (continue normal merge flow)\n\nIf rebase FAILED with conflicts:\n\n1. **Abort the rebase** (DO NOT leave repo in conflicted state):\n```bash\ngit rebase --abort\n```\n\n2. **Record conflict metadata**:\n```bash\n# Capture main SHA for reference\nMAIN_SHA=$(git rev-parse origin/main)\nBRANCH_SHA=$(git rev-parse origin/\u003cpolecat-branch\u003e)\n```\n\n3. **Create conflict-resolution task**:\n```bash\nbd create --type=task --priority=1 --title=\"Resolve merge conflicts: \u003coriginal-issue-title\u003e\" --description=\"## Conflict Resolution Required\n\nOriginal MR: \u003cmr-bead-id\u003e\nBranch: \u003cpolecat-branch\u003e\nOriginal Issue: \u003cissue-id\u003e\nConflict with main at: ${MAIN_SHA}\nBranch SHA: ${BRANCH_SHA}\n\n## Instructions\n1. Clone/checkout the branch\n2. Rebase on current main: git rebase origin/main\n3. Resolve conflicts\n4. Force push: git push -f origin \u003cbranch\u003e\n5. Close this task when done\n\nThe MR will be re-queued for processing after conflicts are resolved.\"\n```\n\n4. **Skip this MR** (do NOT delete branch or close MR bead):\n- Leave branch intact for conflict resolution\n- Leave MR bead open (will be re-processed after resolution)\n- Continue to loop-check for next branch\n\n**CRITICAL**: Never delete a branch that has conflicts. The branch contains\nthe original work and must be preserved for conflict resolution.\n\nTrack: rebase result (success/conflict), conflict task ID if created.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:02:45.430201-08:00","updated_at":"2026-01-15T08:02:45.430201-08:00","dependencies":[{"issue_id":"bd-wisp-bmar","depends_on_id":"bd-wisp-puaa","type":"parent-child","created_at":"2026-01-15T08:02:45.488399-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-bmar","depends_on_id":"bd-wisp-j04u","type":"blocks","created_at":"2026-01-15T08:02:45.762554-08:00","created_by":"beads/refinery"}],"ephemeral":true} +{"id":"bd-wisp-bmc","title":"Check for more work","description":"More branches to process?\n\n**Entry paths:**\n- Normal: After successful merge-push\n- Conflict-skip: After process-branch created conflict-resolution task\n\nIf yes: Return to process-branch with next branch.\nIf no: Continue to generate-summary.\n\n**Track for this cycle:**\n- branches_merged: count and names of successfully merged branches\n- branches_conflict: count and names of branches skipped due to conflicts\n- conflict_tasks: IDs of conflict-resolution tasks created\n\nThis tracking feeds into generate-summary for the patrol digest.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T00:34:44.780188-08:00","updated_at":"2026-01-12T00:35:19.408028-08:00","closed_at":"2026-01-12T00:35:19.408028-08:00","close_reason":"Queue was empty - no loop needed","ephemeral":true} {"id":"bd-wisp-brwi","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:11.5905-08:00","updated_at":"2026-01-14T20:56:11.5905-08:00","dependencies":[{"issue_id":"bd-wisp-brwi","depends_on_id":"bd-wisp-ecpj","type":"parent-child","created_at":"2026-01-14T20:56:11.617856-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-brwi","depends_on_id":"bd-wisp-2qmu","type":"blocks","created_at":"2026-01-14T20:56:11.664444-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-btvh","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:14.808239-08:00","updated_at":"2026-01-14T21:33:14.808239-08:00","dependencies":[{"issue_id":"bd-wisp-btvh","depends_on_id":"bd-wisp-zonw","type":"parent-child","created_at":"2026-01-14T21:33:14.947918-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-btvh","depends_on_id":"bd-wisp-oma9","type":"blocks","created_at":"2026-01-14T21:33:15.091993-08:00","created_by":"beads/witness"}],"ephemeral":true} -{"id":"bd-wisp-bwf","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-13T19:54:13.070611-08:00","updated_at":"2026-01-13T19:54:13.070611-08:00","ephemeral":true} {"id":"bd-wisp-bye","title":"Run bump-version.sh","description":"Update all component versions atomically.\n\n```bash\n./scripts/bump-version.sh 0.45.0\n```\n\nThis updates:\n- cmd/bd/version.go\n- .claude-plugin/*.json\n- integrations/beads-mcp/pyproject.toml\n- integrations/beads-mcp/src/beads_mcp/__init__.py\n- npm-package/package.json\n- Hook templates\n- README.md\n- CHANGELOG.md (adds date)\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T20:07:32.257161-08:00","updated_at":"2026-01-06T20:11:24.896526-08:00","closed_at":"2026-01-06T20:11:24.896526-08:00","close_reason":"Version bumped and verified: 0.45.0","dependencies":[{"issue_id":"bd-wisp-bye","depends_on_id":"bd-wisp-9kb","type":"blocks","created_at":"2026-01-06T20:07:32.275432-08:00","created_by":"beads/crew/dave"}]} -{"id":"bd-wisp-c0xv","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T21:31:43.04241-08:00","updated_at":"2026-01-14T21:31:43.04241-08:00","ephemeral":true} {"id":"bd-wisp-c1oh","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:24.870161-08:00","updated_at":"2026-01-14T21:33:24.870161-08:00","dependencies":[{"issue_id":"bd-wisp-c1oh","depends_on_id":"bd-wisp-srhi","type":"parent-child","created_at":"2026-01-14T21:33:24.874329-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-c5eh","title":"Ping Deacon for health check","description":"Send WITNESS_PING to Deacon for second-order monitoring.\n\nThe Witness fleet collectively monitors Deacon health - this prevents the\n\"who watches the watchers\" problem. If Deacon dies, Witnesses detect it.\n\n**Step 1: Send ping**\n```bash\ngt mail send deacon/ -s \"WITNESS_PING \u003crig\u003e\" -m \"Rig: \u003crig\u003e\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: \u003ccycle-number\u003e\"\n```\n\n**Step 2: Check Deacon health**\n```bash\n# Check Deacon agent bead for last_activity\nbd list --type=agent --json | jq '.[] | select(.description | contains(\"deacon\"))'\n```\n\nLook at the `last_activity` timestamp. If stale (\u003e5 minutes since last update):\n- Deacon may be dead or stuck\n\n**Step 3: Escalate if needed**\n```bash\n# If Deacon appears down\ngt mail send mayor/ -s \"ALERT: Deacon appears unresponsive\" -m \"No Deacon activity for \u003e5 minutes.\nLast seen: \u003ctimestamp\u003e\nWitness: \u003crig\u003e/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:13.621598-08:00","updated_at":"2026-01-14T21:33:13.621598-08:00","dependencies":[{"issue_id":"bd-wisp-c5eh","depends_on_id":"bd-wisp-7dag","type":"parent-child","created_at":"2026-01-14T21:33:13.705587-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-c5eh","depends_on_id":"bd-wisp-alhv","type":"blocks","created_at":"2026-01-14T21:33:13.832242-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-cdbr","title":"Process pending cleanup wisps","description":"Process cleanup wisps (exception handling for dirty polecats).\n\nIn the ephemeral model, cleanup wisps are only created when a polecat has\ndirty state (uncommitted changes, unpushed commits) that prevented immediate\nnuke. Most polecats are nuked immediately on POLECAT_DONE and never create wisps.\n\n```bash\n# Find all cleanup wisps\nbd list --wisp --labels=cleanup --status=open\n```\n\nIf no wisps, skip this step (most common case in ephemeral model).\n\nFor each cleanup wisp, investigate and resolve the dirty state:\n\n## State: pending (needs investigation)\n\n1. **Extract polecat name** from wisp title/labels\n\n2. **Diagnose the problem**:\n```bash\ncd polecats/\u003cname\u003e\ngit status # What's uncommitted?\ngit stash list # Any stashed work?\ngit log origin/main..HEAD # Any unpushed commits?\n```\n\n3. **Resolution options**:\n - **Uncommitted changes**: Commit and push, then nuke\n - **Stashed work**: Pop and commit, or discard if not valuable\n - **Unpushed commits**: Push to origin, then nuke\n - **All valuable work lost**: Escalate to Mayor for recovery\n\n4. **If resolvable locally**: Fix and nuke\n```bash\n# Example: push unpushed commits\ngit push origin HEAD\n\n# Then nuke\ngt polecat nuke \u003cname\u003e\n\n# Close the wisp\nbd close \u003cwisp-id\u003e --reason \"Resolved: pushed commits, nuked\"\n```\n\n5. **If needs escalation**: Send RECOVERY_NEEDED to Mayor\n```bash\ngt mail send mayor/ -s \"RECOVERY_NEEDED \u003crig\u003e/\u003cpolecat\u003e\" \\\n -m \"Cleanup Status: \u003cstatus\u003e\nBranch: \u003cbranch\u003e\nIssue: \u003cissue-id\u003e\n\nCannot auto-resolve. Please advise.\"\n```\nLeave wisp open until Mayor resolves.\n\n## State: merge-requested (legacy, rare)\n\nThis state was used before the ephemeral model. If found, the polecat is\nwaiting for a MERGED signal. The inbox-check step handles these.\n\n**Parallelism**: Use Task tool subagents to process multiple cleanups concurrently.\nEach cleanup is independent - perfect for parallel execution.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:15.75725-08:00","updated_at":"2026-01-14T20:56:15.75725-08:00","dependencies":[{"issue_id":"bd-wisp-cdbr","depends_on_id":"bd-wisp-9u3o","type":"parent-child","created_at":"2026-01-14T20:56:15.770922-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-cdbr","depends_on_id":"bd-wisp-jiwy","type":"blocks","created_at":"2026-01-14T20:56:15.85984-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-cdsh","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:11.325347-08:00","updated_at":"2026-01-14T21:33:11.325347-08:00","dependencies":[{"issue_id":"bd-wisp-cdsh","depends_on_id":"bd-wisp-3430","type":"parent-child","created_at":"2026-01-14T21:33:11.329198-08:00","created_by":"beads/witness"}],"ephemeral":true} -{"id":"bd-wisp-ce6","title":"Run test suite","description":"Run the test suite.\n\n```bash\ngo test ./...\n```\n\nTrack results: pass count, fail count, specific failures.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T01:27:11.196163-08:00","updated_at":"2026-01-12T01:27:49.323086-08:00","closed_at":"2026-01-12T01:27:49.323086-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-ce6","depends_on_id":"bd-wisp-3th","type":"blocks","created_at":"2026-01-12T01:27:11.222525-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-cf3","title":"Create release tag","description":"Create annotated git tag.\n\n```bash\ngit tag -a v0.45.0 -m \"Release v0.45.0\"\n```\n\nVerify: `git tag -l | tail -5`\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T20:07:32.257743-08:00","updated_at":"2026-01-06T20:12:04.079541-08:00","closed_at":"2026-01-06T20:12:04.079541-08:00","close_reason":"Tag v0.45.0 created","dependencies":[{"issue_id":"bd-wisp-cf3","depends_on_id":"bd-wisp-9ka","type":"blocks","created_at":"2026-01-06T20:07:32.278265-08:00","created_by":"beads/crew/dave"}]} {"id":"bd-wisp-cfr","title":"Bump version in MCP Python package","description":"Update the beads-mcp Python package version.\n\n```bash\n# macOS\nsed -i '' 's/version = \"[^\"]*\"/version = \"0.47.1\"/' integrations/beads-mcp/pyproject.toml\nsed -i '' 's/__version__ = \"[^\"]*\"/__version__ = \"0.47.1\"/' integrations/beads-mcp/src/beads_mcp/__init__.py\n\n# Linux\nsed -i 's/version = \"[^\"]*\"/version = \"0.47.1\"/' integrations/beads-mcp/pyproject.toml\nsed -i 's/__version__ = \"[^\"]*\"/__version__ = \"0.47.1\"/' integrations/beads-mcp/src/beads_mcp/__init__.py\n```\n\nVerify:\n```bash\ngrep 'version = ' integrations/beads-mcp/pyproject.toml | head -1\ngrep '__version__ = ' integrations/beads-mcp/src/beads_mcp/__init__.py\n```\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T03:17:16.70893-08:00","updated_at":"2026-01-12T03:20:47.634391-08:00","closed_at":"2026-01-12T03:20:47.634391-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-cfr","depends_on_id":"bd-wisp-5j5","type":"parent-child","created_at":"2026-01-12T03:17:16.725128-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-cfr","depends_on_id":"bd-wisp-a2y","type":"blocks","created_at":"2026-01-12T03:17:16.761173-08:00","created_by":"beads/crew/emma"}],"ephemeral":true} {"id":"bd-wisp-chpd","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:14.806019-08:00","updated_at":"2026-01-14T21:33:14.806019-08:00","dependencies":[{"issue_id":"bd-wisp-chpd","depends_on_id":"bd-wisp-zonw","type":"parent-child","created_at":"2026-01-14T21:33:14.854761-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-chpd","depends_on_id":"bd-wisp-fauj","type":"blocks","created_at":"2026-01-14T21:33:14.99443-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-ci7o","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:13.635769-08:00","updated_at":"2026-01-14T20:56:13.635769-08:00","dependencies":[{"issue_id":"bd-wisp-ci7o","depends_on_id":"bd-wisp-0l5p","type":"parent-child","created_at":"2026-01-14T20:56:13.661171-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-ci7o","depends_on_id":"bd-wisp-dkur","type":"blocks","created_at":"2026-01-14T20:56:13.727642-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-ciu","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T20:55:30.81938-08:00","updated_at":"2026-01-14T20:55:50.386051-08:00","closed_at":"2026-01-14T20:55:50.386051-08:00","close_reason":"Closed","ephemeral":true} +{"id":"bd-wisp-cjtp","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"closed","priority":2,"issue_type":"epic","assignee":"beads/refinery","created_at":"2026-01-14T23:23:53.120502-08:00","updated_at":"2026-01-14T23:26:05.085919-08:00","closed_at":"2026-01-14T23:26:05.085919-08:00","close_reason":"Closed","ephemeral":true} {"id":"bd-wisp-cmi7","title":"Process pending cleanup wisps","description":"Process cleanup wisps (exception handling for dirty polecats).\n\nIn the ephemeral model, cleanup wisps are only created when a polecat has\ndirty state (uncommitted changes, unpushed commits) that prevented immediate\nnuke. Most polecats are nuked immediately on POLECAT_DONE and never create wisps.\n\n```bash\n# Find all cleanup wisps\nbd list --wisp --labels=cleanup --status=open\n```\n\nIf no wisps, skip this step (most common case in ephemeral model).\n\nFor each cleanup wisp, investigate and resolve the dirty state:\n\n## State: pending (needs investigation)\n\n1. **Extract polecat name** from wisp title/labels\n\n2. **Diagnose the problem**:\n```bash\ncd polecats/\u003cname\u003e\ngit status # What's uncommitted?\ngit stash list # Any stashed work?\ngit log origin/main..HEAD # Any unpushed commits?\n```\n\n3. **Resolution options**:\n - **Uncommitted changes**: Commit and push, then nuke\n - **Stashed work**: Pop and commit, or discard if not valuable\n - **Unpushed commits**: Push to origin, then nuke\n - **All valuable work lost**: Escalate to Mayor for recovery\n\n4. **If resolvable locally**: Fix and nuke\n```bash\n# Example: push unpushed commits\ngit push origin HEAD\n\n# Then nuke\ngt polecat nuke \u003cname\u003e\n\n# Close the wisp\nbd close \u003cwisp-id\u003e --reason \"Resolved: pushed commits, nuked\"\n```\n\n5. **If needs escalation**: Send RECOVERY_NEEDED to Mayor\n```bash\ngt mail send mayor/ -s \"RECOVERY_NEEDED \u003crig\u003e/\u003cpolecat\u003e\" \\\n -m \"Cleanup Status: \u003cstatus\u003e\nBranch: \u003cbranch\u003e\nIssue: \u003cissue-id\u003e\n\nCannot auto-resolve. Please advise.\"\n```\nLeave wisp open until Mayor resolves.\n\n## State: merge-requested (legacy, rare)\n\nThis state was used before the ephemeral model. If found, the polecat is\nwaiting for a MERGED signal. The inbox-check step handles these.\n\n**Parallelism**: Use Task tool subagents to process multiple cleanups concurrently.\nEach cleanup is independent - perfect for parallel execution.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:23.562048-08:00","updated_at":"2026-01-14T21:33:23.562048-08:00","dependencies":[{"issue_id":"bd-wisp-cmi7","depends_on_id":"bd-wisp-9gxz","type":"parent-child","created_at":"2026-01-14T21:33:23.585234-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-cmi7","depends_on_id":"bd-wisp-42u0","type":"blocks","created_at":"2026-01-14T21:33:23.758113-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-coc8","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:02:29.820426-08:00","updated_at":"2026-01-14T21:02:34.145472-08:00","ephemeral":true} {"id":"bd-wisp-cq6i","title":"Process pending cleanup wisps","description":"Process cleanup wisps (exception handling for dirty polecats).\n\nIn the ephemeral model, cleanup wisps are only created when a polecat has\ndirty state (uncommitted changes, unpushed commits) that prevented immediate\nnuke. Most polecats are nuked immediately on POLECAT_DONE and never create wisps.\n\n```bash\n# Find all cleanup wisps\nbd list --wisp --labels=cleanup --status=open\n```\n\nIf no wisps, skip this step (most common case in ephemeral model).\n\nFor each cleanup wisp, investigate and resolve the dirty state:\n\n## State: pending (needs investigation)\n\n1. **Extract polecat name** from wisp title/labels\n\n2. **Diagnose the problem**:\n```bash\ncd polecats/\u003cname\u003e\ngit status # What's uncommitted?\ngit stash list # Any stashed work?\ngit log origin/main..HEAD # Any unpushed commits?\n```\n\n3. **Resolution options**:\n - **Uncommitted changes**: Commit and push, then nuke\n - **Stashed work**: Pop and commit, or discard if not valuable\n - **Unpushed commits**: Push to origin, then nuke\n - **All valuable work lost**: Escalate to Mayor for recovery\n\n4. **If resolvable locally**: Fix and nuke\n```bash\n# Example: push unpushed commits\ngit push origin HEAD\n\n# Then nuke\ngt polecat nuke \u003cname\u003e\n\n# Close the wisp\nbd close \u003cwisp-id\u003e --reason \"Resolved: pushed commits, nuked\"\n```\n\n5. **If needs escalation**: Send RECOVERY_NEEDED to Mayor\n```bash\ngt mail send mayor/ -s \"RECOVERY_NEEDED \u003crig\u003e/\u003cpolecat\u003e\" \\\n -m \"Cleanup Status: \u003cstatus\u003e\nBranch: \u003cbranch\u003e\nIssue: \u003cissue-id\u003e\n\nCannot auto-resolve. Please advise.\"\n```\nLeave wisp open until Mayor resolves.\n\n## State: merge-requested (legacy, rare)\n\nThis state was used before the ephemeral model. If found, the polecat is\nwaiting for a MERGED signal. The inbox-check step handles these.\n\n**Parallelism**: Use Task tool subagents to process multiple cleanups concurrently.\nEach cleanup is independent - perfect for parallel execution.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:27.573775-08:00","updated_at":"2026-01-14T21:33:27.573775-08:00","dependencies":[{"issue_id":"bd-wisp-cq6i","depends_on_id":"bd-wisp-opv7","type":"parent-child","created_at":"2026-01-14T21:33:27.601871-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-cq6i","depends_on_id":"bd-wisp-5dph","type":"blocks","created_at":"2026-01-14T21:33:27.813623-08:00","created_by":"beads/witness"}],"ephemeral":true} @@ -2635,23 +2666,28 @@ {"id":"bd-wisp-d6ba","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:12.609637-08:00","updated_at":"2026-01-14T20:56:12.609637-08:00","dependencies":[{"issue_id":"bd-wisp-d6ba","depends_on_id":"bd-wisp-q3lk","type":"parent-child","created_at":"2026-01-14T20:56:12.666944-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-d6ba","depends_on_id":"bd-wisp-m3im","type":"blocks","created_at":"2026-01-14T20:56:12.726365-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-d7b","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"closed","priority":2,"issue_type":"epic","assignee":"beads/refinery","created_at":"2026-01-10T20:13:17.442141-08:00","updated_at":"2026-01-10T20:24:29.145383-08:00","closed_at":"2026-01-10T20:24:29.145383-08:00","close_reason":"Patrol: queue empty, no branches to merge","ephemeral":true} {"id":"bd-wisp-d976","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:16.030915-08:00","updated_at":"2026-01-14T21:33:16.030915-08:00","dependencies":[{"issue_id":"bd-wisp-d976","depends_on_id":"bd-wisp-pkh5","type":"parent-child","created_at":"2026-01-14T21:33:16.147687-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-d976","depends_on_id":"bd-wisp-xh7m","type":"blocks","created_at":"2026-01-14T21:33:16.302499-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-daal","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-15T07:54:01.35692-08:00","updated_at":"2026-01-15T07:54:01.35692-08:00","ephemeral":true} {"id":"bd-wisp-digb","title":"Check timer gates for expiration","description":"Check for expired timer gates and escalate as needed.\n\nTimer gates are async wait conditions with a timeout. When the timeout expires,\nthe gate should be escalated to the overseer for human intervention.\n\n**Step 1: Run timer gate check**\n```bash\nbd gate check --type=timer --escalate\n```\n\nThis command:\n1. Finds all open gate issues with await_type=timer\n2. Checks if `now \u003e created_at + timeout`\n3. Escalates expired gates via `gt escalate` (HIGH severity)\n4. Reports summary of gate status\n\n**Step 2: Review output**\n\nIf expired gates were found and escalated:\n- The escalation creates an audit trail bead\n- Overseer will be notified via mail\n- Gate remains open until manually resolved\n\nIf no expired gates:\n- Continue patrol normally\n\n**Note**: Timer gates do NOT auto-close on expiration. They escalate.\nThis ensures human oversight of timeout conditions.\n\n**Parallelism**: This is a single command, no parallel execution needed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:26.209492-08:00","updated_at":"2026-01-14T21:33:26.209492-08:00","dependencies":[{"issue_id":"bd-wisp-digb","depends_on_id":"bd-wisp-j89a","type":"parent-child","created_at":"2026-01-14T21:33:26.300014-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-digb","depends_on_id":"bd-wisp-hpl4","type":"blocks","created_at":"2026-01-14T21:33:26.498666-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-dj0","title":"beads-release","description":"Beads release workflow v2 - gate-aware async release.\n\nThis formula orchestrates a complete release cycle with async gates:\n\nPhase 1 (Polecat Work):\n 1. Preflight checks (clean git, up to date)\n 2. Documentation updates (CHANGELOG, info.go)\n 3. Version bump (all components)\n 4. Git operations (commit, tag, push)\n\nGate (Async Wait):\n 5. await-ci: Gate on GitHub Actions release.yml completion\n\nPhase 2 (Parallel Verification):\n 6. Verify GitHub release, npm package, PyPI package (concurrent)\n\nPhase 3 (Installation):\n 7. Local installation update\n 8. Daemon restart\n\n## Usage\n\n```bash\nbd mol wisp create beads-release --var version=0.44.0\n```\n\nOr assign to a polecat:\n```bash\ngt sling beads/polecats/p1 --formula beads-release --var version=0.44.0\n```\n\nThe polecat will complete Phase 1, then signal phase-complete. The gate blocks\nuntil release.yml finishes. A new polecat (or the same one) resumes for Phases 2-3.\n","status":"closed","priority":2,"issue_type":"epic","created_at":"2026-01-07T00:02:11.335159-08:00","updated_at":"2026-01-07T00:11:26.667806-08:00","closed_at":"2026-01-07T00:11:26.667806-08:00","close_reason":"Release v0.46.0 published: GitHub, npm, PyPI all verified"} {"id":"bd-wisp-dkur","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n```bash\n# Check if refinery session exists\ngt session status \u003crig\u003e/refinery\n\n# Check for pending merge requests\nbd list --type=merge-request --status=open\n```\n\nIf MRs waiting AND refinery not running:\n```bash\ngt session start \u003crig\u003e/refinery\ngt mail send \u003crig\u003e/refinery -s \"PATROL: Wake up\" -m \"Merge requests in queue. Please process.\"\n```\n\nIf refinery running but queue stale (\u003e30 min), send nudge.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:13.635399-08:00","updated_at":"2026-01-14T20:56:13.635399-08:00","dependencies":[{"issue_id":"bd-wisp-dkur","depends_on_id":"bd-wisp-0l5p","type":"parent-child","created_at":"2026-01-14T20:56:13.653823-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-dmly","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:26.207875-08:00","updated_at":"2026-01-14T21:33:26.207875-08:00","dependencies":[{"issue_id":"bd-wisp-dmly","depends_on_id":"bd-wisp-j89a","type":"parent-child","created_at":"2026-01-14T21:33:26.211932-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-doad","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:53:02.114148-08:00","updated_at":"2026-01-14T21:53:02.114149-08:00","dependencies":[{"issue_id":"bd-wisp-doad","depends_on_id":"bd-wisp-si5o","type":"parent-child","created_at":"2026-01-14T21:53:02.118175-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-drno","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nInbox should contain ONLY:\n- Unprocessed MERGE_READY messages (will process next cycle)\n- Active work items\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- PATROL: Wake up that was acknowledged → archive\n- HELP/Blocked that was handled → archive\n- MERGE_READY where merge completed but archive was missed → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Check for orphaned MR beads**\n\nLook for open MR beads with no corresponding branch:\n```bash\nbd list --type=merge-request --status=open\n```\n\nFor each open MR bead:\n1. Check if branch exists: `git ls-remote origin refs/heads/\u003cbranch\u003e`\n2. If branch gone, verify work is on main: `git log origin/main --oneline | grep \"\u003csource_issue\u003e\"`\n3. If work on main → close MR with reason \"Merged (verified on main)\"\n4. If work NOT on main → investigate before closing:\n - Check source_issue validity (should be gt-xxxxx, not branch name)\n - Search reflog/dangling commits if possible\n - If unverifiable, close with reason \"Unverifiable - no audit trail\"\n - File bead if this indicates lost work\n\n**NEVER close an MR bead without verifying the work landed or is unrecoverable.**\n\n**Goal**: Inbox should have ≤3 active messages at end of cycle.\nKeep only: pending MRs in queue.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:09:52.701821-08:00","updated_at":"2026-01-15T08:09:52.701821-08:00","dependencies":[{"issue_id":"bd-wisp-drno","depends_on_id":"bd-wisp-llul","type":"parent-child","created_at":"2026-01-15T08:09:52.961305-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-drno","depends_on_id":"bd-wisp-knqy","type":"blocks","created_at":"2026-01-15T08:09:53.25346-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-dsc2","title":"Process pending cleanup wisps","description":"Process cleanup wisps (exception handling for dirty polecats).\n\nIn the ephemeral model, cleanup wisps are only created when a polecat has\ndirty state (uncommitted changes, unpushed commits) that prevented immediate\nnuke. Most polecats are nuked immediately on POLECAT_DONE and never create wisps.\n\n```bash\n# Find all cleanup wisps\nbd list --wisp --labels=cleanup --status=open\n```\n\nIf no wisps, skip this step (most common case in ephemeral model).\n\nFor each cleanup wisp, investigate and resolve the dirty state:\n\n## State: pending (needs investigation)\n\n1. **Extract polecat name** from wisp title/labels\n\n2. **Diagnose the problem**:\n```bash\ncd polecats/\u003cname\u003e\ngit status # What's uncommitted?\ngit stash list # Any stashed work?\ngit log origin/main..HEAD # Any unpushed commits?\n```\n\n3. **Resolution options**:\n - **Uncommitted changes**: Commit and push, then nuke\n - **Stashed work**: Pop and commit, or discard if not valuable\n - **Unpushed commits**: Push to origin, then nuke\n - **All valuable work lost**: Escalate to Mayor for recovery\n\n4. **If resolvable locally**: Fix and nuke\n```bash\n# Example: push unpushed commits\ngit push origin HEAD\n\n# Then nuke\ngt polecat nuke \u003cname\u003e\n\n# Close the wisp\nbd close \u003cwisp-id\u003e --reason \"Resolved: pushed commits, nuked\"\n```\n\n5. **If needs escalation**: Send RECOVERY_NEEDED to Mayor\n```bash\ngt mail send mayor/ -s \"RECOVERY_NEEDED \u003crig\u003e/\u003cpolecat\u003e\" \\\n -m \"Cleanup Status: \u003cstatus\u003e\nBranch: \u003cbranch\u003e\nIssue: \u003cissue-id\u003e\n\nCannot auto-resolve. Please advise.\"\n```\nLeave wisp open until Mayor resolves.\n\n## State: merge-requested (legacy, rare)\n\nThis state was used before the ephemeral model. If found, the polecat is\nwaiting for a MERGED signal. The inbox-check step handles these.\n\n**Parallelism**: Use Task tool subagents to process multiple cleanups concurrently.\nEach cleanup is independent - perfect for parallel execution.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:18.014868-08:00","updated_at":"2026-01-14T20:56:18.014868-08:00","dependencies":[{"issue_id":"bd-wisp-dsc2","depends_on_id":"bd-wisp-xj1k","type":"parent-child","created_at":"2026-01-14T20:56:18.030762-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-dsc2","depends_on_id":"bd-wisp-nxm9","type":"blocks","created_at":"2026-01-14T20:56:18.138951-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-dsk4","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:53:02.115362-08:00","updated_at":"2026-01-14T21:53:02.115362-08:00","dependencies":[{"issue_id":"bd-wisp-dsk4","depends_on_id":"bd-wisp-si5o","type":"parent-child","created_at":"2026-01-14T21:53:02.194095-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-dsk4","depends_on_id":"bd-wisp-nofu","type":"blocks","created_at":"2026-01-14T21:53:02.418203-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-du8r","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:50:07.54988-08:00","updated_at":"2026-01-14T21:50:16.630725-08:00","ephemeral":true} +{"id":"bd-wisp-dwgz","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:53:02.117263-08:00","updated_at":"2026-01-14T21:53:02.117263-08:00","dependencies":[{"issue_id":"bd-wisp-dwgz","depends_on_id":"bd-wisp-si5o","type":"parent-child","created_at":"2026-01-14T21:53:02.317913-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-dwgz","depends_on_id":"bd-wisp-hvsi","type":"blocks","created_at":"2026-01-14T21:53:02.546678-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-dwq8","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n```bash\n# Check if refinery session exists\ngt session status \u003crig\u003e/refinery\n\n# Check for pending merge requests\nbd list --type=merge-request --status=open\n```\n\nIf MRs waiting AND refinery not running:\n```bash\ngt session start \u003crig\u003e/refinery\ngt mail send \u003crig\u003e/refinery -s \"PATROL: Wake up\" -m \"Merge requests in queue. Please process.\"\n```\n\nIf refinery running but queue stale (\u003e30 min), send nudge.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:12.459812-08:00","updated_at":"2026-01-14T21:33:12.459812-08:00","dependencies":[{"issue_id":"bd-wisp-dwq8","depends_on_id":"bd-wisp-8e8q","type":"parent-child","created_at":"2026-01-14T21:33:12.488751-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-dwq8","depends_on_id":"bd-wisp-ujyr","type":"blocks","created_at":"2026-01-14T21:33:12.602591-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-dyj8","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:03:06.601381-08:00","updated_at":"2026-01-14T21:03:11.760944-08:00","ephemeral":true} {"id":"bd-wisp-dz5","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"closed","priority":2,"issue_type":"epic","assignee":"beads/refinery","created_at":"2026-01-10T19:40:21.849288-08:00","updated_at":"2026-01-10T19:45:58.671508-08:00","closed_at":"2026-01-10T19:45:58.671508-08:00","close_reason":"Patrol complete: queue empty","ephemeral":true} {"id":"bd-wisp-e3x6","title":"Check timer gates for expiration","description":"Check for expired timer gates and escalate as needed.\n\nTimer gates are async wait conditions with a timeout. When the timeout expires,\nthe gate should be escalated to the overseer for human intervention.\n\n**Step 1: Run timer gate check**\n```bash\nbd gate check --type=timer --escalate\n```\n\nThis command:\n1. Finds all open gate issues with await_type=timer\n2. Checks if `now \u003e created_at + timeout`\n3. Escalates expired gates via `gt escalate` (HIGH severity)\n4. Reports summary of gate status\n\n**Step 2: Review output**\n\nIf expired gates were found and escalated:\n- The escalation creates an audit trail bead\n- Overseer will be notified via mail\n- Gate remains open until manually resolved\n\nIf no expired gates:\n- Continue patrol normally\n\n**Note**: Timer gates do NOT auto-close on expiration. They escalate.\nThis ensures human oversight of timeout conditions.\n\n**Parallelism**: This is a single command, no parallel execution needed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:22.272037-08:00","updated_at":"2026-01-14T21:33:22.272037-08:00","dependencies":[{"issue_id":"bd-wisp-e3x6","depends_on_id":"bd-wisp-qzai","type":"parent-child","created_at":"2026-01-14T21:33:22.346589-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-e3x6","depends_on_id":"bd-wisp-t9h2","type":"blocks","created_at":"2026-01-14T21:33:22.509768-08:00","created_by":"beads/witness"}],"ephemeral":true} -{"id":"bd-wisp-e99","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-13T20:19:57.562836-08:00","updated_at":"2026-01-13T20:19:57.562836-08:00","ephemeral":true} {"id":"bd-wisp-ebaw","title":"Ping Deacon for health check","description":"Send WITNESS_PING to Deacon for second-order monitoring.\n\nThe Witness fleet collectively monitors Deacon health - this prevents the\n\"who watches the watchers\" problem. If Deacon dies, Witnesses detect it.\n\n**Step 1: Send ping**\n```bash\ngt mail send deacon/ -s \"WITNESS_PING \u003crig\u003e\" -m \"Rig: \u003crig\u003e\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: \u003ccycle-number\u003e\"\n```\n\n**Step 2: Check Deacon health**\n```bash\n# Check Deacon agent bead for last_activity\nbd list --type=agent --json | jq '.[] | select(.description | contains(\"deacon\"))'\n```\n\nLook at the `last_activity` timestamp. If stale (\u003e5 minutes since last update):\n- Deacon may be dead or stuck\n\n**Step 3: Escalate if needed**\n```bash\n# If Deacon appears down\ngt mail send mayor/ -s \"ALERT: Deacon appears unresponsive\" -m \"No Deacon activity for \u003e5 minutes.\nLast seen: \u003ctimestamp\u003e\nWitness: \u003crig\u003e/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:16.880884-08:00","updated_at":"2026-01-14T20:56:16.880884-08:00","dependencies":[{"issue_id":"bd-wisp-ebaw","depends_on_id":"bd-wisp-qc3z","type":"parent-child","created_at":"2026-01-14T20:56:16.948852-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-ebaw","depends_on_id":"bd-wisp-l01e","type":"blocks","created_at":"2026-01-14T20:56:17.049715-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-ec4","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","assignee":"beads/refinery","created_at":"2026-01-12T02:44:24.389343-08:00","updated_at":"2026-01-12T17:22:24.034782-08:00","ephemeral":true} {"id":"bd-wisp-ecbz","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:11.591199-08:00","updated_at":"2026-01-14T20:56:11.591199-08:00","dependencies":[{"issue_id":"bd-wisp-ecbz","depends_on_id":"bd-wisp-ecpj","type":"parent-child","created_at":"2026-01-14T20:56:11.627625-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-ecbz","depends_on_id":"bd-wisp-2qbe","type":"blocks","created_at":"2026-01-14T20:56:11.675535-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-ecpj","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T20:56:11.587944-08:00","updated_at":"2026-01-14T20:56:11.587944-08:00","ephemeral":true} {"id":"bd-wisp-efo","title":"Push to main","description":"Push the release commit to origin.\n\n```bash\ngit push origin main\n```\n\nIf rejected, someone else pushed. Pull, rebase, try again.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T03:17:16.711396-08:00","updated_at":"2026-01-12T03:21:47.150051-08:00","closed_at":"2026-01-12T03:21:47.150051-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-efo","depends_on_id":"bd-wisp-5j5","type":"parent-child","created_at":"2026-01-12T03:17:16.733165-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-efo","depends_on_id":"bd-wisp-yi6","type":"blocks","created_at":"2026-01-12T03:17:16.781037-08:00","created_by":"beads/crew/emma"}],"ephemeral":true} {"id":"bd-wisp-eh4","title":"Verify npm package","description":"Confirm npm package published.\n\n```bash\nnpm show @beads/bd version\n```\n\nShould show 0.45.0.\n\nAlso check: https://www.npmjs.com/package/@beads/bd\n\nNote: npm registry may have a small propagation delay (1-2 min).\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T20:07:32.258891-08:00","updated_at":"2026-01-06T20:17:52.238932-08:00","closed_at":"2026-01-06T20:17:52.238932-08:00","close_reason":"All release artifacts verified: GitHub (9 assets), npm 0.45.0, PyPI 0.45.0","dependencies":[{"issue_id":"bd-wisp-eh4","depends_on_id":"bd-wisp-u9o","type":"blocks","created_at":"2026-01-06T20:07:32.283957-08:00","created_by":"beads/crew/dave"}]} -{"id":"bd-wisp-ex5","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"hooked","priority":2,"issue_type":"epic","created_at":"2026-01-13T11:02:35.229332-08:00","updated_at":"2026-01-14T20:45:31.074169-08:00"} +{"id":"bd-wisp-ex5","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"hooked","priority":2,"issue_type":"epic","created_at":"2026-01-13T11:02:35.229332-08:00","updated_at":"2026-01-15T11:59:48.030673-08:00"} {"id":"bd-wisp-f1xa","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n```bash\n# Check if refinery session exists\ngt session status \u003crig\u003e/refinery\n\n# Check for pending merge requests\nbd list --type=merge-request --status=open\n```\n\nIf MRs waiting AND refinery not running:\n```bash\ngt session start \u003crig\u003e/refinery\ngt mail send \u003crig\u003e/refinery -s \"PATROL: Wake up\" -m \"Merge requests in queue. Please process.\"\n```\n\nIf refinery running but queue stale (\u003e30 min), send nudge.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:11.326181-08:00","updated_at":"2026-01-14T21:33:11.326181-08:00","dependencies":[{"issue_id":"bd-wisp-f1xa","depends_on_id":"bd-wisp-3430","type":"parent-child","created_at":"2026-01-14T21:33:11.352598-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-f1xa","depends_on_id":"bd-wisp-x5po","type":"blocks","created_at":"2026-01-14T21:33:11.455755-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-f7gb","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:16.030159-08:00","updated_at":"2026-01-14T21:33:16.030159-08:00","dependencies":[{"issue_id":"bd-wisp-f7gb","depends_on_id":"bd-wisp-pkh5","type":"parent-child","created_at":"2026-01-14T21:33:16.114787-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-f7gb","depends_on_id":"bd-wisp-r6zs","type":"blocks","created_at":"2026-01-14T21:33:16.267613-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-fauj","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n```bash\n# Check if refinery session exists\ngt session status \u003crig\u003e/refinery\n\n# Check for pending merge requests\nbd list --type=merge-request --status=open\n```\n\nIf MRs waiting AND refinery not running:\n```bash\ngt session start \u003crig\u003e/refinery\ngt mail send \u003crig\u003e/refinery -s \"PATROL: Wake up\" -m \"Merge requests in queue. Please process.\"\n```\n\nIf refinery running but queue stale (\u003e30 min), send nudge.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:14.805645-08:00","updated_at":"2026-01-14T21:33:14.805645-08:00","dependencies":[{"issue_id":"bd-wisp-fauj","depends_on_id":"bd-wisp-zonw","type":"parent-child","created_at":"2026-01-14T21:33:14.839544-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-fauj","depends_on_id":"bd-wisp-5nel","type":"blocks","created_at":"2026-01-14T21:33:14.978787-08:00","created_by":"beads/witness"}],"ephemeral":true} @@ -2659,6 +2695,7 @@ {"id":"bd-wisp-fft9","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:26.20988-08:00","updated_at":"2026-01-14T21:33:26.20988-08:00","dependencies":[{"issue_id":"bd-wisp-fft9","depends_on_id":"bd-wisp-j89a","type":"parent-child","created_at":"2026-01-14T21:33:26.32242-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-fft9","depends_on_id":"bd-wisp-digb","type":"blocks","created_at":"2026-01-14T21:33:26.521299-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-fh74","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:14.68687-08:00","updated_at":"2026-01-14T20:56:14.68687-08:00","dependencies":[{"issue_id":"bd-wisp-fh74","depends_on_id":"bd-wisp-7mjs","type":"parent-child","created_at":"2026-01-14T20:56:14.7642-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-fh74","depends_on_id":"bd-wisp-s7ao","type":"blocks","created_at":"2026-01-14T20:56:14.844733-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-fipw","title":"Ping Deacon for health check","description":"Send WITNESS_PING to Deacon for second-order monitoring.\n\nThe Witness fleet collectively monitors Deacon health - this prevents the\n\"who watches the watchers\" problem. If Deacon dies, Witnesses detect it.\n\n**Step 1: Send ping**\n```bash\ngt mail send deacon/ -s \"WITNESS_PING \u003crig\u003e\" -m \"Rig: \u003crig\u003e\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: \u003ccycle-number\u003e\"\n```\n\n**Step 2: Check Deacon health**\n```bash\n# Check Deacon agent bead for last_activity\nbd list --type=agent --json | jq '.[] | select(.description | contains(\"deacon\"))'\n```\n\nLook at the `last_activity` timestamp. If stale (\u003e5 minutes since last update):\n- Deacon may be dead or stuck\n\n**Step 3: Escalate if needed**\n```bash\n# If Deacon appears down\ngt mail send mayor/ -s \"ALERT: Deacon appears unresponsive\" -m \"No Deacon activity for \u003e5 minutes.\nLast seen: \u003ctimestamp\u003e\nWitness: \u003crig\u003e/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:26.210273-08:00","updated_at":"2026-01-14T21:33:26.210273-08:00","dependencies":[{"issue_id":"bd-wisp-fipw","depends_on_id":"bd-wisp-j89a","type":"parent-child","created_at":"2026-01-14T21:33:26.344473-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-fipw","depends_on_id":"bd-wisp-fft9","type":"blocks","created_at":"2026-01-14T21:33:26.543777-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-fix0","title":"Mechanical rebase","description":"Pick next branch from queue. Attempt mechanical rebase on current main.\n\n**Step 1: Checkout and attempt rebase**\n```bash\ngit checkout -b temp origin/\u003cpolecat-branch\u003e\ngit rebase origin/main\n```\n\n**Step 2: Check rebase result**\n\nThe rebase exits with:\n- Exit code 0: Success - proceed to run-tests\n- Exit code 1 (conflicts): Conflict detected - proceed to Step 3\n\nTo detect conflict state after rebase fails:\n```bash\n# Check if we're in a conflicted rebase state\nls .git/rebase-merge 2\u003e/dev/null \u0026\u0026 echo \"CONFLICT_STATE\"\n```\n\n**Step 3: Handle conflicts (if any)**\n\nIf rebase SUCCEEDED (exit code 0):\n- Skip to run-tests step (continue normal merge flow)\n\nIf rebase FAILED with conflicts:\n\n1. **Abort the rebase** (DO NOT leave repo in conflicted state):\n```bash\ngit rebase --abort\n```\n\n2. **Record conflict metadata**:\n```bash\n# Capture main SHA for reference\nMAIN_SHA=$(git rev-parse origin/main)\nBRANCH_SHA=$(git rev-parse origin/\u003cpolecat-branch\u003e)\n```\n\n3. **Create conflict-resolution task**:\n```bash\nbd create --type=task --priority=1 --title=\"Resolve merge conflicts: \u003coriginal-issue-title\u003e\" --description=\"## Conflict Resolution Required\n\nOriginal MR: \u003cmr-bead-id\u003e\nBranch: \u003cpolecat-branch\u003e\nOriginal Issue: \u003cissue-id\u003e\nConflict with main at: ${MAIN_SHA}\nBranch SHA: ${BRANCH_SHA}\n\n## Instructions\n1. Clone/checkout the branch\n2. Rebase on current main: git rebase origin/main\n3. Resolve conflicts\n4. Force push: git push -f origin \u003cbranch\u003e\n5. Close this task when done\n\nThe MR will be re-queued for processing after conflicts are resolved.\"\n```\n\n4. **Skip this MR** (do NOT delete branch or close MR bead):\n- Leave branch intact for conflict resolution\n- Leave MR bead open (will be re-processed after resolution)\n- Continue to loop-check for next branch\n\n**CRITICAL**: Never delete a branch that has conflicts. The branch contains\nthe original work and must be preserved for conflict resolution.\n\nTrack: rebase result (success/conflict), conflict task ID if created.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:09:52.698518-08:00","updated_at":"2026-01-15T08:09:52.698518-08:00","dependencies":[{"issue_id":"bd-wisp-fix0","depends_on_id":"bd-wisp-llul","type":"parent-child","created_at":"2026-01-15T08:09:52.760597-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-fix0","depends_on_id":"bd-wisp-jn0c","type":"blocks","created_at":"2026-01-15T08:09:53.047164-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-fm18","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:22.270361-08:00","updated_at":"2026-01-14T21:33:22.270361-08:00","dependencies":[{"issue_id":"bd-wisp-fm18","depends_on_id":"bd-wisp-qzai","type":"parent-child","created_at":"2026-01-14T21:33:22.274433-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-fm4","title":"Update local installation","description":"Update local bd to the new version.\n\nOption 1 - Homebrew:\n```bash\nbrew upgrade bd\n```\n\nOption 2 - Install script:\n```bash\ncurl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash\n```\n\nVerify:\n```bash\nbd --version\n```\n\nShould show 0.45.0.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T20:07:32.259261-08:00","updated_at":"2026-01-06T20:18:20.106709-08:00","closed_at":"2026-01-06T20:18:20.106709-08:00","close_reason":"Release v0.45.0 complete","dependencies":[{"issue_id":"bd-wisp-fm4","depends_on_id":"bd-wisp-gnr","type":"blocks","created_at":"2026-01-06T20:07:32.286541-08:00","created_by":"beads/crew/dave"},{"issue_id":"bd-wisp-fm4","depends_on_id":"bd-wisp-eh4","type":"blocks","created_at":"2026-01-06T20:07:32.287962-08:00","created_by":"beads/crew/dave"},{"issue_id":"bd-wisp-fm4","depends_on_id":"bd-wisp-04d","type":"blocks","created_at":"2026-01-06T20:07:32.289399-08:00","created_by":"beads/crew/dave"}]} {"id":"bd-wisp-fy78","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:18.015642-08:00","updated_at":"2026-01-14T20:56:18.015642-08:00","dependencies":[{"issue_id":"bd-wisp-fy78","depends_on_id":"bd-wisp-xj1k","type":"parent-child","created_at":"2026-01-14T20:56:18.054851-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-fy78","depends_on_id":"bd-wisp-970o","type":"blocks","created_at":"2026-01-14T20:56:18.163732-08:00","created_by":"beads/witness"}],"ephemeral":true} @@ -2667,7 +2704,6 @@ {"id":"bd-wisp-g6pt","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:14.686155-08:00","updated_at":"2026-01-14T20:56:14.686155-08:00","dependencies":[{"issue_id":"bd-wisp-g6pt","depends_on_id":"bd-wisp-7mjs","type":"parent-child","created_at":"2026-01-14T20:56:14.746895-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-g6pt","depends_on_id":"bd-wisp-7gh5","type":"blocks","created_at":"2026-01-14T20:56:14.826104-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-g6vd","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:19.159775-08:00","updated_at":"2026-01-14T20:56:19.159775-08:00","dependencies":[{"issue_id":"bd-wisp-g6vd","depends_on_id":"bd-wisp-i1rf","type":"parent-child","created_at":"2026-01-14T20:56:19.254795-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-g6vd","depends_on_id":"bd-wisp-sxsg","type":"blocks","created_at":"2026-01-14T20:56:19.378501-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-gb3","title":"Bump version in npm package","description":"Update the npm package version.\n\n```bash\n# macOS/Linux with jq\njq '.version = \"0.47.1\"' npm-package/package.json \u003e tmp \u0026\u0026 mv tmp npm-package/package.json\n```\n\nVerify:\n```bash\njq -r '.version' npm-package/package.json\n```\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T03:17:16.709238-08:00","updated_at":"2026-01-12T03:20:47.636942-08:00","closed_at":"2026-01-12T03:20:47.636942-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-gb3","depends_on_id":"bd-wisp-5j5","type":"parent-child","created_at":"2026-01-12T03:17:16.726136-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-gb3","depends_on_id":"bd-wisp-cfr","type":"blocks","created_at":"2026-01-12T03:17:16.763406-08:00","created_by":"beads/crew/emma"}],"ephemeral":true} -{"id":"bd-wisp-gby","title":"Check for more work","description":"More branches to process?\n\n**Entry paths:**\n- Normal: After successful merge-push\n- Conflict-skip: After process-branch created conflict-resolution task\n\nIf yes: Return to process-branch with next branch.\nIf no: Continue to generate-summary.\n\n**Track for this cycle:**\n- branches_merged: count and names of successfully merged branches\n- branches_conflict: count and names of branches skipped due to conflicts\n- conflict_tasks: IDs of conflict-resolution tasks created\n\nThis tracking feeds into generate-summary for the patrol digest.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T01:27:11.197065-08:00","updated_at":"2026-01-12T01:27:49.671718-08:00","closed_at":"2026-01-12T01:27:49.671718-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-gby","depends_on_id":"bd-wisp-mld","type":"blocks","created_at":"2026-01-12T01:27:11.229663-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-geyu","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:13.634584-08:00","updated_at":"2026-01-14T20:56:13.634584-08:00","dependencies":[{"issue_id":"bd-wisp-geyu","depends_on_id":"bd-wisp-0l5p","type":"parent-child","created_at":"2026-01-14T20:56:13.638708-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-gi0d","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:24.872215-08:00","updated_at":"2026-01-14T21:33:24.872215-08:00","dependencies":[{"issue_id":"bd-wisp-gi0d","depends_on_id":"bd-wisp-srhi","type":"parent-child","created_at":"2026-01-14T21:33:24.977058-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-gi0d","depends_on_id":"bd-wisp-a1kz","type":"blocks","created_at":"2026-01-14T21:33:25.162884-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-glts","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:14.683581-08:00","updated_at":"2026-01-14T20:56:14.683581-08:00","dependencies":[{"issue_id":"bd-wisp-glts","depends_on_id":"bd-wisp-7mjs","type":"parent-child","created_at":"2026-01-14T20:56:14.687358-08:00","created_by":"beads/witness"}],"ephemeral":true} @@ -2678,6 +2714,7 @@ {"id":"bd-wisp-hjcs","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:12.608921-08:00","updated_at":"2026-01-14T20:56:12.608921-08:00","dependencies":[{"issue_id":"bd-wisp-hjcs","depends_on_id":"bd-wisp-q3lk","type":"parent-child","created_at":"2026-01-14T20:56:12.654206-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-hjcs","depends_on_id":"bd-wisp-cwkz","type":"blocks","created_at":"2026-01-14T20:56:12.712627-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-hpl4","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:26.209091-08:00","updated_at":"2026-01-14T21:33:26.209091-08:00","dependencies":[{"issue_id":"bd-wisp-hpl4","depends_on_id":"bd-wisp-j89a","type":"parent-child","created_at":"2026-01-14T21:33:26.277787-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-hpl4","depends_on_id":"bd-wisp-80c1","type":"blocks","created_at":"2026-01-14T21:33:26.476678-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-hs6d","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n```bash\n# Check if refinery session exists\ngt session status \u003crig\u003e/refinery\n\n# Check for pending merge requests\nbd list --type=merge-request --status=open\n```\n\nIf MRs waiting AND refinery not running:\n```bash\ngt session start \u003crig\u003e/refinery\ngt mail send \u003crig\u003e/refinery -s \"PATROL: Wake up\" -m \"Merge requests in queue. Please process.\"\n```\n\nIf refinery running but queue stale (\u003e30 min), send nudge.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:14.684346-08:00","updated_at":"2026-01-14T20:56:14.684346-08:00","dependencies":[{"issue_id":"bd-wisp-hs6d","depends_on_id":"bd-wisp-7mjs","type":"parent-child","created_at":"2026-01-14T20:56:14.704544-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-hvsi","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:53:02.116886-08:00","updated_at":"2026-01-14T21:53:02.116886-08:00","dependencies":[{"issue_id":"bd-wisp-hvsi","depends_on_id":"bd-wisp-si5o","type":"parent-child","created_at":"2026-01-14T21:53:02.293172-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-hvsi","depends_on_id":"bd-wisp-vfe7","type":"blocks","created_at":"2026-01-14T21:53:02.52053-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-hxip","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:19.158326-08:00","updated_at":"2026-01-14T20:56:19.158326-08:00","dependencies":[{"issue_id":"bd-wisp-hxip","depends_on_id":"bd-wisp-i1rf","type":"parent-child","created_at":"2026-01-14T20:56:19.201698-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-hxip","depends_on_id":"bd-wisp-90ls","type":"blocks","created_at":"2026-01-14T20:56:19.32302-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-i1rc","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:03:24.845595-08:00","updated_at":"2026-01-14T21:03:29.012575-08:00","ephemeral":true} {"id":"bd-wisp-i1rf","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T20:56:19.156456-08:00","updated_at":"2026-01-14T20:56:19.156456-08:00","ephemeral":true} @@ -2687,30 +2724,38 @@ {"id":"bd-wisp-ikm7","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:26.211045-08:00","updated_at":"2026-01-14T21:33:26.211045-08:00","dependencies":[{"issue_id":"bd-wisp-ikm7","depends_on_id":"bd-wisp-j89a","type":"parent-child","created_at":"2026-01-14T21:33:26.389058-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-ikm7","depends_on_id":"bd-wisp-h7jn","type":"blocks","created_at":"2026-01-14T21:33:26.589044-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-iqak","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:11.589765-08:00","updated_at":"2026-01-14T20:56:11.589765-08:00","dependencies":[{"issue_id":"bd-wisp-iqak","depends_on_id":"bd-wisp-ecpj","type":"parent-child","created_at":"2026-01-14T20:56:11.607957-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-iqcu","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:10.189247-08:00","updated_at":"2026-01-14T21:33:10.189247-08:00","dependencies":[{"issue_id":"bd-wisp-iqcu","depends_on_id":"bd-wisp-7q1d","type":"parent-child","created_at":"2026-01-14T21:33:10.271343-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-iqcu","depends_on_id":"bd-wisp-33f0","type":"blocks","created_at":"2026-01-14T21:33:10.368677-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-j04u","title":"Scan merge queue","description":"Check the beads merge queue - this is the SOURCE OF TRUTH for pending merges.\n\n```bash\ngit fetch --prune origin\ngt mq list \u003crig\u003e\n```\n\nThe beads MQ tracks all pending merge requests. Do NOT rely on `git branch -r | grep polecat`\nas branches may exist without MR beads, or MR beads may exist for already-merged work.\n\nIf queue empty, skip to context-check step.\n\nFor each MR in the queue, verify the branch still exists:\n```bash\ngit branch -r | grep \u003cbranch\u003e\n```\n\nIf branch doesn't exist for a queued MR:\n- Close the MR bead: `bd close \u003cmr-id\u003e --reason \"Branch no longer exists\"`\n- Remove from processing queue\n\nTrack verified MR list for this cycle.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:02:45.429001-08:00","updated_at":"2026-01-15T08:02:45.429001-08:00","dependencies":[{"issue_id":"bd-wisp-j04u","depends_on_id":"bd-wisp-puaa","type":"parent-child","created_at":"2026-01-15T08:02:45.461197-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-j04u","depends_on_id":"bd-wisp-srvr","type":"blocks","created_at":"2026-01-15T08:02:45.734034-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-j0hb","title":"Process pending cleanup wisps","description":"Process cleanup wisps (exception handling for dirty polecats).\n\nIn the ephemeral model, cleanup wisps are only created when a polecat has\ndirty state (uncommitted changes, unpushed commits) that prevented immediate\nnuke. Most polecats are nuked immediately on POLECAT_DONE and never create wisps.\n\n```bash\n# Find all cleanup wisps\nbd list --wisp --labels=cleanup --status=open\n```\n\nIf no wisps, skip this step (most common case in ephemeral model).\n\nFor each cleanup wisp, investigate and resolve the dirty state:\n\n## State: pending (needs investigation)\n\n1. **Extract polecat name** from wisp title/labels\n\n2. **Diagnose the problem**:\n```bash\ncd polecats/\u003cname\u003e\ngit status # What's uncommitted?\ngit stash list # Any stashed work?\ngit log origin/main..HEAD # Any unpushed commits?\n```\n\n3. **Resolution options**:\n - **Uncommitted changes**: Commit and push, then nuke\n - **Stashed work**: Pop and commit, or discard if not valuable\n - **Unpushed commits**: Push to origin, then nuke\n - **All valuable work lost**: Escalate to Mayor for recovery\n\n4. **If resolvable locally**: Fix and nuke\n```bash\n# Example: push unpushed commits\ngit push origin HEAD\n\n# Then nuke\ngt polecat nuke \u003cname\u003e\n\n# Close the wisp\nbd close \u003cwisp-id\u003e --reason \"Resolved: pushed commits, nuked\"\n```\n\n5. **If needs escalation**: Send RECOVERY_NEEDED to Mayor\n```bash\ngt mail send mayor/ -s \"RECOVERY_NEEDED \u003crig\u003e/\u003cpolecat\u003e\" \\\n -m \"Cleanup Status: \u003cstatus\u003e\nBranch: \u003cbranch\u003e\nIssue: \u003cissue-id\u003e\n\nCannot auto-resolve. Please advise.\"\n```\nLeave wisp open until Mayor resolves.\n\n## State: merge-requested (legacy, rare)\n\nThis state was used before the ephemeral model. If found, the polecat is\nwaiting for a MERGED signal. The inbox-check step handles these.\n\n**Parallelism**: Use Task tool subagents to process multiple cleanups concurrently.\nEach cleanup is independent - perfect for parallel execution.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:19.157562-08:00","updated_at":"2026-01-14T20:56:19.157562-08:00","dependencies":[{"issue_id":"bd-wisp-j0hb","depends_on_id":"bd-wisp-i1rf","type":"parent-child","created_at":"2026-01-14T20:56:19.174832-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-j0hb","depends_on_id":"bd-wisp-69bq","type":"blocks","created_at":"2026-01-14T20:56:19.29539-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-j264","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:53:02.116143-08:00","updated_at":"2026-01-14T21:53:02.116143-08:00","dependencies":[{"issue_id":"bd-wisp-j264","depends_on_id":"bd-wisp-si5o","type":"parent-child","created_at":"2026-01-14T21:53:02.24379-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-j264","depends_on_id":"bd-wisp-xduh","type":"blocks","created_at":"2026-01-14T21:53:02.469048-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-j35h","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:14.684698-08:00","updated_at":"2026-01-14T20:56:14.684698-08:00","dependencies":[{"issue_id":"bd-wisp-j35h","depends_on_id":"bd-wisp-7mjs","type":"parent-child","created_at":"2026-01-14T20:56:14.713098-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-j35h","depends_on_id":"bd-wisp-hs6d","type":"blocks","created_at":"2026-01-14T20:56:14.789812-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-j88f","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:13.638203-08:00","updated_at":"2026-01-14T20:56:13.638203-08:00","dependencies":[{"issue_id":"bd-wisp-j88f","depends_on_id":"bd-wisp-0l5p","type":"parent-child","created_at":"2026-01-14T20:56:13.705409-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-j88f","depends_on_id":"bd-wisp-9tqb","type":"blocks","created_at":"2026-01-14T20:56:13.775924-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-j89a","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T21:33:26.207078-08:00","updated_at":"2026-01-14T21:33:26.207078-08:00","ephemeral":true} +{"id":"bd-wisp-jdh3","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:48:29.069479-08:00","updated_at":"2026-01-14T21:48:35.837303-08:00","ephemeral":true} {"id":"bd-wisp-je0","title":"Update CHANGELOG.md","description":"Write the [Unreleased] section with all changes for 0.47.1.\n\nFormat: Keep a Changelog (https://keepachangelog.com)\n\nSections:\n- ### Added\n- ### Changed\n- ### Fixed\n- ### Documentation\n\nThe bump script will stamp the date automatically.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T03:17:16.707676-08:00","updated_at":"2026-01-12T03:19:17.32748-08:00","closed_at":"2026-01-12T03:19:17.32748-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-je0","depends_on_id":"bd-wisp-5j5","type":"parent-child","created_at":"2026-01-12T03:17:16.721148-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-je0","depends_on_id":"bd-wisp-az0","type":"blocks","created_at":"2026-01-12T03:17:16.753125-08:00","created_by":"beads/crew/emma"}],"ephemeral":true} {"id":"bd-wisp-jfh5","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:24.871423-08:00","updated_at":"2026-01-14T21:33:24.871423-08:00","dependencies":[{"issue_id":"bd-wisp-jfh5","depends_on_id":"bd-wisp-srhi","type":"parent-child","created_at":"2026-01-14T21:33:24.93609-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-jfh5","depends_on_id":"bd-wisp-o0vk","type":"blocks","created_at":"2026-01-14T21:33:25.121013-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-ji8q","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:16.031287-08:00","updated_at":"2026-01-14T21:33:16.031287-08:00","dependencies":[{"issue_id":"bd-wisp-ji8q","depends_on_id":"bd-wisp-pkh5","type":"parent-child","created_at":"2026-01-14T21:33:16.164812-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-ji8q","depends_on_id":"bd-wisp-d976","type":"blocks","created_at":"2026-01-14T21:33:16.319964-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-jiwy","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:15.75681-08:00","updated_at":"2026-01-14T20:56:15.75681-08:00","dependencies":[{"issue_id":"bd-wisp-jiwy","depends_on_id":"bd-wisp-9u3o","type":"parent-child","created_at":"2026-01-14T20:56:15.76081-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-jjrk","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:11.327276-08:00","updated_at":"2026-01-14T21:33:11.327276-08:00","dependencies":[{"issue_id":"bd-wisp-jjrk","depends_on_id":"bd-wisp-3430","type":"parent-child","created_at":"2026-01-14T21:33:11.386943-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-jjrk","depends_on_id":"bd-wisp-p1si","type":"blocks","created_at":"2026-01-14T21:33:11.490697-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-jn0c","title":"Scan merge queue","description":"Check the beads merge queue - this is the SOURCE OF TRUTH for pending merges.\n\n```bash\ngit fetch --prune origin\ngt mq list \u003crig\u003e\n```\n\nThe beads MQ tracks all pending merge requests. Do NOT rely on `git branch -r | grep polecat`\nas branches may exist without MR beads, or MR beads may exist for already-merged work.\n\nIf queue empty, skip to context-check step.\n\nFor each MR in the queue, verify the branch still exists:\n```bash\ngit branch -r | grep \u003cbranch\u003e\n```\n\nIf branch doesn't exist for a queued MR:\n- Close the MR bead: `bd close \u003cmr-id\u003e --reason \"Branch no longer exists\"`\n- Remove from processing queue\n\nTrack verified MR list for this cycle.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:09:52.698095-08:00","updated_at":"2026-01-15T08:09:52.698095-08:00","dependencies":[{"issue_id":"bd-wisp-jn0c","depends_on_id":"bd-wisp-llul","type":"parent-child","created_at":"2026-01-15T08:09:52.731693-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-jn0c","depends_on_id":"bd-wisp-7maa","type":"blocks","created_at":"2026-01-15T08:09:53.01841-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-jz7k","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:27.576974-08:00","updated_at":"2026-01-14T21:33:27.576974-08:00","dependencies":[{"issue_id":"bd-wisp-jz7k","depends_on_id":"bd-wisp-opv7","type":"parent-child","created_at":"2026-01-14T21:33:27.789977-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-jz7k","depends_on_id":"bd-wisp-w68w","type":"blocks","created_at":"2026-01-14T21:33:28.007129-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-kaj2","title":"Run test suite","description":"Run the test suite.\n\n```bash\ngo test ./...\n```\n\nTrack results: pass count, fail count, specific failures.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:09:52.699038-08:00","updated_at":"2026-01-15T08:09:52.699038-08:00","dependencies":[{"issue_id":"bd-wisp-kaj2","depends_on_id":"bd-wisp-llul","type":"parent-child","created_at":"2026-01-15T08:09:52.789408-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-kaj2","depends_on_id":"bd-wisp-fix0","type":"blocks","created_at":"2026-01-15T08:09:53.076579-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-kgga","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:19.160133-08:00","updated_at":"2026-01-14T20:56:19.160133-08:00","dependencies":[{"issue_id":"bd-wisp-kgga","depends_on_id":"bd-wisp-i1rf","type":"parent-child","created_at":"2026-01-14T20:56:19.268171-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-kgga","depends_on_id":"bd-wisp-g6vd","type":"blocks","created_at":"2026-01-14T20:56:19.392613-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-kh5m","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Write handoff summary\n- Prepare for burn/respawn\n\nIf context is LOW:\n- Can continue processing","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:02:45.432631-08:00","updated_at":"2026-01-15T08:02:45.432631-08:00","dependencies":[{"issue_id":"bd-wisp-kh5m","depends_on_id":"bd-wisp-puaa","type":"parent-child","created_at":"2026-01-15T08:02:45.651978-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-kh5m","depends_on_id":"bd-wisp-4r8n","type":"blocks","created_at":"2026-01-15T08:02:45.933003-08:00","created_by":"beads/refinery"}],"ephemeral":true} +{"id":"bd-wisp-knqy","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Write handoff summary\n- Prepare for burn/respawn\n\nIf context is LOW:\n- Can continue processing","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:09:52.701434-08:00","updated_at":"2026-01-15T08:09:52.701434-08:00","dependencies":[{"issue_id":"bd-wisp-knqy","depends_on_id":"bd-wisp-llul","type":"parent-child","created_at":"2026-01-15T08:09:52.9328-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-knqy","depends_on_id":"bd-wisp-67nc","type":"blocks","created_at":"2026-01-15T08:09:53.223605-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-l01e","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:16.880509-08:00","updated_at":"2026-01-14T20:56:16.88051-08:00","dependencies":[{"issue_id":"bd-wisp-l01e","depends_on_id":"bd-wisp-qc3z","type":"parent-child","created_at":"2026-01-14T20:56:16.937856-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-l01e","depends_on_id":"bd-wisp-vik7","type":"blocks","created_at":"2026-01-14T20:56:17.037897-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-l2o8","title":"Ping Deacon for health check","description":"Send WITNESS_PING to Deacon for second-order monitoring.\n\nThe Witness fleet collectively monitors Deacon health - this prevents the\n\"who watches the watchers\" problem. If Deacon dies, Witnesses detect it.\n\n**Step 1: Send ping**\n```bash\ngt mail send deacon/ -s \"WITNESS_PING \u003crig\u003e\" -m \"Rig: \u003crig\u003e\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: \u003ccycle-number\u003e\"\n```\n\n**Step 2: Check Deacon health**\n```bash\n# Check Deacon agent bead for last_activity\nbd list --type=agent --json | jq '.[] | select(.description | contains(\"deacon\"))'\n```\n\nLook at the `last_activity` timestamp. If stale (\u003e5 minutes since last update):\n- Deacon may be dead or stuck\n\n**Step 3: Escalate if needed**\n```bash\n# If Deacon appears down\ngt mail send mayor/ -s \"ALERT: Deacon appears unresponsive\" -m \"No Deacon activity for \u003e5 minutes.\nLast seen: \u003ctimestamp\u003e\nWitness: \u003crig\u003e/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:24.872621-08:00","updated_at":"2026-01-14T21:33:24.872621-08:00","dependencies":[{"issue_id":"bd-wisp-l2o8","depends_on_id":"bd-wisp-srhi","type":"parent-child","created_at":"2026-01-14T21:33:24.997575-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-l2o8","depends_on_id":"bd-wisp-gi0d","type":"blocks","created_at":"2026-01-14T21:33:25.183872-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-l81a","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:15.759589-08:00","updated_at":"2026-01-14T20:56:15.759589-08:00","dependencies":[{"issue_id":"bd-wisp-l81a","depends_on_id":"bd-wisp-9u3o","type":"parent-child","created_at":"2026-01-14T20:56:15.830175-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-l81a","depends_on_id":"bd-wisp-vr8n","type":"blocks","created_at":"2026-01-14T20:56:15.921464-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-laps","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:22.273904-08:00","updated_at":"2026-01-14T21:33:22.273904-08:00","dependencies":[{"issue_id":"bd-wisp-laps","depends_on_id":"bd-wisp-qzai","type":"parent-child","created_at":"2026-01-14T21:33:22.436703-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-laps","depends_on_id":"bd-wisp-45k1","type":"blocks","created_at":"2026-01-14T21:33:22.604393-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-lbn0","title":"Ping Deacon for health check","description":"Send WITNESS_PING to Deacon for second-order monitoring.\n\nThe Witness fleet collectively monitors Deacon health - this prevents the\n\"who watches the watchers\" problem. If Deacon dies, Witnesses detect it.\n\n**Step 1: Send ping**\n```bash\ngt mail send deacon/ -s \"WITNESS_PING \u003crig\u003e\" -m \"Rig: \u003crig\u003e\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: \u003ccycle-number\u003e\"\n```\n\n**Step 2: Check Deacon health**\n```bash\n# Check Deacon agent bead for last_activity\nbd list --type=agent --json | jq '.[] | select(.description | contains(\"deacon\"))'\n```\n\nLook at the `last_activity` timestamp. If stale (\u003e5 minutes since last update):\n- Deacon may be dead or stuck\n\n**Step 3: Escalate if needed**\n```bash\n# If Deacon appears down\ngt mail send mayor/ -s \"ALERT: Deacon appears unresponsive\" -m \"No Deacon activity for \u003e5 minutes.\nLast seen: \u003ctimestamp\u003e\nWitness: \u003crig\u003e/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:27.575813-08:00","updated_at":"2026-01-14T21:33:27.575813-08:00","dependencies":[{"issue_id":"bd-wisp-lbn0","depends_on_id":"bd-wisp-opv7","type":"parent-child","created_at":"2026-01-14T21:33:27.720062-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-lbn0","depends_on_id":"bd-wisp-68xk","type":"blocks","created_at":"2026-01-14T21:33:27.934213-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-llul","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-15T08:09:52.696852-08:00","updated_at":"2026-01-15T08:09:52.696852-08:00","ephemeral":true} {"id":"bd-wisp-m3im","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:12.609287-08:00","updated_at":"2026-01-14T20:56:12.609287-08:00","dependencies":[{"issue_id":"bd-wisp-m3im","depends_on_id":"bd-wisp-q3lk","type":"parent-child","created_at":"2026-01-14T20:56:12.660521-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-m3im","depends_on_id":"bd-wisp-hjcs","type":"blocks","created_at":"2026-01-14T20:56:12.719423-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-m7nl","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:13.621954-08:00","updated_at":"2026-01-14T21:33:13.621954-08:00","dependencies":[{"issue_id":"bd-wisp-m7nl","depends_on_id":"bd-wisp-7dag","type":"parent-child","created_at":"2026-01-14T21:33:13.719363-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-m7nl","depends_on_id":"bd-wisp-c5eh","type":"blocks","created_at":"2026-01-14T21:33:13.84696-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-m7pf","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:11.328699-08:00","updated_at":"2026-01-14T21:33:11.328699-08:00","dependencies":[{"issue_id":"bd-wisp-m7pf","depends_on_id":"bd-wisp-3430","type":"parent-child","created_at":"2026-01-14T21:33:11.432758-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-m7pf","depends_on_id":"bd-wisp-na9o","type":"blocks","created_at":"2026-01-14T21:33:11.539588-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-m9r0","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:11.326547-08:00","updated_at":"2026-01-14T21:33:11.326547-08:00","dependencies":[{"issue_id":"bd-wisp-m9r0","depends_on_id":"bd-wisp-3430","type":"parent-child","created_at":"2026-01-14T21:33:11.363886-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-m9r0","depends_on_id":"bd-wisp-f1xa","type":"blocks","created_at":"2026-01-14T21:33:11.467315-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-madp","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:13.619292-08:00","updated_at":"2026-01-14T21:33:13.619292-08:00","dependencies":[{"issue_id":"bd-wisp-madp","depends_on_id":"bd-wisp-7dag","type":"parent-child","created_at":"2026-01-14T21:33:13.623166-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-mcne","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T21:38:09.244585-08:00","updated_at":"2026-01-14T21:38:09.244585-08:00","ephemeral":true} -{"id":"bd-wisp-mjq","title":"Handle test failures","description":"**VERIFICATION GATE**: This step enforces the Beads Promise.\n\nIf tests PASSED: This step auto-completes. Proceed to merge.\n\nIf tests FAILED:\n1. Diagnose: Is this a branch regression or pre-existing on main?\n2. If branch caused it:\n - Abort merge\n - Notify polecat: \"Tests failing. Please fix and resubmit.\"\n - Skip to loop-check\n3. If pre-existing on main:\n - Option A: Fix it yourself (you're the Engineer!)\n - Option B: File a bead: bd create --type=bug --priority=1 --title=\"...\"\n\n**GATE REQUIREMENT**: You CANNOT proceed to merge-push without:\n- Tests passing, OR\n- Fix committed, OR\n- Bead filed for the failure\n\nThis is non-negotiable. Never disavow. Never \"note and proceed.\" ","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T01:27:11.196466-08:00","updated_at":"2026-01-12T01:27:49.440026-08:00","closed_at":"2026-01-12T01:27:49.440026-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-mjq","depends_on_id":"bd-wisp-ce6","type":"blocks","created_at":"2026-01-12T01:27:11.224814-08:00","created_by":"beads/refinery"}],"ephemeral":true} -{"id":"bd-wisp-mld","title":"Merge and push to main","description":"Merge to main and push. CRITICAL: Notifications come IMMEDIATELY after push.\n\n**Step 1: Merge and Push**\n```bash\ngit checkout main\ngit merge --ff-only temp\ngit push origin main\n```\n\n⚠️ **STOP HERE - DO NOT PROCEED UNTIL STEPS 2-3 COMPLETE**\n\n**Step 2: Send MERGED Notification (REQUIRED - DO THIS IMMEDIATELY)**\n\nRIGHT NOW, before any cleanup, send MERGED mail to Witness:\n\n```bash\ngt mail send \u003crig\u003e/witness -s \"MERGED \u003cpolecat-name\u003e\" -m \"Branch: \u003cbranch\u003e\nIssue: \u003cissue-id\u003e\nMerged-At: $(date -u +%Y-%m-%dT%H:%M:%SZ)\"\n```\n\nThis signals the Witness to nuke the polecat worktree. WITHOUT THIS NOTIFICATION,\nPOLECAT WORKTREES ACCUMULATE INDEFINITELY AND THE LIFECYCLE BREAKS.\n\n**Step 3: Close MR Bead (REQUIRED - DO THIS IMMEDIATELY)**\n\n⚠️ **VERIFICATION BEFORE CLOSING**: Confirm the work is actually on main:\n```bash\n# Get the commit message/issue from the branch\ngit log origin/main --oneline | grep \"\u003cissue-id\u003e\"\n# OR verify the commit SHA is on main:\ngit branch --contains \u003ccommit-sha\u003e | grep main\n```\n\nIf work is NOT on main, DO NOT close the MR bead. Investigate first.\n\n```bash\nbd close \u003cmr-bead-id\u003e --reason \"Merged to main at $(git rev-parse --short HEAD)\"\n```\n\nThe MR bead ID was in the MERGE_READY message or find via:\n```bash\nbd list --type=merge-request --status=open | grep \u003cpolecat-name\u003e\n```\n\n**VALIDATION**: The MR bead's source_issue should be a valid bead ID (gt-xxxxx),\nnot a branch name. If source_issue contains a branch name, flag for investigation.\n\n**Step 4: Archive the MERGE_READY mail (REQUIRED)**\n```bash\ngt mail archive \u003cmerge-ready-message-id\u003e\n```\nThe message ID was tracked when you processed inbox-check.\n\n**Step 5: Cleanup (only after Steps 2-4 confirmed)**\n```bash\ngit branch -d temp\ngit push origin --delete \u003cpolecat-branch\u003e\n```\n\n**VERIFICATION GATE**: You CANNOT proceed to loop-check without:\n- [x] MERGED mail sent to witness\n- [x] MR bead closed\n- [x] MERGE_READY mail archived\n\nIf you skipped notifications or archiving, GO BACK AND DO THEM NOW.\n\nMain has moved. Any remaining branches need rebasing on new baseline.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T01:27:11.196764-08:00","updated_at":"2026-01-12T01:27:49.55647-08:00","closed_at":"2026-01-12T01:27:49.55647-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-mld","depends_on_id":"bd-wisp-mjq","type":"blocks","created_at":"2026-01-12T01:27:11.227232-08:00","created_by":"beads/refinery"}],"ephemeral":true} +{"id":"bd-wisp-mjq","title":"Handle test failures","description":"**VERIFICATION GATE**: This step enforces the Beads Promise.\n\nIf tests PASSED: This step auto-completes. Proceed to merge.\n\nIf tests FAILED:\n1. Diagnose: Is this a branch regression or pre-existing on main?\n2. If branch caused it:\n - Abort merge\n - Notify polecat: \"Tests failing. Please fix and resubmit.\"\n - Skip to loop-check\n3. If pre-existing on main:\n - Option A: Fix it yourself (you're the Engineer!)\n - Option B: File a bead: bd create --type=bug --priority=1 --title=\"...\"\n\n**GATE REQUIREMENT**: You CANNOT proceed to merge-push without:\n- Tests passing, OR\n- Fix committed, OR\n- Bead filed for the failure\n\nThis is non-negotiable. Never disavow. Never \"note and proceed.\" ","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T01:27:11.196466-08:00","updated_at":"2026-01-12T01:27:49.440026-08:00","closed_at":"2026-01-12T01:27:49.440026-08:00","close_reason":"Closed","ephemeral":true} +{"id":"bd-wisp-mnd3","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-15T11:49:39.757676-08:00","updated_at":"2026-01-15T11:49:39.757676-08:00","ephemeral":true} {"id":"bd-wisp-mpdb","title":"Check timer gates for expiration","description":"Check for expired timer gates and escalate as needed.\n\nTimer gates are async wait conditions with a timeout. When the timeout expires,\nthe gate should be escalated to the overseer for human intervention.\n\n**Step 1: Run timer gate check**\n```bash\nbd gate check --type=timer --escalate\n```\n\nThis command:\n1. Finds all open gate issues with await_type=timer\n2. Checks if `now \u003e created_at + timeout`\n3. Escalates expired gates via `gt escalate` (HIGH severity)\n4. Reports summary of gate status\n\n**Step 2: Review output**\n\nIf expired gates were found and escalated:\n- The escalation creates an audit trail bead\n- Overseer will be notified via mail\n- Gate remains open until manually resolved\n\nIf no expired gates:\n- Continue patrol normally\n\n**Note**: Timer gates do NOT auto-close on expiration. They escalate.\nThis ensures human oversight of timeout conditions.\n\n**Parallelism**: This is a single command, no parallel execution needed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:19.158697-08:00","updated_at":"2026-01-14T20:56:19.158697-08:00","dependencies":[{"issue_id":"bd-wisp-mpdb","depends_on_id":"bd-wisp-i1rf","type":"parent-child","created_at":"2026-01-14T20:56:19.214877-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-mpdb","depends_on_id":"bd-wisp-hxip","type":"blocks","created_at":"2026-01-14T20:56:19.337065-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-msq","title":"Update local installation","description":"Update local bd to the new version.\n\nOption 1 - Homebrew:\n```bash\nbrew upgrade bd\n```\n\nOption 2 - Install script:\n```bash\ncurl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash\n```\n\nVerify:\n```bash\nbd --version\n```\n\nShould show 0.47.1.\n","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-12T03:17:16.713524-08:00","updated_at":"2026-01-12T03:17:16.713525-08:00","dependencies":[{"issue_id":"bd-wisp-msq","depends_on_id":"bd-wisp-5j5","type":"parent-child","created_at":"2026-01-12T03:17:16.742098-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-msq","depends_on_id":"bd-wisp-2g2","type":"blocks","created_at":"2026-01-12T03:17:16.799353-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-msq","depends_on_id":"bd-wisp-mtc","type":"blocks","created_at":"2026-01-12T03:17:16.802756-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-msq","depends_on_id":"bd-wisp-8m1","type":"blocks","created_at":"2026-01-12T03:17:16.806081-08:00","created_by":"beads/crew/emma"}],"ephemeral":true} {"id":"bd-wisp-mtc","title":"Verify npm package","description":"Confirm npm package published.\n\n```bash\nnpm show @beads/bd version\n```\n\nShould show 0.47.1.\n\nAlso check: https://www.npmjs.com/package/@beads/bd\n\nNote: npm registry may have a small propagation delay (1-2 min).\n","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-12T03:17:16.712922-08:00","updated_at":"2026-01-12T03:17:16.712923-08:00","dependencies":[{"issue_id":"bd-wisp-mtc","depends_on_id":"bd-wisp-5j5","type":"parent-child","created_at":"2026-01-12T03:17:16.739725-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-mtc","depends_on_id":"bd-wisp-4i8","type":"blocks","created_at":"2026-01-12T03:17:16.792889-08:00","created_by":"beads/crew/emma"}],"ephemeral":true} @@ -2719,7 +2764,9 @@ {"id":"bd-wisp-n898","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:23.565072-08:00","updated_at":"2026-01-14T21:33:23.565072-08:00","dependencies":[{"issue_id":"bd-wisp-n898","depends_on_id":"bd-wisp-9gxz","type":"parent-child","created_at":"2026-01-14T21:33:23.739221-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-n898","depends_on_id":"bd-wisp-vr8p","type":"blocks","created_at":"2026-01-14T21:33:23.915611-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-na9o","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:11.328344-08:00","updated_at":"2026-01-14T21:33:11.328344-08:00","dependencies":[{"issue_id":"bd-wisp-na9o","depends_on_id":"bd-wisp-3430","type":"parent-child","created_at":"2026-01-14T21:33:11.420901-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-na9o","depends_on_id":"bd-wisp-rlzx","type":"blocks","created_at":"2026-01-14T21:33:11.526823-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-ncwc","title":"Check timer gates for expiration","description":"Check for expired timer gates and escalate as needed.\n\nTimer gates are async wait conditions with a timeout. When the timeout expires,\nthe gate should be escalated to the overseer for human intervention.\n\n**Step 1: Run timer gate check**\n```bash\nbd gate check --type=timer --escalate\n```\n\nThis command:\n1. Finds all open gate issues with await_type=timer\n2. Checks if `now \u003e created_at + timeout`\n3. Escalates expired gates via `gt escalate` (HIGH severity)\n4. Reports summary of gate status\n\n**Step 2: Review output**\n\nIf expired gates were found and escalated:\n- The escalation creates an audit trail bead\n- Overseer will be notified via mail\n- Gate remains open until manually resolved\n\nIf no expired gates:\n- Continue patrol normally\n\n**Note**: Timer gates do NOT auto-close on expiration. They escalate.\nThis ensures human oversight of timeout conditions.\n\n**Parallelism**: This is a single command, no parallel execution needed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:14.685062-08:00","updated_at":"2026-01-14T20:56:14.685062-08:00","dependencies":[{"issue_id":"bd-wisp-ncwc","depends_on_id":"bd-wisp-7mjs","type":"parent-child","created_at":"2026-01-14T20:56:14.721506-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-ncwc","depends_on_id":"bd-wisp-j35h","type":"blocks","created_at":"2026-01-14T20:56:14.799023-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-nofu","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n```bash\n# Check if refinery session exists\ngt session status \u003crig\u003e/refinery\n\n# Check for pending merge requests\nbd list --type=merge-request --status=open\n```\n\nIf MRs waiting AND refinery not running:\n```bash\ngt session start \u003crig\u003e/refinery\ngt mail send \u003crig\u003e/refinery -s \"PATROL: Wake up\" -m \"Merge requests in queue. Please process.\"\n```\n\nIf refinery running but queue stale (\u003e30 min), send nudge.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:53:02.114978-08:00","updated_at":"2026-01-14T21:53:02.114978-08:00","dependencies":[{"issue_id":"bd-wisp-nofu","depends_on_id":"bd-wisp-si5o","type":"parent-child","created_at":"2026-01-14T21:53:02.168929-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-nofu","depends_on_id":"bd-wisp-73ys","type":"blocks","created_at":"2026-01-14T21:53:02.392952-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-nomu","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:16.879787-08:00","updated_at":"2026-01-14T20:56:16.879787-08:00","dependencies":[{"issue_id":"bd-wisp-nomu","depends_on_id":"bd-wisp-qc3z","type":"parent-child","created_at":"2026-01-14T20:56:16.915637-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-nomu","depends_on_id":"bd-wisp-s9yg","type":"blocks","created_at":"2026-01-14T20:56:17.015264-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-npqz","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:47:13.501348-08:00","updated_at":"2026-01-14T21:47:17.871576-08:00","ephemeral":true} {"id":"bd-wisp-nsoy","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:15.758819-08:00","updated_at":"2026-01-14T20:56:15.758819-08:00","dependencies":[{"issue_id":"bd-wisp-nsoy","depends_on_id":"bd-wisp-9u3o","type":"parent-child","created_at":"2026-01-14T20:56:15.809994-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-nsoy","depends_on_id":"bd-wisp-qfj1","type":"blocks","created_at":"2026-01-14T20:56:15.900535-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-ntdo","title":"Ping Deacon for health check","description":"Send WITNESS_PING to Deacon for second-order monitoring.\n\nThe Witness fleet collectively monitors Deacon health - this prevents the\n\"who watches the watchers\" problem. If Deacon dies, Witnesses detect it.\n\n**Step 1: Send ping**\n```bash\ngt mail send deacon/ -s \"WITNESS_PING \u003crig\u003e\" -m \"Rig: \u003crig\u003e\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: \u003ccycle-number\u003e\"\n```\n\n**Step 2: Check Deacon health**\n```bash\n# Check Deacon agent bead for last_activity\nbd list --type=agent --json | jq '.[] | select(.description | contains(\"deacon\"))'\n```\n\nLook at the `last_activity` timestamp. If stale (\u003e5 minutes since last update):\n- Deacon may be dead or stuck\n\n**Step 3: Escalate if needed**\n```bash\n# If Deacon appears down\ngt mail send mayor/ -s \"ALERT: Deacon appears unresponsive\" -m \"No Deacon activity for \u003e5 minutes.\nLast seen: \u003ctimestamp\u003e\nWitness: \u003crig\u003e/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:55:53.805881-08:00","updated_at":"2026-01-14T20:55:53.805881-08:00","dependencies":[{"issue_id":"bd-wisp-ntdo","depends_on_id":"bd-wisp-3ds","type":"parent-child","created_at":"2026-01-14T20:55:53.826053-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-ntdo","depends_on_id":"bd-wisp-qtp5","type":"blocks","created_at":"2026-01-14T20:55:53.855204-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-nuw0","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:13.622313-08:00","updated_at":"2026-01-14T21:33:13.622313-08:00","dependencies":[{"issue_id":"bd-wisp-nuw0","depends_on_id":"bd-wisp-7dag","type":"parent-child","created_at":"2026-01-14T21:33:13.733115-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-nuw0","depends_on_id":"bd-wisp-m7nl","type":"blocks","created_at":"2026-01-14T21:33:13.861711-08:00","created_by":"beads/witness"}],"ephemeral":true} @@ -2727,6 +2774,10 @@ {"id":"bd-wisp-nxm9","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:18.014436-08:00","updated_at":"2026-01-14T20:56:18.014436-08:00","dependencies":[{"issue_id":"bd-wisp-nxm9","depends_on_id":"bd-wisp-xj1k","type":"parent-child","created_at":"2026-01-14T20:56:18.018398-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-nys","title":"Review changes since last release","description":"Understand what's being released.\n\n```bash\ngit log $(git describe --tags --abbrev=0)..HEAD --oneline\n```\n\nCategorize changes:\n- Features (feat:)\n- Fixes (fix:)\n- Breaking changes\n- Documentation\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T03:17:16.707033-08:00","updated_at":"2026-01-12T03:18:49.071964-08:00","closed_at":"2026-01-12T03:18:49.071964-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-nys","depends_on_id":"bd-wisp-5j5","type":"parent-child","created_at":"2026-01-12T03:17:16.719145-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-nys","depends_on_id":"bd-wisp-07c","type":"blocks","created_at":"2026-01-12T03:17:16.749907-08:00","created_by":"beads/crew/emma"}],"ephemeral":true} {"id":"bd-wisp-o0vk","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n```bash\n# Check if refinery session exists\ngt session status \u003crig\u003e/refinery\n\n# Check for pending merge requests\nbd list --type=merge-request --status=open\n```\n\nIf MRs waiting AND refinery not running:\n```bash\ngt session start \u003crig\u003e/refinery\ngt mail send \u003crig\u003e/refinery -s \"PATROL: Wake up\" -m \"Merge requests in queue. Please process.\"\n```\n\nIf refinery running but queue stale (\u003e30 min), send nudge.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:24.871026-08:00","updated_at":"2026-01-14T21:33:24.871026-08:00","dependencies":[{"issue_id":"bd-wisp-o0vk","depends_on_id":"bd-wisp-srhi","type":"parent-child","created_at":"2026-01-14T21:33:24.915424-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-o0vk","depends_on_id":"bd-wisp-74vw","type":"blocks","created_at":"2026-01-14T21:33:25.099985-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-o70h","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-15T05:51:08.027509-08:00","updated_at":"2026-01-15T05:51:08.027509-08:00","ephemeral":true} +{"id":"bd-wisp-o9n8","title":"Merge and push to main","description":"Merge to main and push. CRITICAL: Notifications come IMMEDIATELY after push.\n\n**Step 1: Merge and Push**\n```bash\ngit checkout main\ngit merge --ff-only temp\ngit push origin main\n```\n\n⚠️ **STOP HERE - DO NOT PROCEED UNTIL STEPS 2-3 COMPLETE**\n\n**Step 2: Send MERGED Notification (REQUIRED - DO THIS IMMEDIATELY)**\n\nRIGHT NOW, before any cleanup, send MERGED mail to Witness:\n\n```bash\ngt mail send \u003crig\u003e/witness -s \"MERGED \u003cpolecat-name\u003e\" -m \"Branch: \u003cbranch\u003e\nIssue: \u003cissue-id\u003e\nMerged-At: $(date -u +%Y-%m-%dT%H:%M:%SZ)\"\n```\n\nThis signals the Witness to nuke the polecat worktree. WITHOUT THIS NOTIFICATION,\nPOLECAT WORKTREES ACCUMULATE INDEFINITELY AND THE LIFECYCLE BREAKS.\n\n**Step 3: Close MR Bead (REQUIRED - DO THIS IMMEDIATELY)**\n\n⚠️ **VERIFICATION BEFORE CLOSING**: Confirm the work is actually on main:\n```bash\n# Get the commit message/issue from the branch\ngit log origin/main --oneline | grep \"\u003cissue-id\u003e\"\n# OR verify the commit SHA is on main:\ngit branch --contains \u003ccommit-sha\u003e | grep main\n```\n\nIf work is NOT on main, DO NOT close the MR bead. Investigate first.\n\n```bash\nbd close \u003cmr-bead-id\u003e --reason \"Merged to main at $(git rev-parse --short HEAD)\"\n```\n\nThe MR bead ID was in the MERGE_READY message or find via:\n```bash\nbd list --type=merge-request --status=open | grep \u003cpolecat-name\u003e\n```\n\n**VALIDATION**: The MR bead's source_issue should be a valid bead ID (gt-xxxxx),\nnot a branch name. If source_issue contains a branch name, flag for investigation.\n\n**Step 4: Archive the MERGE_READY mail (REQUIRED)**\n```bash\ngt mail archive \u003cmerge-ready-message-id\u003e\n```\nThe message ID was tracked when you processed inbox-check.\n\n**Step 5: Cleanup (only after Steps 2-4 confirmed)**\n```bash\ngit branch -d temp\ngit push origin --delete \u003cpolecat-branch\u003e\n```\n\n**VERIFICATION GATE**: You CANNOT proceed to loop-check without:\n- [x] MERGED mail sent to witness\n- [x] MR bead closed\n- [x] MERGE_READY mail archived\n\nIf you skipped notifications or archiving, GO BACK AND DO THEM NOW.\n\nMain has moved. Any remaining branches need rebasing on new baseline.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:02:45.431453-08:00","updated_at":"2026-01-15T08:02:45.431453-08:00","dependencies":[{"issue_id":"bd-wisp-o9n8","depends_on_id":"bd-wisp-puaa","type":"parent-child","created_at":"2026-01-15T08:02:45.569217-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-o9n8","depends_on_id":"bd-wisp-uqja","type":"blocks","created_at":"2026-01-15T08:02:45.847638-08:00","created_by":"beads/refinery"}],"ephemeral":true} +{"id":"bd-wisp-od5d","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:44:08.955324-08:00","updated_at":"2026-01-14T21:44:13.714755-08:00","ephemeral":true} +{"id":"bd-wisp-ok70","title":"Check for more work","description":"More branches to process?\n\n**Entry paths:**\n- Normal: After successful merge-push\n- Conflict-skip: After process-branch created conflict-resolution task\n\nIf yes: Return to process-branch with next branch.\nIf no: Continue to generate-summary.\n\n**Track for this cycle:**\n- branches_merged: count and names of successfully merged branches\n- branches_conflict: count and names of branches skipped due to conflicts\n- conflict_tasks: IDs of conflict-resolution tasks created\n\nThis tracking feeds into generate-summary for the patrol digest.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:02:45.431843-08:00","updated_at":"2026-01-15T08:02:45.431843-08:00","dependencies":[{"issue_id":"bd-wisp-ok70","depends_on_id":"bd-wisp-puaa","type":"parent-child","created_at":"2026-01-15T08:02:45.596972-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-ok70","depends_on_id":"bd-wisp-o9n8","type":"blocks","created_at":"2026-01-15T08:02:45.876026-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-oma9","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:14.807858-08:00","updated_at":"2026-01-14T21:33:14.807858-08:00","dependencies":[{"issue_id":"bd-wisp-oma9","depends_on_id":"bd-wisp-zonw","type":"parent-child","created_at":"2026-01-14T21:33:14.932855-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-oma9","depends_on_id":"bd-wisp-qmiv","type":"blocks","created_at":"2026-01-14T21:33:15.075409-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-opv7","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T21:33:27.572437-08:00","updated_at":"2026-01-14T21:33:27.572437-08:00","ephemeral":true} {"id":"bd-wisp-oqsv","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:31:03.134548-08:00","updated_at":"2026-01-14T21:31:07.33691-08:00","ephemeral":true} @@ -2735,8 +2786,8 @@ {"id":"bd-wisp-p1si","title":"Check timer gates for expiration","description":"Check for expired timer gates and escalate as needed.\n\nTimer gates are async wait conditions with a timeout. When the timeout expires,\nthe gate should be escalated to the overseer for human intervention.\n\n**Step 1: Run timer gate check**\n```bash\nbd gate check --type=timer --escalate\n```\n\nThis command:\n1. Finds all open gate issues with await_type=timer\n2. Checks if `now \u003e created_at + timeout`\n3. Escalates expired gates via `gt escalate` (HIGH severity)\n4. Reports summary of gate status\n\n**Step 2: Review output**\n\nIf expired gates were found and escalated:\n- The escalation creates an audit trail bead\n- Overseer will be notified via mail\n- Gate remains open until manually resolved\n\nIf no expired gates:\n- Continue patrol normally\n\n**Note**: Timer gates do NOT auto-close on expiration. They escalate.\nThis ensures human oversight of timeout conditions.\n\n**Parallelism**: This is a single command, no parallel execution needed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:11.326916-08:00","updated_at":"2026-01-14T21:33:11.326917-08:00","dependencies":[{"issue_id":"bd-wisp-p1si","depends_on_id":"bd-wisp-3430","type":"parent-child","created_at":"2026-01-14T21:33:11.375379-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-p1si","depends_on_id":"bd-wisp-m9r0","type":"blocks","created_at":"2026-01-14T21:33:11.478987-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-pcgf","title":"Check timer gates for expiration","description":"Check for expired timer gates and escalate as needed.\n\nTimer gates are async wait conditions with a timeout. When the timeout expires,\nthe gate should be escalated to the overseer for human intervention.\n\n**Step 1: Run timer gate check**\n```bash\nbd gate check --type=timer --escalate\n```\n\nThis command:\n1. Finds all open gate issues with await_type=timer\n2. Checks if `now \u003e created_at + timeout`\n3. Escalates expired gates via `gt escalate` (HIGH severity)\n4. Reports summary of gate status\n\n**Step 2: Review output**\n\nIf expired gates were found and escalated:\n- The escalation creates an audit trail bead\n- Overseer will be notified via mail\n- Gate remains open until manually resolved\n\nIf no expired gates:\n- Continue patrol normally\n\n**Note**: Timer gates do NOT auto-close on expiration. They escalate.\nThis ensures human oversight of timeout conditions.\n\n**Parallelism**: This is a single command, no parallel execution needed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:12.607831-08:00","updated_at":"2026-01-14T20:56:12.607831-08:00","dependencies":[{"issue_id":"bd-wisp-pcgf","depends_on_id":"bd-wisp-q3lk","type":"parent-child","created_at":"2026-01-14T20:56:12.635715-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-pcgf","depends_on_id":"bd-wisp-pv6v","type":"blocks","created_at":"2026-01-14T20:56:12.692582-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-pkh5","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T21:33:16.027388-08:00","updated_at":"2026-01-14T21:33:16.027388-08:00","ephemeral":true} +{"id":"bd-wisp-puaa","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-15T08:02:45.427896-08:00","updated_at":"2026-01-15T08:02:45.427896-08:00","ephemeral":true} {"id":"bd-wisp-pv6v","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:12.607455-08:00","updated_at":"2026-01-14T20:56:12.607455-08:00","dependencies":[{"issue_id":"bd-wisp-pv6v","depends_on_id":"bd-wisp-q3lk","type":"parent-child","created_at":"2026-01-14T20:56:12.629424-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-pv6v","depends_on_id":"bd-wisp-4b4r","type":"blocks","created_at":"2026-01-14T20:56:12.686015-08:00","created_by":"beads/witness"}],"ephemeral":true} -{"id":"bd-wisp-pyf","title":"Generate handoff summary","description":"Summarize this patrol cycle.\n\n**VERIFICATION**: Before generating summary, confirm for each merged branch:\n- [ ] MERGED mail was sent to witness\n- [ ] MR bead was closed\n- [ ] MERGE_READY mail archived\n\nIf any notifications or archiving were missed, do them now!\n\nInclude in summary:\n- Branches merged (count, names)\n- MERGED mails sent (count - should match branches merged)\n- MR beads closed (count - should match branches merged)\n- MERGE_READY mails archived (count - should match branches merged)\n- Test results (pass/fail)\n- Branches with conflicts (count, names)\n- Conflict-resolution tasks created (IDs)\n- Issues filed (if any)\n- Any escalations sent\n\n**Conflict tracking is important** for monitoring MQ health. If many branches\nconflict, it may indicate main is moving too fast or branches are too stale.\n\nThis becomes the digest when the patrol is squashed.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T01:27:11.197367-08:00","updated_at":"2026-01-12T01:28:17.663658-08:00","closed_at":"2026-01-12T01:28:17.663658-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-pyf","depends_on_id":"bd-wisp-gby","type":"blocks","created_at":"2026-01-12T01:27:11.232206-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-q2th","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:32:42.911136-08:00","updated_at":"2026-01-14T21:32:47.791972-08:00","ephemeral":true} {"id":"bd-wisp-q3lk","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T20:56:12.605438-08:00","updated_at":"2026-01-14T20:56:12.605438-08:00","ephemeral":true} {"id":"bd-wisp-q7n","title":"Check refinery mail","description":"Check mail for MERGE_READY submissions, escalations, and messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**MERGE_READY**:\nA polecat's work is ready for merge. Extract details and track for processing.\n\n```bash\n# Parse MERGE_READY message body:\n# Branch: \u003cbranch\u003e\n# Issue: \u003cissue-id\u003e\n# Polecat: \u003cpolecat-name\u003e\n# MR: \u003cmr-bead-id\u003e\n# Verified: clean git state, issue closed\n\n# Track in your merge queue for this patrol cycle:\n# - Branch name\n# - Issue ID\n# - Polecat name (REQUIRED for MERGED notification)\n# - MR bead ID (REQUIRED for closing after merge)\n```\n\n**IMPORTANT**: You MUST track the polecat name, MR bead ID, AND message ID - you will need them\nin merge-push step to send MERGED notification, close the MR bead, and archive the mail.\n\nMark as read. The work will be processed in queue-scan/process-branch.\n**Do NOT archive yet** - archive after merge/reject decision in merge-push step.\n\n**PATROL: Wake up**:\nWitness detected MRs waiting but refinery idle. Acknowledge and archive:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HELP / Blocked**:\nAssess and respond. If you can't help, escalate to Mayor.\nArchive after handling:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Check for in-flight merges.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: pending MRs in queue. Inbox should be near-empty.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T01:27:11.195173-08:00","updated_at":"2026-01-12T01:27:25.54453-08:00","closed_at":"2026-01-12T01:27:25.54453-08:00","close_reason":"Closed","ephemeral":true} @@ -2744,44 +2795,52 @@ {"id":"bd-wisp-qfj1","title":"Check timer gates for expiration","description":"Check for expired timer gates and escalate as needed.\n\nTimer gates are async wait conditions with a timeout. When the timeout expires,\nthe gate should be escalated to the overseer for human intervention.\n\n**Step 1: Run timer gate check**\n```bash\nbd gate check --type=timer --escalate\n```\n\nThis command:\n1. Finds all open gate issues with await_type=timer\n2. Checks if `now \u003e created_at + timeout`\n3. Escalates expired gates via `gt escalate` (HIGH severity)\n4. Reports summary of gate status\n\n**Step 2: Review output**\n\nIf expired gates were found and escalated:\n- The escalation creates an audit trail bead\n- Overseer will be notified via mail\n- Gate remains open until manually resolved\n\nIf no expired gates:\n- Continue patrol normally\n\n**Note**: Timer gates do NOT auto-close on expiration. They escalate.\nThis ensures human oversight of timeout conditions.\n\n**Parallelism**: This is a single command, no parallel execution needed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:15.758454-08:00","updated_at":"2026-01-14T20:56:15.758454-08:00","dependencies":[{"issue_id":"bd-wisp-qfj1","depends_on_id":"bd-wisp-9u3o","type":"parent-child","created_at":"2026-01-14T20:56:15.800392-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-qfj1","depends_on_id":"bd-wisp-va4v","type":"blocks","created_at":"2026-01-14T20:56:15.890223-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-qmiv","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:14.807493-08:00","updated_at":"2026-01-14T21:33:14.807493-08:00","dependencies":[{"issue_id":"bd-wisp-qmiv","depends_on_id":"bd-wisp-zonw","type":"parent-child","created_at":"2026-01-14T21:33:14.917356-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-qmiv","depends_on_id":"bd-wisp-5n2z","type":"blocks","created_at":"2026-01-14T21:33:15.058982-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-qng6","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:11.591917-08:00","updated_at":"2026-01-14T20:56:11.591917-08:00","dependencies":[{"issue_id":"bd-wisp-qng6","depends_on_id":"bd-wisp-ecpj","type":"parent-child","created_at":"2026-01-14T20:56:11.637854-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-qng6","depends_on_id":"bd-wisp-vo92","type":"blocks","created_at":"2026-01-14T20:56:11.687419-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-qqyn","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-15T07:12:41.933852-08:00","updated_at":"2026-01-15T07:12:41.933852-08:00","ephemeral":true} {"id":"bd-wisp-qs93","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:19.160492-08:00","updated_at":"2026-01-14T20:56:19.160492-08:00","dependencies":[{"issue_id":"bd-wisp-qs93","depends_on_id":"bd-wisp-i1rf","type":"parent-child","created_at":"2026-01-14T20:56:19.28183-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-qs93","depends_on_id":"bd-wisp-kgga","type":"blocks","created_at":"2026-01-14T20:56:19.406653-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-qtp5","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:55:53.80551-08:00","updated_at":"2026-01-14T20:55:53.80551-08:00","dependencies":[{"issue_id":"bd-wisp-qtp5","depends_on_id":"bd-wisp-3ds","type":"parent-child","created_at":"2026-01-14T20:55:53.822875-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-qtp5","depends_on_id":"bd-wisp-043","type":"blocks","created_at":"2026-01-14T20:55:53.851593-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-qzai","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T21:33:22.269572-08:00","updated_at":"2026-01-14T21:33:22.269572-08:00","ephemeral":true} {"id":"bd-wisp-r2bo","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:02:47.472842-08:00","updated_at":"2026-01-14T21:02:51.68757-08:00","ephemeral":true} {"id":"bd-wisp-r6zs","title":"Check timer gates for expiration","description":"Check for expired timer gates and escalate as needed.\n\nTimer gates are async wait conditions with a timeout. When the timeout expires,\nthe gate should be escalated to the overseer for human intervention.\n\n**Step 1: Run timer gate check**\n```bash\nbd gate check --type=timer --escalate\n```\n\nThis command:\n1. Finds all open gate issues with await_type=timer\n2. Checks if `now \u003e created_at + timeout`\n3. Escalates expired gates via `gt escalate` (HIGH severity)\n4. Reports summary of gate status\n\n**Step 2: Review output**\n\nIf expired gates were found and escalated:\n- The escalation creates an audit trail bead\n- Overseer will be notified via mail\n- Gate remains open until manually resolved\n\nIf no expired gates:\n- Continue patrol normally\n\n**Note**: Timer gates do NOT auto-close on expiration. They escalate.\nThis ensures human oversight of timeout conditions.\n\n**Parallelism**: This is a single command, no parallel execution needed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:16.029789-08:00","updated_at":"2026-01-14T21:33:16.029789-08:00","dependencies":[{"issue_id":"bd-wisp-r6zs","depends_on_id":"bd-wisp-pkh5","type":"parent-child","created_at":"2026-01-14T21:33:16.098263-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-r6zs","depends_on_id":"bd-wisp-1jad","type":"blocks","created_at":"2026-01-14T21:33:16.250448-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-rdax","title":"Check for more work","description":"More branches to process?\n\n**Entry paths:**\n- Normal: After successful merge-push\n- Conflict-skip: After process-branch created conflict-resolution task\n\nIf yes: Return to process-branch with next branch.\nIf no: Continue to generate-summary.\n\n**Track for this cycle:**\n- branches_merged: count and names of successfully merged branches\n- branches_conflict: count and names of branches skipped due to conflicts\n- conflict_tasks: IDs of conflict-resolution tasks created\n\nThis tracking feeds into generate-summary for the patrol digest.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:09:52.700647-08:00","updated_at":"2026-01-15T08:09:52.700647-08:00","dependencies":[{"issue_id":"bd-wisp-rdax","depends_on_id":"bd-wisp-llul","type":"parent-child","created_at":"2026-01-15T08:09:52.875307-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-rdax","depends_on_id":"bd-wisp-rgrr","type":"blocks","created_at":"2026-01-15T08:09:53.163614-08:00","created_by":"beads/refinery"}],"ephemeral":true} +{"id":"bd-wisp-rgrr","title":"Merge and push to main","description":"Merge to main and push. CRITICAL: Notifications come IMMEDIATELY after push.\n\n**Step 1: Merge and Push**\n```bash\ngit checkout main\ngit merge --ff-only temp\ngit push origin main\n```\n\n⚠️ **STOP HERE - DO NOT PROCEED UNTIL STEPS 2-3 COMPLETE**\n\n**Step 2: Send MERGED Notification (REQUIRED - DO THIS IMMEDIATELY)**\n\nRIGHT NOW, before any cleanup, send MERGED mail to Witness:\n\n```bash\ngt mail send \u003crig\u003e/witness -s \"MERGED \u003cpolecat-name\u003e\" -m \"Branch: \u003cbranch\u003e\nIssue: \u003cissue-id\u003e\nMerged-At: $(date -u +%Y-%m-%dT%H:%M:%SZ)\"\n```\n\nThis signals the Witness to nuke the polecat worktree. WITHOUT THIS NOTIFICATION,\nPOLECAT WORKTREES ACCUMULATE INDEFINITELY AND THE LIFECYCLE BREAKS.\n\n**Step 3: Close MR Bead (REQUIRED - DO THIS IMMEDIATELY)**\n\n⚠️ **VERIFICATION BEFORE CLOSING**: Confirm the work is actually on main:\n```bash\n# Get the commit message/issue from the branch\ngit log origin/main --oneline | grep \"\u003cissue-id\u003e\"\n# OR verify the commit SHA is on main:\ngit branch --contains \u003ccommit-sha\u003e | grep main\n```\n\nIf work is NOT on main, DO NOT close the MR bead. Investigate first.\n\n```bash\nbd close \u003cmr-bead-id\u003e --reason \"Merged to main at $(git rev-parse --short HEAD)\"\n```\n\nThe MR bead ID was in the MERGE_READY message or find via:\n```bash\nbd list --type=merge-request --status=open | grep \u003cpolecat-name\u003e\n```\n\n**VALIDATION**: The MR bead's source_issue should be a valid bead ID (gt-xxxxx),\nnot a branch name. If source_issue contains a branch name, flag for investigation.\n\n**Step 4: Archive the MERGE_READY mail (REQUIRED)**\n```bash\ngt mail archive \u003cmerge-ready-message-id\u003e\n```\nThe message ID was tracked when you processed inbox-check.\n\n**Step 5: Cleanup (only after Steps 2-4 confirmed)**\n```bash\ngit branch -d temp\ngit push origin --delete \u003cpolecat-branch\u003e\n```\n\n**VERIFICATION GATE**: You CANNOT proceed to loop-check without:\n- [x] MERGED mail sent to witness\n- [x] MR bead closed\n- [x] MERGE_READY mail archived\n\nIf you skipped notifications or archiving, GO BACK AND DO THEM NOW.\n\nMain has moved. Any remaining branches need rebasing on new baseline.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:09:52.700191-08:00","updated_at":"2026-01-15T08:09:52.700191-08:00","dependencies":[{"issue_id":"bd-wisp-rgrr","depends_on_id":"bd-wisp-llul","type":"parent-child","created_at":"2026-01-15T08:09:52.846637-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-rgrr","depends_on_id":"bd-wisp-va0g","type":"blocks","created_at":"2026-01-15T08:09:53.134127-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-rgwq","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:10.594743-08:00","updated_at":"2026-01-14T20:56:10.594743-08:00","dependencies":[{"issue_id":"bd-wisp-rgwq","depends_on_id":"bd-wisp-umlh","type":"parent-child","created_at":"2026-01-14T20:56:10.623654-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-rgwq","depends_on_id":"bd-wisp-2wi2","type":"blocks","created_at":"2026-01-14T20:56:10.661989-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-rlzx","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:11.32799-08:00","updated_at":"2026-01-14T21:33:11.32799-08:00","dependencies":[{"issue_id":"bd-wisp-rlzx","depends_on_id":"bd-wisp-3430","type":"parent-child","created_at":"2026-01-14T21:33:11.409529-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-rlzx","depends_on_id":"bd-wisp-otbo","type":"blocks","created_at":"2026-01-14T21:33:11.514526-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-rzqu","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:32:22.348046-08:00","updated_at":"2026-01-14T21:32:26.558095-08:00","ephemeral":true} +{"id":"bd-wisp-s44c","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nInbox should contain ONLY:\n- Unprocessed MERGE_READY messages (will process next cycle)\n- Active work items\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- PATROL: Wake up that was acknowledged → archive\n- HELP/Blocked that was handled → archive\n- MERGE_READY where merge completed but archive was missed → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Check for orphaned MR beads**\n\nLook for open MR beads with no corresponding branch:\n```bash\nbd list --type=merge-request --status=open\n```\n\nFor each open MR bead:\n1. Check if branch exists: `git ls-remote origin refs/heads/\u003cbranch\u003e`\n2. If branch gone, verify work is on main: `git log origin/main --oneline | grep \"\u003csource_issue\u003e\"`\n3. If work on main → close MR with reason \"Merged (verified on main)\"\n4. If work NOT on main → investigate before closing:\n - Check source_issue validity (should be gt-xxxxx, not branch name)\n - Search reflog/dangling commits if possible\n - If unverifiable, close with reason \"Unverifiable - no audit trail\"\n - File bead if this indicates lost work\n\n**NEVER close an MR bead without verifying the work landed or is unrecoverable.**\n\n**Goal**: Inbox should have ≤3 active messages at end of cycle.\nKeep only: pending MRs in queue.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:02:45.433025-08:00","updated_at":"2026-01-15T08:02:45.433025-08:00","dependencies":[{"issue_id":"bd-wisp-s44c","depends_on_id":"bd-wisp-puaa","type":"parent-child","created_at":"2026-01-15T08:02:45.679133-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-s44c","depends_on_id":"bd-wisp-kh5m","type":"blocks","created_at":"2026-01-15T08:02:45.962401-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-s7ao","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:14.686512-08:00","updated_at":"2026-01-14T20:56:14.686512-08:00","dependencies":[{"issue_id":"bd-wisp-s7ao","depends_on_id":"bd-wisp-7mjs","type":"parent-child","created_at":"2026-01-14T20:56:14.755555-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-s7ao","depends_on_id":"bd-wisp-g6pt","type":"blocks","created_at":"2026-01-14T20:56:14.83534-08:00","created_by":"beads/witness"}],"ephemeral":true} -{"id":"bd-wisp-s9j","title":"Mechanical rebase","description":"Pick next branch from queue. Attempt mechanical rebase on current main.\n\n**Step 1: Checkout and attempt rebase**\n```bash\ngit checkout -b temp origin/\u003cpolecat-branch\u003e\ngit rebase origin/main\n```\n\n**Step 2: Check rebase result**\n\nThe rebase exits with:\n- Exit code 0: Success - proceed to run-tests\n- Exit code 1 (conflicts): Conflict detected - proceed to Step 3\n\nTo detect conflict state after rebase fails:\n```bash\n# Check if we're in a conflicted rebase state\nls .git/rebase-merge 2\u003e/dev/null \u0026\u0026 echo \"CONFLICT_STATE\"\n```\n\n**Step 3: Handle conflicts (if any)**\n\nIf rebase SUCCEEDED (exit code 0):\n- Skip to run-tests step (continue normal merge flow)\n\nIf rebase FAILED with conflicts:\n\n1. **Abort the rebase** (DO NOT leave repo in conflicted state):\n```bash\ngit rebase --abort\n```\n\n2. **Record conflict metadata**:\n```bash\n# Capture main SHA for reference\nMAIN_SHA=$(git rev-parse origin/main)\nBRANCH_SHA=$(git rev-parse origin/\u003cpolecat-branch\u003e)\n```\n\n3. **Create conflict-resolution task**:\n```bash\nbd create --type=task --priority=1 --title=\"Resolve merge conflicts: \u003coriginal-issue-title\u003e\" --description=\"## Conflict Resolution Required\n\nOriginal MR: \u003cmr-bead-id\u003e\nBranch: \u003cpolecat-branch\u003e\nOriginal Issue: \u003cissue-id\u003e\nConflict with main at: ${MAIN_SHA}\nBranch SHA: ${BRANCH_SHA}\n\n## Instructions\n1. Clone/checkout the branch\n2. Rebase on current main: git rebase origin/main\n3. Resolve conflicts\n4. Force push: git push -f origin \u003cbranch\u003e\n5. Close this task when done\n\nThe MR will be re-queued for processing after conflicts are resolved.\"\n```\n\n4. **Skip this MR** (do NOT delete branch or close MR bead):\n- Leave branch intact for conflict resolution\n- Leave MR bead open (will be re-processed after resolution)\n- Continue to loop-check for next branch\n\n**CRITICAL**: Never delete a branch that has conflicts. The branch contains\nthe original work and must be preserved for conflict resolution.\n\nTrack: rebase result (success/conflict), conflict task ID if created.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T00:34:44.7789-08:00","updated_at":"2026-01-12T00:35:15.077005-08:00","closed_at":"2026-01-12T00:35:15.077005-08:00","close_reason":"Skipped - no branches in queue","dependencies":[{"issue_id":"bd-wisp-s9j","depends_on_id":"bd-wisp-vqe","type":"blocks","created_at":"2026-01-12T00:34:44.804577-08:00","created_by":"beads/refinery"}],"ephemeral":true} +{"id":"bd-wisp-s9j","title":"Mechanical rebase","description":"Pick next branch from queue. Attempt mechanical rebase on current main.\n\n**Step 1: Checkout and attempt rebase**\n```bash\ngit checkout -b temp origin/\u003cpolecat-branch\u003e\ngit rebase origin/main\n```\n\n**Step 2: Check rebase result**\n\nThe rebase exits with:\n- Exit code 0: Success - proceed to run-tests\n- Exit code 1 (conflicts): Conflict detected - proceed to Step 3\n\nTo detect conflict state after rebase fails:\n```bash\n# Check if we're in a conflicted rebase state\nls .git/rebase-merge 2\u003e/dev/null \u0026\u0026 echo \"CONFLICT_STATE\"\n```\n\n**Step 3: Handle conflicts (if any)**\n\nIf rebase SUCCEEDED (exit code 0):\n- Skip to run-tests step (continue normal merge flow)\n\nIf rebase FAILED with conflicts:\n\n1. **Abort the rebase** (DO NOT leave repo in conflicted state):\n```bash\ngit rebase --abort\n```\n\n2. **Record conflict metadata**:\n```bash\n# Capture main SHA for reference\nMAIN_SHA=$(git rev-parse origin/main)\nBRANCH_SHA=$(git rev-parse origin/\u003cpolecat-branch\u003e)\n```\n\n3. **Create conflict-resolution task**:\n```bash\nbd create --type=task --priority=1 --title=\"Resolve merge conflicts: \u003coriginal-issue-title\u003e\" --description=\"## Conflict Resolution Required\n\nOriginal MR: \u003cmr-bead-id\u003e\nBranch: \u003cpolecat-branch\u003e\nOriginal Issue: \u003cissue-id\u003e\nConflict with main at: ${MAIN_SHA}\nBranch SHA: ${BRANCH_SHA}\n\n## Instructions\n1. Clone/checkout the branch\n2. Rebase on current main: git rebase origin/main\n3. Resolve conflicts\n4. Force push: git push -f origin \u003cbranch\u003e\n5. Close this task when done\n\nThe MR will be re-queued for processing after conflicts are resolved.\"\n```\n\n4. **Skip this MR** (do NOT delete branch or close MR bead):\n- Leave branch intact for conflict resolution\n- Leave MR bead open (will be re-processed after resolution)\n- Continue to loop-check for next branch\n\n**CRITICAL**: Never delete a branch that has conflicts. The branch contains\nthe original work and must be preserved for conflict resolution.\n\nTrack: rebase result (success/conflict), conflict task ID if created.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T00:34:44.7789-08:00","updated_at":"2026-01-12T00:35:15.077005-08:00","closed_at":"2026-01-12T00:35:15.077005-08:00","close_reason":"Skipped - no branches in queue","ephemeral":true} {"id":"bd-wisp-s9yg","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n```bash\n# Check if refinery session exists\ngt session status \u003crig\u003e/refinery\n\n# Check for pending merge requests\nbd list --type=merge-request --status=open\n```\n\nIf MRs waiting AND refinery not running:\n```bash\ngt session start \u003crig\u003e/refinery\ngt mail send \u003crig\u003e/refinery -s \"PATROL: Wake up\" -m \"Merge requests in queue. Please process.\"\n```\n\nIf refinery running but queue stale (\u003e30 min), send nudge.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:16.879424-08:00","updated_at":"2026-01-14T20:56:16.879424-08:00","dependencies":[{"issue_id":"bd-wisp-s9yg","depends_on_id":"bd-wisp-qc3z","type":"parent-child","created_at":"2026-01-14T20:56:16.904668-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-s9yg","depends_on_id":"bd-wisp-01il","type":"blocks","created_at":"2026-01-14T20:56:17.004014-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-sbdx","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:16.881589-08:00","updated_at":"2026-01-14T20:56:16.881589-08:00","dependencies":[{"issue_id":"bd-wisp-sbdx","depends_on_id":"bd-wisp-qc3z","type":"parent-child","created_at":"2026-01-14T20:56:16.970937-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-sbdx","depends_on_id":"bd-wisp-6007","type":"blocks","created_at":"2026-01-14T20:56:17.073578-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-sf2g","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:13.620502-08:00","updated_at":"2026-01-14T21:33:13.620502-08:00","dependencies":[{"issue_id":"bd-wisp-sf2g","depends_on_id":"bd-wisp-7dag","type":"parent-child","created_at":"2026-01-14T21:33:13.664483-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-sf2g","depends_on_id":"bd-wisp-trl9","type":"blocks","created_at":"2026-01-14T21:33:13.789048-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-si5o","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:53:02.113388-08:00","updated_at":"2026-01-14T21:53:07.951948-08:00","ephemeral":true} {"id":"bd-wisp-smw1","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:12.459-08:00","updated_at":"2026-01-14T21:33:12.459-08:00","dependencies":[{"issue_id":"bd-wisp-smw1","depends_on_id":"bd-wisp-8e8q","type":"parent-child","created_at":"2026-01-14T21:33:12.462927-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-srhi","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T21:33:24.869374-08:00","updated_at":"2026-01-14T21:33:24.869374-08:00","ephemeral":true} +{"id":"bd-wisp-srvr","title":"Check refinery mail","description":"Check mail for MERGE_READY submissions, escalations, and messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**MERGE_READY**:\nA polecat's work is ready for merge. Extract details and track for processing.\n\n```bash\n# Parse MERGE_READY message body:\n# Branch: \u003cbranch\u003e\n# Issue: \u003cissue-id\u003e\n# Polecat: \u003cpolecat-name\u003e\n# MR: \u003cmr-bead-id\u003e\n# Verified: clean git state, issue closed\n\n# Track in your merge queue for this patrol cycle:\n# - Branch name\n# - Issue ID\n# - Polecat name (REQUIRED for MERGED notification)\n# - MR bead ID (REQUIRED for closing after merge)\n```\n\n**IMPORTANT**: You MUST track the polecat name, MR bead ID, AND message ID - you will need them\nin merge-push step to send MERGED notification, close the MR bead, and archive the mail.\n\nMark as read. The work will be processed in queue-scan/process-branch.\n**Do NOT archive yet** - archive after merge/reject decision in merge-push step.\n\n**PATROL: Wake up**:\nWitness detected MRs waiting but refinery idle. Acknowledge and archive:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HELP / Blocked**:\nAssess and respond. If you can't help, escalate to Mayor.\nArchive after handling:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Check for in-flight merges.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: pending MRs in queue. Inbox should be near-empty.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-15T08:02:45.428574-08:00","updated_at":"2026-01-15T08:04:14.700132-08:00","closed_at":"2026-01-15T08:04:14.700132-08:00","close_reason":"No messages in inbox","dependencies":[{"issue_id":"bd-wisp-srvr","depends_on_id":"bd-wisp-puaa","type":"parent-child","created_at":"2026-01-15T08:02:45.433959-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-stkv","title":"Ping Deacon for health check","description":"Send WITNESS_PING to Deacon for second-order monitoring.\n\nThe Witness fleet collectively monitors Deacon health - this prevents the\n\"who watches the watchers\" problem. If Deacon dies, Witnesses detect it.\n\n**Step 1: Send ping**\n```bash\ngt mail send deacon/ -s \"WITNESS_PING \u003crig\u003e\" -m \"Rig: \u003crig\u003e\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: \u003ccycle-number\u003e\"\n```\n\n**Step 2: Check Deacon health**\n```bash\n# Check Deacon agent bead for last_activity\nbd list --type=agent --json | jq '.[] | select(.description | contains(\"deacon\"))'\n```\n\nLook at the `last_activity` timestamp. If stale (\u003e5 minutes since last update):\n- Deacon may be dead or stuck\n\n**Step 3: Escalate if needed**\n```bash\n# If Deacon appears down\ngt mail send mayor/ -s \"ALERT: Deacon appears unresponsive\" -m \"No Deacon activity for \u003e5 minutes.\nLast seen: \u003ctimestamp\u003e\nWitness: \u003crig\u003e/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:12.461326-08:00","updated_at":"2026-01-14T21:33:12.461326-08:00","dependencies":[{"issue_id":"bd-wisp-stkv","depends_on_id":"bd-wisp-8e8q","type":"parent-child","created_at":"2026-01-14T21:33:12.539039-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-stkv","depends_on_id":"bd-wisp-xrjy","type":"blocks","created_at":"2026-01-14T21:33:12.655081-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-sxsg","title":"Ping Deacon for health check","description":"Send WITNESS_PING to Deacon for second-order monitoring.\n\nThe Witness fleet collectively monitors Deacon health - this prevents the\n\"who watches the watchers\" problem. If Deacon dies, Witnesses detect it.\n\n**Step 1: Send ping**\n```bash\ngt mail send deacon/ -s \"WITNESS_PING \u003crig\u003e\" -m \"Rig: \u003crig\u003e\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: \u003ccycle-number\u003e\"\n```\n\n**Step 2: Check Deacon health**\n```bash\n# Check Deacon agent bead for last_activity\nbd list --type=agent --json | jq '.[] | select(.description | contains(\"deacon\"))'\n```\n\nLook at the `last_activity` timestamp. If stale (\u003e5 minutes since last update):\n- Deacon may be dead or stuck\n\n**Step 3: Escalate if needed**\n```bash\n# If Deacon appears down\ngt mail send mayor/ -s \"ALERT: Deacon appears unresponsive\" -m \"No Deacon activity for \u003e5 minutes.\nLast seen: \u003ctimestamp\u003e\nWitness: \u003crig\u003e/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:19.159406-08:00","updated_at":"2026-01-14T20:56:19.159406-08:00","dependencies":[{"issue_id":"bd-wisp-sxsg","depends_on_id":"bd-wisp-i1rf","type":"parent-child","created_at":"2026-01-14T20:56:19.241528-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-sxsg","depends_on_id":"bd-wisp-g492","type":"blocks","created_at":"2026-01-14T20:56:19.364562-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-t343","title":"Process witness mail","description":"Check inbox and handle messages.\n\n```bash\ngt mail inbox\n```\n\nFor each message:\n\n**POLECAT_STARTED**:\nA new polecat has started working. Acknowledge and archive.\n```bash\n# Acknowledge startup (optional: log for activity tracking)\ngt mail archive \u003cmessage-id\u003e\n```\nNo action needed beyond acknowledgment - archive immediately.\n\n**POLECAT_DONE / LIFECYCLE:Shutdown**:\n\n*EPHEMERAL MODEL*: Polecats are truly ephemeral - done at MR submission,\nrecyclable immediately. Once the branch is pushed (cleanup_status=clean),\nthe polecat can be nuked. The MR lifecycle continues independently in the\nRefinery. If conflicts arise, Refinery creates a NEW conflict-resolution\ntask for a NEW polecat.\n\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (handled by Refinery)\n\nThe handler (HandlePolecatDone) will:\n1. Check cleanup_status from agent bead\n2. If \"clean\" (branch pushed): AUTO-NUKE immediately, archive mail\n3. If dirty: Create cleanup wisp for manual intervention\n\n```bash\n# The handler does this automatically:\n# - For clean state: gt polecat nuke \u003cname\u003e → archive mail\n# - For dirty state: create wisp → process in next step\n```\n\nCleanup wisps are only created when something is wrong (uncommitted changes,\nunpushed commits). Most POLECAT_DONE messages result in immediate nuke.\n\n**MERGED**:\nA branch was merged successfully. This is informational in the ephemeral model\nsince the polecat was already nuked after MR submission.\n\nIf a cleanup wisp exists (dirty state), complete the cleanup:\n```bash\n# Find the cleanup wisp for this polecat\nbd list --wisp --labels=polecat:\u003cname\u003e,state:merge-requested --status=open\n\n# If found, proceed with full polecat nuke:\ngt polecat nuke \u003cname\u003e\n\n# Burn the cleanup wisp\nbd close \u003cwisp-id\u003e\n```\nArchive after cleanup is complete.\n\n**HELP / Blocked**:\nAssess the request. Can you help? If not, escalate to Mayor:\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e needs help\" -m \"\u003cdetails\u003e\"\n```\nArchive after handling (escalated or resolved):\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**HANDOFF**:\nRead predecessor context. Continue from where they left off.\nArchive after absorbing context:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**SWARM_START**:\nMayor initiating batch polecat work. Initialize swarm tracking.\n```bash\n# Parse swarm info from mail body: {\"swarm_id\": \"batch-123\", \"beads\": [\"bd-a\", \"bd-b\"]}\nbd create --wisp --title \"swarm:\u003cswarm_id\u003e\" --description \"Tracking batch: \u003cswarm_id\u003e\" --labels swarm,swarm_id:\u003cswarm_id\u003e,total:\u003cN\u003e,completed:0,start:\u003ctimestamp\u003e\n```\nArchive after creating swarm tracking wisp:\n```bash\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Hygiene principle**: Archive messages after they're fully processed.\nKeep only: active work, unprocessed requests. Inbox should be near-empty.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:14.804781-08:00","updated_at":"2026-01-14T21:33:14.804781-08:00","dependencies":[{"issue_id":"bd-wisp-t343","depends_on_id":"bd-wisp-zonw","type":"parent-child","created_at":"2026-01-14T21:33:14.808742-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-t9h2","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:22.271646-08:00","updated_at":"2026-01-14T21:33:22.271646-08:00","dependencies":[{"issue_id":"bd-wisp-t9h2","depends_on_id":"bd-wisp-qzai","type":"parent-child","created_at":"2026-01-14T21:33:22.328769-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-t9h2","depends_on_id":"bd-wisp-8erf","type":"blocks","created_at":"2026-01-14T21:33:22.491496-08:00","created_by":"beads/witness"}],"ephemeral":true} -{"id":"bd-wisp-tkf","title":"Handle test failures","description":"**VERIFICATION GATE**: This step enforces the Beads Promise.\n\nIf tests PASSED: This step auto-completes. Proceed to merge.\n\nIf tests FAILED:\n1. Diagnose: Is this a branch regression or pre-existing on main?\n2. If branch caused it:\n - Abort merge\n - Notify polecat: \"Tests failing. Please fix and resubmit.\"\n - Skip to loop-check\n3. If pre-existing on main:\n - Option A: Fix it yourself (you're the Engineer!)\n - Option B: File a bead: bd create --type=bug --priority=1 --title=\"...\"\n\n**GATE REQUIREMENT**: You CANNOT proceed to merge-push without:\n- Tests passing, OR\n- Fix committed, OR\n- Bead filed for the failure\n\nThis is non-negotiable. Never disavow. Never \"note and proceed.\" ","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T00:34:44.779587-08:00","updated_at":"2026-01-12T00:35:16.670629-08:00","closed_at":"2026-01-12T00:35:16.670629-08:00","close_reason":"Skipped - no branches in queue","dependencies":[{"issue_id":"bd-wisp-tkf","depends_on_id":"bd-wisp-8ke","type":"blocks","created_at":"2026-01-12T00:34:44.809281-08:00","created_by":"beads/refinery"}],"ephemeral":true} +{"id":"bd-wisp-tkf","title":"Handle test failures","description":"**VERIFICATION GATE**: This step enforces the Beads Promise.\n\nIf tests PASSED: This step auto-completes. Proceed to merge.\n\nIf tests FAILED:\n1. Diagnose: Is this a branch regression or pre-existing on main?\n2. If branch caused it:\n - Abort merge\n - Notify polecat: \"Tests failing. Please fix and resubmit.\"\n - Skip to loop-check\n3. If pre-existing on main:\n - Option A: Fix it yourself (you're the Engineer!)\n - Option B: File a bead: bd create --type=bug --priority=1 --title=\"...\"\n\n**GATE REQUIREMENT**: You CANNOT proceed to merge-push without:\n- Tests passing, OR\n- Fix committed, OR\n- Bead filed for the failure\n\nThis is non-negotiable. Never disavow. Never \"note and proceed.\" ","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T00:34:44.779587-08:00","updated_at":"2026-01-12T00:35:16.670629-08:00","closed_at":"2026-01-12T00:35:16.670629-08:00","close_reason":"Skipped - no branches in queue","ephemeral":true} {"id":"bd-wisp-tno","title":"Burn and respawn or loop","description":"End of patrol cycle decision.\n\n**Step 1: Estimate remaining context**\n\nAsk yourself:\n- Have I processed many branches this cycle?\n- Is the conversation getting long?\n- Am I starting to lose track of earlier context?\n\nRule of thumb: If you've done 3+ merges or processed significant cleanup work,\nit's time for a fresh session.\n\n**Step 2: Decision tree**\n\nIf queue non-empty AND context LOW:\n- Squash this wisp to digest\n- Spawn fresh patrol wisp\n- Return to inbox-check\n\nIf queue empty OR context HIGH OR good stopping point:\n- Squash wisp with summary digest\n- Use `gt handoff` for clean session transition:\n\n```bash\ngt handoff -s \"Patrol complete\" -m \"Merged X branches, Y tests passed.\nQueue: empty/N remaining\nNext: [any notes for successor]\"\n```\n\n**Why gt handoff?**\n- Sends handoff mail to yourself with context\n- Respawns with fresh Claude instance\n- SessionStart hook runs gt prime\n- Successor picks up from your hook\n\n**DO NOT just exit.** Always use `gt handoff` for proper lifecycle.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T01:27:11.198268-08:00","updated_at":"2026-01-12T01:28:31.935242-08:00","closed_at":"2026-01-12T01:28:31.935242-08:00","close_reason":"Closed","ephemeral":true} {"id":"bd-wisp-trl9","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n```bash\n# Check if refinery session exists\ngt session status \u003crig\u003e/refinery\n\n# Check for pending merge requests\nbd list --type=merge-request --status=open\n```\n\nIf MRs waiting AND refinery not running:\n```bash\ngt session start \u003crig\u003e/refinery\ngt mail send \u003crig\u003e/refinery -s \"PATROL: Wake up\" -m \"Merge requests in queue. Please process.\"\n```\n\nIf refinery running but queue stale (\u003e30 min), send nudge.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:13.620112-08:00","updated_at":"2026-01-14T21:33:13.620112-08:00","dependencies":[{"issue_id":"bd-wisp-trl9","depends_on_id":"bd-wisp-7dag","type":"parent-child","created_at":"2026-01-14T21:33:13.650843-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-trl9","depends_on_id":"bd-wisp-4utc","type":"blocks","created_at":"2026-01-14T21:33:13.774713-08:00","created_by":"beads/witness"}],"ephemeral":true} -{"id":"bd-wisp-ttf","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-13T20:41:20.090083-08:00","updated_at":"2026-01-13T20:41:20.090083-08:00","ephemeral":true} {"id":"bd-wisp-u9o","title":"Await CI: release.yml completion","description":"Gate step: Wait for GitHub Actions release workflow to complete.\n\nThis gate blocks until the release.yml workflow run succeeds.\nThe Refinery auto-discovers the workflow run triggered by v0.45.0\nand closes this gate when it completes.\n\nExpected time: 5-10 minutes\n\nThe gate monitors:\n- Build artifacts (all platforms)\n- Test suite pass\n- npm publish\n- PyPI publish\n\nIf the workflow fails, this gate remains open and requires manual intervention.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T20:07:32.258324-08:00","updated_at":"2026-01-06T20:17:28.463543-08:00","closed_at":"2026-01-06T20:17:28.463543-08:00","close_reason":"Release workflow completed successfully","dependencies":[{"issue_id":"bd-wisp-u9o","depends_on_id":"bd-wisp-99t","type":"blocks","created_at":"2026-01-06T20:07:32.268008-08:00","created_by":"beads/crew/dave"},{"issue_id":"bd-wisp-u9o","depends_on_id":"bd-wisp-84x","type":"blocks","created_at":"2026-01-06T20:07:32.281571-08:00","created_by":"beads/crew/dave"}]} {"id":"bd-wisp-uelh","title":"Check timer gates for expiration","description":"Check for expired timer gates and escalate as needed.\n\nTimer gates are async wait conditions with a timeout. When the timeout expires,\nthe gate should be escalated to the overseer for human intervention.\n\n**Step 1: Run timer gate check**\n```bash\nbd gate check --type=timer --escalate\n```\n\nThis command:\n1. Finds all open gate issues with await_type=timer\n2. Checks if `now \u003e created_at + timeout`\n3. Escalates expired gates via `gt escalate` (HIGH severity)\n4. Reports summary of gate status\n\n**Step 2: Review output**\n\nIf expired gates were found and escalated:\n- The escalation creates an audit trail bead\n- Overseer will be notified via mail\n- Gate remains open until manually resolved\n\nIf no expired gates:\n- Continue patrol normally\n\n**Note**: Timer gates do NOT auto-close on expiration. They escalate.\nThis ensures human oversight of timeout conditions.\n\n**Parallelism**: This is a single command, no parallel execution needed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:18.016017-08:00","updated_at":"2026-01-14T20:56:18.016017-08:00","dependencies":[{"issue_id":"bd-wisp-uelh","depends_on_id":"bd-wisp-xj1k","type":"parent-child","created_at":"2026-01-14T20:56:18.066782-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-uelh","depends_on_id":"bd-wisp-fy78","type":"blocks","created_at":"2026-01-14T20:56:18.176272-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-uhif","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:23.563593-08:00","updated_at":"2026-01-14T21:33:23.563593-08:00","dependencies":[{"issue_id":"bd-wisp-uhif","depends_on_id":"bd-wisp-9gxz","type":"parent-child","created_at":"2026-01-14T21:33:23.662468-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-uhif","depends_on_id":"bd-wisp-cz39","type":"blocks","created_at":"2026-01-14T21:33:23.836461-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-ujlq","title":"Check timer gates for expiration","description":"Check for expired timer gates and escalate as needed.\n\nTimer gates are async wait conditions with a timeout. When the timeout expires,\nthe gate should be escalated to the overseer for human intervention.\n\n**Step 1: Run timer gate check**\n```bash\nbd gate check --type=timer --escalate\n```\n\nThis command:\n1. Finds all open gate issues with await_type=timer\n2. Checks if `now \u003e created_at + timeout`\n3. Escalates expired gates via `gt escalate` (HIGH severity)\n4. Reports summary of gate status\n\n**Step 2: Review output**\n\nIf expired gates were found and escalated:\n- The escalation creates an audit trail bead\n- Overseer will be notified via mail\n- Gate remains open until manually resolved\n\nIf no expired gates:\n- Continue patrol normally\n\n**Note**: Timer gates do NOT auto-close on expiration. They escalate.\nThis ensures human oversight of timeout conditions.\n\n**Parallelism**: This is a single command, no parallel execution needed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:12.46058-08:00","updated_at":"2026-01-14T21:33:12.46058-08:00","dependencies":[{"issue_id":"bd-wisp-ujlq","depends_on_id":"bd-wisp-8e8q","type":"parent-child","created_at":"2026-01-14T21:33:12.513735-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-ujlq","depends_on_id":"bd-wisp-5ilx","type":"blocks","created_at":"2026-01-14T21:33:12.628087-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-ujyr","title":"Process pending cleanup wisps","description":"Process cleanup wisps (exception handling for dirty polecats).\n\nIn the ephemeral model, cleanup wisps are only created when a polecat has\ndirty state (uncommitted changes, unpushed commits) that prevented immediate\nnuke. Most polecats are nuked immediately on POLECAT_DONE and never create wisps.\n\n```bash\n# Find all cleanup wisps\nbd list --wisp --labels=cleanup --status=open\n```\n\nIf no wisps, skip this step (most common case in ephemeral model).\n\nFor each cleanup wisp, investigate and resolve the dirty state:\n\n## State: pending (needs investigation)\n\n1. **Extract polecat name** from wisp title/labels\n\n2. **Diagnose the problem**:\n```bash\ncd polecats/\u003cname\u003e\ngit status # What's uncommitted?\ngit stash list # Any stashed work?\ngit log origin/main..HEAD # Any unpushed commits?\n```\n\n3. **Resolution options**:\n - **Uncommitted changes**: Commit and push, then nuke\n - **Stashed work**: Pop and commit, or discard if not valuable\n - **Unpushed commits**: Push to origin, then nuke\n - **All valuable work lost**: Escalate to Mayor for recovery\n\n4. **If resolvable locally**: Fix and nuke\n```bash\n# Example: push unpushed commits\ngit push origin HEAD\n\n# Then nuke\ngt polecat nuke \u003cname\u003e\n\n# Close the wisp\nbd close \u003cwisp-id\u003e --reason \"Resolved: pushed commits, nuked\"\n```\n\n5. **If needs escalation**: Send RECOVERY_NEEDED to Mayor\n```bash\ngt mail send mayor/ -s \"RECOVERY_NEEDED \u003crig\u003e/\u003cpolecat\u003e\" \\\n -m \"Cleanup Status: \u003cstatus\u003e\nBranch: \u003cbranch\u003e\nIssue: \u003cissue-id\u003e\n\nCannot auto-resolve. Please advise.\"\n```\nLeave wisp open until Mayor resolves.\n\n## State: merge-requested (legacy, rare)\n\nThis state was used before the ephemeral model. If found, the polecat is\nwaiting for a MERGED signal. The inbox-check step handles these.\n\n**Parallelism**: Use Task tool subagents to process multiple cleanups concurrently.\nEach cleanup is independent - perfect for parallel execution.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:12.459419-08:00","updated_at":"2026-01-14T21:33:12.459419-08:00","dependencies":[{"issue_id":"bd-wisp-ujyr","depends_on_id":"bd-wisp-8e8q","type":"parent-child","created_at":"2026-01-14T21:33:12.475883-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-ujyr","depends_on_id":"bd-wisp-smw1","type":"blocks","created_at":"2026-01-14T21:33:12.589804-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-umlh","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T20:56:10.591265-08:00","updated_at":"2026-01-14T20:56:10.591265-08:00","ephemeral":true} +{"id":"bd-wisp-uqja","title":"Handle test failures","description":"**VERIFICATION GATE**: This step enforces the Beads Promise.\n\nIf tests PASSED: This step auto-completes. Proceed to merge.\n\nIf tests FAILED:\n1. Diagnose: Is this a branch regression or pre-existing on main?\n2. If branch caused it:\n - Abort merge\n - Notify polecat: \"Tests failing. Please fix and resubmit.\"\n - Skip to loop-check\n3. If pre-existing on main:\n - Option A: Fix it yourself (you're the Engineer!)\n - Option B: File a bead: bd create --type=bug --priority=1 --title=\"...\"\n\n**GATE REQUIREMENT**: You CANNOT proceed to merge-push without:\n- Tests passing, OR\n- Fix committed, OR\n- Bead filed for the failure\n\nThis is non-negotiable. Never disavow. Never \"note and proceed.\" ","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:02:45.431059-08:00","updated_at":"2026-01-15T08:02:45.431059-08:00","dependencies":[{"issue_id":"bd-wisp-uqja","depends_on_id":"bd-wisp-puaa","type":"parent-child","created_at":"2026-01-15T08:02:45.541873-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-uqja","depends_on_id":"bd-wisp-xhmf","type":"blocks","created_at":"2026-01-15T08:02:45.818792-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-urm4","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:24.873786-08:00","updated_at":"2026-01-14T21:33:24.873786-08:00","dependencies":[{"issue_id":"bd-wisp-urm4","depends_on_id":"bd-wisp-srhi","type":"parent-child","created_at":"2026-01-14T21:33:25.059113-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-urm4","depends_on_id":"bd-wisp-70gf","type":"blocks","created_at":"2026-01-14T21:33:25.246975-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-uvd","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"closed","priority":2,"issue_type":"epic","assignee":"beads/refinery","created_at":"2026-01-10T17:57:56.356923-08:00","updated_at":"2026-01-10T18:01:38.662587-08:00","closed_at":"2026-01-10T18:01:38.662587-08:00","close_reason":"Patrol: queue empty, no branches to merge","ephemeral":true} +{"id":"bd-wisp-uw1x","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T23:05:33.825579-08:00","updated_at":"2026-01-14T23:05:33.825579-08:00","ephemeral":true} {"id":"bd-wisp-v0n","title":"Verify version consistency","description":"Confirm all versions match 0.45.0.\n\n```bash\ngrep 'Version = ' cmd/bd/version.go\njq -r '.version' .claude-plugin/plugin.json\njq -r '.version' npm-package/package.json\ngrep 'version = ' integrations/beads-mcp/pyproject.toml\n```\n\nAll should show 0.45.0.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T20:07:32.257354-08:00","updated_at":"2026-01-06T20:11:24.898472-08:00","closed_at":"2026-01-06T20:11:24.898472-08:00","close_reason":"Version bumped and verified: 0.45.0","dependencies":[{"issue_id":"bd-wisp-v0n","depends_on_id":"bd-wisp-bye","type":"blocks","created_at":"2026-01-06T20:07:32.276314-08:00","created_by":"beads/crew/dave"}]} {"id":"bd-wisp-v3ea","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:26.211419-08:00","updated_at":"2026-01-14T21:33:26.211419-08:00","dependencies":[{"issue_id":"bd-wisp-v3ea","depends_on_id":"bd-wisp-j89a","type":"parent-child","created_at":"2026-01-14T21:33:26.411139-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-v3ea","depends_on_id":"bd-wisp-ikm7","type":"blocks","created_at":"2026-01-14T21:33:26.612151-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-va0g","title":"Handle test failures","description":"**VERIFICATION GATE**: This step enforces the Beads Promise.\n\nIf tests PASSED: This step auto-completes. Proceed to merge.\n\nIf tests FAILED:\n1. Diagnose: Is this a branch regression or pre-existing on main?\n2. If branch caused it:\n - Abort merge\n - Notify polecat: \"Tests failing. Please fix and resubmit.\"\n - Skip to loop-check\n3. If pre-existing on main:\n - Option A: Fix it yourself (you're the Engineer!)\n - Option B: File a bead: bd create --type=bug --priority=1 --title=\"...\"\n\n**GATE REQUIREMENT**: You CANNOT proceed to merge-push without:\n- Tests passing, OR\n- Fix committed, OR\n- Bead filed for the failure\n\nThis is non-negotiable. Never disavow. Never \"note and proceed.\" ","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:09:52.699691-08:00","updated_at":"2026-01-15T08:09:52.699691-08:00","dependencies":[{"issue_id":"bd-wisp-va0g","depends_on_id":"bd-wisp-llul","type":"parent-child","created_at":"2026-01-15T08:09:52.818207-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-va0g","depends_on_id":"bd-wisp-kaj2","type":"blocks","created_at":"2026-01-15T08:09:53.105199-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-va4v","title":"Inspect all active polecats","description":"Survey all polecats using agent beads (ZFC: trust what agents report).\n\n**Step 1: List polecat agent beads**\n\n```bash\nbd list --type=agent --json\n```\n\nFilter the JSON output for entries where description contains `role_type: polecat`.\nEach polecat agent bead has fields in its description:\n- `role_type: polecat`\n- `rig: \u003crig-name\u003e`\n- `agent_state: running|orphaned|stuck|done`\n- `hook_bead: \u003ccurrent-work-id\u003e`\n\n**Step 2: For each polecat, check agent_state**\n\n| agent_state | Meaning | Action |\n|-------------|---------|--------|\n| running | Actively working | Check progress (Step 3) |\n| orphaned | Crashed before self-nuke | Auto-nuke if clean (Step 3a) |\n| stuck | Self-reported stuck | Handle stuck protocol |\n| done | Work complete | Verify cleanup triggered (see Step 4a) |\n\n**Step 3: For running polecats, assess progress**\n\nCheck the hook_bead field to see what they're working on:\n```bash\nbd show \u003chook_bead\u003e # See current step/issue\n```\n\nYou can also verify they're responsive:\n```bash\ntmux capture-pane -t gt-\u003crig\u003e-\u003cname\u003e -p | tail -20\n```\n\nLook for:\n- Recent tool activity → making progress\n- Inactive at prompt → may need nudge\n- Error messages → may need help\n\n**Step 3a: For orphaned polecats, auto-nuke if clean**\n\nWhen a polecat has no hook_bead, it likely crashed before running gt done (orphaned). Check if it's safe to nuke:\n\n```bash\n# Check git status in the polecat's worktree\ncd polecats/\u003cname\u003e\ngit status --porcelain # Should be empty (clean)\ngit log origin/main..HEAD # Should have no unpushed commits\n```\n\n**If clean** (no uncommitted changes, no unpushed commits):\n```bash\n# Safe to nuke - no work to lose\ngt polecat nuke \u003cname\u003e\n```\nLog the auto-nuke for audit purposes. No escalation needed.\n\n**If dirty** (uncommitted or unpushed work):\n```bash\n# Escalate to Mayor - polecat has work that might be valuable\ngt mail send mayor/ -s \\\"ORPHAN_DIRTY: \u003cpolecat\u003e has uncommitted work\\\" \\\n -m \\\"Polecat: \u003cname\u003e\nState: orphaned (crashed before self-nuke)\nGit status: \u003cuncommitted-files\u003e\nUnpushed commits: \u003ccount\u003e\n\nPlease advise: recover work or discard?\\\"\n```\n\n**Rationale**: Orphaned polecats with clean git state are pure overhead. They have\nno work and no state worth preserving. Nuking them immediately frees resources\nand reduces noise. Only escalate when there's actual work at risk.\n\n**Step 4: Decide action**\n\n| Observation | Action |\n|-------------|--------|\n| agent_state=running, recent activity | None |\n| agent_state=running, inactive 5-15 min | Gentle nudge |\n| agent_state=running, inactive 15+ min | Direct nudge with deadline |\n| agent_state=stuck | Assess and help or escalate |\n| agent_state=done | Verify cleanup triggered (see Step 4a) |\n\n**Step 4a: Handle agent_state=done**\n\nIn the ephemeral model, polecats with agent_state=done and cleanup_status=clean\nshould already be nuked by HandlePolecatDone. Finding one here indicates:\n\n1. **Stale agent bead** - polecat was nuked but bead remains\n ```bash\n # Verify polecat doesn't exist anymore\n ls polecats/\u003cname\u003e 2\u003e/dev/null || echo \"Already nuked\"\n ```\n If nuked, the agent bead is stale. Clean it up or ignore.\n\n2. **Cleanup wisp exists** - polecat has dirty state needing intervention\n ```bash\n bd list --wisp --labels=polecat:\u003cname\u003e --status=open\n ```\n Process in process-cleanups step.\n\n3. **No wisp, polecat exists** - POLECAT_DONE mail was missed\n Try auto-nuke directly (ephemeral model):\n ```bash\n # Check cleanup_status and nuke if clean\n gt polecat nuke \u003cname\u003e # Will fail if dirty\n ```\n If nuke fails (dirty state), create cleanup wisp for investigation.\n\n**Step 5: Execute nudges**\n```bash\ngt nudge \u003crig\u003e/polecats/\u003cname\u003e \"How's progress? Need help?\"\n```\n\n**Step 6: Escalate if needed**\n```bash\ngt mail send mayor/ -s \"Escalation: \u003cpolecat\u003e stuck\" \\\n -m \"Polecat \u003cname\u003e reports stuck. Please intervene.\"\n```\n\n**Parallelism**: Use Task tool subagents to inspect multiple polecats concurrently.\n\n**ZFC Principle**: Trust agent_state from beads. Don't infer state from PID/tmux.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:15.758069-08:00","updated_at":"2026-01-14T20:56:15.758069-08:00","dependencies":[{"issue_id":"bd-wisp-va4v","depends_on_id":"bd-wisp-9u3o","type":"parent-child","created_at":"2026-01-14T20:56:15.790547-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-va4v","depends_on_id":"bd-wisp-a04e","type":"blocks","created_at":"2026-01-14T20:56:15.880068-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-vaug","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:02:10.242963-08:00","updated_at":"2026-01-14T21:02:14.677425-08:00","ephemeral":true} +{"id":"bd-wisp-vfe7","title":"Ping Deacon for health check","description":"Send WITNESS_PING to Deacon for second-order monitoring.\n\nThe Witness fleet collectively monitors Deacon health - this prevents the\n\"who watches the watchers\" problem. If Deacon dies, Witnesses detect it.\n\n**Step 1: Send ping**\n```bash\ngt mail send deacon/ -s \"WITNESS_PING \u003crig\u003e\" -m \"Rig: \u003crig\u003e\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: \u003ccycle-number\u003e\"\n```\n\n**Step 2: Check Deacon health**\n```bash\n# Check Deacon agent bead for last_activity\nbd list --type=agent --json | jq '.[] | select(.description | contains(\"deacon\"))'\n```\n\nLook at the `last_activity` timestamp. If stale (\u003e5 minutes since last update):\n- Deacon may be dead or stuck\n\n**Step 3: Escalate if needed**\n```bash\n# If Deacon appears down\ngt mail send mayor/ -s \"ALERT: Deacon appears unresponsive\" -m \"No Deacon activity for \u003e5 minutes.\nLast seen: \u003ctimestamp\u003e\nWitness: \u003crig\u003e/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:53:02.11652-08:00","updated_at":"2026-01-14T21:53:02.11652-08:00","dependencies":[{"issue_id":"bd-wisp-vfe7","depends_on_id":"bd-wisp-si5o","type":"parent-child","created_at":"2026-01-14T21:53:02.268636-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-vfe7","depends_on_id":"bd-wisp-j264","type":"blocks","created_at":"2026-01-14T21:53:02.494611-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-vik7","title":"Check timer gates for expiration","description":"Check for expired timer gates and escalate as needed.\n\nTimer gates are async wait conditions with a timeout. When the timeout expires,\nthe gate should be escalated to the overseer for human intervention.\n\n**Step 1: Run timer gate check**\n```bash\nbd gate check --type=timer --escalate\n```\n\nThis command:\n1. Finds all open gate issues with await_type=timer\n2. Checks if `now \u003e created_at + timeout`\n3. Escalates expired gates via `gt escalate` (HIGH severity)\n4. Reports summary of gate status\n\n**Step 2: Review output**\n\nIf expired gates were found and escalated:\n- The escalation creates an audit trail bead\n- Overseer will be notified via mail\n- Gate remains open until manually resolved\n\nIf no expired gates:\n- Continue patrol normally\n\n**Note**: Timer gates do NOT auto-close on expiration. They escalate.\nThis ensures human oversight of timeout conditions.\n\n**Parallelism**: This is a single command, no parallel execution needed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:16.880156-08:00","updated_at":"2026-01-14T20:56:16.880156-08:00","dependencies":[{"issue_id":"bd-wisp-vik7","depends_on_id":"bd-wisp-qc3z","type":"parent-child","created_at":"2026-01-14T20:56:16.926715-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-vik7","depends_on_id":"bd-wisp-nomu","type":"blocks","created_at":"2026-01-14T20:56:17.026458-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-vo92","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:11.591553-08:00","updated_at":"2026-01-14T20:56:11.591553-08:00","dependencies":[{"issue_id":"bd-wisp-vo92","depends_on_id":"bd-wisp-ecpj","type":"parent-child","created_at":"2026-01-14T20:56:11.632715-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-vo92","depends_on_id":"bd-wisp-ecbz","type":"blocks","created_at":"2026-01-14T20:56:11.681446-08:00","created_by":"beads/witness"}],"ephemeral":true} -{"id":"bd-wisp-vqe","title":"Scan merge queue","description":"Check the beads merge queue - this is the SOURCE OF TRUTH for pending merges.\n\n```bash\ngit fetch --prune origin\ngt mq list \u003crig\u003e\n```\n\nThe beads MQ tracks all pending merge requests. Do NOT rely on `git branch -r | grep polecat`\nas branches may exist without MR beads, or MR beads may exist for already-merged work.\n\nIf queue empty, skip to context-check step.\n\nFor each MR in the queue, verify the branch still exists:\n```bash\ngit branch -r | grep \u003cbranch\u003e\n```\n\nIf branch doesn't exist for a queued MR:\n- Close the MR bead: `bd close \u003cmr-id\u003e --reason \"Branch no longer exists\"`\n- Remove from processing queue\n\nTrack verified MR list for this cycle.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T00:34:44.778524-08:00","updated_at":"2026-01-12T00:35:06.623602-08:00","closed_at":"2026-01-12T00:35:06.623602-08:00","close_reason":"Merge queue empty - no branches waiting","dependencies":[{"issue_id":"bd-wisp-vqe","depends_on_id":"bd-wisp-6fb","type":"blocks","created_at":"2026-01-12T00:34:44.802492-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-vr8n","title":"Ping Deacon for health check","description":"Send WITNESS_PING to Deacon for second-order monitoring.\n\nThe Witness fleet collectively monitors Deacon health - this prevents the\n\"who watches the watchers\" problem. If Deacon dies, Witnesses detect it.\n\n**Step 1: Send ping**\n```bash\ngt mail send deacon/ -s \"WITNESS_PING \u003crig\u003e\" -m \"Rig: \u003crig\u003e\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: \u003ccycle-number\u003e\"\n```\n\n**Step 2: Check Deacon health**\n```bash\n# Check Deacon agent bead for last_activity\nbd list --type=agent --json | jq '.[] | select(.description | contains(\"deacon\"))'\n```\n\nLook at the `last_activity` timestamp. If stale (\u003e5 minutes since last update):\n- Deacon may be dead or stuck\n\n**Step 3: Escalate if needed**\n```bash\n# If Deacon appears down\ngt mail send mayor/ -s \"ALERT: Deacon appears unresponsive\" -m \"No Deacon activity for \u003e5 minutes.\nLast seen: \u003ctimestamp\u003e\nWitness: \u003crig\u003e/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:15.759214-08:00","updated_at":"2026-01-14T20:56:15.759214-08:00","dependencies":[{"issue_id":"bd-wisp-vr8n","depends_on_id":"bd-wisp-9u3o","type":"parent-child","created_at":"2026-01-14T20:56:15.820028-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-vr8n","depends_on_id":"bd-wisp-nsoy","type":"blocks","created_at":"2026-01-14T20:56:15.910917-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-vr8p","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure any notes are written to handoff mail\n- Prepare for session restart\n\nIf context is LOW:\n- Can continue patrolling","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:23.564703-08:00","updated_at":"2026-01-14T21:33:23.564703-08:00","dependencies":[{"issue_id":"bd-wisp-vr8p","depends_on_id":"bd-wisp-9gxz","type":"parent-child","created_at":"2026-01-14T21:33:23.720054-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-vr8p","depends_on_id":"bd-wisp-wcq6","type":"blocks","created_at":"2026-01-14T21:33:23.89565-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-w3nf","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:04:00.201195-08:00","updated_at":"2026-01-14T21:04:04.768922-08:00","ephemeral":true} @@ -2792,12 +2851,13 @@ {"id":"bd-wisp-x5po","title":"Process pending cleanup wisps","description":"Process cleanup wisps (exception handling for dirty polecats).\n\nIn the ephemeral model, cleanup wisps are only created when a polecat has\ndirty state (uncommitted changes, unpushed commits) that prevented immediate\nnuke. Most polecats are nuked immediately on POLECAT_DONE and never create wisps.\n\n```bash\n# Find all cleanup wisps\nbd list --wisp --labels=cleanup --status=open\n```\n\nIf no wisps, skip this step (most common case in ephemeral model).\n\nFor each cleanup wisp, investigate and resolve the dirty state:\n\n## State: pending (needs investigation)\n\n1. **Extract polecat name** from wisp title/labels\n\n2. **Diagnose the problem**:\n```bash\ncd polecats/\u003cname\u003e\ngit status # What's uncommitted?\ngit stash list # Any stashed work?\ngit log origin/main..HEAD # Any unpushed commits?\n```\n\n3. **Resolution options**:\n - **Uncommitted changes**: Commit and push, then nuke\n - **Stashed work**: Pop and commit, or discard if not valuable\n - **Unpushed commits**: Push to origin, then nuke\n - **All valuable work lost**: Escalate to Mayor for recovery\n\n4. **If resolvable locally**: Fix and nuke\n```bash\n# Example: push unpushed commits\ngit push origin HEAD\n\n# Then nuke\ngt polecat nuke \u003cname\u003e\n\n# Close the wisp\nbd close \u003cwisp-id\u003e --reason \"Resolved: pushed commits, nuked\"\n```\n\n5. **If needs escalation**: Send RECOVERY_NEEDED to Mayor\n```bash\ngt mail send mayor/ -s \"RECOVERY_NEEDED \u003crig\u003e/\u003cpolecat\u003e\" \\\n -m \"Cleanup Status: \u003cstatus\u003e\nBranch: \u003cbranch\u003e\nIssue: \u003cissue-id\u003e\n\nCannot auto-resolve. Please advise.\"\n```\nLeave wisp open until Mayor resolves.\n\n## State: merge-requested (legacy, rare)\n\nThis state was used before the ephemeral model. If found, the polecat is\nwaiting for a MERGED signal. The inbox-check step handles these.\n\n**Parallelism**: Use Task tool subagents to process multiple cleanups concurrently.\nEach cleanup is independent - perfect for parallel execution.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:11.325784-08:00","updated_at":"2026-01-14T21:33:11.325784-08:00","dependencies":[{"issue_id":"bd-wisp-x5po","depends_on_id":"bd-wisp-3430","type":"parent-child","created_at":"2026-01-14T21:33:11.340906-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-x5po","depends_on_id":"bd-wisp-cdsh","type":"blocks","created_at":"2026-01-14T21:33:11.444287-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-x792","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:12.462414-08:00","updated_at":"2026-01-14T21:33:12.462414-08:00","dependencies":[{"issue_id":"bd-wisp-x792","depends_on_id":"bd-wisp-8e8q","type":"parent-child","created_at":"2026-01-14T21:33:12.577109-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-x792","depends_on_id":"bd-wisp-0v5q","type":"blocks","created_at":"2026-01-14T21:33:12.696602-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-xa5i","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:13.63733-08:00","updated_at":"2026-01-14T20:56:13.63733-08:00","dependencies":[{"issue_id":"bd-wisp-xa5i","depends_on_id":"bd-wisp-0l5p","type":"parent-child","created_at":"2026-01-14T20:56:13.690515-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-xa5i","depends_on_id":"bd-wisp-6byh","type":"blocks","created_at":"2026-01-14T20:56:13.759436-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-xduh","title":"Check timer gates for expiration","description":"Check for expired timer gates and escalate as needed.\n\nTimer gates are async wait conditions with a timeout. When the timeout expires,\nthe gate should be escalated to the overseer for human intervention.\n\n**Step 1: Run timer gate check**\n```bash\nbd gate check --type=timer --escalate\n```\n\nThis command:\n1. Finds all open gate issues with await_type=timer\n2. Checks if `now \u003e created_at + timeout`\n3. Escalates expired gates via `gt escalate` (HIGH severity)\n4. Reports summary of gate status\n\n**Step 2: Review output**\n\nIf expired gates were found and escalated:\n- The escalation creates an audit trail bead\n- Overseer will be notified via mail\n- Gate remains open until manually resolved\n\nIf no expired gates:\n- Continue patrol normally\n\n**Note**: Timer gates do NOT auto-close on expiration. They escalate.\nThis ensures human oversight of timeout conditions.\n\n**Parallelism**: This is a single command, no parallel execution needed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:53:02.115767-08:00","updated_at":"2026-01-14T21:53:02.115767-08:00","dependencies":[{"issue_id":"bd-wisp-xduh","depends_on_id":"bd-wisp-si5o","type":"parent-child","created_at":"2026-01-14T21:53:02.219234-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-xduh","depends_on_id":"bd-wisp-dsk4","type":"blocks","created_at":"2026-01-14T21:53:02.44357-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-xh3z","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:22.272409-08:00","updated_at":"2026-01-14T21:33:22.272409-08:00","dependencies":[{"issue_id":"bd-wisp-xh3z","depends_on_id":"bd-wisp-qzai","type":"parent-child","created_at":"2026-01-14T21:33:22.364378-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-xh3z","depends_on_id":"bd-wisp-e3x6","type":"blocks","created_at":"2026-01-14T21:33:22.528325-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-xh7m","title":"Ping Deacon for health check","description":"Send WITNESS_PING to Deacon for second-order monitoring.\n\nThe Witness fleet collectively monitors Deacon health - this prevents the\n\"who watches the watchers\" problem. If Deacon dies, Witnesses detect it.\n\n**Step 1: Send ping**\n```bash\ngt mail send deacon/ -s \"WITNESS_PING \u003crig\u003e\" -m \"Rig: \u003crig\u003e\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: \u003ccycle-number\u003e\"\n```\n\n**Step 2: Check Deacon health**\n```bash\n# Check Deacon agent bead for last_activity\nbd list --type=agent --json | jq '.[] | select(.description | contains(\"deacon\"))'\n```\n\nLook at the `last_activity` timestamp. If stale (\u003e5 minutes since last update):\n- Deacon may be dead or stuck\n\n**Step 3: Escalate if needed**\n```bash\n# If Deacon appears down\ngt mail send mayor/ -s \"ALERT: Deacon appears unresponsive\" -m \"No Deacon activity for \u003e5 minutes.\nLast seen: \u003ctimestamp\u003e\nWitness: \u003crig\u003e/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:16.030548-08:00","updated_at":"2026-01-14T21:33:16.030548-08:00","dependencies":[{"issue_id":"bd-wisp-xh7m","depends_on_id":"bd-wisp-pkh5","type":"parent-child","created_at":"2026-01-14T21:33:16.130993-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-xh7m","depends_on_id":"bd-wisp-f7gb","type":"blocks","created_at":"2026-01-14T21:33:16.285-08:00","created_by":"beads/witness"}],"ephemeral":true} +{"id":"bd-wisp-xhmf","title":"Run test suite","description":"Run the test suite.\n\n```bash\ngo test ./...\n```\n\nTrack results: pass count, fail count, specific failures.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-15T08:02:45.430652-08:00","updated_at":"2026-01-15T08:02:45.430652-08:00","dependencies":[{"issue_id":"bd-wisp-xhmf","depends_on_id":"bd-wisp-puaa","type":"parent-child","created_at":"2026-01-15T08:02:45.515167-08:00","created_by":"beads/refinery"},{"issue_id":"bd-wisp-xhmf","depends_on_id":"bd-wisp-bmar","type":"blocks","created_at":"2026-01-15T08:02:45.790684-08:00","created_by":"beads/refinery"}],"ephemeral":true} {"id":"bd-wisp-xj1k","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T20:56:18.01371-08:00","updated_at":"2026-01-14T20:56:18.01371-08:00","ephemeral":true} {"id":"bd-wisp-xmlw","title":"Check timer gates for expiration","description":"Check for expired timer gates and escalate as needed.\n\nTimer gates are async wait conditions with a timeout. When the timeout expires,\nthe gate should be escalated to the overseer for human intervention.\n\n**Step 1: Run timer gate check**\n```bash\nbd gate check --type=timer --escalate\n```\n\nThis command:\n1. Finds all open gate issues with await_type=timer\n2. Checks if `now \u003e created_at + timeout`\n3. Escalates expired gates via `gt escalate` (HIGH severity)\n4. Reports summary of gate status\n\n**Step 2: Review output**\n\nIf expired gates were found and escalated:\n- The escalation creates an audit trail bead\n- Overseer will be notified via mail\n- Gate remains open until manually resolved\n\nIf no expired gates:\n- Continue patrol normally\n\n**Note**: Timer gates do NOT auto-close on expiration. They escalate.\nThis ensures human oversight of timeout conditions.\n\n**Parallelism**: This is a single command, no parallel execution needed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:13.636134-08:00","updated_at":"2026-01-14T20:56:13.636134-08:00","dependencies":[{"issue_id":"bd-wisp-xmlw","depends_on_id":"bd-wisp-0l5p","type":"parent-child","created_at":"2026-01-14T20:56:13.668488-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-xmlw","depends_on_id":"bd-wisp-ci7o","type":"blocks","created_at":"2026-01-14T20:56:13.73534-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-xp53","title":"Check timer gates for expiration","description":"Check for expired timer gates and escalate as needed.\n\nTimer gates are async wait conditions with a timeout. When the timeout expires,\nthe gate should be escalated to the overseer for human intervention.\n\n**Step 1: Run timer gate check**\n```bash\nbd gate check --type=timer --escalate\n```\n\nThis command:\n1. Finds all open gate issues with await_type=timer\n2. Checks if `now \u003e created_at + timeout`\n3. Escalates expired gates via `gt escalate` (HIGH severity)\n4. Reports summary of gate status\n\n**Step 2: Review output**\n\nIf expired gates were found and escalated:\n- The escalation creates an audit trail bead\n- Overseer will be notified via mail\n- Gate remains open until manually resolved\n\nIf no expired gates:\n- Continue patrol normally\n\n**Note**: Timer gates do NOT auto-close on expiration. They escalate.\nThis ensures human oversight of timeout conditions.\n\n**Parallelism**: This is a single command, no parallel execution needed.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:10.187834-08:00","updated_at":"2026-01-14T21:33:10.187834-08:00","dependencies":[{"issue_id":"bd-wisp-xp53","depends_on_id":"bd-wisp-7q1d","type":"parent-child","created_at":"2026-01-14T21:33:10.230586-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-xp53","depends_on_id":"bd-wisp-83f5","type":"blocks","created_at":"2026-01-14T21:33:10.324504-08:00","created_by":"beads/witness"}],"ephemeral":true} -{"id":"bd-wisp-xq2g","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T21:24:55.288521-08:00","updated_at":"2026-01-14T21:24:55.288521-08:00","ephemeral":true} {"id":"bd-wisp-xrjy","title":"Check if active swarm is complete","description":"If Mayor started a batch (SWARM_START), check if all polecats have completed.\n\n**Step 1: Find active swarm tracking wisps**\n```bash\nbd list --wisp --labels=swarm --status=open\n```\nIf no active swarm, skip this step.\n\n**Step 2: Count completed polecats for this swarm**\n\nExtract from wisp labels: swarm_id, total, completed, start timestamp.\nCheck how many cleanup wisps have been closed for this swarm's polecats.\n\n**Step 3: If all complete, notify Mayor**\n```bash\ngt mail send mayor/ -s \"SWARM_COMPLETE: \u003cswarm_id\u003e\" -m \"All \u003ctotal\u003e polecats merged.\nDuration: \u003cminutes\u003e minutes\nSwarm: \u003cswarm_id\u003e\"\n\n# Close the swarm tracking wisp\nbd close \u003cswarm-wisp-id\u003e --reason \"All polecats merged\"\n```\n\nNote: Runs every patrol cycle. Notification sent exactly once when all complete.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:12.460956-08:00","updated_at":"2026-01-14T21:33:12.460956-08:00","dependencies":[{"issue_id":"bd-wisp-xrjy","depends_on_id":"bd-wisp-8e8q","type":"parent-child","created_at":"2026-01-14T21:33:12.526352-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-xrjy","depends_on_id":"bd-wisp-ujlq","type":"blocks","created_at":"2026-01-14T21:33:12.641211-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-xw4o","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n```bash\n# Check if refinery session exists\ngt session status \u003crig\u003e/refinery\n\n# Check for pending merge requests\nbd list --type=merge-request --status=open\n```\n\nIf MRs waiting AND refinery not running:\n```bash\ngt session start \u003crig\u003e/refinery\ngt mail send \u003crig\u003e/refinery -s \"PATROL: Wake up\" -m \"Merge requests in queue. Please process.\"\n```\n\nIf refinery running but queue stale (\u003e30 min), send nudge.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:23.562436-08:00","updated_at":"2026-01-14T21:33:23.562436-08:00","dependencies":[{"issue_id":"bd-wisp-xw4o","depends_on_id":"bd-wisp-9gxz","type":"parent-child","created_at":"2026-01-14T21:33:23.604719-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-xw4o","depends_on_id":"bd-wisp-cmi7","type":"blocks","created_at":"2026-01-14T21:33:23.777319-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-xwx","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches, merging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself: \"Would Scotty walk past a warp core leak because it existed before his shift?\"\n\n## Merge Flow\n\nThe Refinery receives MERGE_READY mail from Witnesses when polecats complete work:\n\n```\nWitness Refinery Git\n │ │ │\n │ MERGE_READY │ │\n │─────────────────────────\u003e│ │\n │ │ │\n │ (verify branch) │\n │ │ fetch \u0026 rebase │\n │ │──────────────────────────\u003e│\n │ │ │\n │ (run tests) │\n │ │ │\n │ (if pass) │\n │ │ merge \u0026 push │\n │ │──────────────────────────\u003e│\n │ │ │\n │ MERGED │ │\n │\u003c─────────────────────────│ │\n │ │ │\n```\n\nAfter successful merge, Refinery sends MERGED mail back to Witness so it can\ncomplete cleanup (nuke the polecat worktree).","status":"closed","priority":2,"issue_type":"epic","assignee":"beads/refinery","created_at":"2026-01-10T18:23:27.131593-08:00","updated_at":"2026-01-10T18:29:19.904299-08:00","closed_at":"2026-01-10T18:29:19.904299-08:00","close_reason":"Patrol complete: queue empty, no branches to merge","ephemeral":true} @@ -2806,10 +2866,11 @@ {"id":"bd-wisp-y7zw","title":"End-of-cycle inbox hygiene","description":"Verify inbox hygiene before ending patrol cycle.\n\n**Step 1: Check inbox state**\n```bash\ngt mail inbox\n```\n\nIn the ephemeral model, most POLECAT_DONE messages are handled immediately\n(auto-nuke) and archived. Inbox should contain ONLY:\n- Unprocessed messages (just arrived, will handle next cycle)\n- MERGED notifications (informational, archive after reading)\n\n**Step 2: Archive any stale messages**\n\nLook for messages that were processed but not archived:\n- POLECAT_STARTED older than this cycle → archive\n- POLECAT_DONE that was auto-nuked → should be archived already\n- MERGED notifications → archive after acknowledging\n- HELP/Blocked that was escalated → archive\n- SWARM_START that created tracking wisp → archive\n\n```bash\n# For each stale message found:\ngt mail archive \u003cmessage-id\u003e\n```\n\n**Step 3: Verify cleanup wisp hygiene**\n\nIn the ephemeral model, cleanup wisps should be rare (only for dirty polecats):\n```bash\nbd list --wisp --labels=cleanup --status=open\n```\n\n- state:pending → Needs investigation in process-cleanups\n- state:merge-requested → Legacy state, handle in inbox-check\n\nIf cleanup wisps are accumulating, investigate why polecats aren't clean.\n\n**Goal**: Inbox should be nearly empty. Cleanup wisps should be rare.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:33:12.46168-08:00","updated_at":"2026-01-14T21:33:12.46168-08:00","dependencies":[{"issue_id":"bd-wisp-y7zw","depends_on_id":"bd-wisp-8e8q","type":"parent-child","created_at":"2026-01-14T21:33:12.551748-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-y7zw","depends_on_id":"bd-wisp-stkv","type":"blocks","created_at":"2026-01-14T21:33:12.668509-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-yi6","title":"Create release tag","description":"Create annotated git tag.\n\n```bash\ngit tag -a v0.47.1 -m \"Release v0.47.1\"\n```\n\nVerify: `git tag -l | tail -5`\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T03:17:16.711087-08:00","updated_at":"2026-01-12T03:21:26.4805-08:00","closed_at":"2026-01-12T03:21:26.4805-08:00","close_reason":"Closed","dependencies":[{"issue_id":"bd-wisp-yi6","depends_on_id":"bd-wisp-5j5","type":"parent-child","created_at":"2026-01-12T03:17:16.732169-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-wisp-yi6","depends_on_id":"bd-wisp-1um","type":"blocks","created_at":"2026-01-12T03:17:16.778215-08:00","created_by":"beads/crew/emma"}],"ephemeral":true} {"id":"bd-wisp-z85","title":"Preflight: Pull latest","description":"Ensure we're up to date with origin.\n\n```bash\ngit pull --rebase\n```\n\nResolve any conflicts before proceeding.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T20:07:32.25637-08:00","updated_at":"2026-01-06T20:08:35.668191-08:00","closed_at":"2026-01-06T20:08:35.668191-08:00","close_reason":"Preflight checks passed","dependencies":[{"issue_id":"bd-wisp-z85","depends_on_id":"bd-wisp-w75","type":"blocks","created_at":"2026-01-06T20:07:32.272193-08:00","created_by":"beads/crew/dave"}]} +{"id":"bd-wisp-zc6z","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:47:59.893866-08:00","updated_at":"2026-01-14T21:48:04.357878-08:00","ephemeral":true} {"id":"bd-wisp-zkx9","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"hooked","priority":2,"issue_type":"epic","assignee":"beads/witness","created_at":"2026-01-14T21:04:17.575701-08:00","updated_at":"2026-01-14T21:04:22.514861-08:00","ephemeral":true} {"id":"bd-wisp-zmrk","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T20:56:16.881946-08:00","updated_at":"2026-01-14T20:56:16.881946-08:00","dependencies":[{"issue_id":"bd-wisp-zmrk","depends_on_id":"bd-wisp-qc3z","type":"parent-child","created_at":"2026-01-14T20:56:16.981823-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-zmrk","depends_on_id":"bd-wisp-sbdx","type":"blocks","created_at":"2026-01-14T20:56:17.085485-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wisp-zonw","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop.\n\nThe Witness is the Pit Boss for your rig. You watch polecats, nudge them toward\ncompletion, verify clean git state before kills, and escalate stuck workers.\n\n**You do NOT do implementation work.** Your job is oversight, not coding.\n\n## Ephemeral Polecat Model\n\nPolecats are truly ephemeral - done at MR submission, recyclable immediately:\n\n```\nPolecat lifecycle: spawning → working → mr_submitted → nuked\nMR lifecycle: created → queued → processed → merged (Refinery handles)\n```\n\nOnce a polecat's branch is pushed (cleanup_status=clean), the polecat can be\nnuked immediately. The MR continues independently in the Refinery. If conflicts\narise, Refinery creates a NEW conflict-resolution task for a NEW polecat.\n\n**Key principle**: Polecat lifecycle is separate from MR lifecycle.\n\n## Design Philosophy\n\nThis patrol follows Gas Town principles:\n- **Discovery over tracking**: Observe reality each cycle, don't maintain state\n- **Events over state**: POLECAT_DONE mail triggers immediate cleanup\n- **Ephemeral by default**: Clean polecats are nuked immediately, no waiting\n- **Cleanup wisps for exceptions**: Only created when intervention needed\n- **Task tool for parallelism**: Subagents inspect polecats, not molecule arms\n\n## Patrol Shape (Linear, Deacon-style)\n\n```\ninbox-check ─► process-cleanups ─► check-refinery ─► survey-workers\n │\n ┌──────────────────────────────────────────────────┘\n ▼\n check-timer-gates ─► check-swarm ─► ping-deacon ─► patrol-cleanup ─► context-check ─► loop-or-exit\n```\n\nNo dynamic arms. No fanout gates. No persistent nudge counters.\nState is discovered each cycle from reality (tmux, beads, mail).","status":"open","priority":2,"issue_type":"epic","created_at":"2026-01-14T21:33:14.804018-08:00","updated_at":"2026-01-14T21:33:14.804018-08:00","ephemeral":true} -{"id":"bd-wisp-ztj","title":"Generate handoff summary","description":"Summarize this patrol cycle.\n\n**VERIFICATION**: Before generating summary, confirm for each merged branch:\n- [ ] MERGED mail was sent to witness\n- [ ] MR bead was closed\n- [ ] MERGE_READY mail archived\n\nIf any notifications or archiving were missed, do them now!\n\nInclude in summary:\n- Branches merged (count, names)\n- MERGED mails sent (count - should match branches merged)\n- MR beads closed (count - should match branches merged)\n- MERGE_READY mails archived (count - should match branches merged)\n- Test results (pass/fail)\n- Branches with conflicts (count, names)\n- Conflict-resolution tasks created (IDs)\n- Issues filed (if any)\n- Any escalations sent\n\n**Conflict tracking is important** for monitoring MQ health. If many branches\nconflict, it may indicate main is moving too fast or branches are too stale.\n\nThis becomes the digest when the patrol is squashed.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-12T00:34:44.780484-08:00","updated_at":"2026-01-12T00:35:24.735684-08:00","closed_at":"2026-01-12T00:35:24.735684-08:00","close_reason":"Summary: Queue empty, no branches processed this cycle","dependencies":[{"issue_id":"bd-wisp-ztj","depends_on_id":"bd-wisp-bmc","type":"blocks","created_at":"2026-01-12T00:34:44.816888-08:00","created_by":"beads/refinery"}],"ephemeral":true} +{"id":"bd-wisp-zt88","title":"Loop or exit for respawn","description":"End of patrol cycle decision.\n\n**If context LOW** (can continue patrolling):\n1. Generate a brief summary of this patrol cycle\n2. Squash the current wisp:\n```bash\nbd mol squash \u003cmol-id\u003e --summary \"\u003cpatrol-summary\u003e\"\n```\n3. Create a new patrol wisp:\n```bash\nbd mol wisp mol-witness-patrol\n```\n4. Continue executing from the inbox-check step of the new wisp\n\n**If context HIGH** (approaching limit):\n1. Write handoff mail with notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\u003cobservations\u003e\"\n```\n2. Exit cleanly - the daemon will respawn a fresh Witness session\n\n**IMPORTANT**: You must either create a new wisp (context LOW) or exit (context HIGH).\nNever leave the session without work on your hook.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-14T21:53:02.117632-08:00","updated_at":"2026-01-14T21:53:02.117632-08:00","dependencies":[{"issue_id":"bd-wisp-zt88","depends_on_id":"bd-wisp-si5o","type":"parent-child","created_at":"2026-01-14T21:53:02.342918-08:00","created_by":"beads/witness"},{"issue_id":"bd-wisp-zt88","depends_on_id":"bd-wisp-dwgz","type":"blocks","created_at":"2026-01-14T21:53:02.572698-08:00","created_by":"beads/witness"}],"ephemeral":true} {"id":"bd-wjvua","title":"Session ended: gt-beads-crew-dave","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-13T11:34:21.805868-08:00","created_by":"beads/crew/dave","updated_at":"2026-01-13T11:34:21.854142-08:00","closed_at":"2026-01-13T11:34:21.854142-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-wl0nz","title":"Digest: mol-witness-patrol","description":"Patrol 2: Clean cycle - no polecats, no mail, refinery up.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-14T20:30:55.178803-08:00","updated_at":"2026-01-14T20:30:55.178803-08:00","closed_at":"2026-01-14T20:30:55.178748-08:00","close_reason":"Squashed from 10 wisps"} {"id":"bd-wlzsd","title":"Merge: obsidian-mk99kht7","description":"branch: polecat/obsidian-mk99kht7\ntarget: main\nsource_issue: obsidian-mk99kht7\nrig: beads\nagent_bead: bd-beads-polecat-obsidian\nretry_count: 0\nlast_conflict_sha: null\nconflict_task_id: null","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-10T21:03:34.490385-08:00","created_by":"beads/polecats/obsidian","updated_at":"2026-01-10T21:53:11.57128-08:00","closed_at":"2026-01-10T21:53:11.57128-08:00","close_reason":"Branch no longer exists on remote","labels":["gt:merge-request"]} @@ -2995,9 +3056,11 @@ {"id":"bd-ztm18","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-13T12:19:49.679397-08:00","created_by":"beads/refinery","updated_at":"2026-01-13T12:19:49.750177-08:00","closed_at":"2026-01-13T12:19:49.750177-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-ztnzl","title":"Fix bd init spins forever creating C:\\.beads outside git (GH#996)","description":"dispatched_by: mayor\n\nbd init on Windows spins forever trying to create C:\\.beads when run outside of .git. See https://github.com/steveyegge/beads/issues/996","status":"closed","priority":2,"issue_type":"task","assignee":"beads/crew/giles","created_at":"2026-01-10T12:18:38.637359-08:00","created_by":"mayor","updated_at":"2026-01-10T12:28:14.994264-08:00","closed_at":"2026-01-10T12:28:14.994264-08:00","close_reason":"Fixed infinite loop in findLocalBeadsDir() and findOriginalBeadsDir() on Windows - same pattern as PR #991 fix for FindBeadsDir(). On Windows, filepath.Dir(\"C:\\\\\") returns \"C:\\\\\" (not \"/\" or \".\"), so the loop condition must check if parent == dir to detect filesystem root.","labels":["bug"]} {"id":"bd-ztvjk","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-13T18:50:06.041754-08:00","created_by":"beads/refinery","updated_at":"2026-01-13T18:50:06.109597-08:00","closed_at":"2026-01-13T18:50:06.109597-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} +{"id":"bd-zuuhc","title":"Digest: mol-refinery-patrol","description":"Empty queue patrol - no branches pending, no messages","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-15T07:18:31.144392-08:00","updated_at":"2026-01-15T07:18:31.144392-08:00","closed_at":"2026-01-15T07:18:31.144343-08:00","close_reason":"Squashed from 11 wisps","dependencies":[{"issue_id":"bd-zuuhc","depends_on_id":"bd-wisp-400h","type":"parent-child","created_at":"2026-01-15T07:18:31.145475-08:00","created_by":"beads/refinery"}]} {"id":"bd-zw72","title":"Investigate incremental blocked_issues_cache updates at scale","description":"Current blocked_issues_cache strategy does full DELETE + INSERT on every dependency/status change.\n\n**Problem at scale:**\n- 10K issues: ~50ms rebuild (acceptable)\n- 100K issues: ~500ms rebuild (noticeable)\n- 1M issues: multi-second rebuilds (problematic)\n\n**Current implementation (blocked_cache.go:104-154):**\n- DELETE FROM blocked_issues_cache\n- INSERT with recursive CTE\n\n**Potential optimizations:**\n1. **Incremental updates:** Only add/remove affected issue IDs instead of full rebuild\n2. **Dirty tracking:** Skip rebuild if cache is already valid\n3. **Async rebuild:** Rebuild in background, serve stale cache briefly\n4. **Partial invalidation:** Only invalidate affected subtree\n\n**Decision needed:** Is this premature optimization? Current target is \u003c100K issues.\n\n**Benchmark:** Add benchmark for cache rebuild at 100K scale to measure actual impact.","status":"open","priority":3,"issue_type":"task","created_at":"2025-12-22T22:58:55.165718-08:00","updated_at":"2026-01-02T00:17:14.280698-08:00","dependencies":[{"issue_id":"bd-zw72","depends_on_id":"bd-h0we","type":"discovered-from","created_at":"2025-12-22T22:58:55.166427-08:00","created_by":"daemon"}],"comments":[{"id":10,"issue_id":"bd-zw72","author":"beads/crew/wolf","text":"## Benchmark Investigation Results (2026-01-02)\n\n**Cache rebuild timing:**\n- 10K issues: 773ms (Go benchmark), ~270ms (raw SQL)\n- 20K issues: 1,298ms\n- Extrapolated 100K: ~6.5 seconds\n\nOriginal estimates were 15x too optimistic. Go/CGO/WAL adds ~3x overhead.\n\n**Key insight:** Most dependency changes only affect a localized subgraph. Incremental updates could reduce 773ms to \u003c50ms for typical ops.\n\n**Added:** BenchmarkRebuildBlockedCache_Large/XLarge in sqlite_bench_test.go","created_at":"2026-01-03T01:29:51Z"},{"id":11,"issue_id":"bd-zw72","author":"beads/crew/wolf","text":"## Incremental Update Design Sketch\n\n**When to update cache:**\n1. Add blocks dep → add blocked issue + descendants to cache\n2. Remove blocks dep → check if still blocked, remove if not + propagate to descendants \n3. Close issue → check dependents, remove unblocked + descendants\n4. Reopen issue → add dependents + descendants back\n\n**Key insight:** Adding to cache is simple (just insert). Removing is complex (must verify no alternate blocking path).\n\n**Proposed approach:**\n- For additions: \\`INSERT OR IGNORE\\` the affected subgraph (fast, O(affected_nodes))\n- For removals: Rebuild only for the affected subgraph, not entire cache\n- Keep full rebuild as fallback for complex cases (waits-for, conditional-blocks)\n\n**Estimated improvement:**\n- Typical add/remove: O(affected_nodes) vs O(all_issues)\n- 10K DB with 1 affected node: ~5ms vs 773ms (150x faster)\n- Worst case (unblock entire graph): same as now\n\n**Implementation complexity:** Medium - need to handle transitive parent-child correctly","created_at":"2026-01-03T01:30:30Z"}]} {"id":"bd-zw7pp","title":"Add defensive fix in importer to auto-correct status when deleted_at present","description":"Similar to the existing defensive fix for closed_at (lines 260-267 in multirepo.go), add a fix for the reverse case:\n\nIf an issue has deleted_at set but status != tombstone, auto-correct status to tombstone during import.\n\nThis handles corrupted data gracefully instead of failing import.\n\nExisting pattern in `upsertIssueInTx`:\n```go\n// Defensive fix for deleted_at invariant: tombstones must have deleted_at\nif issue.Status == types.StatusTombstone \u0026\u0026 issue.DeletedAt == nil {\n maxTime := issue.CreatedAt\n if issue.UpdatedAt.After(maxTime) {\n maxTime = issue.UpdatedAt\n }\n deletedAt := maxTime.Add(time.Second)\n issue.DeletedAt = \u0026deletedAt\n}\n```\n\nNeed to add the reverse:\n```go\n// Defensive fix: if deleted_at is set, status must be tombstone\nif issue.Status != types.StatusTombstone \u0026\u0026 issue.DeletedAt != nil {\n issue.Status = types.StatusTombstone\n}\n```","status":"open","priority":2,"issue_type":"task","assignee":"beads/crew/wolf","owner":"steve.yegge@gmail.com","created_at":"2026-01-12T01:26:27.02309-08:00","created_by":"mayor","updated_at":"2026-01-12T01:36:55.587982-08:00"} {"id":"bd-zwpw","title":"Test dependency child","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-05T11:23:05.998311-08:00","updated_at":"2025-11-05T11:23:30.389454-08:00","closed_at":"2025-11-05T11:23:30.389454-08:00","dependencies":[{"issue_id":"bd-zwpw","depends_on_id":"bd-k0j9","type":"blocks","created_at":"2025-11-05T11:23:05.998981-08:00","created_by":"daemon"}]} {"id":"bd-zwtq","title":"Run bd doctor at end of bd init to verify setup","description":"Run bd doctor diagnostics at end of bd init (after line 398 in init.go). If issues found, warn user immediately: '⚠ Setup incomplete. Run bd doctor --fix to complete setup.' Catches configuration problems before user encounters them in normal workflow.","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-11-21T23:16:09.596778-08:00","updated_at":"2025-12-23T04:20:51.887338-08:00","closed_at":"2025-12-23T04:20:51.887338-08:00","dependencies":[{"issue_id":"bd-zwtq","depends_on_id":"bd-tbz3","type":"parent-child","created_at":"2025-11-21T23:16:09.597617-08:00","created_by":"daemon"}]} +{"id":"bd-zwz1r","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-14T21:49:59.170001-08:00","created_by":"beads/refinery","updated_at":"2026-01-14T21:49:59.22607-08:00","closed_at":"2026-01-14T21:49:59.22607-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} {"id":"bd-zy3z","title":"Support wisps in nodb mode for lightweight Gas Town rigs","description":"Enable proper wisp support in --no-db mode to allow lightweight Gas Town rigs (including HQ/Mayor) to run without SQLite overhead.\n\n## Motivation\nGas Town HQ and simple rigs could benefit from nodb mode's simplicity. Currently wisps don't work properly in nodb mode.\n\n## Proposed Design\n\n### Phase 1: Session-scoped wisps\n- Memory storage already has Wisp field on Issue\n- Wisps exist only for the session lifetime\n- Acceptable for patrol cycles that complete within a session\n- Depends on: bd-9avq (fix the leak)\n\n### Phase 2: Optional wisp persistence\n- Add `.beads/wisps.jsonl` for wisp storage (gitignored)\n- Load wisps from this file on nodb startup\n- Save wisps to this file on nodb exit\n- Wisps persist across restarts but don't sync via git\n\n### Phase 3: Verify mol commands\n- Test mol squash, burn, bond work with memory storage\n- These currently check for SQLite storage type\n- May need interface-based approach instead of type assertions\n\n## Files affected\n- cmd/bd/nodb.go - wisp filtering and optional persistence\n- internal/storage/memory/ - verify wisp field handling\n- cmd/bd/mol_*.go - verify memory storage compatibility\n- .beads/.gitignore - add wisps.jsonl","status":"closed","priority":3,"issue_type":"feature","created_at":"2025-12-24T21:15:59.658799-08:00","updated_at":"2025-12-24T21:17:11.570958-08:00","closed_at":"2025-12-24T21:17:11.570958-08:00","dependencies":[{"issue_id":"bd-zy3z","depends_on_id":"bd-9avq","type":"blocks","created_at":"2025-12-24T21:16:04.649866-08:00","created_by":"daemon"}]} {"id":"bd-zykm0","title":"Session ended: gt-beads-crew-fang","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-09T18:37:54.930136-08:00","created_by":"beads/crew/fang","updated_at":"2026-01-09T18:37:54.968386-08:00","closed_at":"2026-01-09T18:37:54.968386-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true} diff --git a/cmd/bd/create.go b/cmd/bd/create.go index 8ff78c84e..6248a3f5e 100644 --- a/cmd/bd/create.go +++ b/cmd/bd/create.go @@ -16,6 +16,7 @@ import ( "github.com/steveyegge/beads/internal/routing" "github.com/steveyegge/beads/internal/rpc" "github.com/steveyegge/beads/internal/storage" + "github.com/steveyegge/beads/internal/storage/factory" "github.com/steveyegge/beads/internal/storage/sqlite" "github.com/steveyegge/beads/internal/timeparsing" "github.com/steveyegge/beads/internal/types" @@ -353,10 +354,10 @@ var createCmd = &cobra.Command{ FatalError("failed to initialize target repo: %v", err) } - // Open new store for target repo - targetDBPath := filepath.Join(targetBeadsDir, ".beads", "beads.db") + // Open new store for target repo using factory to respect backend config + targetBeadsDirPath := filepath.Join(targetBeadsDir, ".beads") var err error - targetStore, err = sqlite.New(rootCtx, targetDBPath) + targetStore, err = factory.NewFromConfig(rootCtx, targetBeadsDirPath) if err != nil { FatalError("failed to open target store: %v", err) } @@ -785,9 +786,8 @@ func createInRig(cmd *cobra.Command, rigName, title, description, issueType stri FatalError("%v", err) } - // Open storage for the target rig - targetDBPath := filepath.Join(targetBeadsDir, "beads.db") - targetStore, err := sqlite.New(ctx, targetDBPath) + // Open storage for the target rig using factory to respect backend config + targetStore, err := factory.NewFromConfig(ctx, targetBeadsDir) if err != nil { FatalError("failed to open rig %q database: %v", rigName, err) } diff --git a/cmd/bd/dolt.go b/cmd/bd/dolt.go new file mode 100644 index 000000000..b69a6f9d5 --- /dev/null +++ b/cmd/bd/dolt.go @@ -0,0 +1,572 @@ +package main + +import ( + "fmt" + "os" + "strings" + + "github.com/spf13/cobra" + "github.com/steveyegge/beads/internal/storage/dolt" + "github.com/steveyegge/beads/internal/ui" +) + +// getDoltStore returns the store as a DoltStore, or an error if not using Dolt backend +func getDoltStore() (*dolt.DoltStore, error) { + ds, ok := store.(*dolt.DoltStore) + if !ok { + return nil, fmt.Errorf("dolt commands require --backend dolt (current backend is sqlite)") + } + return ds, nil +} + +var doltCmd = &cobra.Command{ + Use: "dolt", + GroupID: "sync", + Short: "Dolt version control operations", + Long: `Manage Dolt database versioning. + +Dolt provides Git-like version control for your beads database. You can +commit changes, create branches, merge, push to remotes, and view history. + +Prerequisites: + - Initialize with: bd init --backend dolt + - Dolt must be installed (https://doltdb.com) + +Examples: + bd dolt status # Show pending changes + bd dolt commit -m "Add features" # Commit all changes + bd dolt log # Show commit history + bd dolt branch feature-1 # Create new branch + bd dolt checkout feature-1 # Switch to branch + bd dolt merge feature-1 # Merge branch`, +} + +// ============================================================================ +// Status Command +// ============================================================================ + +var doltStatusCmd = &cobra.Command{ + Use: "status", + Short: "Show pending database changes", + Run: func(_ *cobra.Command, _ []string) { + ds, err := getDoltStore() + if err != nil { + FatalError("%v", err) + } + + status, err := ds.Status(rootCtx) + if err != nil { + FatalError("failed to get status: %v", err) + } + + if len(status.Staged) == 0 && len(status.Unstaged) == 0 { + fmt.Println("No changes to commit") + return + } + + if len(status.Staged) > 0 { + fmt.Println("Staged changes:") + for _, e := range status.Staged { + fmt.Printf(" %s %s\n", ui.RenderPass(e.Status), e.Table) + } + } + + if len(status.Unstaged) > 0 { + if len(status.Staged) > 0 { + fmt.Println() + } + fmt.Println("Unstaged changes:") + for _, e := range status.Unstaged { + fmt.Printf(" %s %s\n", ui.RenderWarn(e.Status), e.Table) + } + } + }, +} + +// ============================================================================ +// Commit Command +// ============================================================================ + +var doltCommitMessage string + +var doltCommitCmd = &cobra.Command{ + Use: "commit", + Short: "Commit all pending changes", + Long: `Commit all pending changes to the Dolt database. + +This stages all changes and creates a new commit. The commit message +is required and should describe what changed. + +Examples: + bd dolt commit -m "Add user authentication feature" + bd dolt commit --message "Fix bug in issue creation"`, + Run: func(_ *cobra.Command, _ []string) { + if doltCommitMessage == "" { + FatalError("commit message is required (-m)") + } + + ds, err := getDoltStore() + if err != nil { + FatalError("%v", err) + } + + if err := ds.Commit(rootCtx, doltCommitMessage); err != nil { + FatalError("failed to commit: %v", err) + } + + fmt.Printf("%s Committed: %s\n", ui.RenderPass("✓"), doltCommitMessage) + }, +} + +// ============================================================================ +// Log Command +// ============================================================================ + +var doltLogLimit int + +var doltLogCmd = &cobra.Command{ + Use: "log", + Short: "Show commit history", + Long: `Show recent commit history for the Dolt database. + +Use -n to limit the number of commits shown (default: 10). + +Examples: + bd dolt log # Show last 10 commits + bd dolt log -n 5 # Show last 5 commits + bd dolt log -n 50 # Show last 50 commits`, + Run: func(_ *cobra.Command, _ []string) { + ds, err := getDoltStore() + if err != nil { + FatalError("%v", err) + } + + commits, err := ds.Log(rootCtx, doltLogLimit) + if err != nil { + FatalError("failed to get log: %v", err) + } + + if len(commits) == 0 { + fmt.Println("No commits yet") + return + } + + for _, c := range commits { + fmt.Printf("%s %s\n", ui.RenderAccent(c.Hash[:8]), c.Message) + fmt.Printf(" Author: %s <%s>\n", c.Author, c.Email) + fmt.Printf(" Date: %s\n\n", c.Date.Format("2006-01-02 15:04:05")) + } + }, +} + +// ============================================================================ +// Branch Commands +// ============================================================================ + +var doltBranchCmd = &cobra.Command{ + Use: "branch [name]", + Short: "List or create branches", + Long: `List branches or create a new branch. + +Without arguments, shows the current branch. +With a branch name, creates a new branch. + +Examples: + bd dolt branch # Show current branch + bd dolt branch feature-1 # Create new branch`, + Run: func(_ *cobra.Command, args []string) { + ds, err := getDoltStore() + if err != nil { + FatalError("%v", err) + } + + if len(args) == 0 { + // Show current branch + branch, err := ds.CurrentBranch(rootCtx) + if err != nil { + FatalError("failed to get current branch: %v", err) + } + fmt.Printf("* %s\n", ui.RenderAccent(branch)) + return + } + + // Create new branch + branchName := args[0] + if err := ds.Branch(rootCtx, branchName); err != nil { + FatalError("failed to create branch: %v", err) + } + + fmt.Printf("%s Created branch: %s\n", ui.RenderPass("✓"), branchName) + }, +} + +var doltCheckoutCmd = &cobra.Command{ + Use: "checkout ", + Short: "Switch to a branch", + Args: cobra.ExactArgs(1), + Run: func(_ *cobra.Command, args []string) { + ds, err := getDoltStore() + if err != nil { + FatalError("%v", err) + } + + branch := args[0] + if err := ds.Checkout(rootCtx, branch); err != nil { + FatalError("failed to checkout: %v", err) + } + + fmt.Printf("%s Switched to branch: %s\n", ui.RenderPass("✓"), branch) + }, +} + +var doltMergeCmd = &cobra.Command{ + Use: "merge ", + Short: "Merge a branch into current branch", + Args: cobra.ExactArgs(1), + Run: func(_ *cobra.Command, args []string) { + ds, err := getDoltStore() + if err != nil { + FatalError("%v", err) + } + + branch := args[0] + if err := ds.Merge(rootCtx, branch); err != nil { + FatalError("failed to merge: %v", err) + } + + fmt.Printf("%s Merged branch: %s\n", ui.RenderPass("✓"), branch) + }, +} + +// ============================================================================ +// Remote Commands +// ============================================================================ + +var doltPushCmd = &cobra.Command{ + Use: "push", + Short: "Push commits to remote", + Run: func(_ *cobra.Command, _ []string) { + ds, err := getDoltStore() + if err != nil { + FatalError("%v", err) + } + + if err := ds.Push(rootCtx); err != nil { + FatalError("failed to push: %v", err) + } + + fmt.Printf("%s Pushed to remote\n", ui.RenderPass("✓")) + }, +} + +var doltPullCmd = &cobra.Command{ + Use: "pull", + Short: "Pull changes from remote", + Run: func(_ *cobra.Command, _ []string) { + ds, err := getDoltStore() + if err != nil { + FatalError("%v", err) + } + + if err := ds.Pull(rootCtx); err != nil { + FatalError("failed to pull: %v", err) + } + + fmt.Printf("%s Pulled from remote\n", ui.RenderPass("✓")) + }, +} + +var doltRemoteCmd = &cobra.Command{ + Use: "remote", + Short: "Manage remotes", + Long: `Manage Dolt remotes for syncing with other databases. + +Dolt remotes work like Git remotes, allowing you to push and pull +changes between databases. + +Examples: + bd dolt remote add origin https://doltremoteapi.dolthub.com/org/repo + bd dolt remote add backup file:///backup/beads`, +} + +var doltRemoteAddCmd = &cobra.Command{ + Use: "add ", + Short: "Add a remote", + Args: cobra.ExactArgs(2), + Run: func(_ *cobra.Command, args []string) { + ds, err := getDoltStore() + if err != nil { + FatalError("%v", err) + } + + name, url := args[0], args[1] + if err := ds.AddRemote(rootCtx, name, url); err != nil { + FatalError("failed to add remote: %v", err) + } + + fmt.Printf("%s Added remote: %s -> %s\n", ui.RenderPass("✓"), name, url) + }, +} + +// ============================================================================ +// Diff Command +// ============================================================================ + +var doltDiffCmd = &cobra.Command{ + Use: "diff [from-ref] [to-ref]", + Short: "Show changes between commits", + Long: `Show changes between two commits or refs. + +Without arguments, shows uncommitted changes. +With one argument, shows changes between that ref and HEAD. +With two arguments, shows changes between the two refs. + +Examples: + bd dolt diff # Uncommitted changes + bd dolt diff abc123 # Changes from abc123 to HEAD + bd dolt diff abc123 def456 # Changes between two commits`, + Run: func(_ *cobra.Command, args []string) { + ds, err := getDoltStore() + if err != nil { + FatalError("%v", err) + } + + var fromRef, toRef string + switch len(args) { + case 0: + fromRef, toRef = "HEAD", "WORKING" + case 1: + fromRef, toRef = args[0], "HEAD" + case 2: + fromRef, toRef = args[0], args[1] + default: + FatalError("too many arguments") + } + + entries, err := ds.GetDiff(rootCtx, fromRef, toRef) + if err != nil { + FatalError("failed to get diff: %v", err) + } + + if len(entries) == 0 { + fmt.Println("No differences") + return + } + + for _, e := range entries { + var symbol string + switch e.DiffType { + case "added": + symbol = ui.RenderPass("+") + case "modified": + symbol = ui.RenderWarn("~") + case "removed": + symbol = ui.RenderFail("-") + default: + symbol = "?" + } + fmt.Printf("%s %s\n", symbol, e.TableName) + } + }, +} + +// ============================================================================ +// History Command +// ============================================================================ + +var doltHistoryCmd = &cobra.Command{ + Use: "history ", + Short: "Show change history for an issue", + Long: `Show the complete change history for a specific issue. + +This shows all commits that modified the issue, with the issue's +state at each point in time. + +Examples: + bd dolt history bd-123 + bd dolt history my-456`, + Args: cobra.ExactArgs(1), + Run: func(_ *cobra.Command, args []string) { + ds, err := getDoltStore() + if err != nil { + FatalError("%v", err) + } + + issueID := args[0] + history, err := ds.GetIssueHistory(rootCtx, issueID) + if err != nil { + FatalError("failed to get history: %v", err) + } + + if len(history) == 0 { + fmt.Printf("No history found for issue %s\n", issueID) + return + } + + for _, h := range history { + fmt.Printf("%s %s\n", ui.RenderAccent(h.CommitHash[:8]), h.CommitDate.Format("2006-01-02 15:04:05")) + fmt.Printf(" Status: %s, Priority: P%d\n", h.Issue.Status, h.Issue.Priority) + if h.Issue.Title != "" { + title := h.Issue.Title + if len(title) > 60 { + title = title[:57] + "..." + } + fmt.Printf(" Title: %s\n", title) + } + fmt.Println() + } + }, +} + +// ============================================================================ +// Show Command (issue at ref) +// ============================================================================ + +var doltShowCmd = &cobra.Command{ + Use: "show ", + Short: "Show an issue at a specific commit", + Long: `Show an issue as it existed at a specific commit or branch. + +This lets you see the historical state of an issue at any point +in the database's version history. + +Examples: + bd dolt show bd-123 abc123 # Issue at commit abc123 + bd dolt show bd-123 main # Issue on main branch + bd dolt show bd-123 feature-1 # Issue on feature branch`, + Args: cobra.ExactArgs(2), + Run: func(_ *cobra.Command, args []string) { + ds, err := getDoltStore() + if err != nil { + FatalError("%v", err) + } + + issueID, ref := args[0], args[1] + issue, err := ds.GetIssueAsOf(rootCtx, issueID, ref) + if err != nil { + FatalError("failed to get issue: %v", err) + } + + if issue == nil { + fmt.Printf("Issue %s not found at ref %s\n", issueID, ref) + os.Exit(1) + } + + // Display issue details + fmt.Printf("%s · %s [P%d · %s]\n", issue.ID, issue.Title, issue.Priority, strings.ToUpper(string(issue.Status))) + if issue.Description != "" { + fmt.Printf("\n%s\n", issue.Description) + } + }, +} + +// ============================================================================ +// Conflicts Commands +// ============================================================================ + +var doltConflictsCmd = &cobra.Command{ + Use: "conflicts", + Short: "List merge conflicts", + Run: func(_ *cobra.Command, _ []string) { + ds, err := getDoltStore() + if err != nil { + FatalError("%v", err) + } + + conflicts, err := ds.GetConflicts(rootCtx) + if err != nil { + FatalError("failed to get conflicts: %v", err) + } + + if len(conflicts) == 0 { + fmt.Println("No conflicts") + return + } + + fmt.Println("Merge conflicts:") + for _, c := range conflicts { + fmt.Printf(" %s: %d conflict(s)\n", c.TableName, c.NumConflicts) + } + fmt.Println() + fmt.Println("Resolve with: bd dolt resolve --ours|--theirs") + }, +} + +var resolveOurs, resolveTheirs bool + +var doltResolveCmd = &cobra.Command{ + Use: "resolve
", + Short: "Resolve merge conflicts", + Long: `Resolve merge conflicts for a table using a strategy. + +Strategies: + --ours Keep our version (current branch) + --theirs Keep their version (merged branch) + +Examples: + bd dolt resolve issues --ours + bd dolt resolve issues --theirs`, + Args: cobra.ExactArgs(1), + Run: func(_ *cobra.Command, args []string) { + ds, err := getDoltStore() + if err != nil { + FatalError("%v", err) + } + + table := args[0] + + var strategy string + if resolveOurs && resolveTheirs { + FatalError("specify only one of --ours or --theirs") + } else if resolveOurs { + strategy = "ours" + } else if resolveTheirs { + strategy = "theirs" + } else { + FatalError("specify --ours or --theirs") + } + + if err := ds.ResolveConflicts(rootCtx, table, strategy); err != nil { + FatalError("failed to resolve conflicts: %v", err) + } + + fmt.Printf("%s Resolved conflicts in %s using %s\n", ui.RenderPass("✓"), table, strategy) + }, +} + +// ============================================================================ +// Init +// ============================================================================ + +func init() { + // Commit flags + doltCommitCmd.Flags().StringVarP(&doltCommitMessage, "message", "m", "", "Commit message (required)") + + // Log flags + doltLogCmd.Flags().IntVarP(&doltLogLimit, "number", "n", 10, "Number of commits to show") + + // Resolve flags + doltResolveCmd.Flags().BoolVar(&resolveOurs, "ours", false, "Keep our version") + doltResolveCmd.Flags().BoolVar(&resolveTheirs, "theirs", false, "Keep their version") + + // Register remote subcommands + doltRemoteCmd.AddCommand(doltRemoteAddCmd) + + // Register all subcommands + doltCmd.AddCommand(doltStatusCmd) + doltCmd.AddCommand(doltCommitCmd) + doltCmd.AddCommand(doltLogCmd) + doltCmd.AddCommand(doltBranchCmd) + doltCmd.AddCommand(doltCheckoutCmd) + doltCmd.AddCommand(doltMergeCmd) + doltCmd.AddCommand(doltPushCmd) + doltCmd.AddCommand(doltPullCmd) + doltCmd.AddCommand(doltDiffCmd) + doltCmd.AddCommand(doltHistoryCmd) + doltCmd.AddCommand(doltShowCmd) + doltCmd.AddCommand(doltConflictsCmd) + doltCmd.AddCommand(doltResolveCmd) + doltCmd.AddCommand(doltRemoteCmd) + + rootCmd.AddCommand(doltCmd) +} diff --git a/internal/storage/dolt/dependencies.go b/internal/storage/dolt/dependencies.go index 387482071..e5f129fe9 100644 --- a/internal/storage/dolt/dependencies.go +++ b/internal/storage/dolt/dependencies.go @@ -40,59 +40,76 @@ func (s *DoltStore) RemoveDependency(ctx context.Context, issueID, dependsOnID s // GetDependencies retrieves issues that this issue depends on func (s *DoltStore) GetDependencies(ctx context.Context, issueID string) ([]*types.Issue, error) { - rows, err := s.db.QueryContext(ctx, ` - SELECT i.id FROM issues i - JOIN dependencies d ON i.id = d.depends_on_id - WHERE d.issue_id = ? - ORDER BY i.priority ASC, i.created_at DESC - `, issueID) + // Use GetDependenciesWithMetadata to get full issue data in a single query + // This avoids nested database calls that can deadlock with Dolt's embedded driver + issuesWithMeta, err := s.GetDependenciesWithMetadata(ctx, issueID) if err != nil { - return nil, fmt.Errorf("failed to get dependencies: %w", err) + return nil, err } - defer rows.Close() - return s.scanIssueIDs(ctx, rows) + // Convert to plain Issue slice + issues := make([]*types.Issue, len(issuesWithMeta)) + for i, iwm := range issuesWithMeta { + issueCopy := iwm.Issue + issues[i] = &issueCopy + } + return issues, nil } // GetDependents retrieves issues that depend on this issue func (s *DoltStore) GetDependents(ctx context.Context, issueID string) ([]*types.Issue, error) { - rows, err := s.db.QueryContext(ctx, ` - SELECT i.id FROM issues i - JOIN dependencies d ON i.id = d.issue_id - WHERE d.depends_on_id = ? - ORDER BY i.priority ASC, i.created_at DESC - `, issueID) + // Use GetDependentsWithMetadata to get full issue data in a single query + // This avoids nested database calls that can deadlock with Dolt's embedded driver + issuesWithMeta, err := s.GetDependentsWithMetadata(ctx, issueID) if err != nil { - return nil, fmt.Errorf("failed to get dependents: %w", err) + return nil, err } - defer rows.Close() - return s.scanIssueIDs(ctx, rows) + // Convert to plain Issue slice + issues := make([]*types.Issue, len(issuesWithMeta)) + for i, iwm := range issuesWithMeta { + issueCopy := iwm.Issue + issues[i] = &issueCopy + } + return issues, nil } // GetDependenciesWithMetadata returns dependencies with metadata func (s *DoltStore) GetDependenciesWithMetadata(ctx context.Context, issueID string) ([]*types.IssueWithDependencyMetadata, error) { + // First, collect all dependency IDs and types in a single query + // This avoids nested database calls that can deadlock with Dolt's embedded driver rows, err := s.db.QueryContext(ctx, ` - SELECT d.depends_on_id, d.type, d.created_at, d.created_by, d.metadata, d.thread_id + SELECT d.depends_on_id, d.type FROM dependencies d WHERE d.issue_id = ? `, issueID) if err != nil { return nil, fmt.Errorf("failed to get dependencies with metadata: %w", err) } - defer rows.Close() - var results []*types.IssueWithDependencyMetadata + type depInfo struct { + id string + depType types.DependencyType + } + var deps []depInfo for rows.Next() { - var depID, depType, createdBy string - var createdAt sql.NullTime - var metadata, threadID sql.NullString - - if err := rows.Scan(&depID, &depType, &createdAt, &createdBy, &metadata, &threadID); err != nil { + var info depInfo + if err := rows.Scan(&info.id, &info.depType); err != nil { + rows.Close() return nil, fmt.Errorf("failed to scan dependency: %w", err) } + deps = append(deps, info) + } + rows.Close() // Close first result set before making more queries - issue, err := s.GetIssue(ctx, depID) + if err := rows.Err(); err != nil { + return nil, err + } + + // Now fetch each issue - this is safe because the first query is closed + var results []*types.IssueWithDependencyMetadata + for _, dep := range deps { + issue, err := s.GetIssue(ctx, dep.id) if err != nil { return nil, err } @@ -102,36 +119,49 @@ func (s *DoltStore) GetDependenciesWithMetadata(ctx context.Context, issueID str result := &types.IssueWithDependencyMetadata{ Issue: *issue, - DependencyType: types.DependencyType(depType), + DependencyType: dep.depType, } results = append(results, result) } - return results, rows.Err() + return results, nil } // GetDependentsWithMetadata returns dependents with metadata func (s *DoltStore) GetDependentsWithMetadata(ctx context.Context, issueID string) ([]*types.IssueWithDependencyMetadata, error) { + // First, collect all dependent IDs and types in a single query + // This avoids nested database calls that can deadlock with Dolt's embedded driver rows, err := s.db.QueryContext(ctx, ` - SELECT d.issue_id, d.type, d.created_at, d.created_by, d.metadata, d.thread_id + SELECT d.issue_id, d.type FROM dependencies d WHERE d.depends_on_id = ? `, issueID) if err != nil { return nil, fmt.Errorf("failed to get dependents with metadata: %w", err) } - defer rows.Close() - var results []*types.IssueWithDependencyMetadata + type depInfo struct { + id string + depType types.DependencyType + } + var deps []depInfo for rows.Next() { - var depID, depType, createdBy string - var createdAt sql.NullTime - var metadata, threadID sql.NullString - - if err := rows.Scan(&depID, &depType, &createdAt, &createdBy, &metadata, &threadID); err != nil { + var info depInfo + if err := rows.Scan(&info.id, &info.depType); err != nil { + rows.Close() return nil, fmt.Errorf("failed to scan dependent: %w", err) } + deps = append(deps, info) + } + rows.Close() // Close first result set before making more queries - issue, err := s.GetIssue(ctx, depID) + if err := rows.Err(); err != nil { + return nil, err + } + + // Now fetch each issue - this is safe because the first query is closed + var results []*types.IssueWithDependencyMetadata + for _, dep := range deps { + issue, err := s.GetIssue(ctx, dep.id) if err != nil { return nil, err } @@ -141,11 +171,11 @@ func (s *DoltStore) GetDependentsWithMetadata(ctx context.Context, issueID strin result := &types.IssueWithDependencyMetadata{ Issue: *issue, - DependencyType: types.DependencyType(depType), + DependencyType: dep.depType, } results = append(results, result) } - return results, rows.Err() + return results, nil } // GetDependencyRecords returns raw dependency records for an issue @@ -447,12 +477,25 @@ func (s *DoltStore) GetNewlyUnblockedByClose(ctx context.Context, closedIssueID // Helper functions func (s *DoltStore) scanIssueIDs(ctx context.Context, rows *sql.Rows) ([]*types.Issue, error) { - var issues []*types.Issue + // First, collect all IDs + // This avoids nested database calls that can deadlock with Dolt's embedded driver + var ids []string for rows.Next() { var id string if err := rows.Scan(&id); err != nil { return nil, fmt.Errorf("failed to scan issue id: %w", err) } + ids = append(ids, id) + } + if err := rows.Err(); err != nil { + return nil, err + } + // rows is closed by caller's defer, but explicitly close to release connection + rows.Close() + + // Now fetch each issue - this is safe because the first query is closed + var issues []*types.Issue + for _, id := range ids { issue, err := s.GetIssue(ctx, id) if err != nil { return nil, err @@ -461,7 +504,7 @@ func (s *DoltStore) scanIssueIDs(ctx context.Context, rows *sql.Rows) ([]*types. issues = append(issues, issue) } } - return issues, rows.Err() + return issues, nil } func scanDependencyRows(rows *sql.Rows) ([]*types.Dependency, error) { diff --git a/internal/storage/dolt/dolt_test.go b/internal/storage/dolt/dolt_test.go index c87c8e7cc..51017bff6 100644 --- a/internal/storage/dolt/dolt_test.go +++ b/internal/storage/dolt/dolt_test.go @@ -3,17 +3,36 @@ package dolt import ( "context" "os" + "os/exec" "testing" "github.com/steveyegge/beads/internal/types" ) +// execLookPath wraps exec.LookPath for test use +func execLookPath(file string) (string, error) { + return exec.LookPath(file) +} + // skipIfNoDolt skips the test if Dolt is not installed func skipIfNoDolt(t *testing.T) { t.Helper() - if _, err := os.Stat("/usr/local/bin/dolt"); os.IsNotExist(err) { - t.Skip("Dolt not installed, skipping test") + // Check common Dolt installation paths + paths := []string{ + "/usr/local/bin/dolt", // Standard Linux/Intel Mac + "/opt/homebrew/bin/dolt", // Apple Silicon Mac + "/usr/bin/dolt", // System package manager } + for _, p := range paths { + if _, err := os.Stat(p); err == nil { + return // Found Dolt + } + } + // Also try finding via PATH + if _, err := execLookPath("dolt"); err == nil { + return // Found in PATH + } + t.Skip("Dolt not installed, skipping test") } // setupTestStore creates a test store with a temporary directory diff --git a/internal/storage/dolt/history.go b/internal/storage/dolt/history.go index 86f8775bb..8be1ef357 100644 --- a/internal/storage/dolt/history.go +++ b/internal/storage/dolt/history.go @@ -291,7 +291,7 @@ type IssueDiff struct { // GetConflicts returns any merge conflicts in the current state func (s *DoltStore) GetConflicts(ctx context.Context) ([]*Conflict, error) { rows, err := s.db.QueryContext(ctx, ` - SELECT table_name, num_conflicts FROM dolt_conflicts + SELECT ` + "`table`" + `, num_conflicts FROM dolt_conflicts `) if err != nil { return nil, fmt.Errorf("failed to get conflicts: %w", err) diff --git a/internal/storage/dolt/store.go b/internal/storage/dolt/store.go index 8cdb4eaa7..87a582862 100644 --- a/internal/storage/dolt/store.go +++ b/internal/storage/dolt/store.go @@ -427,11 +427,11 @@ func (s *DoltStore) Status(ctx context.Context) (*DoltStatus, error) { for rows.Next() { var tableName string var staged bool - var statusInt int - if err := rows.Scan(&tableName, &staged, &statusInt); err != nil { + var statusStr string + if err := rows.Scan(&tableName, &staged, &statusStr); err != nil { return nil, fmt.Errorf("failed to scan status: %w", err) } - entry := StatusEntry{Table: tableName, Status: statusInt} + entry := StatusEntry{Table: tableName, Status: statusStr} if staged { status.Staged = append(status.Staged, entry) } else { @@ -450,5 +450,5 @@ type DoltStatus struct { // StatusEntry represents a changed table type StatusEntry struct { Table string - Status int // 1=new, 2=modified, 3=deleted + Status string // "new table", "modified", "deleted" }