param( [string]$Cases = "eval\rag-retrieval\cases\golden-cases.json", [string]$Fixtures = "eval\rag-retrieval\fixtures", [string]$RetrievedAt = "", [string]$KbScope = "rag-eval", # hybrid = production main path; dense = same-collection recall baseline [ValidateSet("hybrid", "dense")] [string]$SearchMode = "hybrid", [switch]$SkipEval ) $ErrorActionPreference = "Stop" $mavenArgs = @( "-q", "-Dtest=RagLookupSnapshotGeneratorTest", "-Drag.snapshot.enabled=true", "-Drag.snapshot.cases=$Cases", "-Drag.snapshot.fixtures=$Fixtures", "-Dretrieval.kb-scope=$KbScope", "-Dretrieval.search.mode=$SearchMode" ) if ($RetrievedAt -ne "") { $mavenArgs += "-Drag.snapshot.retrievedAt=$RetrievedAt" } $mavenArgs += "test" Write-Host "Generating RAG lookupResult fixtures (search.mode=$SearchMode, kb-scope=$KbScope)..." & mvn @mavenArgs if ($LASTEXITCODE -ne 0) { throw "Fixture generation failed with exit code $LASTEXITCODE" } if (-not $SkipEval) { Write-Host "Running offline RAG retrieval baseline..." & python scripts\eval_rag_retrieval.py --cases $Cases --fixtures $Fixtures if ($LASTEXITCODE -ne 0) { throw "Offline eval failed with exit code $LASTEXITCODE" } }