feat(ai-sdk): /retrieve liefert footnotes[] (C-FN Evidence) für Advisor-Workspace

Footnote-Hits werden aus dem Qdrant-Payload (is_footnote/footnote_label/
footnote_verbatim/ref_citation_unit) in interne LegalSearchResult-Felder (json:"-",
kein Pro-Result-Contract-Change) gemappt und im /retrieve-Handler als Top-Level
footnotes[] (Frontend RawFootnote-Shape) herausgezogen; Hits bleiben in results[]
(LLM-Kontext). figures[] als leerer C8-Platzhalter. Speist den Evidence-Workspace
(evidence-adapter.ts) der Frontend-Session.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-07-01 08:37:59 +02:00
parent f0120b237e
commit 6f0c1cf30d
3 changed files with 35 additions and 0 deletions
@@ -111,11 +111,33 @@ func (h *RAGHandlers) Retrieve(c *gin.Context) {
return
}
// C-FN: Fußnoten-Hits als separates footnotes[] herausziehen (Frontend RawFootnote-Shape),
// damit der Advisor-Evidence-Workspace sie im dedizierten Fußnoten-Bereich rendert. Die Hits
// bleiben zusätzlich in results[] (LLM-Kontext). figures[] = C8-Platzhalter (leer bis C8).
footnotes := make([]gin.H, 0)
for _, r := range results {
if !r.IsFootnote {
continue
}
footnotes = append(footnotes, gin.H{
"id": r.CitationUnit,
"ref": r.CitationUnit,
"number": r.FootnoteLabel,
"regulation_code": r.RegulationCode,
"regulation_short": r.RegulationShort,
"regulation_name": r.RegulationName,
"section": r.RefCitationUnit,
"text": r.FootnoteVerbatim,
})
}
c.JSON(http.StatusOK, gin.H{
"query": req.Query,
"results": results,
"count": len(results),
"assessment": ucca.Assess(results),
"footnotes": footnotes,
"figures": []gin.H{},
})
}