fix(formula): clarify WITNESS_PING routing in witness patrol (#854)

Add explicit routing rules to ping-deacon step:
- WITNESS_PING always goes to deacon/, never to mayor/
- Mayor only receives ALERT messages (Step 3)
- Define what 'healthy' looks like (idle at prompt is normal)

This prevents the witness LLM from misinterpreting the formula
and sending raw WITNESS_PING messages to mayor instead of deacon.

Fixes: gt-uvz90
This commit is contained in:
aleiby
2026-01-21 18:12:20 -08:00
committed by GitHub
parent 39b1c11bb6
commit 1a0f2d6b3b

View File

@@ -38,7 +38,7 @@ needs = ['check-timer-gates']
title = 'Check if active swarm is complete'
[[steps]]
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 <rig>\" -m \"Rig: <rig>\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: <cycle-number>\"\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 (>5 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 >5 minutes.\nLast seen: <timestamp>\nWitness: <rig>/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication."
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## CRITICAL: Routing Rules\n\n**WITNESS_PING always goes to `deacon/` - NEVER to `mayor/`.**\n\nMayor only receives ALERT messages (Step 3), never raw WITNESS_PING messages.\n\n## What \"Healthy\" Looks Like\n\n- Deacon session exists → healthy\n- Deacon idle at prompt → healthy (NORMAL)\n- Deacon actively running → healthy\n\n**Step 1: Send ping**\n```bash\ngt mail send deacon/ -s \"WITNESS_PING <rig>\" -m \"Rig: <rig>\nTimestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nPatrol: <cycle-number>\"\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 (>5 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 >5 minutes.\nLast seen: <timestamp>\nWitness: <rig>/witness\"\n```\n\nNote: Multiple Witnesses may send this alert. Mayor should handle deduplication."
id = 'ping-deacon'
needs = ['check-swarm-completion']
title = 'Ping Deacon for health check'