---
created: 2026-03-12
source: Rivet
tags: [agent-archive, rivet]
---

# System Gaps Fix Plan
*Created: 2026-02-07 17:41 AEST*

## Gap 1: Topic Agent Context Without Michael
**Problem:** Topic agents only get context when Michael pastes reports.
**Fix:** After every work session, write a context summary to each topic agent's profile file under a `## Latest Context` section. Topic agents read their own profile on startup — no paste needed.
**Implementation:** Update heartbeat to auto-append context to agent profile files after work completes.

## Gap 2: TODO.md Write Conflicts
**Problem:** Multiple agents writing TODO.md simultaneously = overwrites.
**Fix:** Create `TODO-INBOX.md` as a staging file. Agents append there. Rivet merges into TODO.md during heartbeats, deduplicating and prioritizing.
**Implementation:** Create TODO-INBOX.md, update all agent profiles to point to inbox, heartbeat merges inbox → TODO.md.

## Gap 3: Stale Task Detection
**Problem:** Tasks sit untouched forever with no escalation.
**Fix:** Add `[added:YYYY-MM-DD]` date tags to new TODO items. Heartbeat checks age — >48hrs without progress gets flagged. >7 days gets killed or escalated to Michael.
**Implementation:** Add age-check logic to heartbeat orchestration step.

## Gap 4: Sub-Agent Reliability
**Problem:** Kimi agents fail silently or produce garbage ~20% of the time.
**Fix:** After every spawn completion, verify the output exists and is reasonable. Log failures to `memory/agent-failures.md`. Retry critical tasks with Sonnet if Kimi fails.
**Implementation:** Add verification step to heartbeat after checking spawn results.

## Gap 5: Spend Tracking
**Problem:** Unlimited agent spawning could burn credits.
**Fix:** Track spawns in `memory/spawn-tracker.json` — max 5 spawns per heartbeat cycle, max 30 per day. Log model + estimated cost.
**Implementation:** Create tracker file, check limits before spawning.

## Gap 6: Quality Feedback Loop
**Problem:** Bad work doesn't improve future work.
**Fix:** Create `memory/lessons-learned.md` — log what went wrong, what model was used, what the fix was. Feed key lessons back into agent profiles monthly.
**Implementation:** Create lessons file, update heartbeat to log failures there.

## Gap 7: Dual-Mode Execution
**Problem:** Can't control topic agents when Michael is offline.
**Fix:** Already solved — spawn sub-agents for overnight work, report to topic chats. Make this explicit in HEARTBEAT.md: "When Michael is offline, YOU are the executor via sub-agents. Topic agents are for interactive sessions only."
**Implementation:** Update HEARTBEAT.md with dual-mode instructions.
