For agents, on top of README.md, which they read first.
- Never edit anything under
zbanks-alttp/: it is upstream's tree byte for byte. What the host needs goes in../../packages/zbanks(shim/host.cfor C,src/lib.rsfor Rust) or in a compiler flag inBUCK, with a comment saying what forced it. - A change the host genuinely cannot make from outside is a carried patch:
a new
patches/NNNN-what-it-does.patch(agit diffof the vendored file, applied with-p4), in its own commit named for what it does, with a comment in the patched code startingCarried patch (jev):, and a row inpatches/README.mdplus its notes inpatches/CLAUDE.md.:patchedinBUCKapplies them in name order; one that stops applying fails the build. To make one: edit the vendored file,git diff --no-color <file> > patches/NNNN-....patch,git checkout <file>. BUCKglobspatches/*.patchonly, sopatches/README.mdandpatches/CLAUDE.mdare inert to the build. Keep any other file there out of that glob's reach.-Dap_goal_add=zb_goal_addapplies toap_map.conly (BUCK). That is what lets the host decline goals the save says are done whileap_plan.ckeeps the realap_goal_add. Adding the define to every source would rename the definition too and silently remove the host from the path.- To refresh from upstream:
git fetch ~/src/github.com/zbanks/alttp master,git rm -r third-party/c/zbanks-alttp,git read-tree --prefix=third-party/c/zbanks-alttp/ -u <commit>, build (every patch must still apply, or be dropped with its row inpatches/if upstream fixed the same thing), and update the commit hash inREADME.md,../../packages/zbanks(src/lib.rs,shim/host.c) and../../research/zbanks-alttp.md. - The bot writes debug files with bare relative names;
-Dfopen=zb_fopenand-Drename=zb_renameinBUCKsend them to the host's chosen directory. A new libc file call in a future upstream (remove,open) needs the same treatment, or its file lands in the repo root.