debug(ai-sdk): temp RAGDEBUG logging in searchControls + wiring

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-06-25 00:37:27 +02:00
parent d9d04deb00
commit eaa5f6e4ee
2 changed files with 7 additions and 1 deletions
@@ -111,9 +111,14 @@ func (c *LegalRAGClient) searchInternal(ctx context.Context, collection string,
// nur die Control-Pool-Rollen behalten — so werden NIST/CRA-Anhang (dense rank ~8-9, unter // nur die Control-Pool-Rollen behalten — so werden NIST/CRA-Anhang (dense rank ~8-9, unter
// dem kleinen top-K) Kandidaten. Re-Rank/applyControlRoles ordnen sie danach. // dem kleinen top-K) Kandidaten. Re-Rank/applyControlRoles ordnen sie danach.
if queryWantsControls(query) { if queryWantsControls(query) {
if controlHits, cErr := c.searchControls(ctx, collection, embedding); cErr == nil { controlHits, cErr := c.searchControls(ctx, collection, embedding)
fmt.Printf("[RAGDEBUG] query=%q wantsControls=true controlHits=%d err=%v poolBefore=%d\n", query, len(controlHits), cErr, len(hits))
if cErr == nil {
hits = mergeDedupHits(hits, controlHits) hits = mergeDedupHits(hits, controlHits)
fmt.Printf("[RAGDEBUG] poolAfterControls=%d\n", len(hits))
} }
} else {
fmt.Printf("[RAGDEBUG] query=%q wantsControls=FALSE\n", query)
} }
// Graph-Augmentation: verbundene Normen (references_out/in) der Top-Hits ueber die // Graph-Augmentation: verbundene Normen (references_out/in) der Top-Hits ueber die
@@ -229,6 +229,7 @@ func (c *LegalRAGClient) searchControls(ctx context.Context, collection string,
kept = append(kept, h) kept = append(kept, h)
} }
} }
fmt.Printf("[RAGDEBUG] searchControls dense=%d kept=%d depth=%d\n", len(hits), len(kept), controlPoolDepth)
return kept, nil return kept, nil
} }