The script ended with `git rm -r accessibility/publish` plus a commit, which
was created fresh with the current time on every run. That changed the tip SHA
even when nothing else had, making the old tip a sibling rather than an
ancestor of the new one -- so every publish was a force-push. It also was not
achieving its stated purpose: `git rm` only removes a file from the tip, so
publish.sh was still present in every older commit of the published repo.
Fold the exclusion into the filter instead, as one filename callback covering
keep, rename and drop. The machinery now leaves the whole history, and the
rewrite is deterministic -- verified by publishing twice into separate
directories and diffing git rev-list --all: all 24 SHAs identical.
Publishing is now `git push`, and a rejected push means something real: that
the dev history itself was rewritten.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The documented way to run the testbed began with
rm -rf ~/AppData/Roaming/LOVE/Alchemist
which is the player's actual playthrough. It was written down as the
official procedure in four places, so every run of the test suite ate a
real save -- including twice in the session that produced the previous
commit. Reported by Talon.
The testbed does genuinely need an empty save directory: it drives a new
game from the main menu through the prologue, which has already happened
in any real save. So tests/run-testbed.sh MOVES the save aside (never
deletes it), runs, discards the test run's directory and moves the real
one back. Restore is on an EXIT trap plus INT/TERM, so it also happens on
a failed run, a crash and Ctrl-C. If the restore itself fails it says so
loudly and leaves the backup on disk rather than pressing on.
This cannot live inside the mod: love.load calls config.initialize,
keybindings.initialize and user.initialize long before main.lua reaches
require("accessibility").initialize(), so by the time any of our Lua runs
the save directory has already been read. The swap has to happen around
the process.
The rm -rf is removed from all four docs that carried it, each replaced
with the script and the reason not to clear that directory by hand --
being written down as procedure is what made it recur.
accessibility/.gitattributes forces LF on *.sh, or a Windows checkout
hands bash a \r and the script dies. It sits inside accessibility/ on
purpose: a top-level one would show up in the game-file footprint check,
which still reads `main.lua | 1 +`.
Verified with a marker file in a populated save directory: 38 checks, 0
failures, marker intact, no leftover backup directories.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The setup is unusual enough to need its own page, and the facts were
scattered across scratch.md, CLAUDE.md and publish.sh: the mod is developed
inside a copy of a commercial game, so the dev tree deliberately has no
remote and publishing means rebuilding a filtered repo and force-pushing
that instead.
docs/00-dev-setup.md covers the two-tree arrangement and which one you are
in, prerequisites and why the game must be an extracted folder rather than
a .love (ffi.load goes through the OS loader), building a dev tree from
scratch including the vanilla-0.4.2 baseline tag and the one main.lua line,
the everyday commands, the save location, reading the [speech] console and
the startup self-test, and the publish flow with its leak check.
Linked from CLAUDE.md and the docs index. No code change.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>