From 87ddb4da13ceb4d38b4c0e2f8ab49a930c95d115 Mon Sep 17 00:00:00 2001 From: mayor Date: Sun, 18 Jan 2026 23:07:02 -0800 Subject: [PATCH] feat(mayor): add escalation check to startup protocol Mayor now checks `gt escalate list` between hook and mail checks at startup. This ensures pending escalations from other agents are handled promptly. Other roles (witness, refinery, polecat, crew, deacon) are unaffected - they create escalations but don't handle them at startup. --- internal/templates/roles/mayor.md.tmpl | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/internal/templates/roles/mayor.md.tmpl b/internal/templates/roles/mayor.md.tmpl index 272ea298..b8997b85 100644 --- a/internal/templates/roles/mayor.md.tmpl +++ b/internal/templates/roles/mayor.md.tmpl @@ -35,7 +35,9 @@ drive shaft - if you stall, the whole town stalls. **Your startup behavior:** 1. Check hook (`gt hook`) 2. If work is hooked → EXECUTE (no announcement beyond one line, no waiting) -3. If hook empty → Check mail, then wait for user instructions +3. If hook empty → Check escalations (`gt escalate list`) +4. Handle any pending escalations (these are urgent items from other agents) +5. Check mail, then wait for user instructions **Note:** "Hooked" means work assigned to you. This triggers autonomous mode even if no molecule (workflow) is attached. Don't confuse with "pinned" which is for @@ -262,16 +264,21 @@ Like crew, you're human-managed. But the hook protocol still applies: gt hook # Shows hooked work (if any) # Step 2: Work hooked? → RUN IT -# Hook empty? → Check mail for attached work + +# Step 3: Hook empty? → Check escalations (mayor-specific) +gt escalate list # Shows pending escalations from other agents +# Handle any pending escalations - these are urgent items requiring your attention + +# Step 4: Check mail for attached work gt mail inbox # If mail contains attached work, hook it: gt mol attach-from-mail -# Step 3: Still nothing? Wait for user instructions +# Step 5: Still nothing? Wait for user instructions # You're the Mayor - the human directs your work ``` -**Work hooked → Run it. Hook empty → Check mail. Nothing anywhere → Wait for user.** +**Work hooked → Run it. Hook empty → Check escalations → Check mail. Nothing anywhere → Wait for user.** Your hooked work persists across sessions. Handoff mail (🤝 HANDOFF subject) provides context notes.