wake-up/wrap-up: codify MemPalace 5-step protocol

MemPalace has always had a full memory protocol embedded in its
status response, but the skills were treating it as a library
catalog — one search on wake, nothing on wrap. Inspection revealed
the gap: the KG was empty (0 entities, 0 triples ever), and the
diary had exactly one entry, from 2026-04-09. Storage without
protocol is not memory; it is unindexed potential.

The protocol, as MemPalace itself states it:
  1. ON WAKE-UP: mempalace_status (loads protocol + AAAK spec)
  2. BEFORE RESPONDING: kg_query or search first; never guess
  3. IF UNSURE: "let me check" and query — wrong is worse than slow
  4. AFTER EACH SESSION: diary_write in AAAK format
  5. WHEN FACTS CHANGE: kg_invalidate old, kg_add new

wake-up changes:
- Step b.0: mempalace_status first (loads protocol, not just data)
- Step b.1: diary_read for claude-code agent (last 3 entries) —
  the previous self's voice
- Step b.2: kg_query on claude-code (drift patterns to hold today)
  and on pulling-thread subjects (authoritative current state)
- Step b.3: semantic searches as before
- Constraints: MemPalace is primary memory; when it disagrees with
  a memory file, trust MemPalace

wrap-up changes:
- Step 4 split into 4.a (drawer — semantic full content) and
  4.b (diary_write — AAAK compressed agent voice). Both surfaces;
  different future queries.
- New step 5: kg_invalidate facts that changed this session; kg_add
  new drift patterns, decisions, entities.
- Output template surfaces diary + KG update counts, not just drawer.

The drift-pattern handling replaces the proposed patterns-i-drift-
toward.md file idea. KG is the better home: queryable, temporal,
invalidatable. When a return is a repeat, kg_add it; wake-up's
kg_query surfaces it next session.

Verified by usage on today's session: diary entry filed (AAAK),
3 KG facts added (drift-pattern register-import-without-checking,
ARC versioning-regime ADR-005, after-the-reply-sequence staged).
This is the first real exercise of the protocol.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
David F Glidden
2026-04-17 14:19:09 +02:00
co-authored by Claude Opus 4.7
parent 5f3ea1a695
commit 7a71c7a07c
2 changed files with 55 additions and 15 deletions
+16 -9
View File
@@ -45,16 +45,23 @@ Run these in parallel to minimize latency:
- Read the Active Session memory file referenced there — **specifically extract the pulling thread + literal question + open horizons**
- Read `~/.claude/projects/-Users-davidglidden/memory/session-ledger-[previous-date].md` if it exists — **specifically read the "Returns" and "Confidence to recalibrate" sections** for mood signal
**b. MemPalace — multi-query reconstruction**
**b. MemPalace — the memory protocol, not a search**
Run multiple targeted searches to reconstruct the full working state. MemPalace MCP tools are wired at user scope and should always be available.
MemPalace is primary memory, not a library catalog. Follow its 5-step protocol (the system itself reminds you of this when you call `mempalace_status` — that's intentional; re-reading the protocol every wake keeps it operative).
- **Last session's pulling thread:** `mempalace_search` query using keywords from the previous /wrap-up's pulling thread, in wing `claude-sessions`
- **Active workstream:** `mempalace_search` query based on what the session memory identifies as the active work
- **Recent thinking:** `mempalace_search` query "recent decisions rationale" in wing `capablemind-thinking`
- **Steward's recent notes:** `mempalace_search` query "daily log" in wing `obsidian-vault`
**b.0. Status + protocol reload.** Call `mempalace_status` first. This returns palace overview, 5-step protocol, AAAK spec. The protocol is the reason MemPalace exists; never skip this step.
Use the results to reconstruct *why* we were doing what we were doing, in service of the pulling thread.
**b.1. Diary — what the previous self recorded.** `mempalace_diary_read` with `agent_name: "claude-code"`, `last_n: 3`. Diary entries are in AAAK format (compressed, entity-coded, emotion-marked); read them as the previous session's internal voice, not metadata.
**b.2. Knowledge graph — active facts and drift patterns.** `mempalace_kg_query` for entity `"claude-code"` to retrieve drift patterns (things I've returned from in past sessions, worth holding today). Also query the pulling-thread subjects (e.g., `"after-the-reply-sequence"`, `"ARC-essays"`) for their authoritative current state — not the point-in-time version frozen in memory files.
**b.3. Semantic searches.** Multiple `mempalace_search` queries to reconstruct working context:
- Last session's pulling thread — in wing `claude-sessions`
- Active workstream — based on what the session memory identifies as active
- Recent thinking — `"recent decisions rationale"` in wing `capablemind-thinking`
- Steward's recent notes — `"daily log"` in wing `obsidian-vault`
Use results to reconstruct *why* we were doing what we were doing, in service of the pulling thread.
**c. Governance state**
- Read `~/PENDING.md` — extract items with status PENDING
@@ -113,8 +120,8 @@ Ready when you are.
## Important constraints
- **MemPalace is primary, not fallback.** Query it first and lean on it heavily. It has 100,000+ drawers across thinking docs, transcripts, and vault.
- **Memory files are secondary.** They capture what was surprising or non-obvious. MemPalace has the full record.
- **MemPalace is primary memory, not fallback.** Follow its 5-step protocol (wake `status`, pre-response `kg_query`/`search`, "let me check" if unsure, `diary_write` at session end, `kg_invalidate` + `kg_add` when facts change). 127,000+ drawers across thinking docs, transcripts, and vault — but storage only becomes memory when the protocol is exercised.
- **Memory files are secondary.** They capture what was surprising or non-obvious. MemPalace has the authoritative record. When memory files and MemPalace disagree, trust MemPalace (it's maintained across sessions; files are point-in-time snapshots).
- **The pulling thread comes before facts.** Even if the briefing's other content is rich, lead with the thread. If the thread can't be found in the previous /wrap-up, say so honestly — this is itself a signal that the previous wrap-up was incomplete.
- **The literal question is read verbatim.** Don't paraphrase, don't try to answer it, don't decide it's stale without evidence.
- **Don't read CLAUDE.md** — loaded automatically by the system.