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
+5
View File
@@ -58,6 +58,11 @@ def test_reflect_revises_and_records_critique(lyra):
# the self-critique was recorded as metacognition
assert any("flattery" in m.lower() for m in state["metacognition"])
# everything she produced was also appended to the permanent journal
import lyra.memory as memory
kinds = {e["kind"] for e in memory.list_journal()}
assert "reflection" in kinds and "metacognition" in kinds
def test_reflect_falls_back_to_draft_if_examine_unparseable(lyra, monkeypatch):
from lyra import llm, self_state