port: my branch IS the stale era, and verify-screen's reference was never its own build

Told the Decoder their diagnosis was wrong. They were right. ui_layout.rs is md5
b6c19d08 in my working tree, at HEAD, on my pushed branch and on origin/main --
one file, stale marker present, tree clean.

What misled me is the same trap a third time: CARGO_TARGET_DIR is a shared
/sylph-home/port/target-container, so two source trees write one binary and cargo
fingerprints per source path -- each build reports Finished while the binary on
disk belongs to whichever tree wrote last. A CLI built from my workspace is
3a39fce (stale, rest t=70), identical to one built from origin/main; the binary
verify-screen actually used was 8e0aa76 (fixed, rest t=12), from a tree nobody had
named. It happened to be the right era, which is worse than wrong -- it agreed
with the pin by luck and one rebuild would have flipped it silently, and title_jp
differs by 74507 px between eras.

verify-screen now reads the reference CLI's pteff00 rest instant and compares it
against the export the port reads, refusing to score if they disagree. Controlled
both ways: passes with the matching binary, refuses the stale one built from my
own workspace.

And the pin is load-bearing, not an annoyance to revert: the workspace crate is
stale, so the pin is the only reason the export is correct. Consequence worth
stating -- my published branch carries the stale crate, so anyone building
sylpheed-cli from it gets the stale decoder.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N7FiFFFwbvG2uxdcEh8HyF
This commit is contained in:
Sylpheed port agent
2026-08-30 14:52:27 +00:00
parent 8666c33a6a
commit dbbf28e22f
2 changed files with 104 additions and 1 deletions

View File

@@ -101,6 +101,42 @@ export DISPLAY="${DISPLAY:-:97}"
[ -x "$CLI" ] || { echo "no reference CLI at $CLI -- \`cargo build --release -p sylpheed-cli\` failed?" >&2; exit 2; }
[ -f export/manifest.json ] || { echo "no export/manifest.json -- run build-export --run" >&2; exit 2; }
# 🔴 THE REFERENCE BINARY IS NOT NECESSARILY THE ONE THIS SCRIPT BUILT.
#
# `CARGO_TARGET_DIR` is a SHARED `/sylph-home/port/target-container`. Two source
# trees -- this workspace and any worktree built with the same variable set --
# write one `release/sylpheed-cli`, and cargo fingerprints per source path, so
# each build reports "Finished" while the binary on disk belongs to whichever
# tree wrote last. `cargo build` here returns in 0.15 s and changes nothing.
#
# That is the hazard the header above says the monorepo removed. It did not; the
# shared target dir reintroduced it by another route. Measured 2026-08-30: a CLI
# built from this workspace is `rest t=70` (the stale record layout) while the
# binary actually sitting in the target dir was `rest t=12` (fixed) -- so this
# script was comparing the port against a decoder from a tree nobody had named.
#
# ⚠️ It happened to be the RIGHT era, which is worse than wrong: it agreed with
# the exporter's pin by luck, and one successful rebuild would have flipped it
# silently. `title_jp` differs by 74 507 px between the two eras.
#
# So the era is CHECKED, against the export the port actually reads, rather than
# assumed from having run `cargo build`.
ref_rest=$("$CLI" screen info "$DISC/dat/GP_TITLE.pak" --build 5 --all 2>/dev/null \
| grep -i 'pteff00' | head -1 | sed -n 's/.*rest (0,0) t=\([0-9]*\).*/\1/p')
exp_rest=$(python3 -c '
import json
m=json.load(open("export/manifest.json"))
f=next(s["file"] for s in m["screens"] if s["name"]=="main_menu")
d=json.load(open("export/"+f))
print(int(next(e for e in d["elements"] if e.get("id")=="pteff00")["rest"]["t"]))')
if [ -n "$ref_rest" ] && [ "$ref_rest" != "$exp_rest" ]; then
echo "🔴 the reference CLI and the export disagree on the decoder era:" >&2
echo " reference $CLI says pteff00 rest t=$ref_rest" >&2
echo " export/ (built by the pinned exporter) says rest t=$exp_rest" >&2
echo " Every row below would compare two decoder eras. Refusing." >&2
exit 2
fi
mkdir -p "$OUT"
# Godot needs one scan to register the `class_name` globals; without it every