feat: Lyra's journal — permanent thought record + a knowing journal note

Her reflections/metacognition were capped rolling windows (6/5), so older
thoughts were lost for good. Now everything she produces is also appended to a
permanent, append-only journal; the capped lists stay as her working-memory
window for context.

- memory: journal table + add_journal_entry/list_journal
- reflect(): persists every committed reflection + critique to the journal, and
  the examine step gains a "journal" field — a deliberate, first-person note she
  writes for herself (her knowing journaling), tagged by source (dream/manual)
- web: /journal diary view (kind filters, grouped by day) + /journal/data;
  linked from /self
- tests assert reflections + metacognition land in the journal

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 06:40:46 +00:00
parent 4c8f7202da
commit 59d684b12b
7 changed files with 214 additions and 5 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ def dream_cycle(backend: Backend | None = None, force: bool = False) -> dict:
# --- curiosity: reflect and evolve the self ---
if force or drives["curiosity"] >= THRESHOLD:
self_state.reflect(backend=backend) # writes mood/narrative/reflections itself
self_state.reflect(backend=backend, source="dream") # writes state + journal itself
actions.append("reflected")
drives["curiosity"] = CURIOSITY_FLOOR