chat-quality
Every disliked answer becomes a test
The chat-quality skill is the loop that reads the thumbs visitors leave on the site chat’s answers. It is set to run twice a month, runs on demand for now, and ends with changes waiting on a branch for the owner. Below are the steps, then one pass of the loop traced from a verdict to that branch. The full skill file is on Skills.
The steps
- Close the last loopRead the previous run’s report and check whether its branch was merged, so a case already written is not proposed twice.
- Pull the verdicts and the logRead the thumbs verdicts and the logged exchanges from the live store, and join each verdict to the exchange it rates by its id. The agent only reads; it never writes there. Without read access it stops and asks.
- TriageEvery thumbs down is a candidate. The unrated answers get a skim too, for silent failures such as an invented path or a limit notice where a real answer was possible. A window with no real failures is a valid result, and the loop stops there.
- Write the cases firstEach failure becomes a case in
evals/chat/golden-set.jsonbefore it is fixed: the question in other words, the facts a good answer needs, the cheapest check that would have caught it, and the rules it covers inevals/chat/SPEC.md. A fact missing from the chat’s sources is the real bug, and the source is what gets fixed. - Run the eval once
npm run eval:chatruns the whole set through the real chat route on a local dev server. It spends real API budget, so it runs once per loop. The answers are read one by one: the new cases should fail before the fix and pass after, and nothing that passed before should break. - Fix on a branchThe new cases and the fixes they called for go on one fresh local branch. Fixes stay inside the chat’s answer pipeline: page prose, the persona and the lookup tools. A fix in the package’s chat engine changes every consumer’s chat, so it is flagged as such.
- Report and hand offA plain-English report: the window, the verdict counts, each disliked answer and its cause, what was encoded and the eval result. Merging the branch approves it; deleting it rejects it. Nothing is pushed or deployed.
One loop, end to end
A visitor rates an answer with a thumb. /api/chat/feedback stores the verdict in Redis under the exchange’s id, beside the exchange that /api/chat logged, and both are deleted after 30 days. The agent reads the two and joins them. The disliked answer becomes a golden-set case written in other words, the eval runs against a dev server, and the fix waits on a local branch. The visitor’s own words stay in a local report that is never committed.
What the loop may touch
The live data is read, never written. Only a paraphrase of the failure and its fix reach the repo, and only on a branch the owner approves.
| Part | What the loop does | Access |
|---|---|---|
Verdicts and exchange log | Reads and joins them | Read only |
Visitors’ own words | Quotes them in the local report only | Stays local |
Golden set and spec | Adds paraphrased cases and any new rule | On a branch |
Page prose, persona, lookup tools | Fixes the cause a case found | On a branch |
The package’s chat engine | Fixes it only when the site cannot | Flagged |
UI, components, spend limits | Proposes, never edits | Off limits |