Problem
search() passes limit/candidates straight into SQL with no guard. Only the /ask body validates; evaluate.run_case and direct callers do not.
Where
vaultrag/retrieval.py (limit: int = 5, candidates: int = 50, interpolated into LIMIT).
Acceptance
Add a failing test first asserting search() with limit=0/-1 or candidates=-1 raises ValueError before SQL. Then fix.
Problem
search()passeslimit/candidatesstraight into SQL with no guard. Only the/askbody validates;evaluate.run_caseand direct callers do not.Where
vaultrag/retrieval.py(limit: int = 5, candidates: int = 50, interpolated intoLIMIT).Acceptance
Add a failing test first asserting
search()withlimit=0/-1orcandidates=-1raisesValueErrorbefore SQL. Then fix.