You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(retrieval): replay trace tokens stamped by every strategy
Every CostStrategy result now carries a deterministic trace token —
sha256(doc_id | doc_version | model | system_prompt_version |
sorted(selected_ids)) hex-encoded. Same inputs always produce the
same 64-char hex string, regardless of reasoning path; permuted ID
order is invariant.
ComputeTraceToken is the canonical helper. SinglePass, ChunkedTree,
and AgenticStrategy each call it before returning. The Cached
wrapper re-derives the token on cache hits so the trace survives
the cache layer (the token is a pure function of cached inputs).
SystemPromptVersion ("v1") is bumped whenever a retrieval system
prompt changes in a way that should invalidate replay; the constant
is asserted in tests so the bump is a deliberate decision.
A future phase will replace the placeholder doc_version "1" with
real per-document versioning — the parameter is in the signature
already so that's a one-line change.
0 commit comments