Commit Graph

6 Commits

Author SHA1 Message Date
MechaCat02
c0a5725934 port: pin by tag, and how to verify audio with no sound card
**The pin.** Pin a TAG, never a bare sha. A sha reachable only from an auto/*
branch is orphaned when that branch is deleted or -- worse -- squash-merged,
because squash creates new commits: main looks like it contains the work while
the pin becomes unreachable and this project stops building for a fresh
checkout, silently, at their build. formats-pin-2026-08-29 exists for the
current state.

Also says plainly why NOT to float to a branch, which was the tempting fix:
Cargo resolves a git dependency once and writes the sha into Cargo.lock, so
floating gives staleness you cannot see instead of staleness you can read.
push-work now pushes --follow-tags so annotated tags travel with the branch.

**Audio.** docs/AUDIO-VERIFICATION.md separates three questions that were being
asked as one: is the transcode faithful (no engine, no device -- a file-vs-file
difference measurement), does Godot route it (AudioEffectRecord on the Master
bus writes a WAV from a headless run), and what does the GAME play (a PulseAudio
null sink, which needs a rebuild).

It leads with the three ways the fidelity measurement lies, because all three
were hit on the first attempt and each produces a confident wrong number rather
than an error: unaligned subtraction, mismatched channel layouts, and probing a
file another process is still writing.

The 5.1 disc fact deliberately is NOT copied here -- it lives in the RE corpus
at docs/re/structures/movie-audio-channels.md and is linked, so there is one
copy to keep true rather than two that drift. Same reason HANDOFF is a summary
with links.

The downmix itself stays flagged as an unmade decision, not quietly resolved.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 11:00:54 +02:00
Sylpheed port agent
4a5fa7f1cb merge main: container and push-work fixes
Bringing the infrastructure fixes from main onto this branch so the two do not
drift. main touched docker/{entrypoint.sh,sylph-port,bin/push-work} and
docs/loop-task.md; this branch's only docker/ change is bin/build-reference-cli,
so there is no overlap and nothing to reconcile by hand.
2026-08-29 06:14:43 +00:00
Sylpheed port agent
b36dddaeb5 build: key the reference CLI's target dir by the pinned revision
The reference renderer was a revision behind for three consecutive diff runs and
nothing said so.

After the pin bump, `build-reference-cli` reported success at rev 5414db3 and
`verify-screen` showed main_menu jumping 3/255 -> 72/255. The natural reading was
that the port had regressed. It had not: the port was right and the REFERENCE was
stale. The shared CARGO_TARGET_DIR still held a `sylpheed-cli` built from
8b6dbcf, cargo said "Finished in 0.13s" and left it there. A clean target dir
built a binary resolving ptframe1 to (440,108) t=62; the shared one still said
(620,108) t=16.

The old check -- does `screen list` run -- cannot catch this. A stale binary runs
perfectly.

So: build into `$CARGO_TARGET_DIR/reference-cli/$rev`, keyed by the pin, where a
new revision has no artifacts to reuse. Then verify the binary AGAINST export/:
both come from the same pin, so if the CLI resolves ptframe1's rest differently
from what the exporter wrote, the two halves of the verification are not the same
revision and it fails loudly. It compares the two rather than asserting a
literal, so it stays true when the pin moves again.

docker/bin is baked into the image, so this needs an image rebuild to reach
PATH; until then invoke the repo copy by path.
2026-08-28 21:44:08 +00:00
MechaCat02
fa74d69886 port: push-work must not configure the repository it runs in
It set `git config --local credential.helper "store --file=$HOME/..."`, which
PERSISTS in the repository. The repo is a bind mount the host also uses, so the
host's git inherited `store --file=/sylph-home/port/.git-credentials` -- a path
that exists only inside the container -- and every host push then failed with
`unable to get credential storage lock: No such file or directory`.

Same root as the EBUSY credential error, from the other side: a tool that
configures a shared repository to suit itself breaks every other user of that
repository. Now applied with `-c` to the single push invocation.

Cleared the leaked setting from both checkouts by hand. Syplheed-Reborn had it
too, from the RE container's copy of this script.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 21:15:24 +02:00
Sylpheed port agent
5d04ef16fe docker: fix build-export for the subcommand, and build the reference CLI at the pin
Two tooling fixes, both needed before P1 can diff anything.

`build-export` was calling `sylpheed-export --disc ... --out export`, which P0
broke when it moved the exporter behind `export` / `check` subcommands. It is a
regression from 8dd0577 and this is the fix. It now also runs `check` after
exporting, because `export` writes a tree and `check` is the only thing that
says the tree is readable by something other than the program that wrote it.

`build-reference-cli` is new. `sylpheed-cli screen render` is the reference the
Godot port gets diffed against, and the only copy of it in the container is
/reborn/target/release, which has two problems: the release binary predates the
`screen` subcommand entirely, and /reborn is a LIVE mount of the other agent's
working tree -- it moved from e81dcad to f5e7426 during a single iteration. A
reference renderer that runs different decoders than the exporter puts a free
variable in every pixel diff, so this builds the CLI from the same pinned
revision the exporter uses and drops it on the persistent target volume.

Both are COPY'd into the image at Dockerfile:76, so neither takes effect in a
running container until the image is rebuilt. The reference CLI is already built
into the target volume by hand, so P1 is not blocked in the meantime.
2026-08-28 19:00:26 +00:00
MechaCat02
9d96be609e scaffold the Godot port, as its own repo with its own agent
The port is deliberately separate from the reverse-engineering project: its own
repository, its own clone, its own container. Two writers in one working tree
means files change under whoever is mid-edit and a `git add -A` by one sweeps up
the other's work -- which happened today in the Reborn tree, so this is set up
not to repeat it.

The wall: Godot never reads a disc format. An offline Rust exporter converts the
user's disc into JSON + PNG + Ogg, and the Godot project reads only that. No
GDExtension, no Rust in port/. Beyond the practical reason -- Godot cannot read
IPFB, RATC, T8aD, XMA or WMV -- there is the design one: modding is a goal, and
if the runtime reads the original formats then modding means reverse
engineering, whereas if it reads JSON it means opening a file.

The decoders come from sylpheed-formats PINNED BY REVISION (8b6dbcf), not
vendored and not reimplemented. `sylpheed_formats::media` in particular already
owns every case where one playable thing is not one archive entry: entries that
span segment files, banks with several sub-waves, and the cutscene voices, which
are one continuous XMA stream chunked into VOICE_*.slb entries whose boundaries
do NOT match the cues. That last one is the easiest thing in this project to get
subtly wrong, so the mission says outright not to re-derive it.

docs/MISSION.md is the objective (P0-P7, each gated by an artifact rather than
by compiling). docs/BLOCKED.md lists what cannot proceed until the RE agent
answers Q1-Q10, and says plainly that none of it may be guessed -- this agent
has no emulator and no oracle, so a value it invents is indistinguishable from a
decoded one a month later.

The container is deliberately small: 3 cpus / 4 GB against the RE container's
6 / 7, and an image with no C++ toolchain, no Vulkan stack and no emulator. Two
full-size containers do not fit on this box beside a desktop.

Its launcher sets the git identity through GIT_AUTHOR_*/GIT_COMMITTER_* rather
than writing [user] into .git/config -- the config route captures every commit
made in that tree, including a human's, which is how six of today's commits
ended up attributed to the RE agent.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 17:56:44 +02:00