WIP: feat(agent): build Longshot commits of both builders, make_game.py's and longshot-builder's (Longshot #2286) #143

Draft
HumanBean wants to merge 15 commits from HumanBean/Beanstalk:feat/longshot-builder into main
Owner

Longshot is replacing nx2/make_game.py with longshot-builder, one Rust program built from builder/ (Longshot #2286). For a while the farm will see commits of both kinds, so the agent builds and tests both, like the Longshot Launcher.

It works before and after #2286 merges. Commits that still have nx2/make_game.py (today's main, the nightlies) are built exactly as on Beanstalk's main: that code is unchanged and its checks pass unchanged. Commits with builder/crates/longshot-builder go through the new flow.

It matches Longshot #2286 at xnrvuytn: the root Cargo workspace, longshot-builder dev tools in place of scripts/tools.py, the error codes of its build-events.md, dev.py packs' farm mode and its upscaler variables.

How the kind is picked

After the fetch, the agent reads each side's tree from git (BuilderKinds.Of, Workspace.KindOfAsync):

  • a commit with builder/crates/longshot-builder is built by longshot-builder;
  • a commit with nx2/make_game.py (and no longshot-builder) is built by make_game.py, as before;
  • a commit with neither is a report of error;
  • a commit from the middle of #2286's history (a builder/Cargo.lock of its own, no root workspace) is refused in words (Builder.LayoutProblem).

A job is one kind. A baseline of one kind and a candidate of the other are refused with an error that says so ("main builds with make_game.py and the pull request with longshot-builder: ... rebase the pull request on main"). Their tools.lock differ anyway, so the existing tools rule would refuse them too, and the nightly regression chain restarts at the change as it already does when tools.lock changes.

Each kind keeps its own folders, so a base of one kind never takes a pack of the other:

  • make_game.py's stay where they are: tools/, python/, games/, bases/, stores/lifts.
  • longshot-builder's are all under <data>/builder/: tools, python, rust, builders, stores, bases.

Eviction looks at both kinds' bases and keeps each kind's active one; builder/bases' linked romfs counts once in the data folder's size. Each kind keeps its own Python: make_game.py's flow keeps its current one, and the new flow uses a pinned python-build-standalone 3.14.10 in builder/python on both systems, because #2286's tools.lock ships no Python.

The longshot-builder flow (Core/WorkspaceBuilder.cs, Core/Builder.cs, Core/BuilderPython.cs)

Prefetch (outside the sandbox, running no code of the repository's):

  • the pinned Python;
  • main's tools.lock tools for this system, installed by the agent itself (WindowsTools.ParseBuilder, WindowsTools.UnpackTarZst, by build-driver's tools/lock.rs and tools/archive.rs rules): each .tar.zst downloaded, checked by its size and SHA-256, and unpacked with no path out, no link out, nothing written through a link, no hard links and nothing half unpacked left, with the system's zstd or the pinned one on Windows;
  • the pinned Rust, and the crates the root Cargo.lock names (main's, and a pull request's when it builds its own builder): only downloaded and checked by their SHA-256 here, never unpacked; they are unpacked in the sandbox. A lock the farm can't fetch (not crates.io's, no checksum, other bytes) is that lock's error.
  • for a plan with an upscaler, its vendor files, fetched by main's fetch.py.

The .nup is checked but never read into games/: longshot-builder reads it in place. A dump is passed as the one folder that holds romfs/ and exefs/.

The builder itself:

  • main's builder is built in the sandbox with scripts/longshot_builder.py build --profile release, offline, with no GPU, its target folder in --work and cargo --locked at the read-only root. It is built once per key: the git ids of builder/, the scripts that build it, and the root Cargo.toml and Cargo.lock. A reused builder is touched, so pruning by write time keeps the ones in use.
  • A manual run whose two sides are both a nightly or release tag downloads both sides' longshot-builder-<tag>-<platform> instead, each checked against SHA256SUMS and SHA256SUMS.sig against Longshot's release key, built into the agent (Workspace.ReleasePair). Otherwise both builders are built from their commits alike, so a job never times a release's profile against a commit's.
  • The PR uses main's builder unless it changes the files in the key. Then it builds its own in the job's folder. The PR's builder is never kept.

Builds:

  • scripts/dev.py packs base|pack|rt with --game <.nup>, LONGSHOT_BUILD (the side's own builder, read-only, so dev.py never runs cargo; the runtime too), LONGSHOT_STORE, LONGSHOT_CACHE (a cache of each build's own) and LONGSHOT_BUILD_JSON=1. Under these, #2286's dev.py packs runs directly, not through a job queue.
  • main's builds write the store. A PR's pack builds over a reflink copy of it, deleted after the pack. The store is emptied before main's next base build once it holds more than 30 GB.
  • Game folders hold no romfs: each one's longshot_romfs.idx names the .nup, and every build and game run gets the .nup read-only at its own path.
  • Timed builds run longshot-builder build --json --no-prepare-shaders with no GPU. Their caches: cold is an empty store, lift a copy of the store's compile/, warm a copy of the whole store.

Upscalers (with #144's plans):

  • the base and the pack get the variables #2286's dev.py packs reads (LONGSHOT_NGX_SDK, LONGSHOT_FSR with LONGSHOT_FFX_SDK, LONGSHOT_XESS_SDK), the SDK folder read-only, and the base's stamp names the upscaler;
  • a timed build gets --upscaler <u>, --ngx-sdk for DLSS and --accept-licenses <vendor>, the licence the tester accepted;
  • FSR 4's and XeSS's files are put in each build's cache under the names longshot-builder looks for, so nothing is downloaded in the sandbox;
  • a plan is refused rather than built without its upscaler: a dev.py packs without upscaler variables, a vendor file main's runtimes.rs pins missing or other, a pull request that pins other files, or a base without the upscaler.

Events and errors (BuildEvents):

  • The agent reads the JSON Lines events (Longshot's docs/dev/reference/build-events.md), from dev.py packs too, and the text form, for progress, stages, the CPU level, done and check. Stage times come from build_times.json.
  • An error code that is this PC's trouble is sent as fail, so the job goes to another tester: every code of build-events.md a PC causes and a commit can't (Builder.PcCodes: the game files' row, the disk, the overlapping folders, a folder in use, cpu_unknown, a download, and the upscalers' license_not_accepted, bad_license, dlss_sdk_missing); the checks keep the list inside the doc's table. tools_incomplete is the commit's when its tree's tools.lock is not main's, else this PC's. Every other code is a report of error.
  • longshot-builder check --json --cache <the agent's> replaces make_game.py --check for these commits.
  • A PR that changes the pinned Rust is refused, as one that changes tools.lock already is.

split_giants stays in the plan schema and applies to make_game.py's builds only. For a longshot-builder side, LONGSHOT_SPLIT_GIANTS is left out of the build (the builder doesn't read it), and the build's report note says it was ignored.

What the review round changed

  • Tools: installed by the agent from main's tools.lock (#2286 deleted scripts/tools.py), checked and unpacked by the builder's own rules; no repository code runs on the host for them.
  • Crates: from the root Cargo.lock, only downloaded and checked outside the sandbox; the builder's key takes the root Cargo.toml and Cargo.lock; a commit from the middle of #2286's history is refused in words.
  • Release builders only when both sides have one.
  • Runtimes name their side's builder, read-only.
  • Error codes: every PC-caused code of build-events.md is a fail; tools_incomplete by the tree's tools.lock.
  • Upscalers: a plan's upscaler (#144) is built, or the plan refused, never dropped.
  • Nits: no GPU where nothing draws, the store's 30 GB cap, the linked romfs counted once, builders kept by use, check --cache.
  • Docs: the agent's README, docs/architecture.md and using.md as the agent now does it.

Coordinator and docs

  • The build-time table knows longshot-builder's stage ids.
  • The lift digest is called "lifted code" for both kinds, rather than "lifted C" (test_timing.py's expected strings were updated for that wording).
  • The planner says split_giants applies to make_game.py's builds only.
  • The architecture, report schema, test plan, using and agent README docs say both builders are supported, and that the make_game.py flow goes once Longshot's main (and the nightlies the farm still tests) have only longshot-builder. That removal will be a follow-up PR.

Testing

On the first version (before the review round):

  • dotnet build agent/Beanstalk.Agent.slnx -c Release: 0 warnings, 0 errors.
  • python -I agent/tests/test_agent_core.py --strict: 2549 checks pass. Every existing check file is unchanged from main; only Program.cs gains a line registering the new section. The BuilderChecks section covers the kind picked from real git commits of each kind and from made-up trees; the refusal across kinds; each kind's folders; the events (JSON and text) and the error codes; build_times.json, the tool variables, the builder key and the Rust build's linker settings; a release's program checked against a signed, a wrongly signed and a mismatched SHA256SUMS; the .nup read in place; bases of a moved .nup rebuilt; the PR's pack built over a store copy, with main's store and base never writable to it; fail vs error routing, and a timed build's command and store.
  • python -I agent/tests/test_release.py: passes.
  • Coordinator pytest -q: 630 passed, 1 skipped.

The review round adds checks to BuilderChecks for each change above (the tools' lock and archive rules, the root lock and key, the layout refusal, the release pair, the PC codes against the doc's table, the upscalers' variables, flags and refusals, the store cap). On the head after the review round (yzoxxkwt): python -I agent/tests/test_agent_core.py --strict passes 2807 checks and the coordinator's test_timing.py and test_plan.py pass (246). The follow-up purzmvnm (each job's own LONGSHOT_DATA; #2286's new game-file codes as this PC's) passes 2817 checks.

Not run: a real farm job or game build. A real run will show:

  • whether the Rust build of longshot-builder works in bubblewrap and in an AppContainer, especially the Linux link with the bundle's clang and lld on a PC without cc;
  • whether the agent's own tools install works on Windows with the pinned zstd;
  • the disk peak with both kinds' folders on one PC (the 100/150 GB minimums are unchanged).

Open points

  • The 30 GB store cap is a guess: nothing else prunes longshot-builder's store, and each pack copies it; the right size needs a real farm's numbers.
  • FSR 4 and XeSS builds are covered only by unit checks on Linux; no real build with either has run.

Notes

  • With LONGSHOT_BUILD_JSON=1, #2286's dev.py packs prints only the builder's JSON events on stdout, so base and pack failures carry their error codes: a disk_full is a fail, a compile_failed a report of error with its code. An older dev.py ignores the variable, and its text output is still read. The make_game.py flow never sets it.
  • The coordinator still checks only tools.lock when a manual run is requested. A pinned-Rust change between two longshot-builder nightlies is caught by the agent, as an error.

https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8

🤖 Generated with Claude Code

Longshot is replacing `nx2/make_game.py` with `longshot-builder`, one Rust program built from `builder/` ([Longshot #2286](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2286)). For a while the farm will see commits of both kinds, so the agent builds and tests both, like the Longshot Launcher. **It works before and after #2286 merges.** Commits that still have `nx2/make_game.py` (today's `main`, the nightlies) are built exactly as on Beanstalk's `main`: that code is unchanged and its checks pass unchanged. Commits with `builder/crates/longshot-builder` go through the new flow. **It matches [Longshot #2286](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2286) at `xnrvuytn`:** the root Cargo workspace, `longshot-builder dev tools` in place of `scripts/tools.py`, the error codes of its `build-events.md`, `dev.py packs`' farm mode and its upscaler variables. ## How the kind is picked After the fetch, the agent reads each side's tree from git (`BuilderKinds.Of`, `Workspace.KindOfAsync`): - a commit with `builder/crates/longshot-builder` is built by longshot-builder; - a commit with `nx2/make_game.py` (and no longshot-builder) is built by make_game.py, as before; - a commit with neither is a report of `error`; - a commit from the middle of #2286's history (a `builder/Cargo.lock` of its own, no root workspace) is refused in words (`Builder.LayoutProblem`). A job is one kind. A baseline of one kind and a candidate of the other are refused with an `error` that says so ("main builds with make_game.py and the pull request with longshot-builder: ... rebase the pull request on main"). Their `tools.lock` differ anyway, so the existing tools rule would refuse them too, and the nightly regression chain restarts at the change as it already does when `tools.lock` changes. Each kind keeps its own folders, so a base of one kind never takes a pack of the other: - make_game.py's stay where they are: `tools/`, `python/`, `games/`, `bases/`, `stores/lifts`. - longshot-builder's are all under `<data>/builder/`: `tools`, `python`, `rust`, `builders`, `stores`, `bases`. Eviction looks at both kinds' bases and keeps each kind's active one; `builder/bases`' linked romfs counts once in the data folder's size. Each kind keeps its own Python: make_game.py's flow keeps its current one, and the new flow uses a pinned python-build-standalone 3.14.10 in `builder/python` on both systems, because #2286's `tools.lock` ships no Python. ## The longshot-builder flow (`Core/WorkspaceBuilder.cs`, `Core/Builder.cs`, `Core/BuilderPython.cs`) **Prefetch** (outside the sandbox, running no code of the repository's): - the pinned Python; - `main`'s `tools.lock` tools for this system, installed by the agent itself (`WindowsTools.ParseBuilder`, `WindowsTools.UnpackTarZst`, by build-driver's `tools/lock.rs` and `tools/archive.rs` rules): each `.tar.zst` downloaded, checked by its size and SHA-256, and unpacked with no path out, no link out, nothing written through a link, no hard links and nothing half unpacked left, with the system's zstd or the pinned one on Windows; - the pinned Rust, and the crates the root `Cargo.lock` names (main's, and a pull request's when it builds its own builder): only downloaded and checked by their SHA-256 here, never unpacked; they are unpacked in the sandbox. A lock the farm can't fetch (not crates.io's, no checksum, other bytes) is that lock's `error`. - for a plan with an upscaler, its vendor files, fetched by `main`'s `fetch.py`. The `.nup` is checked but never read into `games/`: longshot-builder reads it in place. A dump is passed as the one folder that holds `romfs/` and `exefs/`. **The builder itself**: - `main`'s builder is built in the sandbox with `scripts/longshot_builder.py build --profile release`, offline, with no GPU, its target folder in `--work` and cargo `--locked` at the read-only root. It is built once per key: the git ids of `builder/`, the scripts that build it, and the root `Cargo.toml` and `Cargo.lock`. A reused builder is touched, so pruning by write time keeps the ones in use. - A manual run whose two sides are both a nightly or release tag downloads both sides' `longshot-builder-<tag>-<platform>` instead, each checked against `SHA256SUMS` and `SHA256SUMS.sig` against Longshot's release key, built into the agent (`Workspace.ReleasePair`). Otherwise both builders are built from their commits alike, so a job never times a release's profile against a commit's. - The PR uses `main`'s builder unless it changes the files in the key. Then it builds its own in the job's folder. The PR's builder is never kept. **Builds**: - `scripts/dev.py packs base|pack|rt` with `--game <.nup>`, `LONGSHOT_BUILD` (the side's own builder, read-only, so dev.py never runs cargo; the runtime too), `LONGSHOT_STORE`, `LONGSHOT_CACHE` (a cache of each build's own) and `LONGSHOT_BUILD_JSON=1`. Under these, #2286's `dev.py packs` runs directly, not through a job queue. - `main`'s builds write the store. A PR's pack builds over a reflink copy of it, deleted after the pack. The store is emptied before `main`'s next base build once it holds more than 30 GB. - Game folders hold no `romfs`: each one's `longshot_romfs.idx` names the `.nup`, and every build and game run gets the `.nup` read-only at its own path. - Timed builds run `longshot-builder build --json --no-prepare-shaders` with no GPU. Their caches: `cold` is an empty store, `lift` a copy of the store's `compile/`, `warm` a copy of the whole store. **Upscalers** (with [#144](https://git.magicbean.dev/MagicBeanDev/Beanstalk/pulls/144)'s plans): - the base and the pack get the variables #2286's `dev.py packs` reads (`LONGSHOT_NGX_SDK`, `LONGSHOT_FSR` with `LONGSHOT_FFX_SDK`, `LONGSHOT_XESS_SDK`), the SDK folder read-only, and the base's stamp names the upscaler; - a timed build gets `--upscaler <u>`, `--ngx-sdk` for DLSS and `--accept-licenses <vendor>`, the licence the tester accepted; - FSR 4's and XeSS's files are put in each build's cache under the names longshot-builder looks for, so nothing is downloaded in the sandbox; - a plan is refused rather than built without its upscaler: a `dev.py packs` without upscaler variables, a vendor file `main`'s `runtimes.rs` pins missing or other, a pull request that pins other files, or a base without the upscaler. **Events and errors** (`BuildEvents`): - The agent reads the JSON Lines events (Longshot's `docs/dev/reference/build-events.md`), from `dev.py packs` too, and the text form, for progress, stages, the CPU level, `done` and `check`. Stage times come from `build_times.json`. - An error code that is this PC's trouble is sent as `fail`, so the job goes to another tester: every code of `build-events.md` a PC causes and a commit can't (`Builder.PcCodes`: the game files' row, the disk, the overlapping folders, a folder in use, `cpu_unknown`, a download, and the upscalers' `license_not_accepted`, `bad_license`, `dlss_sdk_missing`); the checks keep the list inside the doc's table. `tools_incomplete` is the commit's when its tree's `tools.lock` is not `main`'s, else this PC's. Every other code is a report of `error`. - `longshot-builder check --json --cache <the agent's>` replaces `make_game.py --check` for these commits. - A PR that changes the pinned Rust is refused, as one that changes `tools.lock` already is. **`split_giants`** stays in the plan schema and applies to make_game.py's builds only. For a longshot-builder side, `LONGSHOT_SPLIT_GIANTS` is left out of the build (the builder doesn't read it), and the build's report `note` says it was ignored. ### What the review round changed - **Tools:** installed by the agent from `main`'s `tools.lock` (#2286 deleted `scripts/tools.py`), checked and unpacked by the builder's own rules; no repository code runs on the host for them. - **Crates:** from the root `Cargo.lock`, only downloaded and checked outside the sandbox; the builder's key takes the root `Cargo.toml` and `Cargo.lock`; a commit from the middle of #2286's history is refused in words. - **Release builders** only when both sides have one. - **Runtimes** name their side's builder, read-only. - **Error codes:** every PC-caused code of `build-events.md` is a `fail`; `tools_incomplete` by the tree's `tools.lock`. - **Upscalers:** a plan's upscaler (#144) is built, or the plan refused, never dropped. - **Nits:** no GPU where nothing draws, the store's 30 GB cap, the linked romfs counted once, builders kept by use, `check --cache`. - **Docs:** the agent's README, `docs/architecture.md` and `using.md` as the agent now does it. ## Coordinator and docs - The build-time table knows longshot-builder's stage ids. - The lift digest is called "lifted code" for both kinds, rather than "lifted C" (`test_timing.py`'s expected strings were updated for that wording). - The planner says `split_giants` applies to make_game.py's builds only. - The architecture, report schema, test plan, using and agent README docs say both builders are supported, and that the make_game.py flow goes once Longshot's `main` (and the nightlies the farm still tests) have only longshot-builder. That removal will be a follow-up PR. ## Testing **On the first version** (before the review round): - `dotnet build agent/Beanstalk.Agent.slnx -c Release`: 0 warnings, 0 errors. - `python -I agent/tests/test_agent_core.py --strict`: 2549 checks pass. Every existing check file is unchanged from `main`; only `Program.cs` gains a line registering the new section. The `BuilderChecks` section covers the kind picked from real git commits of each kind and from made-up trees; the refusal across kinds; each kind's folders; the events (JSON and text) and the error codes; `build_times.json`, the tool variables, the builder key and the Rust build's linker settings; a release's program checked against a signed, a wrongly signed and a mismatched `SHA256SUMS`; the `.nup` read in place; bases of a moved `.nup` rebuilt; the PR's pack built over a store copy, with `main`'s store and base never writable to it; fail vs error routing, and a timed build's command and store. - `python -I agent/tests/test_release.py`: passes. - Coordinator `pytest -q`: 630 passed, 1 skipped. The review round adds checks to `BuilderChecks` for each change above (the tools' lock and archive rules, the root lock and key, the layout refusal, the release pair, the PC codes against the doc's table, the upscalers' variables, flags and refusals, the store cap). On the head after the review round (`yzoxxkwt`): `python -I agent/tests/test_agent_core.py --strict` passes 2807 checks and the coordinator's `test_timing.py` and `test_plan.py` pass (246). The follow-up `purzmvnm` (each job's own `LONGSHOT_DATA`; #2286's new game-file codes as this PC's) passes 2817 checks. **Not run:** a real farm job or game build. A real run will show: - whether the Rust build of longshot-builder works in bubblewrap and in an AppContainer, especially the Linux link with the bundle's clang and lld on a PC without cc; - whether the agent's own tools install works on Windows with the pinned zstd; - the disk peak with both kinds' folders on one PC (the 100/150 GB minimums are unchanged). ## Open points - **The 30 GB store cap is a guess**: nothing else prunes longshot-builder's store, and each pack copies it; the right size needs a real farm's numbers. - **FSR 4 and XeSS** builds are covered only by unit checks on Linux; no real build with either has run. ## Notes - With `LONGSHOT_BUILD_JSON=1`, #2286's `dev.py packs` prints only the builder's JSON events on stdout, so base and pack failures carry their error codes: a `disk_full` is a `fail`, a `compile_failed` a report of `error` with its code. An older `dev.py` ignores the variable, and its text output is still read. The make_game.py flow never sets it. - The coordinator still checks only `tools.lock` when a manual run is requested. A pinned-Rust change between two longshot-builder nightlies is caught by the agent, as an `error`. https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Longshot #2286 replaces nx2/make_game.py with longshot-builder, one Rust program
built from builder/. The agent now builds every side with it:

- prefetch, outside the sandbox and with main's code only: the agent's own
  pinned Python (Linux and Windows), tools.lock's tools by main's
  scripts/tools.py install (Windows: with a pinned zstd), the pinned Rust and
  builder/Cargo.lock's crates by main's scripts/renhdrum.py
- main's longshot-builder built in the sandbox (scripts/longshot_builder.py
  build, offline) once per key (the git ids of builder/ and its scripts); a
  tagged side of a manual run uses the release's program, checked against its
  SHA256SUMS signed by Longshot's release key; the PR builds with main's unless
  it changes the builder, then with its own, never kept
- dev.py packs base/pack/rt with LONGSHOT_BUILD and LONGSHOT_STORE: --game is
  the .nup, read in place (no more games/, 25 GB); a PR's pack builds over a
  copy of main's store
- timed builds run longshot-builder build --json directly
- its events read (JSON Lines and the text form), its error codes mapped:
  this PC's trouble (the game files, the disk, a download) is POST /fail, the
  rest a report of error; stages from build_times.json

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
LONGSHOT_SPLIT_GIANTS was make_game.py's: a build variant with it would build
twice for nothing. The coordinator and the agent refuse it now (unknown key);
the planner no longer offers it, and the upscalers' words say why they are
left out (their vendors' files need licenses accepted).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
docs(timing): timed builds, stages and the lift's digest in longshot-builder's terms
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 19s
CI / Coordinator image (pull_request) Successful in 21s
CI / Agent build and checks (pull_request) Successful in 1m31s
CI / Coordinator tests (pull_request) Failing after 1m40s
98d664f38e
The timed builds are longshot-builder builds now: its stage ids (tools,
read, lift, compile, finish, shaders) in the build-time table, the lift's
digest of its gen/ folder ("lifted code", no longer C), the caches as copies
of its store, and a manual run's tagged sides built with their release's
longshot-builder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
HumanBean force-pushed feat/longshot-builder from 98d664f38e
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 19s
CI / Coordinator image (pull_request) Successful in 21s
CI / Agent build and checks (pull_request) Successful in 1m31s
CI / Coordinator tests (pull_request) Failing after 1m40s
to 89fcbef963
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 9s
CI / Coordinator image (pull_request) Successful in 19s
CI / Agent build and checks (pull_request) Successful in 1m31s
CI / Coordinator tests (pull_request) Failing after 1m59s
2026-11-23 20:03:50 +00:00
Compare
Author
Owner

I rewrote the branch's history (force-pushed, now at 89fcbef9) to add the Assisted-by: Claude Opus 5.5 trailer that Beanstalk's AGENTS.md asks for, next to the Co-Authored-By and Claude-Session ones. The code is unchanged. The description now also says that Longshot #2286 will make dev.py packs pass --json through, so base and pack failures will carry their error codes.

I rewrote the branch's history (force-pushed, now at 89fcbef9) to add the `Assisted-by: Claude Opus 5.5` trailer that Beanstalk's AGENTS.md asks for, next to the `Co-Authored-By` and `Claude-Session` ones. The code is unchanged. The description now also says that Longshot #2286 will make `dev.py packs` pass `--json` through, so base and pack failures will carry their error codes.
HumanBean force-pushed feat/longshot-builder from 89fcbef963
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 9s
CI / Coordinator image (pull_request) Successful in 19s
CI / Agent build and checks (pull_request) Successful in 1m31s
CI / Coordinator tests (pull_request) Failing after 1m59s
to c249ed46a6
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 17s
CI / Workflow lint (actionlint) (pull_request) Successful in 16s
CI / Coordinator image (pull_request) Successful in 23s
CI / Agent build and checks (pull_request) Successful in 1m28s
CI / Coordinator tests (pull_request) Failing after 1m55s
2026-11-23 20:13:27 +00:00
Compare
HumanBean changed title from WIP: feat(agent)!: build Longshot with longshot-builder, the new builder from Longshot #2286 to WIP: feat(agent): build Longshot commits of both builders, make_game.py's and longshot-builder's (Longshot #2286) 2026-11-23 20:14:34 +00:00
Author
Owner

I reworked this to be backwards compatible, and force-pushed it (now at c249ed46). The agent now builds and tests both kinds of Longshot commit:

  • A commit with builder/crates/longshot-builder goes through the new longshot-builder flow.
  • A commit with nx2/make_game.py goes through make_game.py's flow, exactly as on main.

The kind is read from each side's tree. A job whose two sides use different builders is refused with an error that says why. Each kind keeps its own folders: everything for the new flow is under <data>/builder/. split_giants stays in the plan schema; a longshot-builder build ignores it and its report says so. Every existing agent check file passes unchanged, alongside the new BuilderChecks.

The history is now two commits, both with the Assisted-by, Co-Authored-By and Claude-Session trailers. The earlier commit that removed split_giants is gone. This PR no longer depends on #2286 merging first: it works before and after.

I reworked this to be backwards compatible, and force-pushed it (now at c249ed46). The agent now builds and tests both kinds of Longshot commit: - A commit with `builder/crates/longshot-builder` goes through the new longshot-builder flow. - A commit with `nx2/make_game.py` goes through make_game.py's flow, exactly as on `main`. The kind is read from each side's tree. A job whose two sides use different builders is refused with an `error` that says why. Each kind keeps its own folders: everything for the new flow is under `<data>/builder/`. `split_giants` stays in the plan schema; a longshot-builder build ignores it and its report says so. Every existing agent check file passes unchanged, alongside the new `BuilderChecks`. The history is now two commits, both with the `Assisted-by`, `Co-Authored-By` and `Claude-Session` trailers. The earlier commit that removed `split_giants` is gone. This PR no longer depends on #2286 merging first: it works before and after.
feat(agent): longshot-builder's error codes from dev.py packs too (LONGSHOT_BUILD_JSON)
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 4s
CI / Coordinator image (pull_request) Successful in 19s
CI / Workflow lint (actionlint) (pull_request) Successful in 18s
CI / Agent build and checks (pull_request) Successful in 1m33s
CI / Coordinator tests (pull_request) Failing after 1m54s
70a118e836
Longshot #2286's dev.py packs prints only longshot-builder's JSON events on
stdout with LONGSHOT_BUILD_JSON=1, so the new flow's base, pack and runtime
commands set it: a base's or a pack's failure then carries its code (this
PC's trouble sent as fail). Only for longshot-builder's commits; an older
dev.py ignores the variable and its text form is read as before.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2TsN4jgNUFQPfkAq8
Author
Owner

Pushed 70a118e8. Longshot #2286's dev.py packs now accepts LONGSHOT_BUILD_JSON=1, so the new flow sets it for packs base, pack and rt. This applies to longshot-builder commits only; the make_game.py flow never sets it. With it set, base and pack failures carry longshot-builder's error codes: disk_full and the other PC-trouble codes go to another tester as a fail, and compile_failed becomes a report of error with its code. An older dev.py ignores the variable, and its text output is still read. The new checks are in BuilderChecks: 2549 agent checks pass.

Pushed 70a118e8. Longshot #2286's `dev.py packs` now accepts `LONGSHOT_BUILD_JSON=1`, so the new flow sets it for packs base, pack and rt. This applies to longshot-builder commits only; the make_game.py flow never sets it. With it set, base and pack failures carry longshot-builder's error codes: `disk_full` and the other PC-trouble codes go to another tester as a fail, and `compile_failed` becomes a report of error with its code. An older `dev.py` ignores the variable, and its text output is still read. The new checks are in `BuilderChecks`: 2549 agent checks pass.
HumanBean force-pushed feat/longshot-builder from 70a118e836
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 4s
CI / Coordinator image (pull_request) Successful in 19s
CI / Workflow lint (actionlint) (pull_request) Successful in 18s
CI / Agent build and checks (pull_request) Successful in 1m33s
CI / Coordinator tests (pull_request) Failing after 1m54s
to fb67307efc
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 5s
CI / Coordinator image (pull_request) Successful in 22s
CI / Agent build and checks (pull_request) Successful in 1m33s
CI / Coordinator tests (pull_request) Failing after 1m50s
2026-11-24 04:35:24 +00:00
Compare
fix(agent): longshot-builder's data folder (LONGSHOT_DATA) the job's own, and Longshot #2286's new game-file codes this PC's
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 4s
CI / Workflow lint (actionlint) (pull_request) Successful in 5s
CI / Agent build and checks (pull_request) Successful in 47s
CI / Coordinator image (pull_request) Successful in 11s
CI / Coordinator tests (pull_request) Failing after 2m9s
e29eda3a2b
Longshot #2286 now keeps longshot-builder's license notes in a per-user data
folder apart from the cache: LONGSHOT_DATA, else the XDG or LocalAppData data
folder. The farm sets it explicitly next to LONGSHOT_CACHE, writable: main's
builds builder/data, a pull request's pack builder-data/ in its job's folder,
a timed build data/ in its own folder. Licenses are still accepted at every
build (dev.py packs' variables, --accept-licenses), and the farm runs no
update, so nothing reads the notes back; rt's shader preparation reads neither.
dev.py's own defaults (builder-cache/, builder-data/ in its development folder)
are setdefaults that packs base, pack and rt never apply, and LONGSHOT_BUILD
with LONGSHOT_BUILD_JSON=1 is exactly what packs.py's why_direct takes as the
farm's, so its builds run directly, never through the PC's job queue.

build-events.md's codes at #2286's head add nup_path_too_long, nup_damaged and
not_the_same_nup to the game files row: this PC's (PcCodes). usage (a command
line it does not take) is the agent's own: a report of error. The codes check
follows the table; disk_full, now from any full drive, stays this PC's.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
fix(agent): stage_failed this PC's, both kinds' active bases held, release downloads capped and pruned
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 4s
CI / Workflow lint (actionlint) (pull_request) Successful in 5s
CI / Coordinator image (pull_request) Successful in 16s
CI / Coordinator tests (pull_request) Failing after 1m30s
CI / Agent build and checks (pull_request) Successful in 1m34s
09c477f912
- stage_failed (folder.rs: the new build could not be put in the game
  folder, writable and with room) is this PC's, not passing; the check
  now walks build-events.md's whole codes table, each code this PC's or
  the commit's.
- BasesHeld lists both builder kinds' active bases first, then the kept
  ones of both kinds by last use: make_game.py's kept bases no longer hide
  longshot-builder's.
- The store's comment says what longshot-builder prunes itself (objects
  to 8 GB after each build, 14 days; the newest 3 lifts); the agent's cap
  is a backstop at twice that, 16 GB, down from 30 GB.
- Releases' programs (builders/release-<tag>/) and old pinned Rusts
  (builder/rust/rust-<v>-<key>/ and their downloads) are pruned by last use
  once a job's builders are chosen: 3 releases and 1 other Rust kept, never
  the running job's.
- A release's download is capped at the size its manifest
  (longshot-builder-<tag>-<platform>.json, checked through SHA256SUMS)
  gives it.
- docs/architecture.md: a release's carried sources are never unpacked by
  the farm's builds, which all pass --root.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
fix(agent): romfs_folder_theirs is the commit's
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 5s
CI / Workflow lint (actionlint) (pull_request) Successful in 5s
CI / Coordinator image (pull_request) Successful in 10s
CI / Agent build and checks (pull_request) Successful in 1m36s
CI / Coordinator tests (pull_request) Failing after 2m5s
37ded82843
Longshot #2286 (02386f32) added the builder error code romfs_folder_theirs: a build from a dump refuses a game
folder holding a non-empty romfs folder the builder did not make. The farm's game folders are only ever the
builder's: new and empty (a base, a timed build), or a base's kept by dev.py packs (clear_output keeps romfs and the
install note). So the code there means a builder, the tree's, that no longer knows its own note: another tester would
say the same, and it is a report of error, not POST /fail. Not in PcCodes or PassingCodes; the codes check lists it.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1SkKpc592GgxftLP8o
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 5s
CI / Workflow lint (actionlint) (pull_request) Successful in 5s
CI / Coordinator image (pull_request) Successful in 10s
CI / Agent build and checks (pull_request) Successful in 1m36s
CI / Coordinator tests (pull_request) Failing after 2m5s
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/longshot-builder:HumanBean-feat/longshot-builder'
git switch 'HumanBean-feat/longshot-builder'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Beanstalk!143
No description provided.