From cf28f6fdf0401b51c332b6d0f34c47ead6ffcb53 Mon Sep 17 00:00:00 2001 From: claude Date: Thu, 6 Aug 2026 00:52:59 +0400 Subject: [PATCH] qa reads /trace for the query chain again (V-564) --- CLAUDE.md | 16 ++++++++++++++++ docs/qa.md | 14 +++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 72cc9b2..6c60d1d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -261,6 +261,22 @@ of the house. A demonstrative ("отметь это как сделанное") `h.surfacedItems` only when exactly one item was spoken. Otherwise the turn goes back to the cascade rather than transitioning the wrong item. +**Who claimed a turn is now recorded, and so is who did not** (V-564, umbrella +V-558). Arbitration between the claimants on the utterance stream is order, +hardcoded in the pre-route resolver ladder, in `buildRouter` and in +`querySources`. `internal/decision` records one `Record` per turn: every +claimant, what it would have made the turn, the score it reported, and whether +it won, declined, lost on score, was thinned by a gate or was **never asked**. +The record rides the context, the same seam `querysource.go` uses, so a claim +site cannot change a route and a context with no record costs nothing. It is +installed in `runTurn`, so the mic, telegram and the web all leave the same +trail. Storage is a 25-turn in-memory ring on the handler (`decision.Ring`), +read over `ipc.TurnDecisions` and rendered as the second table on `/trace`. +Nothing persists: a turn record is read minutes later or never, and his words do +not belong in a table that outlives the diagnosis. Adding a rung to the ladder +in `runTurn` means adding its name to `preRouteLadder` in +`cmd/mavend/decisiontrace.go`, or that rung is silently missing from the record. + ## LLM output contract All phrasing paths emit `{"response":"...","mood":"..."}` (parsed in `replier_llm.go` and diff --git a/docs/qa.md b/docs/qa.md index cd1c808..ebad83d 100644 --- a/docs/qa.md +++ b/docs/qa.md @@ -423,11 +423,15 @@ something only a ZIM answers, with the search block on. Live search leads and th ZIMs are the fallback since 02-08-2026. **286**'s remaining half is doc and git ingestion, which is build work, not a check. -**Do not read `/trace` for this.** `/trace` is the nudge-rule trace: rule, -severity, predicate, gate, selected. No query-source field exists anywhere in the -codebase. The only evidence of which query source claimed a turn is the -`voice: search:` and `voice: kiwix:` lines in `docker compose logs mavend` -(`actions_query.go:589` and `:660`). +**Read `/trace` for this.** It carries two tables since 06-08-2026 (V-564). The +nudge-rule trace it always had, and below it the **turn decisions**: one +collapsible record per utterance. Each names every claimant, what it would have +made the turn, the score it reported, and whether it won, declined, lost or was +**never asked**. That last one answers "did Kiwix pass, or was it never +reached". The log lines cannot tell you that. The ring holds the last 25 turns +in daemon memory and is empty after a restart, so read it in the same sitting. +`/chat` still shows the claiming source as a badge, and the `voice: query +claimed by source` line is still in `docker compose logs mavend`. Run 02-08-2026, 20 turns. **Search leads and the personal boundary holds.** Every world question that reached the boundary was claimed by search. All three