From 05b64ccacb05814a32a227b945ab5e2901b7fdd8 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 29 Jul 2026 22:01:24 -0400 Subject: [PATCH] docs(knowledge): name the guard for the verification filter's two dialects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The location filter's section comment says THE TWO MUST CHANGE TOGETHER and names tests/test_retrieval_scopes.py as what enforces it. The drift-check filter added in #2086 has the same two-dialect structure and the same hazard — a predicate applied in only one arm makes a record findable one way and invisible another — but pointed at no guard, so the next person had to discover that tests/test_snippet_drift_check.py walks both. Also names the case that motivated `attention` existing at all: an ok verdict whose code_sha has gone stale is neither `drifted` nor `unverified`, and is the one shape a reader is likely to think redundant and remove. Written while verifying the plugin fixes end-to-end — this edit is what the write-path trigger fired on, correctly surfacing snippet #2192 as prior art at this exact path. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01UaYUaouG9jjhATyuxCKrQs --- src/scribe/services/knowledge.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/scribe/services/knowledge.py b/src/scribe/services/knowledge.py index 8373044..6fdfa43 100644 --- a/src/scribe/services/knowledge.py +++ b/src/scribe/services/knowledge.py @@ -120,6 +120,12 @@ def _location_clause(parts: dict[str, str]): # the verdict's: jsonpath compares the two fields within the row, so this stays # one index-served predicate rather than a post-filter that would make the # pagination total a lie. +# +# Same two-dialect discipline as the location filter above, and the same hazard: +# THE TWO MUST CHANGE TOGETHER. tests/test_snippet_drift_check.py is the guard — +# it walks both dialects over the same cases, including the one that motivated +# `attention` existing (an ok verdict whose code_sha has gone stale, which is +# neither `drifted` nor `unverified` yet plainly needs looking at). def verification_matches(data: dict | None, value: str) -> bool: """Python dialect of the verification predicate.