From 0acad8af25c98fde89fe1091f422f8ad1da4abba Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Wed, 24 Dec 2025 14:02:17 -0800 Subject: [PATCH] bd sync: 2025-12-24 14:02:17 --- .beads/issues.jsonl | 74 ++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 0b282243..f1486a55 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -323,7 +323,7 @@ {"id":"gt-9rmm","title":"Merge: gt-a95","description":"branch: polecat/Ace\ntarget: main\nsource_issue: gt-a95\nrig: gastown","status":"closed","priority":1,"issue_type":"merge-request","created_at":"2025-12-19T14:53:53.973816-08:00","updated_at":"2025-12-19T19:13:27.736445-08:00","closed_at":"2025-12-19T17:48:09.608699-08:00"} {"id":"gt-9t14","title":"Wire up --wisp flag for ephemeral molecules","description":"The --wisp flag exists in gt sling but isn't wired through to bd mol.\n\nNeed:\n1. bd mol run --wisp - spawn to .beads-wisp/ instead of .beads/\n2. Automatic burn on molecule completion\n3. Optional squash to digest for audit trail\n\nCurrently:\n- sling.go sets thing.IsWisp but never uses it\n- bd mol run has no --wisp flag\n- .beads-wisp/ exists but nothing writes to it","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-12-22T13:12:25.192854-08:00","updated_at":"2025-12-22T13:18:50.72531-08:00","closed_at":"2025-12-22T13:18:50.72531-08:00","close_reason":"Wired --wisp flag: uses .beads-wisp/ storage when available, propagates IsWisp through MoleculeContext"} {"id":"gt-9uxr","title":"Critical packages lack test coverage","description":"Several packages have no test files:\n- internal/lock/ - Core identity locking (212 lines UNTESTED)\n- internal/witness/ - Worker monitoring\n- internal/mrqueue/ - MR queue management\n- internal/claude/ - Claude integration\n- internal/style/ - Terminal styling\n- internal/constants/ - Constants\n\nPriority for testing:\n1. lock/ - prevents duplicate agents, critical for correctness\n2. witness/ - agent lifecycle management\n3. mrqueue/ - merge request processing\n\nOverall: 37 test files for 160 Go files (23% by file count)","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T12:51:01.154427-08:00","updated_at":"2025-12-24T12:51:01.154427-08:00","dependencies":[{"issue_id":"gt-9uxr","depends_on_id":"gt-jo9n","type":"blocks","created_at":"2025-12-24T12:52:07.558885-08:00","created_by":"daemon"}]} -{"id":"gt-9uy0","title":"Remove 'spawn' terminology from molecular chemistry","description":"Clean all docs and code to present ONLY current terminology. No migration paths, no \"old vs new\" tables, no deprecated flags. The codebase should read as if the current design was always the design.\n\n**Terminology rules:**\n- spawn = polecats/workers ONLY\n- pour = create persistent mol\n- wisp = create ephemeral wisp \n- run = create and execute\n\n**Scope:**\n- Remove all \"Old → New\" migration tables\n- Remove deprecated flag documentation (--persistent, etc.)\n- Remove chemistry-design-changes.md entirely (it is a migration doc)\n- Clean all docs to use current terminology only\n- Rename spawn functions in code that deal with molecules","status":"in_progress","priority":1,"issue_type":"task","created_at":"2025-12-24T13:06:43.805547-08:00","updated_at":"2025-12-24T13:51:45.118248-08:00","dependencies":[{"issue_id":"gt-9uy0","depends_on_id":"gt-jo9n","type":"blocks","created_at":"2025-12-24T13:06:49.341648-08:00","created_by":"daemon"}]} +{"id":"gt-9uy0","title":"Remove 'spawn' terminology from molecular chemistry","description":"Clean all docs and code to present ONLY current terminology. No migration paths, no \"old vs new\" tables, no deprecated flags. The codebase should read as if the current design was always the design.\n\n**Terminology rules:**\n- spawn = polecats/workers ONLY\n- pour = create persistent mol\n- wisp = create ephemeral wisp \n- run = create and execute\n\n**Scope:**\n- Remove all \"Old → New\" migration tables\n- Remove deprecated flag documentation (--persistent, etc.)\n- Remove chemistry-design-changes.md entirely (it is a migration doc)\n- Clean all docs to use current terminology only\n- Rename spawn functions in code that deal with molecules","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-24T13:06:43.805547-08:00","updated_at":"2025-12-24T14:02:16.131816-08:00","closed_at":"2025-12-24T14:02:16.131816-08:00","close_reason":"Completed terminology cleanup: spawn→pour/wisp for molecules across docs, code, and templates","dependencies":[{"issue_id":"gt-9uy0","depends_on_id":"gt-jo9n","type":"blocks","created_at":"2025-12-24T13:06:49.341648-08:00","created_by":"daemon"}]} {"id":"gt-9wv0","title":"gt spawn should verify daemon is running for polecat triggering","description":"gt spawn notifies the Deacon (via mail) that a polecat was started, expecting the Deacon to trigger it once Claude is ready. But if the daemon isn't running, the mail sits unread and the polecat never gets triggered.\n\n## Current Behavior\n1. gt spawn starts polecat session\n2. gt spawn sends POLECAT_STARTED to deacon/\n3. (assumes daemon will trigger polecat)\n\n## Problem\nIf gt daemon isn't running, step 3 never happens and polecat sits at prompt.\n\n## Solution\nIn gt spawn, after session start:\n1. Check if daemon is running (gt daemon status)\n2. If not running, either:\n a. Start daemon: gt daemon start\n b. Or warn user: 'Daemon not running, polecat may not auto-start'\n\n## Alternative\nThe user can manually trigger with gt nudge, but automated flow should work.","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-23T01:03:03.71521-08:00","updated_at":"2025-12-23T01:03:03.71521-08:00","dependencies":[{"issue_id":"gt-9wv0","depends_on_id":"gt-bjft","type":"blocks","created_at":"2025-12-23T01:03:12.187224-08:00","created_by":"daemon"}]} {"id":"gt-9za0","title":"Mol Mall: Molecule marketplace distribution","description":"Design the Mol Mall distribution mechanism for sharing molecules.\n\n## Core Insight\n\nMol Mall is just a registry of molecules.jsonl fragments. No special format needed.\n\n## Distribution Model\n\n```\nMol Mall (registry)\n │\n │ bd mol search \"security\"\n ▼\nMolecule catalog (searchable index)\n │\n │ bd mol install mol-security-scan\n ▼\nDownload molecules.jsonl fragment\n │\n │ Append to ~/.beads/molecules.jsonl\n ▼\nAvailable locally: bd mol list\n```\n\n## Registry Format\n\nSimple JSON index served from HTTPS:\n\n```json\n{\n \"molecules\": [\n {\n \"id\": \"mol-security-scan\",\n \"title\": \"Security Scan\",\n \"description\": \"OWASP Top 10 vulnerability checker\",\n \"labels\": [\"plugin\", \"code-review\", \"tier:sonnet\"],\n \"author\": \"anthropic\",\n \"version\": \"1.0.0\",\n \"url\": \"https://mol-mall.anthropic.com/molecules/mol-security-scan.jsonl\"\n }\n ]\n}\n```\n\n## CLI Commands\n\n```bash\nbd mol search \u003cquery\u003e # Search registry\nbd mol info \u003cid\u003e # Show molecule details\nbd mol install \u003cid\u003e # Download and install\nbd mol uninstall \u003cid\u003e # Remove from catalog\nbd mol update # Update all installed molecules\n```\n\n## Installation Locations\n\n```\n~/.beads/molecules.jsonl # User-level (default install location)\n~/gt/.beads/molecules.jsonl # Town-level (shared across rigs)\n.beads/molecules.jsonl # Project-level (team-specific)\n```\n\n## Version Management\n\nMolecules can have versions via labels: `version:1.0.0`\nInstall specific version: `bd mol install mol-security-scan@1.0.0`\n\n## Auth (Future)\n\nPrivate registries could require auth token.\nEnterprise Mol Malls for internal distribution.\n\n## Related\n\n- gt-u818: Plugin System (plugins ARE molecules)\n- molecular-chemistry.md: Format documentation","status":"open","priority":2,"issue_type":"feature","created_at":"2025-12-23T05:14:35.698369-08:00","updated_at":"2025-12-23T05:14:35.698369-08:00"} {"id":"gt-9zic","title":"Merge: gt-rp0k","description":"branch: polecat/nux\ntarget: main\nsource_issue: gt-rp0k\nrig: gastown","status":"closed","priority":1,"issue_type":"merge-request","created_at":"2025-12-22T23:40:52.956859-08:00","updated_at":"2025-12-22T23:50:12.379136-08:00","closed_at":"2025-12-22T23:50:12.379136-08:00","close_reason":"Merged to main"} @@ -1015,39 +1015,39 @@ {"id":"gt-zut3","title":"Immediate daemon notification on lifecycle request","description":"When gt handoff sends a lifecycle request to the daemon (via bd mail send deacon/), the daemon only discovers it on its next heartbeat poll (every 5 min). Workers wait unnecessarily for retirement.\n\n## Current Behavior\n1. Worker runs gt handoff\n2. Lifecycle mail sent to deacon/ via beads\n3. Worker blocks waiting for retirement\n4. Daemon heartbeat runs (up to 5 min later)\n5. Daemon processes lifecycle request and kills session\n\n## Expected Behavior\nLifecycle requests should be processed immediately, not on poll interval.\n\n## Proposed Solutions\n\n### Option A: SIGUSR1 Signal (simplest)\n1. Add SIGUSR1 handler in daemon that calls ProcessLifecycleRequests()\n2. gt handoff reads daemon.pid and sends SIGUSR1 after mail send\n\n### Option B: Unix Socket\n1. Daemon listens on ~/gt/daemon/lifecycle.sock\n2. gt handoff connects and sends 'process' message\n\n### Option C: Watchfile + fsnotify\n1. gt handoff touches ~/gt/daemon/lifecycle.trigger\n2. Daemon uses fsnotify to detect and process\n\nRecommend Option A for simplicity.\n\n## Affected Files\n- internal/daemon/daemon.go - add signal handler\n- internal/cmd/handoff.go - send signal after mail","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-12-20T20:20:07.616335-08:00","updated_at":"2025-12-20T20:27:42.419089-08:00","closed_at":"2025-12-20T20:27:42.419089-08:00"} {"id":"gt-zx3","title":"Per-rig beads repo configuration","description":"Add per-rig beads configuration to rig config schema.\n\n## Config Schema\n\nIn each rig's config.json:\n\n```json\n{\n \"version\": 1,\n \"name\": \"wyvern\",\n \"git_url\": \"https://github.com/steveyegge/wyvern\",\n \"beads\": {\n \"repo\": \"local\", // \"local\" | \"\u003cpath\u003e\" | \"\u003cgit-url\u003e\"\n \"root\": null, // Override bd --root (optional)\n \"prefix\": \"wyv\" // Issue prefix for this rig\n }\n}\n```\n\n## Repo Options\n\n| Value | Meaning | Use Case |\n|-------|---------|----------|\n| `\"local\"` | Use project's `.beads/` | Own projects, full commit access |\n| `\"\u003cpath\u003e\"` | Use beads at path | OSS contributions |\n| `\"\u003cgit-url\u003e\"` | Clone and use repo | Team shared beads |\n\n## Environment Injection\n\nWhen spawning polecats, Gas Town sets:\n```bash\nexport BEADS_ROOT=\"\u003cresolved-path\u003e\"\n```\n\n## Resolution Logic\n\n```go\nfunc ResolveBeadsRoot(rigConfig *RigConfig, rigPath string) (string, error) {\n beads := rigConfig.Beads\n switch {\n case beads.Root != \"\":\n return beads.Root, nil\n case beads.Repo == \"local\" || beads.Repo == \"\":\n return filepath.Join(rigPath, \".beads\"), nil\n case strings.HasPrefix(beads.Repo, \"/\"):\n return beads.Repo, nil\n case strings.Contains(beads.Repo, \"://\"):\n return cloneAndResolve(beads.Repo)\n default:\n return filepath.Join(rigPath, beads.Repo), nil\n }\n}\n```\n\n## Backwards Compatibility\n\nIf `beads` section missing, assume `\"repo\": \"local\"`.","status":"open","priority":1,"issue_type":"task","created_at":"2025-12-15T19:47:16.660049-08:00","updated_at":"2025-12-15T20:48:02.122203-08:00","dependencies":[{"issue_id":"gt-zx3","depends_on_id":"gt-l3c","type":"blocks","created_at":"2025-12-15T19:47:35.726502-08:00","created_by":"daemon"}]} {"id":"gt-zxgu","title":"Remove shell respawn loops from witness and deacon","description":"Currently witness and deacon use shell loops (`while true; do claude; done`) to auto-respawn when Claude exits. This bypasses the proper lifecycle architecture.\n\n## Current Behavior\n- witness.go: ensureWitnessSession() wraps Claude in a shell loop\n- deacon.go: runDeaconStart() wraps Claude in a shell loop\n- When Claude exits, shell automatically restarts it\n\n## Desired Behavior \n- Agents should request lifecycle changes via LIFECYCLE mail to deacon\n- Daemon processes lifecycle requests and handles restarts\n- No shell loops - daemon and deacon's health-scan handle respawns\n\n## Why Change\n1. Shell loops bypass state verification (requesting_cycle flag)\n2. Shell loops bypass handoff mail protocol\n3. Shell loops make lifecycle tracking harder\n4. Daemon already has infrastructure for this\n\n## Migration\n1. Remove shell loop from witness (daemon/deacon handles restart)\n2. Remove shell loop from deacon (daemon handles restart via ensureDeaconRunning)\n3. Verify daemon's health check properly restarts dead agents\n4. Update templates if needed\n\n## Risk\nLow - we have gt witness restart and gt deacon restart as fallbacks","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-23T03:55:49.172227-08:00","updated_at":"2025-12-23T04:02:27.122299-08:00","closed_at":"2025-12-23T04:02:27.122299-08:00","close_reason":"Removed shell respawn loops from witness and deacon. Daemon now properly detects dead Claude via pane command and restarts."} -{"id":"mol-deacon-patrol","title":"mol-deacon-patrol","description":"Mayor's daemon patrol loop.\n\nThe Deacon is the Mayor's background process that runs continuously,\nhandling callbacks, monitoring rig health, and performing cleanup.\nEach patrol cycle runs these steps in sequence, then loops or exits.\n","status":"open","priority":2,"issue_type":"epic","created_at":"2025-12-24T13:47:34.820178-08:00","updated_at":"2025-12-24T13:47:34.820178-08:00","labels":["template"]} -{"id":"mol-deacon-patrol.context-check","title":"Check own context limit","description":"Check own context limit.\n\nThe Deacon runs in a Claude session with finite context.\nCheck if approaching the limit:\n\n```bash\ngt context --usage\n```\n\nIf context is high (\u003e80%), prepare for handoff:\n- Summarize current state\n- Note any pending work\n- Write handoff to molecule state\n\nThis enables the Deacon to burn and respawn cleanly.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:34.820182-08:00","updated_at":"2025-12-24T13:47:34.820182-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.context-check","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T13:47:34.88507-08:00","created_by":"stevey"}]} -{"id":"mol-deacon-patrol.health-scan","title":"Check Witness and Refinery health","description":"Check Witness and Refinery health for each rig.\n\n**ZFC Principle**: You (Claude) make the judgment call about what is \"stuck\" or\n\"unresponsive\" - there are no hardcoded thresholds in Go. Read the signals,\nconsider context, and decide.\n\nFor each rig, run:\n```bash\ngt witness status \u003crig\u003e\ngt refinery status \u003crig\u003e\n```\n\n**Signals to assess:**\n\n| Component | Healthy Signals | Concerning Signals |\n|-----------|-----------------|-------------------|\n| Witness | State: running, recent activity | State: not running, no heartbeat |\n| Refinery | State: running, queue processing | Queue stuck, merge failures |\n\n**Tracking unresponsive cycles:**\n\nMaintain in your patrol state (persisted across cycles):\n```\nhealth_state:\n \u003crig\u003e:\n witness:\n unresponsive_cycles: 0\n last_seen_healthy: \u003ctimestamp\u003e\n refinery:\n unresponsive_cycles: 0\n last_seen_healthy: \u003ctimestamp\u003e\n```\n\n**Decision matrix** (you decide the thresholds based on context):\n\n| Cycles Unresponsive | Suggested Action |\n|---------------------|------------------|\n| 1-2 | Note it, check again next cycle |\n| 3-4 | Attempt restart: gt witness restart \u003crig\u003e |\n| 5+ | Escalate to Mayor with context |\n\n**Restart commands:**\n```bash\ngt witness restart \u003crig\u003e\ngt refinery restart \u003crig\u003e\n```\n\n**Escalation:**\n```bash\ngt mail send mayor/ -s \"Health: \u003crig\u003e \u003ccomponent\u003e unresponsive\" \\\n -m \"Component has been unresponsive for N cycles. Restart attempts failed.\n Last healthy: \u003ctimestamp\u003e\n Error signals: \u003cdetails\u003e\"\n```\n\nReset unresponsive_cycles to 0 when component responds normally.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:34.820181-08:00","updated_at":"2025-12-24T13:47:34.820181-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.health-scan","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T13:47:34.842805-08:00","created_by":"stevey"}]} -{"id":"mol-deacon-patrol.inbox-check","title":"Handle callbacks from agents","description":"Handle callbacks from agents.\n\nCheck the Mayor's inbox for messages from:\n- Witnesses reporting polecat status\n- Refineries reporting merge results\n- Polecats requesting help or escalation\n- External triggers (webhooks, timers)\n\n```bash\ngt mail inbox\n# For each message:\ngt mail read \u003cid\u003e\n# Handle based on message type\n```\n\nCallbacks may spawn new polecats, update issue state, or trigger other actions.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:34.820179-08:00","updated_at":"2025-12-24T13:47:34.820179-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.inbox-check","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T13:47:34.821473-08:00","created_by":"stevey"}]} -{"id":"mol-deacon-patrol.loop-or-exit","title":"Burn and respawn or loop","description":"Burn and let daemon respawn, or exit if context high.\n\nDecision point at end of patrol cycle:\n\nIf context is LOW:\n- Sleep briefly (avoid tight loop)\n- Return to inbox-check step\n\nIf context is HIGH:\n- Write state to persistent storage\n- Exit cleanly\n- Let the daemon orchestrator respawn a fresh Deacon\n\nThe daemon ensures Deacon is always running:\n```bash\n# Daemon respawns on exit\ngt daemon status\n```\n\nThis enables infinite patrol duration via context-aware respawning.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:34.820182-08:00","updated_at":"2025-12-24T13:47:34.820182-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.loop-or-exit","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T13:47:34.895699-08:00","created_by":"stevey"}]} -{"id":"mol-deacon-patrol.orphan-check","title":"Find abandoned work","description":"Find abandoned work.\n\nScan for orphaned state:\n- Issues marked in_progress with no active polecat\n- Polecats that stopped responding mid-work\n- Merge queue entries with no polecat owner\n- Wisp sessions that outlived their spawner\n\n```bash\nbd list --status=in_progress\ngt polecats --all --orphan\n```\n\nFor each orphan:\n- Check if polecat session still exists\n- If not, mark issue for reassignment or retry\n- File incident beads if data loss occurred\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:34.820181-08:00","updated_at":"2025-12-24T13:47:34.820181-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.orphan-check","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T13:47:34.863897-08:00","created_by":"stevey"}]} -{"id":"mol-deacon-patrol.plugin-run","title":"Execute registered plugins","description":"Execute registered plugins.\n\nScan ~/gt/plugins/ for plugin directories. Each plugin has a plugin.md with\nYAML frontmatter defining its gate (when to run) and instructions (what to do).\n\nSee docs/deacon-plugins.md for full documentation.\n\nGate types:\n- cooldown: Time since last run (e.g., 24h)\n- cron: Schedule-based (e.g., \"0 9 * * *\")\n- condition: Metric threshold (e.g., wisp count \u003e 50)\n- event: Trigger-based (e.g., startup, heartbeat)\n\nFor each plugin:\n1. Read plugin.md frontmatter to check gate\n2. Compare against state.json (last run, etc.)\n3. If gate is open, execute the plugin\n\nPlugins marked parallel: true can run concurrently using Task tool subagents.\nSequential plugins run one at a time in directory order.\n\nSkip this step if ~/gt/plugins/ does not exist or is empty.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:34.820181-08:00","updated_at":"2025-12-24T13:47:34.820181-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.plugin-run","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T13:47:34.853401-08:00","created_by":"stevey"}]} -{"id":"mol-deacon-patrol.session-gc","title":"Clean dead sessions","description":"Clean dead sessions.\n\nGarbage collect terminated sessions:\n- Remove stale polecat directories\n- Clean up wisp session artifacts\n- Prune old logs and temp files\n- Archive completed molecule state\n\n```bash\ngt gc --sessions\ngt gc --wisps --age=1h\n```\n\nPreserve audit trail. Only clean sessions confirmed dead.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:34.820182-08:00","updated_at":"2025-12-24T13:47:34.820182-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.session-gc","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T13:47:34.874552-08:00","created_by":"stevey"}]} -{"id":"mol-deacon-patrol.trigger-pending-spawns","title":"Nudge newly spawned polecats","description":"Nudge newly spawned polecats that are ready for input.\n\nWhen polecats are spawned, their Claude session takes 10-20 seconds to initialize.\nThe spawn command returns immediately without waiting. This step finds spawned\npolecats that are now ready and sends them a trigger to start working.\n\n```bash\n# For each rig with polecats\nfor rig in gastown beads; do\n gt polecats $rig\n # For each working polecat, check if Claude is ready\n # Use tmux capture-pane to look for \"\u003e \" prompt\ndone\n```\n\nFor each ready polecat that hasn't been triggered yet:\n1. Send \"Begin.\" to trigger UserPromptSubmit hook\n2. The hook injects mail, polecat sees its assignment\n3. Mark polecat as triggered in state\n\nUse WaitForClaudeReady from tmux package (polls for \"\u003e \" prompt).\nTimeout: 60 seconds per polecat. If not ready, try again next cycle.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:34.820179-08:00","updated_at":"2025-12-24T13:47:34.820179-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.trigger-pending-spawns","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T13:47:34.832282-08:00","created_by":"stevey"}]} -{"id":"mol-polecat-arm","title":"mol-polecat-arm","description":"Single polecat inspection and action cycle.\n\nThis molecule is bonded dynamically by mol-witness-patrol's survey-workers step.\nEach polecat being monitored gets one arm that runs in parallel with other arms.\n\n## Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| polecat_name | Yes | Name of the polecat to inspect |\n| rig | Yes | Rig containing the polecat |\n","status":"open","priority":2,"issue_type":"epic","created_at":"2025-12-24T13:47:35.606383-08:00","updated_at":"2025-12-24T13:47:35.606383-08:00","labels":["template"]} -{"id":"mol-polecat-arm.assess","title":"Assess work status","description":"Categorize polecat state based on captured output.\n\nStates:\n- **working**: Recent tool calls, active processing\n- **idle**: At prompt, no recent activity\n- **error**: Showing errors or stack traces\n- **requesting_shutdown**: Sent LIFECYCLE/Shutdown mail\n- **done**: Showing completion indicators\n\nCalculate: minutes since last activity.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.606384-08:00","updated_at":"2025-12-24T13:47:35.606384-08:00","dependencies":[{"issue_id":"mol-polecat-arm.assess","depends_on_id":"mol-polecat-arm","type":"parent-child","created_at":"2025-12-24T13:47:35.618834-08:00","created_by":"stevey"}]} -{"id":"mol-polecat-arm.capture","title":"Capture polecat state","description":"Capture recent tmux output for {{polecat_name}}.\n\n```bash\ntmux capture-pane -t gt-{{rig}}-{{polecat_name}} -p | tail -50\n```\n\nRecord:\n- Last activity timestamp (when was last tool call?)\n- Visible errors or stack traces\n- Completion indicators (\"Done\", \"Finished\", etc.)\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.606383-08:00","updated_at":"2025-12-24T13:47:35.606383-08:00","dependencies":[{"issue_id":"mol-polecat-arm.capture","depends_on_id":"mol-polecat-arm","type":"parent-child","created_at":"2025-12-24T13:47:35.607562-08:00","created_by":"stevey"}]} -{"id":"mol-polecat-arm.decide","title":"Decide intervention action","description":"Apply the nudge matrix to determine action for {{polecat_name}}.\n\n| State | Idle Time | Nudge Count | Action |\n|-------|-----------|-------------|--------|\n| working | any | any | none |\n| idle | \u003c10min | any | none |\n| idle | 10-15min | 0 | nudge-1 (gentle) |\n| idle | 15-20min | 1 | nudge-2 (direct) |\n| idle | 20+min | 2 | nudge-3 (final) |\n| idle | any | 3 | escalate |\n| error | any | any | assess-severity |\n| requesting_shutdown | any | any | pre-kill-verify |\n| done | any | any | pre-kill-verify |\n\nNudge text:\n1. \"How's progress? Need any help?\"\n2. \"Please wrap up soon. What's blocking you?\"\n3. \"Final check. Will escalate in 5 min if no response.\"\n\nRecord decision and rationale.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.606384-08:00","updated_at":"2025-12-24T13:47:35.606384-08:00","dependencies":[{"issue_id":"mol-polecat-arm.decide","depends_on_id":"mol-polecat-arm","type":"parent-child","created_at":"2025-12-24T13:47:35.64126-08:00","created_by":"stevey"}]} -{"id":"mol-polecat-arm.execute","title":"Execute intervention","description":"Take the decided action for {{polecat_name}}.\n\n**nudge-N**:\n```bash\ntmux send-keys -t gt-{{rig}}-{{polecat_name}} \"{{nudge_text}}\" Enter\n```\n\n**pre-kill-verify**:\n```bash\ncd polecats/{{polecat_name}}\ngit status # Must be clean\ngit log origin/main..HEAD # Check for unpushed\nbd show \u003cassigned-issue\u003e # Verify closed/deferred\n```\nIf clean: kill session, remove worktree, delete branch\nIf dirty: record failure, retry next cycle\n\n**escalate**:\n```bash\ngt mail send mayor/ -s \"Escalation: {{polecat_name}} stuck\" -m \"...\"\n```\n\n**none**: No action needed.\n\nRecord: action taken, result, updated nudge count.\n\n## Output\n\nThe arm completes with:\n- action_taken: none | nudge-1 | nudge-2 | nudge-3 | killed | escalated\n- result: success | failed | pending\n- updated_state: New nudge count and timestamp for {{polecat_name}}\n\nThis data feeds back to the parent patrol's aggregate step.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.606384-08:00","updated_at":"2025-12-24T13:47:35.606384-08:00","dependencies":[{"issue_id":"mol-polecat-arm.execute","depends_on_id":"mol-polecat-arm","type":"parent-child","created_at":"2025-12-24T13:47:35.652356-08:00","created_by":"stevey"}]} -{"id":"mol-polecat-arm.load-history","title":"Load intervention history","description":"Read nudge history for {{polecat_name}} from patrol state.\n\n```\nnudge_count = state.nudges[{{polecat_name}}].count\nlast_nudge_time = state.nudges[{{polecat_name}}].timestamp\n```\n\nThis data was loaded by the parent patrol's load-state step and passed\nto the arm via the bonding context.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.606384-08:00","updated_at":"2025-12-24T13:47:35.606384-08:00","dependencies":[{"issue_id":"mol-polecat-arm.load-history","depends_on_id":"mol-polecat-arm","type":"parent-child","created_at":"2025-12-24T13:47:35.629822-08:00","created_by":"stevey"}]} -{"id":"mol-refinery-patrol","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches,\nmerging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself:\n\"Would Scotty walk past a warp core leak because it existed before his shift?\"\n","status":"open","priority":2,"issue_type":"epic","created_at":"2025-12-24T13:47:35.360986-08:00","updated_at":"2025-12-24T13:47:35.360986-08:00","labels":["template"]} -{"id":"mol-refinery-patrol.burn-or-loop","title":"Burn and respawn or loop","description":"End of patrol cycle decision.\n\nIf queue non-empty AND context LOW:\n- Burn this wisp, start fresh patrol\n- Return to inbox-check\n\nIf queue empty OR context HIGH:\n- Burn wisp with summary digest\n- Exit (daemon will respawn if needed)\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.36099-08:00","updated_at":"2025-12-24T13:47:35.36099-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.burn-or-loop","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.460289-08:00","created_by":"stevey"}]} -{"id":"mol-refinery-patrol.context-check","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\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.360989-08:00","updated_at":"2025-12-24T13:47:35.360989-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.context-check","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.449257-08:00","created_by":"stevey"}]} -{"id":"mol-refinery-patrol.generate-summary","title":"Generate handoff summary","description":"Summarize this patrol cycle.\n\nInclude:\n- Branches processed (count, names)\n- Test results (pass/fail)\n- Issues filed (if any)\n- Branches skipped (with reasons)\n- Any escalations sent\n\nThis becomes the digest when the patrol is squashed.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.360989-08:00","updated_at":"2025-12-24T13:47:35.360989-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.generate-summary","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.438252-08:00","created_by":"stevey"}]} -{"id":"mol-refinery-patrol.handle-failures","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.\"\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.360988-08:00","updated_at":"2025-12-24T13:47:35.360988-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.handle-failures","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.405544-08:00","created_by":"stevey"}]} -{"id":"mol-refinery-patrol.inbox-check","title":"Check refinery mail","description":"Check mail for MR submissions, escalations, messages.\n\n```bash\ngt mail inbox\n# Process any urgent items\n```\n\nHandle shutdown requests, escalations, and status queries.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.360986-08:00","updated_at":"2025-12-24T13:47:35.360986-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.inbox-check","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.362378-08:00","created_by":"stevey"}]} -{"id":"mol-refinery-patrol.loop-check","title":"Check for more work","description":"More branches to process?\n\nIf yes: Return to process-branch with next branch.\nIf no: Continue to generate-summary.\n\nTrack: branches processed, branches skipped (with reasons).\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.360988-08:00","updated_at":"2025-12-24T13:47:35.360988-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.loop-check","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.427296-08:00","created_by":"stevey"}]} -{"id":"mol-refinery-patrol.merge-push","title":"Merge and push to main","description":"Merge to main and push immediately.\n\n```bash\ngit checkout main\ngit merge --ff-only temp\ngit push origin main\ngit branch -d temp\ngit branch -D \u003cpolecat-branch\u003e # Local delete (branches never go to origin)\n```\n\nMain has moved. Any remaining branches need rebasing on new baseline.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.360988-08:00","updated_at":"2025-12-24T13:47:35.360988-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.merge-push","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.416461-08:00","created_by":"stevey"}]} -{"id":"mol-refinery-patrol.process-branch","title":"Process next branch","description":"Pick next branch. Rebase on current main.\n\n```bash\ngit checkout -b temp origin/\u003cpolecat-branch\u003e\ngit rebase origin/main\n```\n\nIf rebase conflicts and unresolvable:\n- git rebase --abort\n- Notify polecat to fix and resubmit\n- Skip to loop-check for next branch\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.360987-08:00","updated_at":"2025-12-24T13:47:35.360987-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.process-branch","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.384106-08:00","created_by":"stevey"}]} -{"id":"mol-refinery-patrol.queue-scan","title":"Scan merge queue","description":"Fetch remote and identify polecat branches waiting.\n\n```bash\ngit fetch origin\ngit branch -r | grep polecat\ngt refinery queue \u003crig\u003e\n```\n\nIf queue empty, skip to context-check step.\nTrack branch list for this cycle.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.360987-08:00","updated_at":"2025-12-24T13:47:35.360987-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.queue-scan","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.373355-08:00","created_by":"stevey"}]} -{"id":"mol-refinery-patrol.run-tests","title":"Run test suite","description":"Run the test suite.\n\n```bash\ngo test ./...\n```\n\nTrack results: pass count, fail count, specific failures.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.360987-08:00","updated_at":"2025-12-24T13:47:35.360987-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.run-tests","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.394641-08:00","created_by":"stevey"}]} -{"id":"mol-witness-patrol","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop using the Christmas Ornament pattern.\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\nThis molecule uses dynamic bonding to spawn mol-polecat-arm for each worker,\nenabling parallel inspection with a fanout gate for aggregation.\n\n## The Christmas Ornament Shape\n\n```\n ★ mol-witness-patrol (trunk)\n /|\\\n ┌────────┘ │ └────────┐\n PREFLIGHT DISCOVERY CLEANUP\n │ │ │\n inbox-check survey aggregate (WaitsFor: all-children)\n check-refnry │ save-state\n load-state │ generate-summary\n ↓ context-check\n ┌───────┼───────┐ burn-or-loop\n ● ● ● mol-polecat-arm (dynamic)\n ace nux toast\n```\n","status":"open","priority":2,"issue_type":"epic","created_at":"2025-12-24T13:47:35.125609-08:00","updated_at":"2025-12-24T13:47:35.125609-08:00","labels":["template"]} -{"id":"mol-witness-patrol.aggregate","title":"Aggregate arm results","description":"Collect outcomes from all polecat inspection arms.\n\nThis is a **fanout gate** - it cannot proceed until ALL dynamically-bonded\npolecat arms have completed their inspection cycles.\n\nOnce all arms complete, collect their outcomes:\n- Actions taken per polecat (nudge, kill, escalate, none)\n- Updated nudge counts\n- Any errors or issues discovered\n\nBuild the consolidated state for save-state.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.125614-08:00","updated_at":"2025-12-24T13:47:35.125614-08:00","dependencies":[{"issue_id":"mol-witness-patrol.aggregate","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.170139-08:00","created_by":"stevey"}]} -{"id":"mol-witness-patrol.burn-or-loop","title":"Burn and respawn or loop","description":"End of patrol cycle decision.\n\nIf context is LOW:\n- Burn this wisp (no audit trail needed for patrol cycles)\n- Sleep briefly to avoid tight loop (30-60 seconds)\n- Return to inbox-check step\n\nIf context is HIGH:\n- Burn wisp with summary digest\n- Exit cleanly (daemon will respawn fresh Witness)\n\n```bash\nbd mol burn # Destroy ephemeral wisp\n```\n\nThe daemon ensures Witness is always running.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.125616-08:00","updated_at":"2025-12-24T13:47:35.125616-08:00","dependencies":[{"issue_id":"mol-witness-patrol.burn-or-loop","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.212926-08:00","created_by":"stevey"}]} -{"id":"mol-witness-patrol.check-refinery","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n**Redundant system**: This check runs in both gt spawn and Witness patrol\nto ensure the merge queue processor stays operational.\n\n```bash\n# Check if refinery session is running\ngt session status \u003crig\u003e/refinery\n\n# Check for merge requests in queue\nbd list --type=merge-request --status=open\n```\n\nIf merge requests are waiting AND refinery is 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 is running but queue is non-empty for \u003e30 min, send nudge.\nThis ensures polecats don't wait forever for their branches to merge.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.125611-08:00","updated_at":"2025-12-24T13:47:35.125611-08:00","dependencies":[{"issue_id":"mol-witness-patrol.check-refinery","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.138131-08:00","created_by":"stevey"}]} -{"id":"mol-witness-patrol.context-check","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure state is saved to handoff bead\n- Prepare for burn/respawn\n\nIf context is LOW:\n- Can continue patrolling\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.125616-08:00","updated_at":"2025-12-24T13:47:35.125616-08:00","dependencies":[{"issue_id":"mol-witness-patrol.context-check","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.20237-08:00","created_by":"stevey"}]} -{"id":"mol-witness-patrol.generate-summary","title":"Generate handoff summary","description":"Summarize this patrol cycle for digest.\n\nInclude:\n- Workers inspected (count, names)\n- Nudges sent (count, to whom)\n- Sessions killed (count, names)\n- Escalations (count, issues)\n- Issues found (brief descriptions)\n- Actions pending for next cycle\n\nThis becomes the digest when the patrol wisp is squashed.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.125616-08:00","updated_at":"2025-12-24T13:47:35.125616-08:00","dependencies":[{"issue_id":"mol-witness-patrol.generate-summary","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.191632-08:00","created_by":"stevey"}]} -{"id":"mol-witness-patrol.inbox-check","title":"Process witness mail","description":"Process witness mail: lifecycle requests, help requests.\n\n```bash\ngt mail inbox\n```\n\nHandle by message type:\n- **LIFECYCLE/Shutdown**: Queue for pre-kill verification\n- **Blocked/Help**: Assess if resolvable or escalate\n- **HANDOFF**: Load predecessor state\n- **Work complete**: Verify issue closed, proceed to pre-kill\n\nRecord any pending actions for later steps.\nMark messages as processed when complete.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.12561-08:00","updated_at":"2025-12-24T13:47:35.12561-08:00","dependencies":[{"issue_id":"mol-witness-patrol.inbox-check","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.127181-08:00","created_by":"stevey"}]} -{"id":"mol-witness-patrol.load-state","title":"Load persisted patrol state","description":"Read handoff bead and get nudge counts.\n\nLoad persistent state from the witness handoff bead:\n- Active workers and their status from last cycle\n- Nudge counts per worker per issue\n- Last nudge timestamps\n- Pending escalations\n\n```bash\nbd show \u003chandoff-bead-id\u003e\n```\n\nIf no handoff exists (fresh start), initialize empty state.\nThis state persists across wisp burns and session cycles.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.125611-08:00","updated_at":"2025-12-24T13:47:35.125611-08:00","dependencies":[{"issue_id":"mol-witness-patrol.load-state","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.148759-08:00","created_by":"stevey"}]} -{"id":"mol-witness-patrol.save-state","title":"Persist patrol state","description":"Update handoff bead with new states.\n\nPersist state to the witness handoff bead:\n- Updated worker statuses from all arms\n- Current nudge counts per worker\n- Nudge timestamps\n- Actions taken this cycle\n- Pending items for next cycle\n\n```bash\nbd update \u003chandoff-bead-id\u003e --description=\"\u003cserialized state\u003e\"\n```\n\nThis state survives wisp burns and session cycles.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.125616-08:00","updated_at":"2025-12-24T13:47:35.125616-08:00","dependencies":[{"issue_id":"mol-witness-patrol.save-state","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.180863-08:00","created_by":"stevey"}]} -{"id":"mol-witness-patrol.survey-workers","title":"Survey all polecats (fanout)","description":"List polecats and bond mol-polecat-arm for each one.\n\n```bash\n# Get list of polecats\ngt polecat list \u003crig\u003e\n```\n\nFor each polecat discovered, dynamically bond an inspection arm:\n\n```bash\n# Bond mol-polecat-arm for each polecat\nfor polecat in $(gt polecat list \u003crig\u003e --names); do\n bd mol bond mol-polecat-arm $PATROL_WISP_ID \\\n --ref arm-$polecat \\\n --var polecat_name=$polecat \\\n --var rig=\u003crig\u003e\ndone\n```\n\nThis creates child wisps like:\n- patrol-x7k.arm-ace (5 steps)\n- patrol-x7k.arm-nux (5 steps)\n- patrol-x7k.arm-toast (5 steps)\n\nEach arm runs in PARALLEL. The aggregate step will wait for all to complete.\n\nIf no polecats are found, this step completes immediately with no children.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T13:47:35.125611-08:00","updated_at":"2025-12-24T13:47:35.125611-08:00","dependencies":[{"issue_id":"mol-witness-patrol.survey-workers","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T13:47:35.159449-08:00","created_by":"stevey"}]} +{"id":"mol-deacon-patrol","title":"mol-deacon-patrol","description":"Mayor's daemon patrol loop.\n\nThe Deacon is the Mayor's background process that runs continuously,\nhandling callbacks, monitoring rig health, and performing cleanup.\nEach patrol cycle runs these steps in sequence, then loops or exits.\n","status":"open","priority":2,"issue_type":"epic","created_at":"2025-12-24T14:01:56.570703-08:00","updated_at":"2025-12-24T14:01:56.570703-08:00","labels":["template"]} +{"id":"mol-deacon-patrol.context-check","title":"Check own context limit","description":"Check own context limit.\n\nThe Deacon runs in a Claude session with finite context.\nCheck if approaching the limit:\n\n```bash\ngt context --usage\n```\n\nIf context is high (\u003e80%), prepare for handoff:\n- Summarize current state\n- Note any pending work\n- Write handoff to molecule state\n\nThis enables the Deacon to burn and respawn cleanly.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:01:56.570706-08:00","updated_at":"2025-12-24T14:01:56.570706-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.context-check","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T14:01:56.637666-08:00","created_by":"stevey"}]} +{"id":"mol-deacon-patrol.health-scan","title":"Check Witness and Refinery health","description":"Check Witness and Refinery health for each rig.\n\n**ZFC Principle**: You (Claude) make the judgment call about what is \"stuck\" or\n\"unresponsive\" - there are no hardcoded thresholds in Go. Read the signals,\nconsider context, and decide.\n\nFor each rig, run:\n```bash\ngt witness status \u003crig\u003e\ngt refinery status \u003crig\u003e\n```\n\n**Signals to assess:**\n\n| Component | Healthy Signals | Concerning Signals |\n|-----------|-----------------|-------------------|\n| Witness | State: running, recent activity | State: not running, no heartbeat |\n| Refinery | State: running, queue processing | Queue stuck, merge failures |\n\n**Tracking unresponsive cycles:**\n\nMaintain in your patrol state (persisted across cycles):\n```\nhealth_state:\n \u003crig\u003e:\n witness:\n unresponsive_cycles: 0\n last_seen_healthy: \u003ctimestamp\u003e\n refinery:\n unresponsive_cycles: 0\n last_seen_healthy: \u003ctimestamp\u003e\n```\n\n**Decision matrix** (you decide the thresholds based on context):\n\n| Cycles Unresponsive | Suggested Action |\n|---------------------|------------------|\n| 1-2 | Note it, check again next cycle |\n| 3-4 | Attempt restart: gt witness restart \u003crig\u003e |\n| 5+ | Escalate to Mayor with context |\n\n**Restart commands:**\n```bash\ngt witness restart \u003crig\u003e\ngt refinery restart \u003crig\u003e\n```\n\n**Escalation:**\n```bash\ngt mail send mayor/ -s \"Health: \u003crig\u003e \u003ccomponent\u003e unresponsive\" \\\n -m \"Component has been unresponsive for N cycles. Restart attempts failed.\n Last healthy: \u003ctimestamp\u003e\n Error signals: \u003cdetails\u003e\"\n```\n\nReset unresponsive_cycles to 0 when component responds normally.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:01:56.570704-08:00","updated_at":"2025-12-24T14:01:56.570704-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.health-scan","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T14:01:56.593901-08:00","created_by":"stevey"}]} +{"id":"mol-deacon-patrol.inbox-check","title":"Handle callbacks from agents","description":"Handle callbacks from agents.\n\nCheck the Mayor's inbox for messages from:\n- Witnesses reporting polecat status\n- Refineries reporting merge results\n- Polecats requesting help or escalation\n- External triggers (webhooks, timers)\n\n```bash\ngt mail inbox\n# For each message:\ngt mail read \u003cid\u003e\n# Handle based on message type\n```\n\nCallbacks may spawn new polecats, update issue state, or trigger other actions.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:01:56.570703-08:00","updated_at":"2025-12-24T14:01:56.570703-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.inbox-check","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T14:01:56.571785-08:00","created_by":"stevey"}]} +{"id":"mol-deacon-patrol.loop-or-exit","title":"Burn and respawn or loop","description":"Burn and let daemon respawn, or exit if context high.\n\nDecision point at end of patrol cycle:\n\nIf context is LOW:\n- Sleep briefly (avoid tight loop)\n- Return to inbox-check step\n\nIf context is HIGH:\n- Write state to persistent storage\n- Exit cleanly\n- Let the daemon orchestrator respawn a fresh Deacon\n\nThe daemon ensures Deacon is always running:\n```bash\n# Daemon respawns on exit\ngt daemon status\n```\n\nThis enables infinite patrol duration via context-aware respawning.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:01:56.570706-08:00","updated_at":"2025-12-24T14:01:56.570706-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.loop-or-exit","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T14:01:56.648691-08:00","created_by":"stevey"}]} +{"id":"mol-deacon-patrol.orphan-check","title":"Find abandoned work","description":"Find abandoned work.\n\nScan for orphaned state:\n- Issues marked in_progress with no active polecat\n- Polecats that stopped responding mid-work\n- Merge queue entries with no polecat owner\n- Wisp sessions that outlived their spawner\n\n```bash\nbd list --status=in_progress\ngt polecats --all --orphan\n```\n\nFor each orphan:\n- Check if polecat session still exists\n- If not, mark issue for reassignment or retry\n- File incident beads if data loss occurred\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:01:56.570705-08:00","updated_at":"2025-12-24T14:01:56.570705-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.orphan-check","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T14:01:56.615838-08:00","created_by":"stevey"}]} +{"id":"mol-deacon-patrol.plugin-run","title":"Execute registered plugins","description":"Execute registered plugins.\n\nScan ~/gt/plugins/ for plugin directories. Each plugin has a plugin.md with\nYAML frontmatter defining its gate (when to run) and instructions (what to do).\n\nSee docs/deacon-plugins.md for full documentation.\n\nGate types:\n- cooldown: Time since last run (e.g., 24h)\n- cron: Schedule-based (e.g., \"0 9 * * *\")\n- condition: Metric threshold (e.g., wisp count \u003e 50)\n- event: Trigger-based (e.g., startup, heartbeat)\n\nFor each plugin:\n1. Read plugin.md frontmatter to check gate\n2. Compare against state.json (last run, etc.)\n3. If gate is open, execute the plugin\n\nPlugins marked parallel: true can run concurrently using Task tool subagents.\nSequential plugins run one at a time in directory order.\n\nSkip this step if ~/gt/plugins/ does not exist or is empty.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:01:56.570704-08:00","updated_at":"2025-12-24T14:01:56.570704-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.plugin-run","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T14:01:56.60486-08:00","created_by":"stevey"}]} +{"id":"mol-deacon-patrol.session-gc","title":"Clean dead sessions","description":"Clean dead sessions.\n\nGarbage collect terminated sessions:\n- Remove stale polecat directories\n- Clean up wisp session artifacts\n- Prune old logs and temp files\n- Archive completed molecule state\n\n```bash\ngt gc --sessions\ngt gc --wisps --age=1h\n```\n\nPreserve audit trail. Only clean sessions confirmed dead.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:01:56.570705-08:00","updated_at":"2025-12-24T14:01:56.570705-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.session-gc","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T14:01:56.626766-08:00","created_by":"stevey"}]} +{"id":"mol-deacon-patrol.trigger-pending-spawns","title":"Nudge newly spawned polecats","description":"Nudge newly spawned polecats that are ready for input.\n\nWhen polecats are spawned, their Claude session takes 10-20 seconds to initialize.\nThe spawn command returns immediately without waiting. This step finds spawned\npolecats that are now ready and sends them a trigger to start working.\n\n```bash\n# For each rig with polecats\nfor rig in gastown beads; do\n gt polecats $rig\n # For each working polecat, check if Claude is ready\n # Use tmux capture-pane to look for \"\u003e \" prompt\ndone\n```\n\nFor each ready polecat that hasn't been triggered yet:\n1. Send \"Begin.\" to trigger UserPromptSubmit hook\n2. The hook injects mail, polecat sees its assignment\n3. Mark polecat as triggered in state\n\nUse WaitForClaudeReady from tmux package (polls for \"\u003e \" prompt).\nTimeout: 60 seconds per polecat. If not ready, try again next cycle.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:01:56.570704-08:00","updated_at":"2025-12-24T14:01:56.570704-08:00","dependencies":[{"issue_id":"mol-deacon-patrol.trigger-pending-spawns","depends_on_id":"mol-deacon-patrol","type":"parent-child","created_at":"2025-12-24T14:01:56.582902-08:00","created_by":"stevey"}]} +{"id":"mol-polecat-arm","title":"mol-polecat-arm","description":"Single polecat inspection and action cycle.\n\nThis molecule is bonded dynamically by mol-witness-patrol's survey-workers step.\nEach polecat being monitored gets one arm that runs in parallel with other arms.\n\n## Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| polecat_name | Yes | Name of the polecat to inspect |\n| rig | Yes | Rig containing the polecat |\n","status":"open","priority":2,"issue_type":"epic","created_at":"2025-12-24T14:02:03.234125-08:00","updated_at":"2025-12-24T14:02:03.234125-08:00","labels":["template"]} +{"id":"mol-polecat-arm.assess","title":"Assess work status","description":"Categorize polecat state based on captured output.\n\nStates:\n- **working**: Recent tool calls, active processing\n- **idle**: At prompt, no recent activity\n- **error**: Showing errors or stack traces\n- **requesting_shutdown**: Sent LIFECYCLE/Shutdown mail\n- **done**: Showing completion indicators\n\nCalculate: minutes since last activity.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:03.234127-08:00","updated_at":"2025-12-24T14:02:03.234127-08:00","dependencies":[{"issue_id":"mol-polecat-arm.assess","depends_on_id":"mol-polecat-arm","type":"parent-child","created_at":"2025-12-24T14:02:03.246311-08:00","created_by":"stevey"}]} +{"id":"mol-polecat-arm.capture","title":"Capture polecat state","description":"Capture recent tmux output for {{polecat_name}}.\n\n```bash\ntmux capture-pane -t gt-{{rig}}-{{polecat_name}} -p | tail -50\n```\n\nRecord:\n- Last activity timestamp (when was last tool call?)\n- Visible errors or stack traces\n- Completion indicators (\"Done\", \"Finished\", etc.)\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:03.234126-08:00","updated_at":"2025-12-24T14:02:03.234126-08:00","dependencies":[{"issue_id":"mol-polecat-arm.capture","depends_on_id":"mol-polecat-arm","type":"parent-child","created_at":"2025-12-24T14:02:03.235117-08:00","created_by":"stevey"}]} +{"id":"mol-polecat-arm.decide","title":"Decide intervention action","description":"Apply the nudge matrix to determine action for {{polecat_name}}.\n\n| State | Idle Time | Nudge Count | Action |\n|-------|-----------|-------------|--------|\n| working | any | any | none |\n| idle | \u003c10min | any | none |\n| idle | 10-15min | 0 | nudge-1 (gentle) |\n| idle | 15-20min | 1 | nudge-2 (direct) |\n| idle | 20+min | 2 | nudge-3 (final) |\n| idle | any | 3 | escalate |\n| error | any | any | assess-severity |\n| requesting_shutdown | any | any | pre-kill-verify |\n| done | any | any | pre-kill-verify |\n\nNudge text:\n1. \"How's progress? Need any help?\"\n2. \"Please wrap up soon. What's blocking you?\"\n3. \"Final check. Will escalate in 5 min if no response.\"\n\nRecord decision and rationale.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:03.234128-08:00","updated_at":"2025-12-24T14:02:03.234128-08:00","dependencies":[{"issue_id":"mol-polecat-arm.decide","depends_on_id":"mol-polecat-arm","type":"parent-child","created_at":"2025-12-24T14:02:03.268522-08:00","created_by":"stevey"}]} +{"id":"mol-polecat-arm.execute","title":"Execute intervention","description":"Take the decided action for {{polecat_name}}.\n\n**nudge-N**:\n```bash\ntmux send-keys -t gt-{{rig}}-{{polecat_name}} \"{{nudge_text}}\" Enter\n```\n\n**pre-kill-verify**:\n```bash\ncd polecats/{{polecat_name}}\ngit status # Must be clean\ngit log origin/main..HEAD # Check for unpushed\nbd show \u003cassigned-issue\u003e # Verify closed/deferred\n```\nIf clean: kill session, remove worktree, delete branch\nIf dirty: record failure, retry next cycle\n\n**escalate**:\n```bash\ngt mail send mayor/ -s \"Escalation: {{polecat_name}} stuck\" -m \"...\"\n```\n\n**none**: No action needed.\n\nRecord: action taken, result, updated nudge count.\n\n## Output\n\nThe arm completes with:\n- action_taken: none | nudge-1 | nudge-2 | nudge-3 | killed | escalated\n- result: success | failed | pending\n- updated_state: New nudge count and timestamp for {{polecat_name}}\n\nThis data feeds back to the parent patrol's aggregate step.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:03.234128-08:00","updated_at":"2025-12-24T14:02:03.234128-08:00","dependencies":[{"issue_id":"mol-polecat-arm.execute","depends_on_id":"mol-polecat-arm","type":"parent-child","created_at":"2025-12-24T14:02:03.27941-08:00","created_by":"stevey"}]} +{"id":"mol-polecat-arm.load-history","title":"Load intervention history","description":"Read nudge history for {{polecat_name}} from patrol state.\n\n```\nnudge_count = state.nudges[{{polecat_name}}].count\nlast_nudge_time = state.nudges[{{polecat_name}}].timestamp\n```\n\nThis data was loaded by the parent patrol's load-state step and passed\nto the arm via the bonding context.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:03.234127-08:00","updated_at":"2025-12-24T14:02:03.234127-08:00","dependencies":[{"issue_id":"mol-polecat-arm.load-history","depends_on_id":"mol-polecat-arm","type":"parent-child","created_at":"2025-12-24T14:02:03.257427-08:00","created_by":"stevey"}]} +{"id":"mol-refinery-patrol","title":"mol-refinery-patrol","description":"Merge queue processor patrol loop.\n\nThe Refinery is the Engineer in the engine room. You process polecat branches,\nmerging them to main one at a time with sequential rebasing.\n\n**The Scotty Test**: Before proceeding past any failure, ask yourself:\n\"Would Scotty walk past a warp core leak because it existed before his shift?\"\n","status":"open","priority":2,"issue_type":"epic","created_at":"2025-12-24T14:02:02.983211-08:00","updated_at":"2025-12-24T14:02:02.983211-08:00","labels":["template"]} +{"id":"mol-refinery-patrol.burn-or-loop","title":"Burn and respawn or loop","description":"End of patrol cycle decision.\n\nIf queue non-empty AND context LOW:\n- Burn this wisp, start fresh patrol\n- Return to inbox-check\n\nIf queue empty OR context HIGH:\n- Burn wisp with summary digest\n- Exit (daemon will respawn if needed)\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.983216-08:00","updated_at":"2025-12-24T14:02:02.983216-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.burn-or-loop","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T14:02:03.081862-08:00","created_by":"stevey"}]} +{"id":"mol-refinery-patrol.context-check","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\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.983215-08:00","updated_at":"2025-12-24T14:02:02.983215-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.context-check","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T14:02:03.070901-08:00","created_by":"stevey"}]} +{"id":"mol-refinery-patrol.generate-summary","title":"Generate handoff summary","description":"Summarize this patrol cycle.\n\nInclude:\n- Branches processed (count, names)\n- Test results (pass/fail)\n- Issues filed (if any)\n- Branches skipped (with reasons)\n- Any escalations sent\n\nThis becomes the digest when the patrol is squashed.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.983215-08:00","updated_at":"2025-12-24T14:02:02.983215-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.generate-summary","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T14:02:03.059979-08:00","created_by":"stevey"}]} +{"id":"mol-refinery-patrol.handle-failures","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.\"\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.983215-08:00","updated_at":"2025-12-24T14:02:02.983215-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.handle-failures","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T14:02:03.027466-08:00","created_by":"stevey"}]} +{"id":"mol-refinery-patrol.inbox-check","title":"Check refinery mail","description":"Check mail for MR submissions, escalations, messages.\n\n```bash\ngt mail inbox\n# Process any urgent items\n```\n\nHandle shutdown requests, escalations, and status queries.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.983213-08:00","updated_at":"2025-12-24T14:02:02.983213-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.inbox-check","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T14:02:02.984306-08:00","created_by":"stevey"}]} +{"id":"mol-refinery-patrol.loop-check","title":"Check for more work","description":"More branches to process?\n\nIf yes: Return to process-branch with next branch.\nIf no: Continue to generate-summary.\n\nTrack: branches processed, branches skipped (with reasons).\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.983215-08:00","updated_at":"2025-12-24T14:02:02.983215-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.loop-check","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T14:02:03.049164-08:00","created_by":"stevey"}]} +{"id":"mol-refinery-patrol.merge-push","title":"Merge and push to main","description":"Merge to main and push immediately.\n\n```bash\ngit checkout main\ngit merge --ff-only temp\ngit push origin main\ngit branch -d temp\ngit branch -D \u003cpolecat-branch\u003e # Local delete (branches never go to origin)\n```\n\nMain has moved. Any remaining branches need rebasing on new baseline.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.983215-08:00","updated_at":"2025-12-24T14:02:02.983215-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.merge-push","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T14:02:03.038275-08:00","created_by":"stevey"}]} +{"id":"mol-refinery-patrol.process-branch","title":"Process next branch","description":"Pick next branch. Rebase on current main.\n\n```bash\ngit checkout -b temp origin/\u003cpolecat-branch\u003e\ngit rebase origin/main\n```\n\nIf rebase conflicts and unresolvable:\n- git rebase --abort\n- Notify polecat to fix and resubmit\n- Skip to loop-check for next branch\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.983214-08:00","updated_at":"2025-12-24T14:02:02.983214-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.process-branch","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T14:02:03.005836-08:00","created_by":"stevey"}]} +{"id":"mol-refinery-patrol.queue-scan","title":"Scan merge queue","description":"Fetch remote and identify polecat branches waiting.\n\n```bash\ngit fetch origin\ngit branch -r | grep polecat\ngt refinery queue \u003crig\u003e\n```\n\nIf queue empty, skip to context-check step.\nTrack branch list for this cycle.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.983213-08:00","updated_at":"2025-12-24T14:02:02.983213-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.queue-scan","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T14:02:02.995049-08:00","created_by":"stevey"}]} +{"id":"mol-refinery-patrol.run-tests","title":"Run test suite","description":"Run the test suite.\n\n```bash\ngo test ./...\n```\n\nTrack results: pass count, fail count, specific failures.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.983214-08:00","updated_at":"2025-12-24T14:02:02.983214-08:00","dependencies":[{"issue_id":"mol-refinery-patrol.run-tests","depends_on_id":"mol-refinery-patrol","type":"parent-child","created_at":"2025-12-24T14:02:03.016692-08:00","created_by":"stevey"}]} +{"id":"mol-witness-patrol","title":"mol-witness-patrol","description":"Per-rig worker monitor patrol loop using the Christmas Ornament pattern.\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\nThis molecule uses dynamic bonding to spawn mol-polecat-arm for each worker,\nenabling parallel inspection with a fanout gate for aggregation.\n\n## The Christmas Ornament Shape\n\n```\n ★ mol-witness-patrol (trunk)\n /|\\\n ┌────────┘ │ └────────┐\n PREFLIGHT DISCOVERY CLEANUP\n │ │ │\n inbox-check survey aggregate (WaitsFor: all-children)\n check-refnry │ save-state\n load-state │ generate-summary\n ↓ context-check\n ┌───────┼───────┐ burn-or-loop\n ● ● ● mol-polecat-arm (dynamic)\n ace nux toast\n```\n","status":"open","priority":2,"issue_type":"epic","created_at":"2025-12-24T14:02:02.741378-08:00","updated_at":"2025-12-24T14:02:02.741379-08:00","labels":["template"]} +{"id":"mol-witness-patrol.aggregate","title":"Aggregate arm results","description":"Collect outcomes from all polecat inspection arms.\n\nThis is a **fanout gate** - it cannot proceed until ALL dynamically-bonded\npolecat arms have completed their inspection cycles.\n\nOnce all arms complete, collect their outcomes:\n- Actions taken per polecat (nudge, kill, escalate, none)\n- Updated nudge counts\n- Any errors or issues discovered\n\nBuild the consolidated state for save-state.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.741382-08:00","updated_at":"2025-12-24T14:02:02.741382-08:00","dependencies":[{"issue_id":"mol-witness-patrol.aggregate","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T14:02:02.786478-08:00","created_by":"stevey"}]} +{"id":"mol-witness-patrol.burn-or-loop","title":"Burn and respawn or loop","description":"End of patrol cycle decision.\n\nIf context is LOW:\n- Burn this wisp (no audit trail needed for patrol cycles)\n- Sleep briefly to avoid tight loop (30-60 seconds)\n- Return to inbox-check step\n\nIf context is HIGH:\n- Burn wisp with summary digest\n- Exit cleanly (daemon will respawn fresh Witness)\n\n```bash\nbd mol burn # Destroy ephemeral wisp\n```\n\nThe daemon ensures Witness is always running.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.741382-08:00","updated_at":"2025-12-24T14:02:02.741382-08:00","dependencies":[{"issue_id":"mol-witness-patrol.burn-or-loop","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T14:02:02.829989-08:00","created_by":"stevey"}]} +{"id":"mol-witness-patrol.check-refinery","title":"Ensure refinery is alive","description":"Ensure the refinery is alive and processing merge requests.\n\n**Redundant system**: This check runs in both gt spawn and Witness patrol\nto ensure the merge queue processor stays operational.\n\n```bash\n# Check if refinery session is running\ngt session status \u003crig\u003e/refinery\n\n# Check for merge requests in queue\nbd list --type=merge-request --status=open\n```\n\nIf merge requests are waiting AND refinery is 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 is running but queue is non-empty for \u003e30 min, send nudge.\nThis ensures polecats don't wait forever for their branches to merge.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.741381-08:00","updated_at":"2025-12-24T14:02:02.741381-08:00","dependencies":[{"issue_id":"mol-witness-patrol.check-refinery","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T14:02:02.753589-08:00","created_by":"stevey"}]} +{"id":"mol-witness-patrol.context-check","title":"Check own context limit","description":"Check own context usage.\n\nIf context is HIGH (\u003e80%):\n- Ensure state is saved to handoff bead\n- Prepare for burn/respawn\n\nIf context is LOW:\n- Can continue patrolling\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.741382-08:00","updated_at":"2025-12-24T14:02:02.741382-08:00","dependencies":[{"issue_id":"mol-witness-patrol.context-check","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T14:02:02.819112-08:00","created_by":"stevey"}]} +{"id":"mol-witness-patrol.generate-summary","title":"Generate handoff summary","description":"Summarize this patrol cycle for digest.\n\nInclude:\n- Workers inspected (count, names)\n- Nudges sent (count, to whom)\n- Sessions killed (count, names)\n- Escalations (count, issues)\n- Issues found (brief descriptions)\n- Actions pending for next cycle\n\nThis becomes the digest when the patrol wisp is squashed.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.741382-08:00","updated_at":"2025-12-24T14:02:02.741382-08:00","dependencies":[{"issue_id":"mol-witness-patrol.generate-summary","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T14:02:02.808239-08:00","created_by":"stevey"}]} +{"id":"mol-witness-patrol.inbox-check","title":"Process witness mail","description":"Process witness mail: lifecycle requests, help requests.\n\n```bash\ngt mail inbox\n```\n\nHandle by message type:\n- **LIFECYCLE/Shutdown**: Queue for pre-kill verification\n- **Blocked/Help**: Assess if resolvable or escalate\n- **HANDOFF**: Load predecessor state\n- **Work complete**: Verify issue closed, proceed to pre-kill\n\nRecord any pending actions for later steps.\nMark messages as processed when complete.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.74138-08:00","updated_at":"2025-12-24T14:02:02.74138-08:00","dependencies":[{"issue_id":"mol-witness-patrol.inbox-check","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T14:02:02.742442-08:00","created_by":"stevey"}]} +{"id":"mol-witness-patrol.load-state","title":"Load persisted patrol state","description":"Read handoff bead and get nudge counts.\n\nLoad persistent state from the witness handoff bead:\n- Active workers and their status from last cycle\n- Nudge counts per worker per issue\n- Last nudge timestamps\n- Pending escalations\n\n```bash\nbd show \u003chandoff-bead-id\u003e\n```\n\nIf no handoff exists (fresh start), initialize empty state.\nThis state persists across wisp burns and session cycles.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.741381-08:00","updated_at":"2025-12-24T14:02:02.741381-08:00","dependencies":[{"issue_id":"mol-witness-patrol.load-state","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T14:02:02.764533-08:00","created_by":"stevey"}]} +{"id":"mol-witness-patrol.save-state","title":"Persist patrol state","description":"Update handoff bead with new states.\n\nPersist state to the witness handoff bead:\n- Updated worker statuses from all arms\n- Current nudge counts per worker\n- Nudge timestamps\n- Actions taken this cycle\n- Pending items for next cycle\n\n```bash\nbd update \u003chandoff-bead-id\u003e --description=\"\u003cserialized state\u003e\"\n```\n\nThis state survives wisp burns and session cycles.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.741382-08:00","updated_at":"2025-12-24T14:02:02.741382-08:00","dependencies":[{"issue_id":"mol-witness-patrol.save-state","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T14:02:02.797264-08:00","created_by":"stevey"}]} +{"id":"mol-witness-patrol.survey-workers","title":"Survey all polecats (fanout)","description":"List polecats and bond mol-polecat-arm for each one.\n\n```bash\n# Get list of polecats\ngt polecat list \u003crig\u003e\n```\n\nFor each polecat discovered, dynamically bond an inspection arm:\n\n```bash\n# Bond mol-polecat-arm for each polecat\nfor polecat in $(gt polecat list \u003crig\u003e --names); do\n bd mol bond mol-polecat-arm $PATROL_WISP_ID \\\n --ref arm-$polecat \\\n --var polecat_name=$polecat \\\n --var rig=\u003crig\u003e\ndone\n```\n\nThis creates child wisps like:\n- patrol-x7k.arm-ace (5 steps)\n- patrol-x7k.arm-nux (5 steps)\n- patrol-x7k.arm-toast (5 steps)\n\nEach arm runs in PARALLEL. The aggregate step will wait for all to complete.\n\nIf no polecats are found, this step completes immediately with no children.\n","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-24T14:02:02.741381-08:00","updated_at":"2025-12-24T14:02:02.741381-08:00","dependencies":[{"issue_id":"mol-witness-patrol.survey-workers","depends_on_id":"mol-witness-patrol","type":"parent-child","created_at":"2025-12-24T14:02:02.775535-08:00","created_by":"stevey"}]}