feat: poker-session notes are session narration, tagged by construction

The HUD's "her notes" panel showed any journal/note entry in the session's time
window — which swept in her *autonomous* journaling (dream-cycle reflections,
thought loop, existential musings) that merely overlapped in time. So a poker
session displayed her feelings, not the night.

Fix both halves:
- Identity: the `note` tool stamps `source=poker:{id}` when a session is live, so
  a session note is identifiable by construction. The HUD filters on that tag
  (kind='note' only) instead of a time window — her journaling has a different
  source and can never leak onto the poker HUD. `journal_write` stays her private
  journal and never shows here.
- Behavior: the Cash card now tells her to use `note` as a running SESSION LOG —
  factual beats a hand/stack log misses (table dynamics, Brian's arc, momentum),
  beat-reporter not diarist — and explicitly keeps feelings/reflection off the
  table. The note tool spec echoes this for the live-session case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-03 19:41:35 +00:00
parent 71bbe07220
commit 7f23aeae17
4 changed files with 49 additions and 26 deletions
+8 -9
View File
@@ -1298,17 +1298,16 @@ def hud(session_id: int | None = None) -> dict | None:
for h in list_hands(sid)
]
# Notes she jotted *during* this session: journal/note entries inside its
# [started_at, ended_at] window. A live session has no end yet, so it stays
# open-ended; without the upper bound a closed session would keep absorbing
# every note she writes long after it's over.
started = s.get("started_at") or ""
ended = s.get("ended_at") or None
# Her session narration: notes she took *for this session*, identified by the
# `poker:{id}` source tag stamped at write time (see tools._note) — NOT by a
# time window. Her autonomous journaling (dream-cycle reflections, thought
# loop, existential musings) has a different source, so it can never leak onto
# the poker HUD.
tag = f"poker:{sid}"
notes = [
{"created_at": j["created_at"], "kind": j["kind"], "content": j["content"]}
for j in memory.list_journal(kinds=("note", "journal"))
if (j["created_at"] or "") >= started
and (ended is None or (j["created_at"] or "") <= ended)
for j in memory.list_journal(kinds=("note",))
if (j.get("source") or "") == tag
][:20]
stats = session_stats(sid)