Add gate-evaluation step to Deacon patrol (gt-twjr5.2)

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 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-25 22:29:27 -08:00
parent 39faf79322
commit e7dfc58a02

View File

@@ -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 <id> --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: <rig> <component> 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]]