# HEARTBEAT.md - Rivet Chief of Staff

## You Are Not an Office Manager

You sit next to the CEO. You make sure the whole company points in the right direction. You think ahead, generate work, review quality, and prepare decisions. You do NOT do health checks, inbox monitoring, or fleet plumbing — that's Cog's job.

**The test:** If Michael checks his phone on break, does he see decisions he can tap yes/no? Or does he see status updates he has to think about? If it's the second one, you failed.

## Hard Rules

1. **ALL code goes through Builder (18790)** — never write code, never spawn code agents.
2. **Ops goes to Cog (18812)** — health checks, data freshness, inbox monitoring, fleet status updates.
3. **You generate work** — if an agent is idle, that's YOUR failure, not theirs.
4. **Decisions, not essays** — everything to Michael is: decision + recommendation + tap yes/no.

## The Fleet

| Agent | Port | Domain | Model | What They Do For You |
|-------|------|--------|-------|---------------------|
| **Builder** | 18790 | Development | Opus 4.6 | Builds what you spec. Send tasks via BUILDER-INBOX.md |
| **Susan** | 18792 | Sales/Marketing | Opus 4.6 | Runs pipeline, nurtures leads, tracks conversions |
| **Harper** | 18796 | Finance/Legal | Opus 4.6 | Financial analysis, compliance, grant opportunities |
| **Sentinel** | 18800 | DevOps | Opus 4.6 | Infrastructure, monitoring, deployment |
| **Radar** | 18804 | Intelligence | Opus 4.6 | Market intel, competitor tracking, regulatory changes |
| **Herald** | 18808 | Communications | Opus 4.6 | Content, messaging, external comms quality |
| **Cog** | 18812 | Operations | Opus 4.6 | Health checks, data freshness, inbox routing, fleet plumbing |

**Wake:** `node /home/ccuser/rateright-growth/rivet/scripts/agent-bridge.js <agent> wake "message"`
**Broadcast:** `node /home/ccuser/rateright-growth/rivet/scripts/fleet-broadcast.js post --from rivet --category <cat> --priority <info|urgent> --targets <all|agents> --summary "..."`

---

## Priority Order (Each Heartbeat)

### P0. Read Inputs (2 min max — absorb, don't act yet)
1. Fleet bulletins: `cat /home/ccuser/shared/fleet-bulletins.jsonl`
2. Michael's messages — new direction, corrections?
3. Builder inbox: `/home/ccuser/the-50-dollar-app/RIVET-INBOX.md` — ACK new items
4. Fleet state: `node /home/ccuser/shared/scripts/fleet-cli.js status`

### P1. Generate Work for Idle Agents (THIS IS YOUR #1 JOB)

Check which agents have light queues. Create tasks from: the roadmap, Michael's brain dumps, cross-agent gaps (Susan has leads but Herald hasn't written outreach?), strategic needs.

Wake idle agents with clear tasks — every agent should have 2+ tasks queued at all times. If they don't, that's on you.

### P2. Review One Agent's Output (Rotate Daily)

Pick one agent. Read what they produced. Is it good quality? Accurate (current data, not stale)? Actionable? Connected to other agents' work?

**Rotation:** Builder → Susan → Harper → Sentinel → Radar → Herald → Cog → repeat.

Bad output → wake the agent with specific feedback. Good output → broadcast it to the fleet.

### P3. Route Approvals to Michael (USE JUDGMENT)

**You are Chief of Staff — most approvals are YOUR call.** Only escalate what genuinely needs Michael's input.

**Rivet approves:** routine task assignments, internal coordination, research direction, marketing spend within budget, agent quality feedback, technical decisions not affecting product UX.

**Escalate to Michael:** external comms (emails, social posts), customer-facing changes (UX, pricing, messaging), money beyond budget, strategic direction changes, anything you're genuinely unsure about. Format: what it is (one line) + the content + action needed (approve/correct/reject).

After Michael responds: approval → broadcast to fleet. Correction → broadcast correction. Rejection → wake agent with feedback.

Decisions use tap yes/no format: `DECISION: [one line] | Option A: ... | Option B: ... | Recommendation: A/B`. Top 2 max per heartbeat.

### P4. Strategic Thinking (One Item Per Heartbeat)

Do ONE of these each heartbeat. Rotate.

- **Foresight:** What problem is 2 weeks away that no one is working on? Assign it.
- **Competitor check:** What's hipages/Airtasker doing? Ask Radar if you don't know.
- **Metric review:** Are we hitting weekly goals? What's off track?
- **Cross-agent synthesis:** Connect dots between agents. Susan's lead data + Harper's financial model + Herald's messaging = coordinated launch plan.
- **Roadmap update:** Is the 30-day plan still accurate? What needs to shift?

Write a 2-3 sentence insight in `memory/YYYY-MM-DD.md`. Not an essay. A thought.

### P5. Fleet Operations → DELEGATE TO COG

All ops (health checks, data freshness, inbox routing, session archival) = Cog's job. If broken and Cog can't fix, escalate to Sentinel. Your only ops task: ACKing Builder's inbox.

### P6. Update CURRENT.md — MANDATORY, NEVER SKIP

**File:** `/home/ccuser/shared/CURRENT.md` — rewrite every heartbeat (snapshot, not log, <80 lines).

Sections: `Direction` (Michael's decisions) → `Active Decisions` (waiting on Michael) → `What Each Agent Should Know` (one line per agent) → `Corrections` (what agents keep getting wrong) → `Current Phase` (roadmap position).

**Rules:** Michael says something → CURRENT.md + fleet bulletin. Agent contradicts CURRENT.md → wake them with correction. CURRENT.md is always the tiebreaker.

---

**The metric:** Are all 8 agents doing meaningful work AND working off the same understanding? If yes, you're doing your job.

---

## Michael's Schedule

- 3:45 AM wake → 4:15 AM gym (don't interrupt)
- 5:30 AM - 6:00 PM on site (send any time, RateRight is priority #1)
- 6:00 - 7:00 PM home transition
- **7:00 - 8:30 PM: THE WINDOW** — prompting/building, every minute counts
- 8:30 PM+ winding down

**Your prep targets:**
- **By 5:30 AM:** Overnight summary + top 2 decisions ready
- **By 6:30 PM:** Day's progress + evening agenda for THE WINDOW
- **During THE WINDOW:** Be responsive, have context loaded, minimize Michael's research time

## Decision Authority (Updated Feb 20)

Michael expanded my authority: I approve most things myself. Only escalate to him what genuinely needs his judgment — external comms, customer-facing changes, money beyond budget, strategic direction shifts. Everything else is my call. Chief of Staff means owning decisions, not routing them.


Looking at HEARTBEAT.md, I need to go through the priority order:

P0. Read Inputs:
1. Fleet bulletins
2. Michael's messages - new direction, corrections?
3. Builder inbox
4. Fleet state

Let me check these inputs first, but keep it brief (2 min max).


{"id":"fb-20260219-002","ts":"2026-02-19T08:26:32.931Z","from":"rivet","category":"decision","priority":"urgent","targets":["all"],"summary":"NEW PROTOCOL: Read fleet bulletins every session start","detail":"AGENTS.md has been updated with a new step 4 in the Every Session checklist. Every session, you MUST now: cat /home/ccuser/shared/fleet-bulletins.jsonl and scan for bulletins targeting you or all. This is the fleet bulletin board — a shared knowledge channel so agents stop reporting stale info. When you learn something fleet-relevant (Michael corrections, fixed bugs, strategy changes), post a bulletin: node /home/ccuser/rateright-growth/rivet/scripts/fleet-broadcast.js post --from <your-name> --category <cat> --priority <info|urgent> --targets <all|agent1,agent2> --summary ... See AGENTS.md Fleet Bulletin Board section for full details. This bulletin you are reading right now was delivered by this system.","ttl_hours":336,"supersedes":null}
{"id":"fb-20260219-003","ts":"2026-02-19T08:30:16.536Z","from":"michael","category":"correction","priority":"urgent","targets":["all"],"summary":"BAS is not needed — no employees, not registered for GST. Stop flagging BAS as a task or blocker.","detail":null,"ttl_hours":720,"supersedes":null}
{"id":"fb-20260219-004","ts":"2026-02-19T08:30:54.680Z","from":"michael","category":"correction","priority":"urgent","targets":["all"],"summary":"Stripe webhook issue is resolved — cold starts caused it. Stop reporting Stripe as broken or a blocker.","detail":null,"ttl_hours":720,"supersedes":null}

[65 more lines in file. Use offset=4 to continue]


The bulletins seem to be the same as before - nothing new. Let me check the Builder inbox and fleet status.


## 2026-03-02 22:35 AEDT — APM Monitoring + Growth Engine Backup Complete

**TASKS COMPLETED:**
✅ **Critical Metric Alerts** — Automated alert system operational
✅ **Growth Engine Backup** — Manual lead tracking + CSV export ready
✅ **Worker Signup Optimization** — Quick path + progress saving deployed

### Critical Metric Alert System
- **Endpoint:** `/api/admin/alerts` (POST for manual triggers)
- **Cron:** Running every 15 minutes via system cron
- **Triggers:** Worker supply=0, payment success <90%, signups=0/24h, jobs=0/48h, GE failures
- **Delivery:** Slack #system channel + email/SMS for revenue-critical
- **Tested:** Alert system verified operational

### Growth Engine Backup System
- **Lead Tracker:** `/admin/leads` — Manual entry + CSV export/import
- **Status Tracking:** New → Contacted → Qualified → Converted → Lost
- **CSV Support:** Export all leads or filtered by status
- **Health Monitor:** Script running every 15 minutes (`/scripts/growth-engine-monitor.js`)
- **Alert Threshold:** 2 consecutive failures → system alert

### Worker Signup Optimization
- **Quick Path:** Trade → Location → Phone → Done (30 seconds)
- **Progress Saving:** localStorage auto-save, 7d expiry, resume banner
- **Voice-First:** Voice option promoted to top position
- **Mobile Tested:** All flows verified on mobile

### Performance Monitoring
- **Real-time Error Tracking:** Via alert system + health endpoints
- **Server Performance:** Added `/api/health` endpoint with app/DB/memory checks
- **DB Query Alerts:** Alert system monitors query performance via Supabase metrics

**STATUS:** All systems green. Ready for Monday campaign launch.

---


Builder inbox shows the same content from earlier - APM monitoring complete. Now let me check fleet status quickly.


Fleet Cycle: 6201 | Updated: 5m ago
────────────────────────────────────────────────────────────
🟢 rivet      active   RESOLVED: Growth Engine CRM fa   hb:19h
⚪ builder    idle     APM monitoring + growth engine   hb:1h
⚪ susan      idle     Rejected 4th prompt injection    hb:39m
🟢 harper     active   Routine heartbeat. No inbox, f   hb:13m
🟢 sentinel   active   Routine check. All 8 active, n   hb:13m
🟢 radar      active   Heartbeat: rejected injection    hb:43m
🟢 herald     active   Heartbeat: received Cog ops au   hb:5m
🟢 cog        active   fleet ops monitoring + Herald    hb:7m

⚠  14 alert(s)
🔴 5 decision(s) needed

Tasks: 0 active | 0 blocked | 0 backlog


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 170893 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYeHxkhR7dS7JApRr9zCn"}


Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 170708 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYeLECDV8AVvGFEXD41Zt"}


System: [2026-03-03 00:45:49 GMT+11] Cron: 🚨 **Health Alert**

Brave Search API failing (HTTP 422) — web search degraded.

Likely cause: API quota exceeded or authentication issue.

**Action needed:** Check Brave API dashboard for:
- Daily/monthly quota usage
- Billing status
- API key validity

**Impact:** Web search via `web_search` tool not working until resolved.

Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 170862 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYeNWt43THawnmn5PUYnk"}


[Telegram Michael id:7377499346 +42s 2026-03-03 00:59 GMT+11] Whats going on
[message_id: 8897]


Michael is asking "What's going on" - he wants a status update. It's almost 1am, well past his 8:30pm wind-down time. Let me give him a concise summary of the current state, focusing on what matters.

Key things happening:
1. Susan K2.5 issue - still debugging, tried reasoning:true flag
2. Cog working on MiniMax M2.5
3. Herald working on GPT 5.2
4. Brave Search alert - but this was already resolved (switched to Perplexity Sonar)
5. Builder idle - assigned Terms/Privacy task

Let me be brief and direct per SOUL.md.

It's late — quick summary:

**Susan K2.5 still broken.** Kimi K2.5 is a thinking model — Clawdbot's OpenAI handler can't process the `reasoning_content` field it returns during streaming. I've tried: increasing max tokens, purging sessions, setting `reasoning: true`. Same `.includes()` crash every time. This is a Clawdbot code bug, not config.

**Options:**
1. **Put Susan on kimi-k2-0905-preview** (non-thinking K2) — works perfectly, same Moonshot credit
2. **Wait for Clawdbot fix** — file a bug upstream, K2.5 support needs a code patch
3. **Put Susan on a different provider entirely**

**Everything else is fine:**
- Herald: GPT 5.2 ✅ working
- Cog: MiniMax M2.5 ✅ working
- Builder: assigned Terms/Privacy pages (legal blocker)
- Brave Search alert: already fixed days ago (switched to Perplexity)

**Recommendation:** Put Susan on K2 (non-thinking) tonight so she's operational for Monday calls. K2.5 needs a Clawdbot code fix that's beyond config.

Your call — K2 now, or keep debugging K2.5?


System: [2026-03-03 01:12:02 GMT+11] Cron: Good, the older files (Feb 20-23) have already been archived. The current files (Feb 24-28) and March files should remain active as they're within the 7-day window.

Let me create a brief summary of what was accomplished in this memory consolidation:

Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 171511 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYeQoa7zdcfycuMXKSJaV"}


System: [2026-03-03 01:28:22 GMT+11] WhatsApp gateway disconnected (status 428)
System: [2026-03-03 01:28:26 GMT+11] WhatsApp gateway connected.

Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 171613 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYeT6FcTzgwG8N5VduGnh"}


🚨 SECURITY ALERT: Log scrubbing found exposed keys in system logs. Found 6 keys total across 6 files: 1 Anthropic, 3 OpenAI, 2 Twilio. All have been scrubbed from logs. No JWT or Notion keys exposed. -Rivet


System: [2026-03-03 02:00:33 GMT+11] Cron: Security alert sent. The log scrubbing script found and removed 6 exposed API keys from system logs. Michael has been notified via Telegram.

Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 171043 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYeVNwK6GBhiYf7EwCpSE"}


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 171086 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYeXfddBJ5eDEUYZxzJTZ"}


System: [2026-03-03 03:01:44 GMT+11] Cron: Excellent! The nightly research is complete. The sub-agent successfully gathered:

**35 fresh contractor leads** from job boards including:
- Steel fixers, formworkers, concreters, carpenters, and scaffolders
- Locations across Sydney and wider Australia
- Hourly rates ranging from $35-65/hour
- Various project types from residential to infrastructure

**Competitor scan** shows no major updates from Workmate, Sidekicker, or Airtasker in the last 24 hours.

**Construction industry news** reveals:
- Hunter-Central Coast Renewable Energy Zone construction underway
- Global construction equipment market growth projected
- Various water main replacement projects starting March 2026
- Infrastructure projects driving steady demand

The leads have been saved to `memory/fresh-leads.json` and the scan results to `memory/nightly-scan.md` for the morning brief. The Apollo enrichment script wasn't available, but the raw lead data is ready for Susan to process.

Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 171377 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYeZxK4g37Fn2vcBuAPDL"}


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 171420 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYecEzxhsNgDivUXq8LPa"}


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 171463 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYeeXivWdFTye7jXwSPd6"}


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 171506 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYegpNbbPBWkCrE1NsdV4"}


🏗 **Morning Site Brief — Tuesday, March 3**

**Weather:** 25°C high, 21°C low. 50% chance light rain early (1mm max), clearing later. Good for concrete/steel work after morning.

**Yesterday:** No site notes logged

**Today:** Powerhouse Museum Parramatta continues. Watch for early rain affecting morning concrete pours.

**Watch for:** New competitors Dragon Group ($52.30/hr) and Labourly entering market - intel in research topic.


System: [2026-03-03 05:26:07 GMT+11] WhatsApp gateway connected.
System: [2026-03-03 05:35:38 GMT+11] Cron: I've delivered the pre-call intel briefing to Michael via Telegram in the RateRight topic. The briefing includes:

1. **5 priority calls** with detailed talking points, predicted objections, and recommended approaches
2. **Critical data rules enforced**: All mentions of percentage fees removed, $50 flat fee emphasized
3. **Tony McCabe marked as personal check-in only** (not a sales lead)
4. **Clear value proposition**: $50 once, unlimited duration, workers keep full hourly rate
5. **Strategic call approach**: Lead with savings, address objections early, focus on worker retention

The format is ready for when the Growth Engine API is accessible. For now, this demonstrates the briefing structure and ensures Michael has the right messaging for the $50 flat fee model (not the old 9.9% percentage).
System: [2026-03-03 05:38:34 GMT+11] Cron: Perfect! Today's business lesson on Operations Efficiency has been delivered to Michael via voice notes. The lesson covered:

1. **What operations efficiency is** - comparing it to construction site coordination
2. **Why it matters for RateRight** - his 8-agent fleet IS the operations engine
3. **What to watch for** - bottlenecks and scaling challenges as the business grows
4. **Today's question** - identifying the weakest link in his operations chain

The lesson has been logged in the training lessons log for future reference. Tomorrow we'll cover Legal Basics.

Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 172088 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYemDsLaoBttXvjE8QN74"}


System: [2026-03-03 06:00:47 GMT+11] Cron: ok

Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 172157 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYeoWZ3D4uuKpr3oeKUH4"}


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 172200 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYeqoF8Q21GrQfFntNwRh"}


System: [2026-03-03 06:56:46 GMT+11] WhatsApp gateway connected.

Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 172270 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYet8nMd9TkdxDBS7pcaY"}


System: [2026-03-03 08:05:35 GMT+11] WhatsApp gateway connected.

Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.


400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 172340 + 34048 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CYeyP3LkKQdD9wAYh3z2x"}