monorepo: one repository for the decoders, the port and the corpus

Merges the Godot port into the reverse-engineering repository, preserving both
histories -- 1019 commits of corpus plus the port's 31, brought in by subtree
merge and then moved into place so git can follow each file across the rename.

The reason is not tidiness. The two-repo split forced the exporter to depend on
the decoders by pinned revision, and that created a whole class of failure that
now disappears: a sha reachable only from a topic branch, orphaned by a
squash-merge, breaking a fresh checkout silently at build time. It also forced a
live read-only mount of one agent's working tree into another's container, which
is why a contract file could move mid-iteration. With a path dependency, a
decoder change and the exporter change it requires land in the same commit or
not at all.

Canary stays separate: it is a fork tracking upstream.

New structure for the long term:

  docs/game/     how the game is NAVIGATED -- menus, modals, prompts, alerts,
                 and in-game flight. Written so nobody rediscovers it. Mostly
                 open questions on purpose; the in-game tutorials are the
                 resource for the flight half.
  docs/port/MODDING.md
                 modding as a constraint on the exporter TODAY, not a later
                 feature: one logical asset in one file (the disc splits nearly
                 everything, and resolving that is the exporter's job), names a
                 person recognises, PNG/OGG/OGV/JSON only, base-and-overrides so
                 re-exporting is always safe, provenance in every file.
  data/base + data/mods
                 generated tree and drop-in overrides, both gitignored
  exchange/      transient inter-agent files, deliberately outside history
  docs/agents/   the team protocol

Both the README and the navigation doc lead with the correction that cost the
most: the oracle is the real game under Xenia Canary. Reborn's renderer is a
hypothesis under test, it has been wrong, and treating it as ground truth
propagated into three documents and both agents before a human caught it.

Scripted modding stays possible without being built: no screen name is hardcoded
in GDScript and there is no native code in port/, which is what Godot Mod Loader
needs to be able to substitute behaviour later.
This commit is contained in:
MechaCat02
2026-08-29 11:34:46 +02:00
parent f44ebced59
commit 9fbb352ef0
45 changed files with 293 additions and 1523 deletions

52
tools/port/screen-strip Executable file
View File

@@ -0,0 +1,52 @@
#!/usr/bin/env bash
# Render one screen at several points on its timeline and montage them -- the
# P2 gate artifact, and the way to eyeball any animation question later.
#
# tools/screen-strip main_menu # a default spread
# tools/screen-strip main_menu 0.45 0.6 0.9 1.35 # explicit seconds
#
# Also writes <screen>.rest.png and <screen>.settled.png and reports where they
# differ. That difference is the interesting number: the timeline is expected to
# land EXACTLY on the declared resting pose for every element whose `rest` the
# decoders identify correctly, so a clean run shows a difference confined to the
# elements we know it misses, and nothing else. A difference anywhere else means
# the interpolation is wrong.
set -euo pipefail
cd "${PROJECT_DIR:-/work}"
name="${1:?usage: screen-strip SCREEN [SECONDS...]}"; shift
times=("$@")
[ ${#times[@]} -eq 0 ] && times=(0.45 0.52 0.57 0.62 0.67 0.75 0.90 1.35)
OUT="${OUT:-${TMPDIR:-/tmp}/screen-strip}"
export DISPLAY="${DISPLAY:-:97}"
mkdir -p "$OUT"
[ -d port/.godot ] || godot --headless --path port --import >/dev/null 2>&1
shot() { # shot <godot args...> <outfile>
local out="${!#}"
godot --path port --resolution 1280x720 -- "--screen=$name" "${@:1:$#-1}" \
"--capture=$out" >"$OUT/$name.log" 2>&1
}
labelled=()
for t in "${times[@]}"; do
shot "--time=$t" "$OUT/$name.t$t.png"
convert "$OUT/$name.t$t.png" -resize 320x180 -bordercolor gray30 -border 1 \
-background black -fill white -pointsize 13 label:"t = ${t}s" \
-gravity center -append "$OUT/$name.lab$t.png"
labelled+=("$OUT/$name.lab$t.png")
done
montage "${labelled[@]}" -tile 4x -geometry +4+4 -background black "$OUT/$name.strip.png"
shot --pose=rest "$OUT/$name.rest.png"
shot --time=99 "$OUT/$name.settled.png"
convert "$OUT/$name.settled.png" "$OUT/$name.rest.png" -compose difference -composite "$OUT/$name.d.png"
max=$(convert "$OUT/$name.d.png" -format "%[fx:maxima*255]" info:)
convert "$OUT/$name.d.png" -colorspace Gray -threshold 0 "$OUT/$name.m.png"
if [ "${max%.*}" = "0" ]; then
box="(identical)"
else
box=$(convert "$OUT/$name.m.png" -trim -format "%wx%h%X%Y" info: 2>/dev/null)
fi
echo "$name: strip -> $OUT/$name.strip.png"
echo "$name: settled timeline vs declared rest -- max ${max}/255, differing region $box"