Re-orders /sdk/v1/rag/search results so binding law from the matching
jurisdiction and domain ranks above guidance, foreign and off-domain law —
without dropping anything (guidance stays as interpretation context).
Internal-only: response schema is unchanged (json:"-" fields), so every
consumer benefits without a contract change.
- authority.go: classifyAuthority / queryDomain / chunkDomain / scopeClass /
topic ontology. Tagged payload (authority_weight/source_class/jurisdiction)
wins; deterministic fallback via category + name markers for the untagged corpus.
- authority_rerank.go: rerankByAuthority. final = semantic + authority +
jurisdiction + domain + scope + topic; the authority score is written back to
Score so the multi-collection advisor merge preserves the order.
- legal_rag_client: stratified retrieval — the binding-law pool AUGMENTS the
semantic pool (mergeDedupHits), then re-rank.
- legal_rag_http: searchBinding (source_class filter) + shared doPointsSearch.
- table-driven tests for authority/domain/scope/topic + rerank acceptance +
a stratified-binding integration test. go test -race green.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ai-sdk (legal_rag_client/scroll/types) liest die gepinnten Spec-Felder
article_label/regulation_code/article/paragraph/sub/citation_style/is_recital
mit Fallback auf alt-ingestierte Chunks (regulation_id, section); neuer getBool-Helfer.
Advisor + Drafting-Engine bilden die Quellenzeile primaer aus article_label
("BDSG § 38 Abs. 1"), sonst aus den strukturierten Feldern. 17 Tests gruen, tsc sauber.
Vertrag: docs-src/development/rag_reingest_spec.md (§2/§7). Deploy an den Re-Ingest
gekoppelt — neue Felder sind bis dahin leer (graceful Fallback).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>