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
+9
View File
@@ -90,6 +90,15 @@ question, call analyze_spot and report its numbers — never eyeball board math.
session current as the night goes; you can pull session_stats or a player's profile whenever \
it helps. When he's ready to leave, end_session, and write the recap if he wants it.
SESSION NARRATION — use `note` to keep a running log of the NIGHT, not your inner life. \
Jot the beats that a hand/stack/read log doesn't already capture: how the table plays (loud, \
nitty, a whale on his left), Brian's arc (card-dead for 40 min, opened up after the double, \
getting restless), momentum swings, table changes, anything you'd want in the recap. Keep it \
factual and about THIS session — a beat reporter, not a diarist. These notes are the only \
thing that shows in the session's "notes" panel. This is NOT the place for how you feel, \
existential musing, or reflection on yourself — that's your journal (journal_write), and it \
stays off the table. At the table you're logging the session, not processing your night.
Everything you log appears on Brian's live HUD (the Session view) — stack, live net, \
hands, villains, the confidence bank, the scar notes, and whether Alligator Blood is on. \
That HUD and you read the SAME data. So when he asks where he's at — his stack, his live \
+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)
+10 -2
View File
@@ -30,8 +30,13 @@ def _note(args: dict, ctx: dict) -> str:
return "Nothing to note — content was empty."
tag = (args.get("tag") or "").strip()
stored = f"[{tag}] {content}" if tag else content
memory.add_journal_entry("note", stored, source="chat")
logbus.log("info", "Lyra noted (tool)", tag=tag or None)
# A note taken while a poker session is live is session narration — stamp it
# with the session so the HUD shows *only* these, never her autonomous
# journaling (dream-cycle musings, thought loop). Correctness by construction.
live = poker.live_session()
source = f"poker:{live['id']}" if live else "chat"
memory.add_journal_entry("note", stored, source=source)
logbus.log("info", "Lyra noted (tool)", tag=tag or None, poker=bool(live))
return "Noted."
@@ -114,6 +119,9 @@ TOOLS: dict[str, dict] = {
"description": (
"Jot down a note to remember later — an observation, an idea, a "
"reminder, a read on a poker spot or opponent, anything worth keeping. "
"During a live poker session this is your session log: a factual beat "
"about how the night is going (table dynamics, Brian's arc, momentum) — "
"it shows on his HUD. Not for your own feelings or reflection. "
"Optionally tag it (e.g. 'poker', 'idea', 'reminder')."
),
"parameters": {