zeph: Q96 -- absence cell + exhausted-stem recovery in q60_enforce.py

This commit is contained in:
zephyrus-sparkborn committed 2026-10-28 13:11:15 +00:00
1 parent 99f95b5b7a
commit f17c9367ef
1 file changed
+59 -5
+59 -5
View File
@@ -29,9 +29,14 @@ What it does, on a checkout at a NAMED head:
concatenation so no literal for it exists in this source; (b) FAIL concatenation so no literal for it exists in this source; (b) FAIL
diagnostics are masked (stem + length + site, never the full value), diagnostics are masked (stem + length + site, never the full value),
because a report quoting the fault re-commits it at the next head. because a report quoting the fault re-commits it at the next head.
The beae0b1f stem rule keys on the 8-char stem: any future token The beae0b1f stem rule keys on the 8-char stem, narrowed per reply
sharing that stem classifies exhausted without a look (reply 113 130 section 2 / interview 117 section 1.1 (Q96): a truncated token
section 1 boundary note). sharing that stem skips the longer-string look and stays
UNRECOVERED-JUSTIFIED, but a full UUID-shaped value arriving under
that stem is reported RECOVERED with its site. The old, wider rule
(any future token sharing the stem classifies exhausted without a
look) suppressed a genuine recovery; the placeholder itself is still
never a recovery.
Quoting rule (interview 117 Q2): a verdict is only ever quoted at a head Quoting rule (interview 117 Q2): a verdict is only ever quoted at a head
that contains the artifact it grades. Green readings at heads predating that contains the artifact it grades. Green readings at heads predating
@@ -41,8 +46,19 @@ Exit status: 0 when no FAIL line is printed, 1 otherwise.
``--selftest`` builds fixture trees and asserts the negative cells: an ``--selftest`` builds fixture trees and asserts the negative cells: an
unknown truncated token fails, a real complete-but-wrong value fails, the unknown truncated token fails, a real complete-but-wrong value fails, the
fixture value classifies TEST-FIXTURE, a self-quoting report file excluded fixture value classifies TEST-FIXTURE, a self-quoting report file excluded
from the population collapses the count, and the check over the checker's from the population collapses the count, the check over the checker's
own directory passes (cell 7, the self-scan leg). own directory passes (cell 7, the self-scan leg), the checker's own
source bytes do not contain the concatenated fixture value (cell 8, the
absence cell, Q96), and a full value under the exhausted beae0b1f stem
reports RECOVERED (cell 9, Q96).
Correction, reply 130 probe D / interview 117 section 1.4: the
2026-10-27 check-in credited cell 7 with proving that no UUID-shaped
literal for the fixture exists in this source. That instrument claim is
refuted -- cell 7 prints TEST-FIXTURE for exactly that occurrence class
and stays green. The property holds today and is proven by ``full value
in source bytes: False``, which cell 8 now asserts every run; cell 7
proves something else (the check passes over its own directory).
Usage: Usage:
python3 q60_enforce.py --tree <checkout-path> [--exclude <relpath> ...] python3 q60_enforce.py --tree <checkout-path> [--exclude <relpath> ...]
@@ -184,6 +200,19 @@ def run_check(tree, excludes):
break break
if longer: if longer:
break break
else:
# Q96 narrowing: a truncated token under an exhausted stem
# skips the longer-string look, but a full value that arrives
# under that stem is a recovery, not an exhaustion. The
# placeholder (and the fixture, by symmetry) never counts.
for rel, text in contents.items():
for val in FULL_RE.findall(text):
if (val[:8] == stem8 and val != PLACEHOLDER
and val not in KNOWN_FIXTURE.values()):
longer = (val, rel)
break
if longer:
break
if longer: if longer:
lines.append("TOKEN %s: RECOVERED-IN-TREE %s at %s" % (stem, longer[0], longer[1])) lines.append("TOKEN %s: RECOVERED-IN-TREE %s at %s" % (stem, longer[0], longer[1]))
elif stem8 in KNOWN_EXTERNAL: elif stem8 in KNOWN_EXTERNAL:
@@ -219,6 +248,19 @@ def selftest():
"""Fixture trees; each cell asserts a behaviour, not a tautology.""" """Fixture trees; each cell asserts a behaviour, not a tautology."""
passed = [] passed = []
# Cell 8 (Q96 absence cell): the concatenated fixture value must not
# appear in this file's own bytes. The value is assembled here from
# the table, never written as a literal, so a literal re-commit of
# it in this source fails this cell while cell 7 stays green
# (TEST-FIXTURE) -- the two cells red on distinguishable faults.
# Proven both directions by the mutant runs in the landing record:
# clean source -> absent (False); literal-inserted copy -> present.
fixture_value = "".join(KNOWN_FIXTURE.values())
with open(os.path.abspath(__file__), "rb") as fh:
assert fixture_value.encode("utf-8") not in fh.read(), \
"fixture value literal present in checker source"
passed.append("source-absence-passes")
def check(tree, excludes, want_fail, label): def check(tree, excludes, want_fail, label):
_lines, failed = run_check(tree, excludes) _lines, failed = run_check(tree, excludes)
assert failed == want_fail, "%s: want fail=%s" % (label, want_fail) assert failed == want_fail, "%s: want fail=%s" % (label, want_fail)
@@ -269,6 +311,18 @@ def selftest():
for l in lines), "fixture value did not classify TEST-FIXTURE at its site" for l in lines), "fixture value did not classify TEST-FIXTURE at its site"
check(d, ["report.md"], False, "fixture-value-passes") check(d, ["report.md"], False, "fixture-value-passes")
os.remove(os.path.join(d, "f.md")) os.remove(os.path.join(d, "f.md"))
# Cell 9 (Q96 exhausted-stem flip): a full value arriving under
# the exhausted beae0b1f stem reports RECOVERED with its site.
# Built by concatenation, as in cell 4, so no second UUID-shaped
# literal enters this source; the value is Timmy's probe-C value.
with open(os.path.join(d, "g.md"), "w") as fh:
fh.write("beae0b1f-" "9f2c-4d1e-8a77-3c5b6e9d0a11\n")
lines, _ = run_check(d, ["report.md"])
assert any(l.startswith("TOKEN beae0b1f: RECOVERED-IN-TREE")
and l.endswith("at g.md") for l in lines), \
"full value under exhausted stem did not report RECOVERED"
check(d, ["report.md"], False, "exhausted-stem-recovers")
os.remove(os.path.join(d, "g.md"))
# Cell 7 (the sixth cell of reply 113, renumbered by cell 6): run the # Cell 7 (the sixth cell of reply 113, renumbered by cell 6): run the
# check over the checker's own directory and assert rc 0. This is # check over the checker's own directory and assert rc 0. This is
# the leg that was missing: five cells graded fixture trees, none # the leg that was missing: five cells graded fixture trees, none