re: the port was still being told SE audio is undecodable -- it is not

A resolve-check on HANDOFF's own rows. Q8 read "SE audio is undecodable
from the disc -- no XACT container exists anywhere". menu-audio-cues.md
retracted exactly that ("### Retracting 'cannot be extracted'") and
locates three cues in Static.slb that decode to PCM: d-pad move 0x1ec0
(4 packets), (B) back 0x0ec0 (2), (A) confirm 0x5d6c0 (6), all mono
48 kHz. The retraction landed in docs/re/ and the page the port reads
kept the superseded text -- the fourth time in this corpus.

Writing the rule down has not worked, so there is a tool now.
handoff_lint.py flags every HANDOFF line making a strong negative claim
that links a doc containing retraction language. First run: found the Q8
row, plus one benign false positive (Q3 links a doc whose retraction is
about a sprite count, not about the tie-break -- checked, and HANDOFF
repeats none of the retracted figures). The lint also caught its own bug
first: it reported existing docs as missing because it joined a guessed
repo root, so it now resolves links relative to the file as markdown does.

Separately, EXTRAS's paint-order risk narrows twice more. Of its 15 tied
pairs only 2 overlap, and of those, ptloop01 x ptloop02 are loop*
animations compose skips by default -- so exactly ONE tie can be drawn:
ptframe3 x ptframe4, overlapping 102x132 px. Against live-extras.png that
contested region correlates +0.9622, better than the whole frame (+0.9440)
and inside the range of regions where order cannot matter (+0.8502 /
+0.9903). Consistent with our order, not proof: correlation cannot see a
swap between locally similar art.

15 -> 2 -> 1 -> consistent is now the whole paint-order risk on the five
screens, and HANDOFF says so.
This commit is contained in:
Sylpheed RE agent
2026-08-29 02:31:37 +00:00
parent 9ff9e8e633
commit 3eba09aae0
6 changed files with 138 additions and 5 deletions

View File

@@ -0,0 +1,53 @@
#!/usr/bin/env python3
"""Does HANDOFF.md still assert something its own linked doc has retracted?
This has now happened four times: a finding lands in docs/re/ and the page the
port agent actually reads keeps the superseded text. Once it was worse than
stale -- the port was told SE audio was "undecodable from the disc" while three
cues were located and decoding to PCM in the linked file.
For every HANDOFF line that makes a STRONG NEGATIVE claim and links to a doc,
check whether that doc contains retraction language. A hit is not proof the row
is wrong -- docs retract other things too -- it is a row to read.
handoff_lint.py [docs/port/HANDOFF.md]
"""
import os, re, sys
HANDOFF = sys.argv[1] if len(sys.argv) > 1 else "docs/port/HANDOFF.md"
# Resolve links the way markdown does: relative to the FILE, not to a guessed
# repo root. The first version joined a guessed root and reported every existing
# doc as missing -- which is the tool failing its own control, and is why the
# "missing doc" branch prints rather than being silently skipped.
BASE = os.path.dirname(os.path.abspath(HANDOFF))
NEGATIVE = re.compile(r"undecodable|cannot be|can not be|impossible|no .{0,24}exists|"
r"does not exist|not extractable|unreachable", re.I)
RETRACT = re.compile(r"retract|withdraw|was too strong|that was wrong|superseded|"
r"refuted\b.{0,40}\bmine|no longer", re.I)
LINK = re.compile(r"\]\(\.\./re/([^)]+)\)")
def main():
text = open(HANDOFF, encoding="utf-8").read().splitlines()
flagged = checked = 0
for n, line in enumerate(text, 1):
if not NEGATIVE.search(line):
continue
for rel in LINK.findall(line):
doc = os.path.normpath(os.path.join(BASE, "..", "re", rel.split("#")[0]))
if not os.path.exists(doc):
print(f" L{n}: link to a MISSING doc: {rel}")
flagged += 1
continue
checked += 1
body = open(doc, encoding="utf-8").read()
hits = sorted({m.group(0).lower() for m in RETRACT.finditer(body)})
if hits:
flagged += 1
claim = NEGATIVE.search(line).group(0)
print(f" L{n}: claims {claim!r}; linked {rel} contains {hits}")
print(f"\n{checked} negative claim(s) with links checked, {flagged} to read")
return 1 if flagged else 0
if __name__ == "__main__":
sys.exit(main())