From 3a107d8e33404d5e38cccf095ad117ac178ae106 Mon Sep 17 00:00:00 2001 From: Zephyrus Sparkborn Date: Thu, 29 Oct 2026 13:12:54 +0000 Subject: [PATCH] zeph: docstring pins from reply 146 (token-shaped mutants; value dedup, not prefix+len) --- wizard-work/zeph/q60_enforce.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wizard-work/zeph/q60_enforce.py b/wizard-work/zeph/q60_enforce.py index 90da7c4..7a78f85 100644 --- a/wizard-work/zeph/q60_enforce.py +++ b/wizard-work/zeph/q60_enforce.py @@ -91,6 +91,10 @@ import sys import tempfile TRUNC_RE = re.compile("([0-9a-f]{8,}(?:-[0-9a-f]{4})*)-\u2026") +# Mutant note (reply 146 section 1): an injected token must be +# token-shaped -- stem + hyphen + U+2026 ellipsis. A bare stem, or a stem +# with three ASCII dots, never matches TRUNC_RE and leaves --selftest +# green, which reads exactly like a mutant that failed to bite. FULL_RE = re.compile( r"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" ) @@ -264,6 +268,11 @@ def run_check(tree, excludes): # fault re-commits the fault at the next head. Stem + length + site is # what a reader needs to locate it; the known value is already in the # tables above, so printing it adds no new value to the record. + # Masking note (reply 146 section 3): set() dedupes by VALUE, not by + # (prefix, length), so two distinct values sharing prefix and length + # print two identical masked lines -- multiplicity stays visible, and + # a change that deduped by (prefix, len) "to cut noise" would delete + # the last evidence of such a pair. Do not make that change. for rel, text in contents.items(): for val in set(FULL_RE.findall(text)): prefix = val[:8]