# Dorian Memory System — Audit Report
**Date:** 2026-04-06
**Initiated by:** Braden McLeish
**Triggered by:** False positive alert from Dorian at 2:10 AM (missing `knowledge/daily/2026-04-06.md`)

---

## Background

Dorian reported two errors this morning:

1. Missing file `knowledge/daily/2026-04-06.md` with missing section `## Critical Facts Retrieval Check (auto)`
2. Agent roster mismatch — expected 5 agents, found 6, with unexpected agent `ops-manager`

Error 2 was resolved immediately: `ops-manager` is a legitimate v1 specialist defined in AGENTS.md and Section 3.3 of SPECIALIST-ARCHITECTURE.md. The architecture diagram simply hadn't been updated when `ops-manager` was implemented. Fixed by updating the "Current State" diagram in `SPECIALIST-ARCHITECTURE.md` to reflect 6 agents.

Error 1 was a false positive — the file existed with all 3 facts passing. This triggered a deeper audit of the memory system.

---

## Memory System Architecture (Reference)

Dorian's memory system is file-based, explicit, and deterministic. All continuity is achieved through structured files, controlled load order, and explicit write operations. If something is not written to a file, it does not persist.

### Three Memory Layers

**Layer 1 — Long-Term Memory (Curated)**
File: `MEMORY.md`
Manually curated, stable, high-signal. Contains preferences, key decisions, active projects, operational rules, and important user context. Loaded only in main sessions (never in shared/group contexts).

**Layer 2 — Short-Term Memory (Daily Logs)**
Files: `memory/YYYY-MM-DD.md`
Append-only, time-scoped, agent-written. Captures events, actions, decisions, and intermediate context. Always read (today + yesterday) at session start.

**Layer 3 — Working Memory (Thread State)**
Files: `memory/active-thread.md` + daily checkpoint logs
Tracks active thread ID, title, status, and last user intent. Closest to "live RAM." Must update on every thread switch.

### Deterministic Load Order (Every Session)
1. `SOUL.md` → identity + behavior rules
2. `USER.md` → who the user is
3. `memory/YYYY-MM-DD.md` (today + yesterday) → recent context
4. `MEMORY.md` → ONLY if main session

### Two Automated Layers
- `knowledge/daily/YYYY-MM-DD.md` — cron-written at 2:00 AM daily by `memory-consolidate` LaunchAgent. Structured audit layer including Critical Facts Retrieval Check.
- `memory/YYYY-MM-DD.md` — agent-written during sessions. Event log. Consolidate script reads from this as input for candidate promotions into `knowledge/daily/`.

---

## Audit Findings

### What Is Working

| Component | Status | Notes |
|---|---|---|
| `knowledge/daily/` | ✅ Healthy | Gap-free since 2026-03-09 (28 consecutive days). Cron-driven, reliable. |
| Core identity files | ✅ Current | SOUL.md, USER.md, AGENTS.md all present and current. |
| LaunchAgent infrastructure | ✅ Loaded | Mostly clean exits. |
| `consolidate.sh` logic | ✅ Correct | Correctly creates daily file and runs Critical Facts check. |
| File creation timing | ✅ No race condition | `knowledge/daily/2026-04-06.md` was created at 02:00:06 AM, well before the 2:10 AM alert. |

### What Is Broken or Drifted

#### 1. Root `dashboard-data.json` — Stale Path (HIGH)
**Root cause of this morning's false positive.**

Two `dashboard-data.json` files exist:
- `/workspace/dashboard-data.json` — last modified **2026-03-06**. Frozen snapshot from the day the script first ran when no daily file existed. Permanently shows `"Critical Facts Unknown"`. Never updated.
- `/workspace/tmp/dashboard-data.json` — last modified **2026-04-05**. The live file written by `build_dashboard_data.py` on every refresh.

`build_dashboard_data.py` writes to `tmp/dashboard-data.json`. Whatever Dorian reads for alerts reads the root file. The path mismatch means every Critical Facts alert since March 6 has been based on 30-day-old data.

#### 2. Stuck Pending Promotion — Persistent Exit Code 2 (MEDIUM)
`consolidate.sh` exits with code 2 whenever pending promotions exist. A single item from **2026-03-09** referencing "hook-ingress/gateway update" has caused exit code 2 every night for 28 days. Since `hook-ingress` is not a defined system in this workspace, it will never self-resolve.

Impact: every consolidate failure looks identical to normal operation. Real failures are masked.

#### 3. `active-thread.md` Stale (MEDIUM)
Last updated: **2026-03-01** (36 days ago). Still references the `pipeline-guardrails` thread, which was completed in early March. The file is functioning as dead state rather than live working memory. Per `PIPELINES.md`, it should update on every thread switch — it hasn't been touched in over a month.

#### 4. `MEMORY.md` Not Being Curated (MEDIUM)
The curation step (distilling daily logs into long-term knowledge) is not firing reliably. There is no automated writer for `MEMORY.md` — it depends on Dorian doing it during sessions.

| Section | Last Updated | Status |
|---|---|---|
| Profile / Working Preferences | Foundational | ✅ Current |
| Active Projects | No timestamps | ⚠️ Moderately stale |
| Key Decisions | 2026-03-05 | ❌ 32 days without new entries |
| Change Log | 2026-03-24 | ⚠️ 13 days stale |
| Open Loops | Undated | ❌ References February events ("dedicated computer arriving Wednesday") |

Significant work since March 24 not recorded: gateway reinstall, Ralphs sync, ops-manager deployment, specialist architecture going live.

#### 5. `memory/` Session Gaps (LOW-MEDIUM)
16 gap days since 2026-02-21, including a notable **5-day dead zone: March 29 – April 2** with no daily log. These are not infrastructure failures — the agent simply didn't write to memory during sessions on those days. Today (April 6) has no entry yet.

#### 6. HEARTBEAT.md Session Baseline Undefined (LOW)
HEARTBEAT.md contains only two checks. The session count check has no defined baseline, making it a no-op — drift cannot be measured without a reference point.

---

## Priority Fixes

| Priority | Fix | Detail |
|---|---|---|
| 1 — HIGH | Fix `dashboard-data.json` path split | Update reader to point to `tmp/dashboard-data.json` or delete frozen root file. Eliminates false positives. |
| 2 — MEDIUM | Dismiss stuck pending promotion | Move 2026-03-09 "hook-ingress" item to Closed in `pending-promotions.md`. Restores meaningful exit codes. |
| 3 — MEDIUM | Update `active-thread.md` | Mark pipeline-guardrails as resolved. Reflect current reality. |
| 4 — MEDIUM | MEMORY.md curation pass | Prune stale Open Loops. Add Key Decisions and Change Log entries for March 24 – April 6. |
| 5 — LOW | Define HEARTBEAT.md session baseline | Establish normal session count so the check can detect real drift. |

---

## Key Takeaway

The automated infrastructure (`knowledge/daily/`, LaunchAgents, consolidate timing) is healthy and reliable. The failure points are all in the agent-dependent layer — memory that requires Dorian to actively write during sessions. The 5-day dead zone and 32-day gap in Key Decisions suggest session-end memory discipline has eroded. Fixing the dashboard path and pending promotion clears the noise. The curation fixes restore the system to its designed operating state.

---

*Audit conducted 2026-04-06 using Claude Code for filesystem access.*
