From e7dfc58a02cd341e93c45f244ade9ddc122412e6 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Thu, 25 Dec 2025 22:29:27 -0800 Subject: [PATCH] Add gate-evaluation step to Deacon patrol (gt-twjr5.2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New step evaluates pending async gates each patrol cycle: - Lists open gates via bd gate list - For timer gates, checks if elapsed time exceeds timeout - Closes elapsed gates and notifies waiters - Runs in parallel with trigger-pending-spawns 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../formulas/mol-deacon-patrol.formula.toml | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.beads/formulas/mol-deacon-patrol.formula.toml b/.beads/formulas/mol-deacon-patrol.formula.toml index 3711e634..cef2438e 100644 --- a/.beads/formulas/mol-deacon-patrol.formula.toml +++ b/.beads/formulas/mol-deacon-patrol.formula.toml @@ -61,6 +61,35 @@ id = "trigger-pending-spawns" needs = ["inbox-check"] title = "Nudge newly spawned polecats" +[[steps]] +description = """ +Evaluate pending async gates. + +Gates are async coordination primitives that block until conditions are met. +The Deacon is responsible for monitoring gates and closing them when ready. + +**Timer gates** (await_type: timer): +Check if elapsed time since creation exceeds the timeout duration. + +```bash +# List all open gates +bd gate list --json + +# For each timer gate, check if elapsed: +# - CreatedAt + Timeout < Now → gate is ready to close +# - Close with: bd gate close --reason "Timer elapsed" +``` + +**GitHub gates** (await_type: gh:run, gh:pr) - handled in separate step. + +**Human/Mail gates** - require external input, skip here. + +After closing a gate, the Waiters field contains mail addresses to notify. +Send a brief notification to each waiter that the gate has cleared.""" +id = "gate-evaluation" +needs = ["inbox-check"] +title = "Evaluate pending async gates" + [[steps]] description = """ Check Witness and Refinery health for each rig. @@ -118,7 +147,7 @@ gt mail send mayor/ -s \"Health: unresponsive\" \\ Reset unresponsive_cycles to 0 when component responds normally.""" id = "health-scan" -needs = ["trigger-pending-spawns"] +needs = ["trigger-pending-spawns", "gate-evaluation"] title = "Check Witness and Refinery health" [[steps]]