Files
Sylpheed/tools/port/index-decisions
MechaCat02 c3758e3850 port: land the play-tested work, and only that
Takes the port branch up to 77320d5e -- the state the human play-tested on
2026-09-02 -- for SOURCE paths only. Not a branch merge: `auto/port-p6-audio`
is 366 commits and 938 files, and most of that must not land.

WHAT COMES IN (76 files, all human-confirmed working):
  * the logo splash animation. 08ed3dd1 found it: `pose_at` ASSIGNED the settle
    instant instead of clamping to it, so the splash never animated at all --
    and the same bug manufactured a passing harness result, because the harness
    photographed t past the settle. Confirmed by play-test: "cannot notice any
    obvious difference from the actual game."
  * gamepad input -- (A)/(B) bound additively (`ui_accept` ships with NO joypad
    binding), stick latched with hysteresis at the game's own 61% digitise
    threshold. This is what made (A), video-skip and Extras work at all.
  * menu navigation and flow, menu audio, the exporter, the authored
    declarations, and 23 verification tools under tools/port/.

WHAT IS DELIBERATELY LEFT ON THE BRANCH:
  * everything after c0ae460a -- the F5/F6 title-timing investigation, whose own
    tip commit calls itself a "hand-off for one-minute human checks". Unchecked
    by definition; it goes through the new review gate like anything else.
  * the OPTIONS menu work of 2026-09-03. Real, probably good, NOT play-tested.
  * the F1 repeat mechanism, which its own commit calls "deliberately inert".

WHAT MUST NOT LAND, AND WHY THE .gitignore CHANGED:
  545 MB of extracted game content was committed on that branch -- 850 sprite,
  audio and transcoded video files under `export-probe/` and `export-probe2/`,
  plus 246 MB of loose .wav and .tsv at the repo root. This repository's own
  rule, in this file, is "never game content".

  The rule was not missing. It was written, and it was tightened on that very
  branch, with a careful comment explaining why BOTH `export/` and `data/base/`
  had to be listed -- while the exporter was writing to a third name that
  nobody had thought to list. Enumerating names is the thing that failed. So
  the ignore rules now describe the SHAPE: any top-level `export*/`, game media
  by extension, and loose capture output at the root. Verified both ways -- it
  catches all four offenders and ignores nothing currently tracked.

Verified: `cargo check --workspace` clean; all nine GDScript files parse in
project context, with a positive control (an injected syntax error is detected,
3 lines) so the clean result means something. `tools/port/check-all` was NOT
run -- it needs the container, the export tree and a display.
2026-09-04 16:17:14 +02:00

61 lines
2.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Regenerate the contents block at the top of `docs/port/DECISIONS.md`.
#
# tools/port/index-decisions # rewrite the index
# tools/port/index-decisions --check # fail if it is out of date
#
# 🔴 WHY THIS EXISTS. The record reached 6 500 lines and 111 sections with no
# index, and on 2026-08-30 I spent an iteration empirically re-deriving a result
# it already contained -- under two headings that name the screens in question --
# then reported the question as unexplained to the Decoder. An unnavigable record
# is not a record that is hard to read; it is one that does not get read.
#
# ⚠️ `--check` exists because a stale index is worse than none: it would answer
# "is this already decided?" with a confident no. `check-all` runs it.
set -euo pipefail
cd "${PROJECT_DIR:-/work}"
DOC=docs/port/DECISIONS.md
BEG='<!-- INDEX: generated by tools/port/index-decisions -- do not hand-edit -->'
END='<!-- /INDEX -->'
body=$(python3 - "$DOC" <<'PY'
import re, sys
lines = open(sys.argv[1]).read().split('\n')
out = []
for l in lines:
if l.startswith('## '):
title = l[3:].strip()
# A GitHub anchor: lowercased, punctuation dropped, spaces to hyphens.
anchor = re.sub(r'[^\w\s-]', '', title.lower()).strip().replace(' ', '-')
# NO LINE NUMBERS. They would make the index a fixpoint problem -- writing
# it shifts every line below it -- and, worse, every appended section
# would silently invalidate all of them. An anchor survives both.
out.append(f"* [{title}](#{anchor})")
print('\n'.join(out))
PY
)
new=$(printf '%s\n\n%d sections. Search this before re-deriving anything.\n\n%s\n\n%s\n' \
"$BEG" "$(grep -c '^## ' "$DOC")" "$body" "$END")
cur=$(awk -v b="$BEG" -v e="$END" 'index($0,b){f=1} f{print} index($0,e){f=0}' "$DOC")
if [ "${1:-}" = --check ]; then
if [ "$cur" = "$new" ]; then echo " index-decisions ok"; exit 0
else echo " index-decisions 🔴 the index is out of date -- run tools/port/index-decisions"; exit 1; fi
fi
python3 - "$DOC" "$BEG" "$END" "$new" <<'PY'
import sys
doc, beg, end, new = sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4]
s = open(doc).read()
if beg in s:
i, j = s.index(beg), s.index(end) + len(end)
s = s[:i] + new.rstrip('\n') + s[j:]
else:
# First run: place it after the H1 and its opening paragraph.
k = s.index('\n## ')
s = s[:k] + '\n\n' + new.rstrip('\n') + s[k:]
open(doc, 'w').write(s)
print("index written")
PY