Plan: answer quality data, configurable classification and the lists built from it
## AI disclosure
_Used AI to help with research and writing (reading the call notes, comparing them with the log fields in #3615759, drafting this issue). The reasoning and positions are my own, and I reviewed everything before posting. ([Drupal.org AI policy](https://www.drupal.org/docs/develop/issues/issue-procedures-and-etiquette/policy-on-the-use-of-ai-when-contributing-to-drupal#s-disclosure))_
_Summary updated 2026-11-24 with the decisions of 23 November, the merge of !25 and the MR for #3615787. Used AI to help with drafting the update; I reviewed it before posting._
## Problem/Motivation
Part of #3615758. Weak answers are hard to find. Some answers have no sources, some are vague, some change every time the same question is asked. A dashboard can only show this if each answer records something about its quality first.
On the call of 11 November 2026, Christoph suggested 2 steps: first a concept for what an answer records and how it is classified, then a follow-up issue to show it in a dashboard. This issue is the first step. It holds the plan only; the children build it.
## Proposed resolution
_Agreed on 23 November, from @mErilainen's review and the reply that followed in the comments._
**1. What each answer records.** On the `ai_answers_log` row, one per turn:
- The outcome the code decides: answered, or no answer with a reason (`fallback`, `uncited`, `no_sources`, `error`). Already in `ai_answers_log` (#3615759, merged on 23 November).
- Visitor feedback, provider, model and prompt hash. Already in `ai_answers_log`.
- `has_information` and `missing`: the model's own signal on whether it had the information (#3615779). A signal only; the code still decides the outcome.
- `cached` and the id of the turn whose answer was reused (#3610890).
!25 merged without the last 2 groups, so #3615779 and #3610890 each add their own fields with an update hook. 1.1.x has no release yet.
**2. A configurable classification.** Built in #3615787 (!34).
- It lives in `ai_answers_tag` (#3615760) as a second, single-label vocabulary per agent, next to the tag vocabulary. Term descriptions go into the prompt.
- 1 AI call per turn returns the topic tags and the category together, as JSON with the format set in code. The admin prompt is guidance only.
- The category is stored like the tags, keyed by the log row. A gap is only a query over the log, so nothing is stored on the gap.
- By default only unanswered turns are classified. Once #3615779 lands, turns the model was unsure about are classified too.
- A per-run item limit, because cron's time budget doesn't cap tokens.
- Default categories `expected` (the site should answer this), `vague` (too unclear to answer) and `noise` (off-topic), each with a description, shipped as optional config that is off by default.
**3. The lists built from it.** All lists use 1 shared turn filter, a query helper in the `ai_answers_log` module: typed questions and demo data (#3615781) only, no `eval` traffic, and `error` turns only in the errors list. It is added in !24 (#3615760), and the gaps MR (!30) uses it after its rebase.
| List | Turns |
|---|---|
| Unanswered | no answer, reason not `error` (the gaps query in #3615761) |
| Errors | reason `error` |
| Model unsure | answered, `has_information` is `partial` or `no`. Its own list, not counted as gaps by default |
| Negative feedback | feedback is negative |
| By category | needs #3615787 |
| By tag | needs #3615760 |
The dashboard (#3615780) and the gaps page (#3615761) read these lists.
**Out of scope:** answers that change between asks. That needs canonical questions (#3615782, #3615783).
## Remaining tasks
- [x] Agree on the fields each answer records
- [x] Agree on where the classification runs and where its result is stored (log row or gap)
- [x] Agree on the default categories
- [x] File the child issue for the classification (#3615787)
- [ ] Update the children with the result:
- [x] #3615760: add the shared turn filter to `ai_answers_log` in !24. Until then !34 keeps it in `Tagger::classifiesTurn()`.
- [ ] #3615761: use the shared filter after the rebase, and keep "model unsure" out of the gaps by default
- [ ] #3615779: add `has_information` and `missing` with an update hook
- [ ] #3610890: add `cached` and the reused-turn id with an update hook
- [ ] #3615780: list the 6 lists above as the dashboard's data
## User interface changes
None in this issue. See #3615787 and #3615780.
## API changes
None in this issue. The shared turn filter is a new query helper in `ai_answers_log` (#3615760).
## Data model changes
None in this issue. The fields go in #3615779 (`has_information`, `missing`) and #3610890 (`cached`, reused-turn id), each with an update hook. The classification settings and the optional default vocabulary go in #3615787.
issue
GitLab AI Context
Project: project/ai_answers
Instance: https://git.drupalcode.org
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://git.drupalcode.org/project/ai_answers/-/raw/1.0.x/README.md — project overview and setup
Repository: https://git.drupalcode.org/project/ai_answers
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD