Skip to content

First-release polish (spec 020) - #20

Merged
YBazanPro merged 3 commits into
mainfrom
feat/spec-020-first-release-polish
Oct 20, 2026
Merged

YBazanPro merged 3 commits into
mainfrom
feat/spec-020-first-release-polish

Conversation

@YBazanPro

Copy link
Copy Markdown
Owner

Implements spec 020: first-release polish (roadmap Phase 5.3 and Phase 6).

What changes

  • Suggested questions (Documents). After a version is indexed, the chat model proposes 3 questions; each is kept only when retrieval, run as the document's owner, finds the document with confident evidence. Stored on the version (SuggestedQuestions, SuggestionsStatus), editable by the owner (PUT /api/documents/{id}/suggestions, If-Match), kept on reprocess, skipped in demo mode. A failure never fails the ingestion run.
  • Home page. Value statement, Ask a question, suggested questions (a click opens a new conversation and asks it, via chat?ask=), documents per language, last indexing date, recent documents, README link (GET /api/documents/suggestions, /summary).
  • Citation source states. Passages and citation snapshots store a text hash (PassageTextHash, backfilled in SQL by both migrations). IDocumentSources returns current, newer-unchanged, newer-changed, archived or unavailable per citation; badges in CitationItem, notices and Open current version in SourcePreview.
  • Chat conveniences. Rename (PATCH, empty reverts to the first question), accent- and case-insensitive search (q), Markdown export (GET …/export), Copy answer with sources.
  • Evaluation module (new, schema evaluation). The harness run and judge upload their report (--no-upload; upload <report> for older ones). Admin Evaluation tab: list with headline metrics, run detail, comparison of two runs, delete with confirmation. Maintainer only; only sample-scoped reports are accepted.
  • Accessibility and README. Accessible names for citations, states and icon-only buttons; README rewritten for clone-and-run with a French and English demo script.

Migrations

  • Documents SuggestedQuestionsAndPassageHashes: suggestion columns, passages.text_hash (backfilled) and an index on (version_id, text_hash).
  • Chat RenameSearchAndSourceStates: title up to 200, title_edited, citation_snapshots.text_hash (backfilled), unaccent.
  • Evaluation InitialEvaluation.

All three were applied to an existing dev database.

Verification

  • Build: 0 warnings; dotnet format --verify-no-changes clean.
  • dotnet test --solution RagAssistant.slnx: 1,348 passed.
  • Playwright smoke tests against the AppHost in https-demo: 21 passed, 6 of them new. One existing admin smoke test is also fixed: it failed because the inspector shows the question twice.
  • Two real harness reports uploaded with upload (one with its judge result), re-uploaded (replaced), and compared through the API.

Not done

  • AC-27: the manual checklist (contrast of the badges in both themes, NVDA reading a citation and an answer status).
  • AC-28: the README was not followed from a fresh clone.
  • Generated suggestions in the browser: demo mode generates none, so they were not seen live with a real model; the link they use was.

🤖 Generated with Claude Code

YBazanPro and others added 2 commits October 20, 2026 13:30
- Suggested questions: generated after indexing by the chat model and kept
  only when retrieval, as the owner, finds the document confidently; stored
  on the version, editable by the owner (If-Match), kept on reprocess,
  skipped in demo mode, never fatal to the run.
- Home page: value statement, ask action, suggested questions, corpus
  summary per language and recent documents (GET /api/documents/suggestions
  and /summary).
- Citation source states: passages and snapshots store a text hash
  (backfilled in SQL); IDocumentSources says current, newer-unchanged,
  newer-changed, archived or unavailable; badges and SourcePreview notices
  with "Open current version".
- Chat: rename (PATCH, empty reverts), accent-insensitive search (q),
  Markdown export, "Copy answer with sources"; ?ask= asks in a new
  conversation.
- Evaluation module (roadmap 5.3): harness reports uploaded by run and
  judge (--no-upload, upload <report>), admin Evaluation tab with list,
  detail, comparison and delete.
- Accessibility labels, Playwright smoke tests for the new flows, README
  rewritten for clone-and-run and a French and English demo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ast the cosine floor (spec 019)

websearch_to_tsquery ANDs every word, so a natural-language question
matched almost no passage and hybrid search equalled vector search
(baseline variants: R@5 0.86 / MRR 0.84 for both). The question's
lexemes are now OR-ed into one tsquery, quoted as they are so nothing
stems them twice.

While cosine is the gate (reranking off or skipped), the floor also
dropped every keyword-only hit below MinScore, the exact-term matches
hybrid search exists for. A keyword match now passes the floor when the
passage holds at least Hybrid:MinKeywordCoverage (default 0.5) of the
question's distinct lexemes; one common word is not evidence.
ConfidentScore still applies, so keyword-only evidence is low-confidence.

Coverage is a new stage field on the diagnostic endpoint; the setting is
shown in the admin configuration and recorded in harness reports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(retrieval): OR keyword query and coverage-gated floor exemption (spec 019)
@YBazanPro
YBazanPro merged commit 1a1d01e into main Oct 20, 2026
1 check passed
@YBazanPro
YBazanPro deleted the feat/spec-020-first-release-polish branch October 20, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant