[feat-022] Force LLM citations on lists + prose-page-ref fallback chips
Two fixes for the "Parties" column case the user found, where the LLM described both parties but emitted no [[page:N||quote:...]] markers, leaving the Citations chip row empty even though "Page 1" was clearly stated in prose. Backend prompts (queryGemini + queryGeminiAllColumns): - Lists/bulleted summaries are explicitly NOT exempt from citation rules. The prompt now spells out "if the summary lists three parties, emit three citation markers - one per party" with a worked example: "ACME CORP [[page:1||quote:ACME CORP]] and BETA INC [[page:1||quote:BETA INC]]". - Tightened the rule from "factual claim" to "every distinct fact (every name, date, number, party, clause, defined term, or substantive statement)" so the model can't lawyer its way out of citing a list. - Explicit ban on prose page references like "(Page 5)" or "see Section 3" inside the summary - must use the marker format so the UI can render clickable chips. - Reasoning may also include [[page:N||quote:...]] citations, and the prompt now encourages it. - "keywords" guidance picks up "party names" as a preferred kind. Frontend safety net for legacy / occasionally-still-lazy outputs: - citation-utils gains extractProsePageRefs() - scans free text for "Page N" / "page N" / "p. N" / "pp. N" patterns and emits quoteless ParsedCitation entries, deduped against any structured citations on the same page. - TRDocDetailView's allCitations now appends those prose refs after the structured ones, so the Citations chip row gets at least the page-jump affordance even when the model skipped its markers. The existing [N]-numbered superscripts in the cell text stay stable (only structured citations get numbered). Net effect: a re-run of the Parties column should now produce per-party [[page:N||quote:...]] markers and four real Citations chips. For cells already in the DB (without re-running) the prose fallback at least gives a clickable "Page 1" jump. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| Repository | nwhitehouse/mike |
|---|---|
| Author | Nick Whitehouse <nick.whitehouse@mccarthyfinch.com> |
| Authored | |
| Parents | c8ad2161 |
| Stats | 3 files changed , +51 , -7 |
| Part of | Tabular cell citation + keyword chips |
Capture this commit into my fork
Download a Markdown prompt that tells Claude how to port this
exact commit into your working tree. Run it via
claude -p < capture-commit-ada3fc90.md
from inside the repo you want the change in.