diff --git a/.beads/formulas/mol-witness-patrol.formula.toml b/.beads/formulas/mol-witness-patrol.formula.toml index 6d04c228..12c612b9 100644 --- a/.beads/formulas/mol-witness-patrol.formula.toml +++ b/.beads/formulas/mol-witness-patrol.formula.toml @@ -56,7 +56,7 @@ needs = ['patrol-cleanup'] title = 'Check own context limit' [[steps]] -description = "End of patrol cycle decision.\n\n**If context LOW**:\n- Sleep briefly to avoid tight loop (30-60 seconds)\n- Return to inbox-check step\n- Continue patrolling\n\n**If context HIGH**:\n- Write handoff mail to self with any notable observations:\n```bash\ngt handoff -s \"Witness patrol handoff\" -m \"\"\n```\n- Exit cleanly (daemon respawns fresh Witness)\n\nThe daemon ensures Witness is always running." +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 --summary \"\"\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 \"\"\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 idle without work on your hook." id = 'loop-or-exit' needs = ['context-check'] title = 'Loop or exit for respawn' diff --git a/internal/cmd/prime.go b/internal/cmd/prime.go index fc556198..76bc2c49 100644 --- a/internal/cmd/prime.go +++ b/internal/cmd/prime.go @@ -908,7 +908,7 @@ func outputDeaconPatrolContext(ctx RoleContext) { "Execute the step (heartbeat, mail, health checks, etc.)", "Close step: `bd close `", "Check next: `bd ready`", - "At cycle end (loop-or-exit step):\n - Generate summary of patrol cycle\n - Squash: `bd --no-daemon mol squash --summary \"\"`\n - Loop back to create new wisp, or exit if context high", + "At cycle end (loop-or-exit step):\n - If context LOW:\n * Squash: `bd mol squash --summary \"\"`\n * Create new patrol: `bd mol wisp mol-deacon-patrol`\n * Continue executing from inbox-check step\n - If context HIGH:\n * Send handoff: `gt handoff -s \"Deacon patrol\" -m \"\"`\n * Exit cleanly (daemon respawns fresh session)", }, } outputPatrolContext(cfg) @@ -931,7 +931,7 @@ func outputWitnessPatrolContext(ctx RoleContext) { "Execute the step (survey polecats, inspect, nudge, etc.)", "Close step: `bd close `", "Check next: `bd ready`", - "At cycle end (burn-or-loop step):\n - Generate summary of patrol cycle\n - Squash: `bd --no-daemon mol squash --summary \"\"`\n - Loop back to create new wisp, or exit if context high", + "At cycle end (loop-or-exit step):\n - If context LOW:\n * Squash: `bd mol squash --summary \"\"`\n * Create new patrol: `bd mol wisp mol-witness-patrol`\n * Continue executing from inbox-check step\n - If context HIGH:\n * Send handoff: `gt handoff -s \"Witness patrol\" -m \"\"`\n * Exit cleanly (daemon respawns fresh session)", }, } outputPatrolContext(cfg) @@ -954,7 +954,7 @@ func outputRefineryPatrolContext(ctx RoleContext) { "Execute the step (queue scan, process branch, tests, merge)", "Close step: `bd close `", "Check next: `bd ready`", - "At cycle end (burn-or-loop step):\n - Generate summary of patrol cycle\n - Squash: `bd --no-daemon mol squash --summary \"\"`\n - Loop back to create new wisp, or exit if context high", + "At cycle end (loop-or-exit step):\n - If context LOW:\n * Squash: `bd mol squash --summary \"\"`\n * Create new patrol: `bd mol wisp mol-refinery-patrol`\n * Continue executing from inbox-check step\n - If context HIGH:\n * Send handoff: `gt handoff -s \"Refinery patrol\" -m \"\"`\n * Exit cleanly (daemon respawns fresh session)", }, } outputPatrolContext(cfg)