Skip to content

The recipe branch: mods chosen when the game is built, a help key, two books, and the recipe that checks itself - #1

Merged
takushieternal merged 11 commits into
claude/great-maxwell-00u7q3from
recipe
Oct 16, 2026
Merged

takushieternal merged 11 commits into
claude/great-maxwell-00u7q3from
recipe

Conversation

@mplscorwin

@mplscorwin mplscorwin commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

What this changes for the game as shipped: nothing about how it plays. A plain build carries
every mod it carries today, plays online with builds made before this branch, and passes every
existing test. One message is new: a refused join now says "Different game version or mods".

What it adds

  1. Mods chosen when the game is built. mods/catalog.tsv declares each mod (its files, what it
    needs, whether online players must match, the tests that need it); mods/default.cfg is the
    shipped set; an uncommitted mods.cfg holds your own (-archipelago, +helpbook, hd3d off).
    A mod that is off is not in the program: its files compile to nothing and src/mods_off.c
    stands in, doing what the game would do had the mod never been written. Its menu lines go; its
    zelda3.ini keys are still accepted. zelda3 --mods says what a build carries. Two builds whose
    game-changing mods differ refuse each other instead of drifting apart.
    • Switchable: story, screenshot, 2D-HD, 3D view (needs 2D-HD), randomizer, Archipelago (needs the
      randomizer), the network. Co-op is not a switch: it is the game now (138 names used by 22
      other files, measured).
    • The rules are mods/SPEC.md (M1 to M21); tests/mods/run.sh checks each in shell (37 tests),
      and --prove-red plants nine faults that must each turn it red.
  2. A new mod, off by default: the help key. Ctrl+H opens the player's book at the section for
    what you are doing (the menu, the title or a game over, online, together, a dungeon, outdoors, the
    credits): the Windows help viewer on Windows, the browser elsewhere. tests/coop/helpbook.txt,
    tests/unit/helpbook_url_test.c.
  3. Two books, docs/books/manual.md (for players) and docs/books/devguide.md (for modders),
    as numbered game-book sections that each say where to go next. make books builds a Windows help
    file (.chm) for each, web pages, and plain text; the Windows download carries them.
    tools/books.py check refuses a route to nowhere, a section no one can reach, or a page the help
    key needs that is missing.
  4. RECIPE.org: the branch as a literate recipe, what each part is, in order, with the command
    and what you should see. Its check blocks are read by two readers that must agree byte for byte,
    and the check runs in CI.
  5. CONTEXT-MODELS/: what the work was planned from. Each mod makes its own case with its
    measured numbers; the readers the books were written for; the project's words (yours, Alfred's,
    and Corwin's workshop's, none renamed). contributors/BRYANT.md and ALFRED.md are empty and
    yours to fill, or delete
    : no one's first person is written for them.
  6. The Nintendo Switch build, relanded as a build option (your 6a7984b removed it). It had
    stopped building before it was removed: its Makefile's SRC_DIR pointed at src/, which cannot
    reach snes/ or third_party/. With that fixed, every source compiles for the Switch; it carries
    its own set of mods (mods/switch.cfg: no Archipelago, whose TLS needs the system's OpenSSL, and
    no network, since the port never starts the Switch's sockets). make switch builds
    zelda3.nro, with devkitPro or in its image devkitpro/devkita64, and a new CI job builds it on
    every push without shipping it. Two commits (941b5f5, 693ec85), so it can be dropped alone.

Also: stand-ins for your new A Link to the Past world (8464ead), written from each caller.
Ap_MedallionOpens keeps the original rule (Ether opens Misery Mire, Quake opens Turtle Rock), which
a plain "no" would have broken. BUILDING.md and the README have short sections, and
AI_DISCLOSURE.txt stays true.

How it was checked

  • Upstream baseline at 0831a3d: 185/185 tests pass.
  • The build matrix (tools/mods_matrix.sh) builds the shipped set, each mod off alone and all off,
    and runs every test in each, skipping nothing; tools/mods_needs.py reads which tests need which
    mod. The first (discovery) run set the catalog's test lists (CONTEXT-MODELS/data/matrix1-*). The
    final run, on this branch's code, is still going as this opens; its results will land as one more
    commit here.
    Two network tests (net_combat_*) failed once each in the discovery run while the
    machine was busy compiling; the final run is on an idle machine, to tell load from a real need.
  • A council read the branch before this pull request (all five are AI sub-agents):
    • a doubt-first critic: 20 rows, 1 block;
    • a reward-first critic: 13 rows;
    • an editor's seat: 12 rows, "looks good to council";
    • two fact-checks of every claim in the player's book, on two model sizes: 8 and 2 false, all
      real.
      All of it was answered in commit 39d79cc, and the fixes closed on one clean QA pass. The block: the recipe's own check said "every check
      passed" after a failure when run with plain sh. It now stops at the first failure, and
      tests/recipe/run.sh proves it.
  • CI now also builds every mod off but the help key, runs the URL unit test and the recipe's proof,
    and compiles the help key's Windows file with MinGW.

The first push failed CI, and why

The Archipelago client tests compile src/ap_*.c directly, without make, and the first version of
src/mods.h stopped with an error when the generated header was missing. Fixed in 1426a4f: a file
compiled on its own gets the shipped set (mods/SPEC.md, M22), with a test that compiles every mod's
file alone in a clean tree. Every Linux, Windows, Switch and Archipelago CI step was then run in a
clean clone before the next push (ci-local, which reads the steps from build.yaml itself).

Not checked

  • The Switch build running (it builds and links; not run on hardware or an emulator).
  • The .chm in the real Windows help viewer. Two readers here agree the files are sound
    (7-Zip, chmlib); a person on Windows 11 is the third.
  • The help key on macOS and Windows at run time; tested on Linux, compiled for Windows.

Authorship

Every commit on this branch was made by an AI (Claude, working for Corwin Brust as "Mentat"). By
Corwin's house rule they are authored under his name and each carries
Co-Authored-By: Mentat (for Corwin; claude-opus-5-5); AI_DISCLOSURE.txt says so. If you would
rather they were authored "Claude" like the rest of the history, that is a rebase away.

Mentat (for Corwin; claude-opus-5-5)

mplscorwin and others added 11 commits October 16, 2026 16:19
A build now carries exactly the mods its builder chose. mods/catalog.tsv
declares each mod (its files, what it requires, whether online players
must match, the tests that need it); mods/default.cfg is the shipped set;
an uncommitted mods.cfg holds your own choices (+name, -name, or
"name off"). tools/mods.py turns them into src/mods_build.h before every
build (make, Visual Studio, MinGW; run_with_tcc.bat falls back to the
committed src/mods_default.h). A mod that is off compiles to nothing:
src/mods_off.c stands in for it, doing what the game would do had the
mod never been written. Its menu lines are hidden; its zelda3.ini keys
are still accepted and do nothing.

The shipped set is the game as it was: every existing mod on, and the
shipped build sends the same protocol version as before, so it plays
online with builds made without this. A build whose game-changing mods
differ sends a tag instead, and mismatched builds refuse each other
("Different game version or mods"). zelda3 --mods prints what a build
carries.

The rules are mods/SPEC.md (M1-M21); tests/mods/run.sh checks each
clause in shell (36 tests) and --prove-red plants eight faults that
must each turn it red. tools/mods_census.py measures a mod's surface
from the compiled objects; tools/mods_matrix.sh builds every
composition and runs every test in each; tools/mods_needs.py reads
which tests really need which mod.

New, off by default: the helpbook mod. Ctrl+H opens the player's book
at the section for the moment (the menu, the title screen, online,
together, a dungeon, outdoors); the Windows help viewer on Windows, the
browser elsewhere. tests/coop/helpbook.txt checks it.

Co-Authored-By: Mentat (for Corwin; claude-opus-5-5) <[email protected]>
Two game books, one Markdown file each (docs/books/manual.md,
docs/books/devguide.md), seventeen numbered sections, each ending with
where to go next. tools/books.py check refuses a book in which a route
goes nowhere, a section cannot be reached from section 1, a section
strands its reader, or a page the help key can open is missing;
tests/books/run.sh tests it and --prove-red plants five faults.
tools/books.py build (make books) makes help/: a Windows help file
(.chm) for each book, the pages as HTML, each book on one page, and
plain text. The markers are the C4 game-book markers, so its linter can
read the books too.

Co-Authored-By: Mentat (for Corwin; claude-opus-5-5) <[email protected]>
First-person models in layers: each mod making its own case with its
measured numbers (ideas/), the readers the books were written for
(readers/), the contributors (contributors/: each person's file is
theirs to write, and is empty), how the parts lean on each other
(RELATIONS.tsv, from the census), the project's words from the game,
Bryant and Alfred's garden and Corwin's lab (TAXONOMY.tsv), and the
plan for keeping those words steady from design to build
(PLAN-theseus-argo-disco.md).

Co-Authored-By: Mentat (for Corwin; claude-opus-5-5) <[email protected]>
What each part is, in the order to make it, the command, and what you
should see. Its check blocks are pulled out by two readers that must
agree byte for byte (tools/unfold.awk, tools/unfold.py); CI runs that
check on Linux, and builds the books into the Linux and Windows
downloads.

Co-Authored-By: Mentat (for Corwin; claude-opus-5-5) <[email protected]>
8464ead taught Archipelago to play Archipelago's own A Link to the Past
world, and the game now asks it eleven new things (and the randomizer
one). tools/mods_census.py listed them; each stand-in was written from
its caller. Places answer "not a place of the multiworld" (-1), gates
and items pass the original game's answer through, and
Ap_MedallionOpens keeps the original rule (Ether opens Misery Mire,
Quake opens Turtle Rock), which it also holds: a plain "no" would have
sealed both dungeons in builds without Archipelago. Erratum 7 in the
developer's guide; the census and relations in CONTEXT-MODELS are
measured again.

Co-Authored-By: Mentat (for Corwin; claude-opus-5-5) <[email protected]>
Upstream removed it in 6a7984b. Its files come back exactly as they
were at 0831a3d, with a README: nothing builds it unless asked (no CI
job, not the top Makefile, not the README), which is "off by default"
for a whole platform. Building it needs one new step, making
src/mods_build.h first. Not checked: no devkitPro where this was made.

Files restored from Bryant Frankford's tree at 0831a3d.

Co-Authored-By: Mentat (for Corwin; claude-opus-5-5) <[email protected]>
README: a section on choosing the mods when you build (mods.cfg, the
help key, the books), pointers to the player's book, the developer's
guide and RECIPE.org, and two lines in "Where to mod". AI_DISCLOSURE.txt
stays true: the recipe branch's commits were made by an AI too, and are
authored under Corwin's name by his house rule, each naming the AI.

Co-Authored-By: Mentat (for Corwin; claude-opus-5-5) <[email protected]>
Before the pull request the branch was read by a council: a
doubt-first critic, a reward-first critic, an editor's seat, and two
fact-checks of every claim in the player's book. What they found, and
what changed:

- The recipe's own check said "every check passed" after a check had
  failed, when run with plain sh. It now stops at the first failure,
  restores mods.cfg on any exit, and tests/recipe/run.sh plants a
  broken catalog and a broken book to prove it (and --prove-red shows
  the test sees the old weakness).
- The 3D view now requires the 2D-HD look: without its light gathering
  dark rooms drew fully lit. A plain "-hd2d" is refused, with the reason.
- The catalog's test lists come from the build matrix, not from names;
  tools/mods_needs.py counts a failure as explained by any mod that is
  off with the named one.
- The help key: the legend, game over and file screens open "starting",
  the credits "last"; the Windows help path is quoted and file:// URLs
  are percent-encoded (tests/unit/helpbook_url_test.c); Controls help
  hides the 3D and screenshot lines in builds without them.
- run_with_tcc.bat stops on a refused mods.cfg, and says so when it has
  no Python; a mods.cfg with a byte-order mark is accepted.
- CI builds every mod off but the help key, runs the recipe's proof and
  the URL test, and compiles the help key's Windows file with MinGW.
- The player's book: nine claims corrected (L3 for first person, the
  ping, DeathLink, the assets message, notarized, the menus, the keys in
  zelda3.ini, the screenshots the repository keeps, your own saves);
  Watch everyone explained; who wrote it moved to the end.
- RECIPE.org states its claim as two bets and measures them
  (tools/books.py voice); BUILDING.md says how to choose mods in a hand
  build; numbers in CONTEXT-MODELS match their data.

Co-Authored-By: Mentat (for Corwin; claude-opus-5-5) <[email protected]>
CONTEXT-MODELS/data/matrix1-*.tsv: the discovery run of
tools/mods_matrix.sh (every test in every composition, nothing
skipped), from which the catalog's tests column was set. The final run
on the finished branch follows. tools/mods_needs.py now counts a
shipped-build failure as explained when the test belongs to a mod the
shipped set leaves off (the help key).

Co-Authored-By: Mentat (for Corwin; claude-opus-5-5) <[email protected]>
CI's Archipelago client job compiles src/ap_*.c directly, without
make, and src/mods.h stopped with #error when src/mods_build.h had not
been made. Now a file compiled on its own gets the shipped set from
src/mods_default.h (mods/SPEC.md, M22). tests/mods/run.sh compiles
every mod's own file alone in a clean tree, and --prove-red plants the
old erroring header back to show the test sees it. The council's doubt
seat had named this risk (d10); the first answer was only a paragraph in
BUILDING.md, which now says what is true.

Co-Authored-By: Mentat (for Corwin; claude-opus-5-5) <[email protected]>
Upstream removed the Switch build in 6a7984b. It had stopped building
some time before: its Makefile's SRC_DIR was ../.. (src/), which cannot
reach snes/ or third_party/. With SRC_DIR at the top of the tree every
source compiles for the Switch, and the one link error left is
Archipelago's sigaction, which libnx does not have.

So the Switch carries its own set of mods: mods/switch.cfg, read through
the tool's new --cfg option (mods/SPEC.md, M23), is the shipped set
without Archipelago (its TLS loads the system's OpenSSL at run time; a
Switch has none) and without the network (the port never starts the
Switch's sockets). `make switch` builds src/platform/switch/zelda3.nro
with devkitPro, or in its image devkitpro/devkita64. A new CI job builds
it there on every push, so it keeps building; it is not shipped (no
artifact). Untested on hardware or an emulator: it builds and links.

Co-Authored-By: Mentat (for Corwin; claude-opus-5-5) <[email protected]>
@takushieternal

Copy link
Copy Markdown
Member

Noice

@takushieternal
takushieternal merged commit 8711960 into claude/great-maxwell-00u7q3 Oct 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants