diff --git a/docs/tickets/ticket-000028-multi-modality-witness.md b/docs/tickets/ticket-000028-multi-modality-witness.md index 944767d..babf238 100644 --- a/docs/tickets/ticket-000028-multi-modality-witness.md +++ b/docs/tickets/ticket-000028-multi-modality-witness.md @@ -261,10 +261,18 @@ if canonical_match is not None: witness = None if policy.get("canonical_witness_enabled", False): from arborist.qa.witness import run_witness - # Cache lookup is a no-op closure pre-#000027 (always returns - # None). Post-#000027 it's the actual canonical_cache lookup. - def _cache_lookup() -> bytes | None: - return None # TODO: wire post-#000027 + # Cache lookup closes over the prior persisted row's answer + # bytes (post-#000027 / e19aed8). The real implementation in + # arborist/qa/query.py:2158-2172 reads the cached_row picked + # up at the top of the canonical branch — comparing against + # that prior row, not anything we'd write in the same call, + # so the leg is non-tautological. + _cached_bytes = ( + cached_row["answer_text"].encode("utf-8", errors="surrogatepass") + if cached_row is not None + else None + ) + _cache_lookup = lambda: _cached_bytes # noqa: E731 witness = run_witness( question=question, pi_star_ref=pi_star_ref,