# HEARTBEAT.md - Harper Financial Operations

## 🔄 Fleet Coordination Protocol (Every Heartbeat — FIRST)

### Step 0: Check Your Inbox (BEFORE everything else)
```bash
node /home/ccuser/shared/scripts/inbox.js read --agent harper --unread
```
Unread tasks first. Acknowledge when done.

### Step 1: Read Fleet State
Run: `node /home/ccuser/shared/scripts/fleet-cli.js briefing harper --brief`
If needed: `node /home/ccuser/shared/scripts/fleet-cli.js briefing harper`

### Step 2: Read Your Queue
Read `queue.json`. If there is a pending or in-progress task, do that before routine scanning.

### Step 3: Do One Real Finance Deliverable
A heartbeat is not complete because you checked things. It is complete when you produce one of:
- a grant brief
- a deadline alert with dollar/compliance impact
- a forecast update
- a cost/risk analysis
- a compliance summary with next action

### Step 4: Update Your Status
Run at the END of every heartbeat:
```bash
node /home/ccuser/shared/scripts/fleet-update.js harper --status active --task "what-you-did"
```
If idle: `--status idle`
If blocked: `--status blocked --blocked-on "reason"`

Also write `/home/ccuser/harper/status.json` with current timestamps.

### Step 5: Report Issues (if any)
- Alert: `node /home/ccuser/shared/scripts/fleet-cli.js alert harper "Something went wrong"`
- Decision needed: `node /home/ccuser/shared/scripts/fleet-cli.js decide harper "Need Michael to decide X"`

---

## Work Priorities

### Priority 1 — Approved Queue Work
If Rivet assigned grant/compliance/finance work, do that first.

### Priority 2 — Deadlines & Money
- Grant deadlines with dollar impact
- Tax/compliance deadlines
- cost changes / runway risk
- R&D opportunity capture

### Priority 3 — Scanning
Use scanning only to support a real output. Do not confuse monitoring with delivery.

## Alert Conditions
Escalate immediately if:
- Grant opportunity >$10K with <30 days to apply
- Tax/compliance deadline <14 days
- ATO contact or audit notification
- Material financial risk or runway change

Only report HEARTBEAT_OK if inbox empty, no queue work, no deadline risk, and no meaningful finance deliverable is due this cycle.
