Give every prompt one shared context block (#394) #36

Closed
claude wants to merge 4 commits from overnight/prompt-context into overnight/prompt-address
Contributor

Three commits, ~320 lines. Vikunja #394. This is the one I think actually matters.

Before this, every prompt she runs on knew: that she is feminine, and (in two of five prompts) that you are male. Nothing else. No clock, no location, no idea what she can do. The conversation prompt said literally "You're talking with your owner" — no gender, no informality, nothing.

So the model was guessing to fill the gaps, and formal "вы" is a perfectly sensible guess when you don't know who you're speaking to. Some of what we've been blaming on "the 0.8B is weak at Russian" may just be that.

One block, rendered per turn, in front of all five prompts. Here's exactly what she gets with the config as it ships today:

Ты — Maven, домашняя ассистентка. О себе говоришь в женском роде: "я записала", "я проверила".
ОБРАЩЕНИЕ: владелец — мужчина, всегда на "ты" (ты, тебя, тебе, твой) и в единственном числе ("выпей", "посмотри"). Никогда "вы"/"вас"/"ваш". Никогда "он"/"его" о нём — ты говоришь ему, а не о нём. Глаголы о нём — в мужском роде ("ты забыл").
Сейчас: пятница, 31 июля 2026, 16:04 (местное время).
Умеешь: разговаривать и отвечать на вопросы; ставить напоминания; записывать заметки и факты и отвечать по ним; смотреть календарь; писать в телеграм; запускать разрешённые команды на сервере.

The address form has its own labelled line because that is the thing that kept getting lost when it was a clause inside a paragraph.

It works with an empty config. The gender and address rules are hard product constraints, so they are defaults in code — the persona config field being blank is how we got here, and nothing correct is allowed to depend on someone filling in JSON again. Two optional fields were added (voice.owner_name, voice.city); both are empty and nothing needs them. Set them if you want her to know your name and city.

The capability list is verified, not invented. Each entry is a real code path, and the three config-gated ones are checked against the same conditions the daemon uses to wire the real thing — so weather is correctly absent (no weather block in the config, so the stub is wired and she says she can't). A capability she offers and cannot perform is worse than one she never mentions.

The block is Russian even in front of the English prompts. The rules are Russian grammar; stating them in English would describe the rule instead of showing it, and translating would create the second copy this whole change exists to prevent.

The third commit is a bug I caught in the first two, and it would have been bad. The list ended with "Больше ничего — если просят другое, скажи прямо, что не умеешь" — and this block goes in front of the chat and general-knowledge prompts. That told her to refuse the exact thing those two prompts exist for. Talking is now first in the list and the closing line limits actions, not everything.

Same commit dropped the self-introduction from the knowledge prompt: it said "Ты — Мавена, персональный ассистент" — a different name and a masculine noun — immediately after the block says she is Maven and feminine. Its test pinned the wrong name, so the test was fixed too, and now asserts the prompt does not introduce her.

Numbers: unchanged, which is the honest result. Three runs a side — before 12/11/9 of 15, after 11/11/12. Both inside the noise #393 documented. I am not claiming an improvement and the fixture cannot support one. The point was not to make it worse while giving her the context she was missing. Latency is unchanged; the block costs about 120 tokens.

The real caveat: the fixture only scores nudges. The three prompts that changed most here — chat, query, knowledge — have no scorer at all, so the conversation path you care about is still unmeasured. That is the gap worth closing next.

Two smaller things left alone: the block says "местное время" without naming the zone (costs tokens for a case I have not seen fail), and the reply path uses time.Now rather than an injected clock because the replier is built before the handler exists — so a test faking the clock still sees real time in that prompt.

Three commits, ~320 lines. Vikunja #394. **This is the one I think actually matters.** Before this, every prompt she runs on knew: that she is feminine, and (in two of five prompts) that you are male. Nothing else. **No clock, no location, no idea what she can do.** The conversation prompt said literally *"You're talking with your owner"* — no gender, no informality, nothing. So the model was guessing to fill the gaps, and **formal "вы" is a perfectly sensible guess when you don't know who you're speaking to.** Some of what we've been blaming on "the 0.8B is weak at Russian" may just be that. **One block, rendered per turn, in front of all five prompts.** Here's exactly what she gets with the config as it ships today: > Ты — Maven, домашняя ассистентка. О себе говоришь в женском роде: "я записала", "я проверила". > **ОБРАЩЕНИЕ:** владелец — мужчина, всегда на "ты" (ты, тебя, тебе, твой) и в единственном числе ("выпей", "посмотри"). Никогда "вы"/"вас"/"ваш". Никогда "он"/"его" о нём — ты говоришь ему, а не о нём. Глаголы о нём — в мужском роде ("ты забыл"). > Сейчас: пятница, 31 июля 2026, 16:04 (местное время). > Умеешь: разговаривать и отвечать на вопросы; ставить напоминания; записывать заметки и факты и отвечать по ним; смотреть календарь; писать в телеграм; запускать разрешённые команды на сервере. **The address form has its own labelled line** because that is the thing that kept getting lost when it was a clause inside a paragraph. **It works with an empty config.** The gender and address rules are hard product constraints, so they are defaults in code — the `persona` config field being blank is how we got here, and nothing correct is allowed to depend on someone filling in JSON again. Two optional fields were added (`voice.owner_name`, `voice.city`); both are empty and nothing needs them. **Set them if you want her to know your name and city.** **The capability list is verified, not invented.** Each entry is a real code path, and the three config-gated ones are checked against the *same* conditions the daemon uses to wire the real thing — so weather is correctly absent (no weather block in the config, so the stub is wired and she says she can't). A capability she offers and cannot perform is worse than one she never mentions. **The block is Russian even in front of the English prompts.** The rules are Russian grammar; stating them in English would describe the rule instead of showing it, and translating would create the second copy this whole change exists to prevent. **The third commit is a bug I caught in the first two, and it would have been bad.** The list ended with *"Больше ничего — если просят другое, скажи прямо, что не умеешь"* — and this block goes in front of the **chat and general-knowledge** prompts. That told her to refuse the exact thing those two prompts exist for. Talking is now first in the list and the closing line limits **actions**, not everything. Same commit dropped the self-introduction from the knowledge prompt: it said *"Ты — Мавена, персональный ассистент"* — a different name **and a masculine noun** — immediately after the block says she is Maven and feminine. Its test pinned the wrong name, so the test was fixed too, and now asserts the prompt does *not* introduce her. **Numbers: unchanged, which is the honest result.** Three runs a side — before 12/11/9 of 15, after 11/11/12. Both inside the noise #393 documented. **I am not claiming an improvement** and the fixture cannot support one. The point was not to make it worse while giving her the context she was missing. Latency is unchanged; the block costs about 120 tokens. **The real caveat:** the fixture only scores nudges. The three prompts that changed most here — chat, query, knowledge — have no scorer at all, so the conversation path you care about is still unmeasured. That is the gap worth closing next. **Two smaller things left alone:** the block says "местное время" without naming the zone (costs tokens for a case I have not seen fail), and the reply path uses `time.Now` rather than an injected clock because the replier is built before the handler exists — so a test faking the clock still sees real time in that prompt.
claude added 4 commits 2026-07-31 14:08:20 +02:00
The "address him as ты" rule had only reached two of the five system
prompts. Instead of pasting it into the other three (five copies drift —
that is how this happened), there is now one block, in internal/persona,
prepended to all five: nudges, action replies, chat, note queries and
general knowledge.

The block says who he is and how to address him (a man, always "ты",
never "вы", never "он" about him; Maven stays feminine), plus the
current local date and time. It is rendered fresh each turn because the
time changes, and it is correct with an empty config — the address and
gender rules are defaults in code. Config only adds optional facts:
owner_name, city, and the existing free-text `persona` string, which is
now the static half of the block.

Russian even in front of the English prompts: the rules are Russian
grammar, so they read best stated in Russian, and there is one copy.

Vikunja #394.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CGeSZxh1DCtRxmFVSYVGvJ
The context block now lists her real capabilities: reminders, notes and
facts (write and recall), and the calendar — all three are code paths in
mavend today. Weather, telegram and shell acts are listed only when the
config actually has them, because offering something she cannot do is
worse than staying quiet about it.

Also drops the pronouns from the optional name/city line. The block's
own "ты" is Maven, so "тебя зовут" read as her name and "его" would have
shown her the third-person form she must never use about him. They are
plain labels now.

Vikunja #394.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CGeSZxh1DCtRxmFVSYVGvJ
The block listed what she can do and ended with "nothing else". It sits
in front of the chat and general-knowledge prompts too, so that told her
to refuse the exact thing those prompts are for. Talking is now first in
the list, and the closing line limits ACTIONS rather than everything.

Also dropped the self-introduction from the knowledge prompt. It said
"Мавена, персональный ассистент" — a different name and a masculine
noun, right after the block says she is Maven and feminine. Identity
lives in the block now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CGeSZxh1DCtRxmFVSYVGvJ
Owner

Superseded by #47, which landed this whole stack on master as one reviewed integration merge. This PR head is an ancestor of master — its commits are in, nothing here is lost. Closing as merged-by-proxy rather than merged, since the merge came in through #47.

Review threads on this PR were answered or acted on before the merge; the Russian wording fixes went in as #48.

Superseded by #47, which landed this whole stack on master as one reviewed integration merge. This PR head is an ancestor of master — its commits are in, nothing here is lost. Closing as merged-by-proxy rather than merged, since the merge came in through #47. Review threads on this PR were answered or acted on before the merge; the Russian wording fixes went in as #48.
kami closed this pull request 2026-07-31 20:22:31 +02:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kami/Maven#36