From 29ddd164bba518e95f2e927ea2f253f516c18ef7 Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Sun, 10 May 2026 07:52:54 -0400 Subject: [PATCH] =?UTF-8?q?ticket=20#000028=20=C2=A72.6=20sketch:=20refres?= =?UTF-8?q?h=20stale=20TODO=20post-#000027?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Broader stale-map sweep across docs/, bench/, scripts/, Makefile, and top-level surfaced one hit: the witness-mode example sketch in §2.6 of ticket #000028 still showed a no-op cache_lookup closure with "TODO: wire post-#000027" — even though the real implementation in arborist/qa/query.py:2158-2172 wired the cache leg in commit e19aed8 (2026-05-09), the same commit that closed both #000027 and #000028. Updated the sketch to match the actual implementation: the cache lookup closes over the prior persisted row's answer bytes (encoded with surrogatepass for UTF safety), and the comparison is non- tautological because cached_row is the row picked up BEFORE we'd write a new one in this same call. Same drift pattern as the #000028 §8 follow-up refresh (6d20aeb) and the #000010/§000021/#000040 sweep (e84f453) and the repair.py TODOs (8980e64): pre-implementation design notes don't get refreshed after the implementation lands. Each instance is one session-waste saved. After this, both surfaces are clean: - arborist/ + tests/ stale TODOs: zero (8980e64) - docs/ + bench/ + scripts/ + Makefile + top-level: zero (this commit) The remaining matches are all genuine future-work markers (raw_html cache in async_web_fetcher.py:2309) or false-positives (\\uXXXX escape-pattern docs in mesh/wire.py and tests/test_cli_render.py). --- .../ticket-000028-multi-modality-witness.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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,