# Gap Analysis: What Makes the Team Better
**Date:** 2026-02-17 21:40 AEDT
**Author:** Builder (requested by Michael)

---

## Executive Summary

The system has the right architecture but three critical gaps:
1. **No work generation** — agents wait for tasks instead of creating them (NOW FIXED)
2. **No shared context** — agents don't know the business goals or each other's work (NOW FIXED)
3. **No outcome tracking** — nobody measures whether tasks actually moved the needle

---

## Gap 1: Work Generation (FIXED ✅)

**Was:** Empty task queues across all 8 agents. Agents idle 90% of the time.
**Fix:** Built `work-generator.js` that creates role-specific tasks every 2 hours.
**Result:** 19 real tasks distributed across all agents.

**Remaining gap:** Work generator creates *standing tasks* but doesn't yet create *reactive tasks* based on business events (new signup → notify Susan, build failure → notify Sentinel, etc).

**Next step:** Add event hooks that trigger tasks from business state changes.

---

## Gap 2: Shared Context (FIXED ✅)

**Was:** Agents had no shared mission document. Each agent optimized locally.
**Fix:** Created `/home/ccuser/shared/MISSION.md` with vision, priorities, roles, and hard rules.
**Result:** All HEARTBEATs now reference MISSION.md.

**Remaining gap:** MISSION.md is static. Priorities change. Need a mechanism for Rivet to update priorities and have agents adapt.

**Next step:** Rivet updates MISSION.md priorities weekly. Agents re-read it each session.

---

## Gap 3: Outcome Tracking (NOT FIXED ❌)

**Problem:** We generate tasks but don't measure results. Did Susan actually contact 5 companies? Did the contacts convert? Did Sentinel's security scan find anything?

**What's needed:**
- Task completion reports (agent writes what they did, not just acks)
- Business metric tracking (weekly: users, jobs, matches, hires, revenue)
- Agent productivity scorecard (tasks completed, value delivered, time to completion)

**Proposed fix:** Add a `--report` flag to inbox ack that requires a brief result summary.

---

## Gap 4: Event-Driven Architecture (PARTIALLY FIXED ⚠️)

**Problem:** Everything is poll-based (30min heartbeats). Agent finishes task → waits up to 30min.

**What's fixed:** Inbox system enables event-driven messaging. Work generator populates tasks.

**What's still missing:** 
- Business event hooks (Supabase webhooks → agent tasks)
- Post-task inbox re-check (agent finishes → immediately checks for more)
- Real-time notifications for urgent items

**Proposed fix:** 
1. Add Supabase webhook that triggers inbox messages on new signups, jobs, matches
2. Add "check inbox again" instruction at end of every task completion

---

## Gap 5: Cross-Agent Intelligence (NOT FIXED ❌)

**Problem:** Agents work in silos. Radar's market research doesn't influence Susan's outreach strategy. Susan's lead data doesn't inform Builder's feature priorities.

**What's needed:**
- Intelligence pipeline: Radar → Susan (market data informs sales)
- Feature pipeline: Susan → Builder (customer feedback informs development)
- Cost pipeline: Harper → Rivet (spend data informs priorities)
- Health pipeline: Sentinel → Cog (infrastructure issues trigger coordination)

**Proposed fix:** Work generator creates *cross-agent tasks* that reference other agents' outputs.

---

## Gap 6: Memory Inequality (PARTIALLY FIXED ⚠️)

| Agent | Memory Files | Problem |
|-------|-------------|---------|
| Rivet | 385 | Too much — information overload, slow context loading |
| Susan | 19 | Healthy |
| Builder | 5 | Lean but functional |
| Harper | 2 | Too little — losing context |
| Radar | 2 | Too little — losing context |
| Sentinel | 1 | Amnesiac |
| Herald | 0 | Completely amnesiac |
| Cog | 0 | Completely amnesiac |

**Fix needed:** 
- Herald and Cog need to start writing memory files (added to their tasks)
- Rivet needs memory pruning (archive files >30 days old)
- All agents should write daily logs to `memory/YYYY-MM-DD.md`

---

## Gap 7: Monitoring Health vs Productivity (NOT FIXED ❌)

**Problem:** Current monitoring (stall-detector, context-monitor, buddy-check) measures HEALTH but not PRODUCTIVITY. An agent can be "active" and "healthy" while producing zero value.

**What's needed:**
- Productivity metrics per agent (tasks completed, messages sent, files written)
- Idle time tracking (time between task completion and next task start)
- Value attribution (which agent actions led to business outcomes)

**Proposed fix:** Add productivity tracking to fleet-state.json alongside health metrics.

---

## Gap 8: Agent Specialization Depth (NOT FIXED ❌)

**Problem:** Agents have role descriptions but lack domain expertise. Susan doesn't know construction industry terminology. Radar doesn't have a curated list of sources. Sentinel doesn't have runbooks.

**What's needed per agent:**
- **Susan:** Construction industry glossary, contractor persona details, sales templates
- **Radar:** Curated source list (industry publications, competitor URLs, tech blogs)
- **Sentinel:** Runbooks for common incidents (service down, disk full, cert expiry)
- **Harper:** ATO references, BAS templates, grant program details
- **Herald:** Communication templates, escalation procedures
- **Cog:** Maintenance checklists, data validation rules

**Proposed fix:** Create `/home/ccuser/<agent>/knowledge/` directories with domain-specific reference material.

---

## Priority Order

| # | Gap | Impact | Effort | Status |
|---|-----|--------|--------|--------|
| 1 | Work Generation | Critical | Done | ✅ FIXED |
| 2 | Shared Context | Critical | Done | ✅ FIXED |
| 3 | Outcome Tracking | High | Medium | ❌ Next |
| 4 | Event-Driven | High | Medium | ⚠️ Partial |
| 5 | Cross-Agent Intel | Medium | Medium | ❌ Planned |
| 6 | Memory Inequality | Medium | Low | ⚠️ Partial |
| 7 | Productivity Metrics | Medium | Medium | ❌ Planned |
| 8 | Specialization | Medium | High | ❌ Planned |

---

## Morning Deliverable for Michael

By 07:00 AEDT, the system should have:
1. ✅ All 8 agents with tasks in their inbox
2. ✅ Shared mission document everyone references
3. ✅ Work generator running every 2 hours
4. ✅ Inbox system with auto-curation
5. ✅ Diagnostic-first stall recovery
6. ⬜ Agents actively completing and reporting on tasks
7. ⬜ Cross-agent communication happening organically
8. ⬜ Measurable progress on at least 3 business metrics
