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:
@@ -132,6 +132,15 @@ def create_app() -> FastAPI:
|
||||
state = await asyncio.to_thread(self_state.reflect)
|
||||
return {"ok": True, "mood": state.get("mood")}
|
||||
|
||||
@app.get("/journal")
|
||||
async def journal_page() -> FileResponse:
|
||||
"""Lyra's journal — the permanent, append-only record of her thoughts."""
|
||||
return FileResponse(str(_STATIC / "journal.html"))
|
||||
|
||||
@app.get("/journal/data")
|
||||
async def journal_data(limit: int = 300) -> dict:
|
||||
return {"entries": memory.list_journal(limit=limit)}
|
||||
|
||||
@app.get("/stream/logs")
|
||||
async def stream_logs(request: Request) -> StreamingResponse:
|
||||
"""Live activity feed: replay the recent buffer, then stream new events."""
|
||||
|
||||
Reference in New Issue
Block a user