Preserve context across conversation intents (V-542)

Owner explicitly requested direct commits to master; bypass the branch-only hook.
This commit is contained in:
2026-08-13 02:14:46 +04:00
parent a0e6643465
commit da9114b623
15 changed files with 499 additions and 56 deletions
+22 -16
View File
@@ -1,7 +1,7 @@
{
"schema_version": 1,
"name": "conversation_anaphora",
"description": "Five consecutive Russian turns about one object, replayed from the run that found V-542 on the box on 05-08-2026. He names a monitor, then asks four questions that all say \"он\" and never name it again.\n\nThis scenario exists because the shape had nowhere to fail. The routing fixture scores one utterance at a time, so a conversation that breaks on its second turn cannot lose a point there, and V-44 step 2 could only be verified by hand. That is item 3 of V-542.\n\nFour of the five replies below are WRONG, and the assertions pin them anyway. Read them as the recorded defect rather than the contract: she has the last four turns in front of her and never once names the thing he is asking about. Every wrong assertion is marked in its step note with what it must become. When V-542 lands, those flip and the ones marked correct do not move.\n\nWhat the four assert is that the reply LACKS \"монитор\". Absence is the defect itself: she is answering a question about a thing she wrote down two minutes ago and cannot name it. It also survives the fallback picker, which matters on the three query turns — they refuse from internal/phraser/fallbacks_ru_v1.json, four variants deep, and the same scenario returned \"тут я пас.\" one run and \"не знаю, честно.\" the next, so a string assertion there would pin the picker rather than the daemon.\n\nTurn 4 asserts its text as well, because that turn goes through the chat path and the chat path is now scriptable. scriptedPhraser in simulator_test.go answers PhraseChat from the same script entries the router reads (V-542 item 4); before it, the simulator wired phraser.NewStub() and no scenario could say what she SAYS on a chat turn at all.\n\nThe routes are scripted exactly as the box produced them, because the failure is not the model's. Turn 1 went to fact despite \"давай поболтаем\", every question after it went to query, and turn 4 went to chat. A scripted route is what lets this scenario pin the daemon's half without a llama-server in the loop.",
"description": "Five consecutive Russian turns about one object, replayed from the run that found V-542 on the box on 05-08-2026. He names a monitor once, then refers to it by pronoun or ellipsis for four turns.\n\nThe router decisions stay exactly as the box produced them: fact, query, query, chat, query. That is intentional. Routing sees one utterance; dialogue continuity owns what earlier turns make it mean. A grounded fact inside an explicit conversational opener is still stored, while its exact utterance also enters the transcript. Anaphoric queries are answered through chat with that transcript instead of walking note and world sources without their referent.\n\nEvery scripted chat answer below is conditional on history containing the original monitor turn. A canned reply therefore cannot make this scenario pass if session capture, cross-intent merge, history ordering or PhraseChat wiring loses the referent. The visible assertions require the answer to name the monitor, and the final tick remains the not-a-nag control.",
"start": "2026-08-05T14:00:00+03:00",
"script": [
{
@@ -11,20 +11,27 @@
},
{
"match": "он большой",
"route": "[{\"intent\":\"query\",\"text\":\"а он большой?\"}]"
"route": "[{\"intent\":\"query\",\"text\":\"а он большой?\"}]",
"reply": "{\"response\":\"Ты про новый монитор; диагональ ты пока не называл.\",\"mood\":\"neutral\"}",
"history_contains": ["купил новый монитор"]
},
{
"match": "сколько он примерно стоит",
"route": "[{\"intent\":\"query\",\"text\":\"сколько он примерно стоит по-твоему?\"}]"
"route": "[{\"intent\":\"query\",\"text\":\"сколько он примерно стоит по-твоему?\"}]",
"reply": "{\"response\":\"Новый монитор без модели и диагонали я честно не оценю.\",\"mood\":\"thinking\"}",
"history_contains": ["купил новый монитор"]
},
{
"match": "переплатил",
"route": "[{\"intent\":\"chat\",\"text\":\"мне кажется я переплатил\"}]",
"reply": "{\"response\":\"я не знаю, о каком именно устройстве ты говоришь.\",\"mood\":\"neutral\"}"
"reply": "{\"response\":\"Про новый монитор поняла; цену лучше сравнить по точной модели.\",\"mood\":\"thinking\"}",
"history_contains": ["купил новый монитор"]
},
{
"match": "стоит его вернуть",
"route": "[{\"intent\":\"query\",\"text\":\"стоит его вернуть?\"}]"
"route": "[{\"intent\":\"query\",\"text\":\"стоит его вернуть?\"}]",
"reply": "{\"response\":\"Новый монитор стоит вернуть, если сравнение подтвердит переплату или он тебе не подходит.\",\"mood\":\"neutral\"}",
"history_contains": ["купил новый монитор"]
},
{
"match": "",
@@ -35,43 +42,42 @@
"steps": [
{
"at": "14:00",
"note": "CORRECT, and it is the first half of the defect. \"давай поболтаем\" is an explicit request to converse and the turn is filed as a fact anyway. Storing what he said is not wrong on its own — he did buy a monitor — but the object then lives in the fact store and never enters the transcript PhraseChat reads. That is V-542 decision 2: either the marker claims the turn at stage 0, or it means nothing and comes out of the fixture.",
"note": "A substantive statement inside an explicit conversational opener remains a grounded fact, and the exact same utterance becomes dialogue context. Conversation is session state, not a competing storage intent.",
"say": "давай поболтаем: я вчера купил новый монитор",
"expect_events": ["purchase"],
"expect_no_send": true
},
{
"at": "14:01",
"note": "WRONG. \"он\" is the monitor from one turn ago, and she says she has no record of it. followUpMerge inherits prev.Slots.Key, and a query turn asking about a pronoun has no key to merge, so the question reaches the query sources naked and the notes source answers the only way it can. Must become: an answer about the monitor, or a route to chat where the transcript is.",
"note": "The query route cannot see earlier turns. The dialogue merge sees the anaphora and answers through chat with the transcript, which names the monitor.",
"say": "а он большой?",
"expect_reply_lacks": ["монитор"],
"expect_reply_contains": ["монитор"],
"expect_no_send": true
},
{
"at": "14:02",
"note": "WRONG, and it rules out one explanation. This is not the previous turn failing to stick — it is the same wall a second time, two turns from where the monitor was named. Nothing accumulates across query turns.",
"note": "The referent survives a second routed-query boundary; the previous contextual turn did not replace the transcript anchor.",
"say": "сколько он примерно стоит по-твоему?",
"expect_reply_lacks": ["монитор"],
"expect_reply_contains": ["монитор"],
"expect_no_send": true
},
{
"at": "14:03",
"note": "WRONG, and it is the same wall from the other side. This turn routed chat, so it HAD the history that Session.History holds, and it asks which device he means anyway — because turn 1's object went to the fact store rather than the transcript. So a source reading the conversation is not sufficient on its own; decision 1 has to say which store the referent comes from. This is the one step whose text is pinned: the reply is scripted and reaches PhraseChat, so it is the box's own words rather than a fallback pick. Must become: a reply that names the monitor.",
"note": "A native chat route reads the same cross-intent transcript, in chronological order, without receiving the current utterance twice.",
"say": "мне кажется я переплатил",
"expect_reply_contains": ["о каком именно устройстве"],
"expect_reply_lacks": ["монитор"],
"expect_reply_contains": ["монитор"],
"expect_no_send": true
},
{
"at": "14:04",
"note": "WRONG. The fifth turn is the one that shows the cost. A returns question about a purchase two minutes old is answered with \"не нашла у тебя такой записи\", which is wrong in kind rather than merely unhelpful: the record exists, she wrote it herself at 14:00 under the key purchase.",
"note": "The fifth turn proves the oldest retained turn still supplies the referent after fact, query and chat crossings.",
"say": "стоит его вернуть?",
"expect_reply_lacks": ["монитор"],
"expect_reply_contains": ["монитор"],
"expect_no_send": true
},
{
"at": "14:05",
"note": "CORRECT, and it is the control. Nothing in five conversational turns was sent at him unprompted, and a tick with him mid-conversation stays silent. Whatever V-542 changes must not change this.",
"note": "Control: session continuity is reactive state only. A tick during the conversation sends nothing unprompted.",
"tick": true,
"expect_no_send": true
}