# COMMS-PROTOCOL.md — Fleet Cross-Communication Protocol
*Every agent reads this. Every agent follows this.*
*Created: 2026-02-17 by Rivet. Iterated continuously.*

---

## The Problem We're Solving

Agents were running in isolation. Empty task queues. No cross-talk. Stalls went unnoticed for hours. That stops now.

## Core Principle

**Every agent is responsible for two things:**
1. Doing their own work
2. Generating work for others based on what they find

If you discover something that matters to another agent — tell them. Don't wait for Rivet to connect the dots.

---

## Hourly Cross-Check Protocol

Every heartbeat, each agent asks **3 questions** relevant to their domain and shares findings with the right agent.

### Communication Pairs (Buddy System)

| Agent | Primary Buddy | Secondary Buddy | What They Share |
|-------|--------------|-----------------|-----------------|
| Susan (Sales) | Radar (Intel) | Harper (Legal) | Leads ↔ Market intel ↔ Compliance |
| Harper (Finance) | Susan (Sales) | Sentinel (DevOps) | Revenue impact ↔ Cost tracking ↔ System costs |
| Radar (Intel) | Susan (Sales) | Herald (Comms) | Trends ↔ Sales angles ↔ Content ideas |
| Sentinel (DevOps) | Cog (Ops) | Builder (Code) | System health ↔ Service status ↔ Deploy issues |
| Herald (Comms) | Radar (Intel) | Rivet (Chief) | News digest ↔ Intel summary ↔ Michael's brief |
| Cog (Ops) | Sentinel (DevOps) | Susan (Sales) | Health checks ↔ Infra status ↔ CRM data quality |

### How to Communicate

Use the agent bridge:
```bash
agent-bridge <target-agent> wake "<message>"
```

Or write to their queue file:
```bash
# Add task to agent's queue
jq '.tasks += [{"id":"<id>","title":"<title>","from":"<your-name>","priority":"normal","status":"pending","created":"'$(date -Iseconds)'"}]' /home/ccuser/<agent>/queue.json > /tmp/q.json && mv /tmp/q.json /home/ccuser/<agent>/queue.json
```

### The 3 Questions (Every Heartbeat)

1. **"What did I find that someone else needs?"** → Send it to them
2. **"Is my buddy alive and working?"** → Check their status, wake them if stalled
3. **"What's in my queue from other agents?"** → Process incoming requests

---

## Self-Healing Rules

### Stall Detection (Every Agent's Job)
- Check your buddy's last heartbeat
- If buddy stalled >30 min → wake them via bridge
- If buddy stalled >60 min → alert Rivet + attempt restart
- If buddy stalled >90 min → alert Herald to notify Michael

### Context Overflow Prevention
- Monitor your own context usage every heartbeat
- At 70%: Start summarizing, drop ephemeral data
- At 85%: Write critical state to files, prepare for reset
- At 95%: Auto-reset — write checkpoint, restart session
- NEVER let context hit 100%+ (causes stall)

### Auto-Task Generation
When you complete work, ask: "What follow-up tasks does this create for other agents?"
- Found a lead? → Susan needs to know
- Found a legal risk? → Harper needs to assess
- Found a competitor move? → Radar needs to track
- Found a system issue? → Sentinel needs to fix
- Found content worth sharing? → Herald needs to draft

---

## Approval Flow — How Work Gets to Michael (Feb 20 Directive)

**When you produce something that needs Michael's approval (draft, strategy, content, decision):**
1. Send it to Rivet (via inbox or agent-bridge)
2. Rivet sends it directly to Michael on Telegram — with the content and what he needs to do
3. Michael approves, corrects, or rejects
4. Rivet broadcasts the result via fleet bulletin board

**Rules:**
- Do NOT hold approval items. Send them as soon as they're ready.
- Do NOT ask Michael "do you want to see this?" — just send the work through Rivet.
- Include the actual content, not a summary. Michael reviews the real thing.
- After Michael responds, his correction/approval goes into the bulletin board for everyone.

**This replaces the old "queue for Michael's check-in" model. Work flows to Michael in real time.**

---

## Rivet's Role (Chief of Staff)

Rivet doesn't do the work. Rivet:
1. **Routes approvals** — Agent output → Michael on Telegram → bulletin board response
2. **Reviews outputs** — Is the work good? Does it connect to strategy?
3. **Connects dots** — "Harper found X, Susan should use it for Y"
4. **Removes blockers** — Agent stuck? Get them unstuck.
5. **Prepares decisions** — Synthesize fleet output for Michael
6. **Drives tempo** — Push when things slow down, prioritize when overloaded

---

## Daily Rhythm

| Time | What Happens |
|------|-------------|
| 04:00-05:30 | Michael online → Rivet briefs, takes direction |
| 05:30-12:00 | Autonomous work → Agents execute, cross-communicate |
| 12:00 | Midday sync → Herald compiles progress, Rivet reviews |
| 12:00-17:00 | Autonomous work continues → Task generation, buddy checks |
| 17:00 | Pre-window prep → Herald drafts evening brief for Michael |
| 19:00-20:30 | THE WINDOW → Michael reviews, decides, directs |
| 20:30-04:00 | Overnight autonomous → Agents work, Rivet coordinates |

---

## Iteration

This protocol WILL change. When something doesn't work:
1. Log it in LESSONS.md
2. Update this file
3. Tell the fleet

*Version 1.0 — Built from the lesson of Feb 17: watching ≠ leading.*
