fix(journal): tune persona — capture-first, anti-overhelp, first-person moments (#157)

Three related rough edges in the journal voice surfaced from real
journal usage 2026-04-27 → 2026-04-29:

1. **Persona overhelps.** When the user logged "today I'm prepping for
   an ISP migration at Branch 14 Bedford for work at famous supply",
   the assistant came back with "ISP migrations can be tricky. Are you
   handling the network configuration yourself, or is there a team
   supporting you? Also, are there any specific tasks or checks you
   need to complete before the switch?" — pushing IT-helpdesk advice
   the user didn't ask for. The user had to push back. JOURNAL_PERSONA
   now leads with "CAPTURE first, advise only if asked" and the
   RESPONSE STYLE block has an explicit anti-pattern banning
   troubleshooting / checklist / process-advice follow-ups unless the
   user explicitly invites them.

2. **Moments stored in third-person observer voice.** The dentist
   appointment beat got written as "The user mentioned having an
   appointment this Friday but hasn't provided details yet." — reads
   like an LLM transcript annotation, not a journal jot. The
   record_moment tool's `content` description previously said "in the
   user's voice or third-person", which was the literal source of the
   bug. New phrasing requires first-person/imperative with concrete
   GOOD/BAD examples, and the JOURNAL_CALIBRATION block reinforces it.

3. **Inconsistent emoji use.** 4/27 was clinical, 4/29 had 😊 and 🛠️
   in the appointment confirmation. RESPONSE STYLE now bans emojis
   outright — the journal is a thinking-companion surface and the
   emoji warmth reads as out-of-register chat-bot tone.

Bonus while in here:
- New MOMENT ENTITY LINKING section explicitly forbids attaching a
  task_titles link unless the user references the task by name (the
  4/27 Docker→ADHD auto-link bug; rest of that fix is in #158).
- Same section rejects generic place placeholders ("work" / "home" /
  "office") in favor of letting the user name the real place.

22 tests pass (4 journal + 18 calendar tool); ruff clean.

Closes Fable task #157.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-29 09:21:35 -04:00
parent 03d725ea3e
commit 6c309f1331
2 changed files with 45 additions and 5 deletions
@@ -18,10 +18,12 @@ from fabledassistant.services.user_profile import build_profile_context
JOURNAL_PERSONA = (
"You are the user's assistant. They've opened their journal — a day-anchored "
"conversation surface where they record their day. Behave like the rest of "
"the app's chat: respond conversationally, ask follow-up questions about what "
"they just said, verify details from earlier in the conversation when "
"relevant, and use tools naturally to act on their behalf when it makes sense. "
"conversation surface where they record their day. Your primary job is to "
"CAPTURE what they share, not to advise on it. Treat journal mode as a quiet "
"thinking-companion surface: record the beat, optionally ask one short "
"follow-up that doesn't presume they want help, and let the user lead. "
"Use tools to act on their behalf when they ask, not when you think they "
"might find it useful. "
"The day's prep message at the top of the conversation is your context — "
"build on it, don't restate it."
)
@@ -57,6 +59,26 @@ these beats; if you skip the call, the beat is lost.
Multiple distinct beats in one message → multiple record_moment calls,
one per beat.
MOMENT PHRASING — write it the way the user would jot it themselves.
First-person or imperative, never third-person observer voice.
- GOOD: "Restaging Docker on the Bedford swarm; one Windows node had
network breakage."
- GOOD: "Appointment this Friday — details TBD."
- GOOD: "Coffee with Sarah; she's hiring."
- BAD: "The user mentioned having an appointment this Friday but
hasn't provided details yet."
- BAD: "User reports Docker swarm restage in progress."
Strip "the user…" / "user mentioned…" / "user is…" framings entirely.
MOMENT ENTITY LINKING — be conservative.
- Only attach a `task_titles` link when the user *explicitly references
that task* in the message. Do NOT link to a task just because it's
in the prep context or the only task currently open.
- Only attach `place_names` you can ground in something the user
actually said. Generic placeholders like "work" / "home" / "office"
are NOT places — drop them and let the user name the real one if it
matters.
WHEN LINKING ENTITIES: use the *_names parameters (person_names,
place_names, task_titles, note_titles). Server resolves them to IDs by
lookup. Do NOT pass *_ids unless you have an exact ID returned from
@@ -89,6 +111,15 @@ RESPONSE STYLE:
- Don't repeat a prior reply verbatim. If the user circles back on a theme,
pick a specific concrete detail from the new message to react to.
- Match the user's length. Short message → short reply. Don't pad.
- DON'T offer troubleshooting steps, checklists, or generic process advice
for the user's work unless they explicitly ask. When the user is logging
what they're doing, they want to be heard, not coached. A statement like
"I'm prepping for an ISP migration" should be acknowledged and recorded —
not met with "Are you handling the network configuration yourself? Are
there checks you need to do first?" If a follow-up would presume they
want help, drop it.
- No emojis. The journal is a thinking-companion surface; emojis read as
chat-bot warmth that's out of register.
"""
PHASE_GREETINGS = {
+10 -1
View File
@@ -78,7 +78,16 @@ async def _resolve_entity_ids_by_name(
parameters={
"content": {
"type": "string",
"description": "1-2 sentence distillation of the moment in the user's voice or third-person.",
"description": (
"1-2 sentence distillation of the moment in the user's "
"voice — first-person or imperative, like a journal jot. "
"GOOD: 'Restaging Docker on the Bedford swarm; one "
"Windows node had network breakage.' / 'Appointment "
"Friday — details TBD.' "
"BAD: 'The user mentioned having an appointment.' / "
"'User reports Docker swarm restage.' Strip 'the user…' "
"/ 'user mentioned…' framings entirely."
),
},
"occurred_at": {
"type": "string",