WIP: feat(vk): the game on a screen in an OpenXR headset #2595

Draft
SqueezyLemonade wants to merge 10 commits from SqueezyLemonade/Longshot:openxr-engine into mod-api
First-time contributor

Summary

There was no way to play in a VR headset, and with the sandbox on a headset's runtime could not be reached at all. This adds
a Headset row (Graphics, Off by default, after a restart) and, for it, one narrow sandbox rule. With the row On, the
game's picture is shown on a flat screen set in the room in an OpenXR headset, at the headset's own refresh rate, whatever
the game's frame rate, with the sandbox on. The window is unchanged. This is the first of three PRs for OpenXR in the
engine, as agreed with HumanBean; it targets mod-api (10 commits: 9 for the headset, then 1 for the sandbox rule).

The headset (9 commits). What it does:

  • Opens the OpenXR loader by name at run time (no link), then the active runtime and its headset, before the Vulkan instance.
  • Runs the session on the game's own device and queue, on a thread of its own, with one quad layer: 70 degrees wide at
    3.5 m, placed in front of the head at the start and after a recenter.
  • Copies the picture the game presents into one of six images in the frame's own recording; the headset's thread takes the
    newest finished one. Neither side waits for the other.
  • Any failed step turns the headset off for that run with one warn line (vk: headset: ...: off this run); the game goes on
    in its window.
  • With the headset on: no HDR surface, no frame generation, and V-Sync Auto means Off.

The sandbox rule (1 commit, written as HumanBean asked, since there is no headset on his dev machine). Before it, with
the sandbox on, the OpenXR loader was refused the active runtime's manifest when it is in the home folder (a per-user
active_runtime.json, XR_RUNTIME_JSON), then the runtime's library when that is in the home folder, and Monado's and
WiVRn's clients would then be refused their service's socket in $XDG_RUNTIME_DIR: the player saw one warn line ("no OpenXR
runtime is active, or the sandbox keeps it out") and only the window. The rule applies only when the Headset row is on
(headset=1 in the settings file, read before the lockdown as vk_headset.cpp's asked() reads it, and never for the
Builder's shader preparation). With the row off not a rule changes. With it on, host/sandbox_linux.c openxr_runtime finds
the active runtime as the OpenXR loader's manifest_file.cpp does on Linux and gives:

Given Rights Why
the manifest (XR_RUNTIME_JSON alone when set; else the first openxr/1 of $XDG_CONFIG_HOME, each $XDG_CONFIG_DIRS folder and /etc with active_runtime.<arch>.json or active_runtime.json, both when both are there; a link followed to its target, as the loader does), only a file with a library_path (a folder named there is never given) read, the file alone the loader reads it
the folder of its library_path (relative: against the manifest's real folder, as the loader does) read and run the loader loads the library; never the home, the root or a system folder itself (sbx_folder_narrow); a bare name is the system's search, read already
the runtime's one socket, by its library's file name (sbx_openxr_socket), when it is there reach (Landlock ABI 9; below it, bound back into the private folders) the client talks to its service through it
Runtime (library) Socket Read in
Monado (libopenxr_monado.so) $XDG_RUNTIME_DIR/monado_comp_ipc Monado's src/xrt/ipc/client/ipc_client_connection.c (a pathname socket at u_file_get_path_in_runtime_dir(XRT_IPC_MSG_SOCK_FILENAME); the name's default in its CMakeLists.txt)
WiVRn (libopenxr_wivrn.so) $XDG_RUNTIME_DIR/wivrn/comp_ipc WiVRn's server/CMakeLists.txt (set(XRT_IPC_MSG_SOCK_FILENAME "wivrn/comp_ipc" ...) before Monado is added); the same string is in the shipped client library
any other none

Each grant writes its sandbox: allowed ... line ending (Headset); below ABI 9 (every kernel before 7.1) the socket shows
as its sandbox: bound back line instead. What is not given writes one sandbox: Headset: ... line saying why. With the
sandbox on, the row takes a quit and a new start, not a restart from the Insert menu: a restart keeps the rules of the run
before.

What it does not do:

  • No head tracking: the view does not follow the head. That is the next PR.
  • No controllers, no hands, no Stereo: one picture, the same for both eyes.
  • The mods' output effects are not in the headset's picture: Colour vision correction and the CRT filter run in the
    window's scaling pass, at the window's size, after the picture is copied for the headset. With one on, the window is
    corrected and the headset is not, and one warn line says so. Two ways to close it, neither written: run the output effects
    again at the headset image's size (an image set per caller in vk_effects.cpp, and twice their GPU time), or copy the
    window's finished picture (the window's size and aspect, and a second seam in the presenter's recording). Which one is
    the maintainers' call.
  • The sandbox gives nothing else of $XDG_RUNTIME_DIR (the socket file alone, not wivrn/); no /dev/shm (Monado's service
    makes its shared memory with shm_open and unlinks it at once; the client gets the fd over the socket and only maps it);
    not the OpenXR API layers' folders (a layer in the home is not seen); nothing more for SteamVR (its client is closed source:
    its manifest and library's folder alone); no socket made after the start (start the runtime's service before the game).
  • Windows' sandbox gives a headset nothing yet. The loader beside the game and a runtime in Program Files are readable,
    and the active runtime is named under HKLM; but a runtime in a Steam library is not granted, and the runtimes' services are
    reached through their own named objects, which an AppContainer with no capability cannot open unless the runtime lets ALL
    APPLICATION PACKAGES in. Not written, not run: a later change, when someone can run it. Until then HOS_SANDBOX=0 there.

Read first: gpu/vk/vk_headset.h, gpu/vk/vk_headset.cpp, gpu/vk/vk_headset_picture.cpp, gpu/vk/headset_rules.h,
docs/dev/reference/headset.md; for the rule, host/sandbox_linux.c (headset_on, openxr_runtime, the call beside
vulkan_libs), host/sandbox_plan.h (sbx_openxr_socket, the three SbxInput fields, their rules at the end of
sbx_rules_build) and docs/dev/reference/sandbox.md ("A headset", and the Windows paragraph). The renderer's own files
change by 28 lines in and 11 out, the seams (vk_main.cpp, vk_replay.cpp, vk_menu.cpp, vk_menu.h, vk_internal.h,
vk_framegen.cpp, vk_fsr3fi.cpp). The row is a module of its own (gpu/vk/menu/headset.cpp), so the menu mod draws it
from the declarations (game/mods/menu/test/menu_rows.json has it); the About page credits the headers
(game/mods/menu/src/credits.ts). json_lib_dir's parsing of library_path moved into json_library for both, unchanged
for the Vulkan files.

The OpenXR headers in third_party/openxr are byte for byte those of Khronos' OpenXR-SDK tag release-1.1.65 (compared by
git blob id; PROVENANCE.md names the commit). Nothing else of the SDK is included. Players supply the loader: on Windows
openxr_loader.dll in the game folder, on Linux their distribution's package (docs/user/advanced.md, "Headset").

Next, each its own PR: head tracking (a camera mod on existing sites and the eyes' projection layer), then an Output
resolution shaped like the headset's eye.

The code was written with Claude (Anthropic's model) and reviewed with it in a separate pass before the runs; I read it and
tested it. Every commit carries a Co-Authored-By trailer.

Testing

Tested: Linux Mint (Cinnamon, X11), kernel 7.0 (Landlock ABI 8, the private folders on), RTX 4070, NVIDIA 595.99.02.
The headset's numbers are from build f971453d (the 9 headset commits) on 038beefa, the merge base with mod-api, unless a
line says 3b5ef5be; the sandbox rule's from the 10th commit on top.

The headset:

  • In the headset (Meta Quest 3 on WiVRn 26.9, sandbox off, 26 Nov): the title screen and the game on the screen in the room,
    fixed in place; recenter works. The thin line along the screen's edge seen on 3b5ef5be (it moved with the head) is not
    seen on this build. On 3b5ef5be also: sharp, right colours, steady; headset off and back on, and quit.
  • Row Off: the start log has the same lines as plain 038beefa (but thread order, timings and the shader cache's own lines)
    and no headset or OpenXR line, in all three pairs below.
  • Row On with no loader, and with no active runtime, sandbox on and off: one warn line each ("the OpenXR loader
    (libopenxr_loader.so.1) is not installed, or cannot be opened"; "no OpenXR runtime is active, or the sandbox keeps it
    out"), the game runs and quits with status 0.
  • A stand-in OpenXR runtime (loaded by the system's loader from its manifest, 90 Hz): every runtime frame ended with a layer
    (869-901 per 10 s) while the game ran at about 122 fps; the screen held the game's picture (2.4-3.9 of 255 from the
    window's shot, mean absolute difference at 192x108); session states 1-5 at the start, 4 3 6 1 8 at the quit, quit in 0.46 s.
    On 3b5ef5be also: 120 Hz (1,200 of 1,200), STOPPING then READY, and a lost session, each with the game running on.
  • tests/run_all.py --changed (270 checks that read the changed files): 262 pass, 7 fail, 1 skipped. The 7 fail the same on
    plain 038beefa (crt_shaders, gfx_world, gfx_effects, scene_format, settings_table, framegen_resources,
    present_source_crop). The skipped one needs a Vulkan device (present_aspect_vulkan). New: tests/test_headset_rules.py
    (each rule broken on purpose; the off path; the locks).

The sandbox rule (the sandbox on; a stand-in runtime in the home folder, loaded by the system's OpenXR loader 1.0.20, 90 Hz;
it runs in the game's process, so it has no socket):

  • In the headset (Meta Quest 3 on WiVRn 26.9, the Flatpak, 26 Nov): sandbox: allowed r .../openxr_wivrn.json (the active OpenXR runtime's manifest (Headset)), allowed rx .../lib/wivrn (the OpenXR runtime's library (Headset)) and
    sandbox: bound back /run/user/<uid>/wivrn/comp_ipc (ABI 8: the socket through the private folders); WiVRn reached,
    2064x2162 an eye, session states 1-5 and at the quit 4 3 6 1 8; the game shown on the screen in the room. On this setup the
    manifest and library are under /var/lib/flatpak, which the system rules read already, so the headset run proves the
    socket alone
    ; a manifest and library in the home folder are proven by the stand-in runs. The window opened only through a
    test-only LD_PRELOAD shim (Risks): the sandbox cannot open an X11 window on this PC.
  • Before the rule, XR_RUNTIME_JSON naming the stand-in's manifest in the home folder: refused at the manifest (the loader's
    "failed to open .../standin.json. Does it exist?", then "no OpenXR runtime is active, or the sandbox keeps it out (-51):
    off this run"). On 3b5ef5be also refused as active_runtime.json, and at a library in the home folder.
  • With the rule, the same: sandbox: allowed r .../standin.json (the active OpenXR runtime's manifest (Headset)) and
    allowed rx of its library's folder; the runtime loaded, session states 1-5, 900-901 frames ended per 10 s with a layer each,
    quit in 0.26 s, exit 0. With no XR_RUNTIME_JSON, the manifest as $XDG_CONFIG_HOME/openxr/1/active_runtime.json, a file
    and then a link to the manifest elsewhere: the file, then the link's target granted; 900-901 frames per 10 s each, exit 0.
  • Row off (headset=0), the stand-in still named: the same 109 sandbox: lines as without the rule (the run folders aside),
    no Headset line, no headset started, exit 0.
  • tests/test_sandbox_linux.py: new rows for the rules (the manifest read alone, the library's folder read and run, the socket
    reach alone, nothing else of the runtime folder or the home, three rules more and the rest the same, no socket right before
    ABI 9, the socket table) and for sandbox_linux.c over made-up folders (an absolute and a relative library_path, a
    linked active_runtime.json, XR_RUNTIME_JSON alone, a manifest not there, a folder as the manifest, a manifest with no
    library_path, a bare library name, a runtime found in $XDG_CONFIG_DIRS, a library in the home itself, a socket not
    there, both names in one folder, the socket bound back below ABI 9, headset=0, the shader preparation, and the row off
    byte for byte against no runtime at all), and a source check that the rule is called only behind headset_on. Each part was
    broken on purpose once: every one fails a row. tests/run_all.py --changed for this commit: 40 pass, 5 fail, the same 5
    without it (dev_ab, release_workflow, windows_on_linux, job_queue, settings_table).
  • The commit that adds the manifest's file check (a folder or a file with no library_path is not given) is checked by test
    rows; the headset and stand-in runs above ran the rule before that check, which gives their manifests the same.

Lint: every pre-commit hook passes on the sandbox commit (end-of-file, whitespace, gitleaks, ruff, the commit message). On
the headset's commits: actionlint passes; ruff's one error (F401, tests/test_recorder_sync.py) is a line already on 038beefa.

Still to test:

  • Linux, V-Sync On, with the window covered: the headset keeps its own rate, expecting no frames held at the window's rate (by hand)
  • Windows 11, any Tier 1 GPU, openxr_loader.dll in the game folder: it compiles with llvm-mingw, and the row starts the headset with HOS_SANDBOX=0, expecting the same start lines (by hand)
  • AMD RX 6000-9000 on Mesa RADV, and Intel Arc: the screen in the headset, expecting the same as on NVIDIA (by hand)
  • Monado (monado-service), sandbox on: the session starts through monado_comp_ipc, expecting the same as on WiVRn (by hand)
  • SteamVR and Meta Quest Link: the screen in the headset with the sandbox off, expecting the same as on WiVRn; with it on, SteamVR is expected to be refused with the one warn line, and whatever it needs shows in the log (by hand)
  • Linux, Landlock ABI 9 (kernel 7.1+): the socket by RESOLVE_UNIX instead of the bind (by hand)
  • Linux, a real runtime whose manifest and library are in the home folder (a self-built WiVRn or Monado): the sandbox on, expecting the same as the stand-in (by hand)

Measurements

Verdict: no cost with the row Off: median frame time 7.94 ms against 7.93 ms on plain 038beefa, within the spread of the
pairs. With the row On and a stand-in runtime, one run: 8.00 ms median. The sandbox rule changes what the sandbox lets
through at the start, never a frame; with the row off its rules and log lines are the same as without it (Testing).

Baseline: 038beefa, the merge base with mod-api, which has none of what this changes.
Setup: Linux Mint, kernel 7.0, RTX 4070, NVIDIA 595.99.02; Kokiri start save (assets/saves), 1920x1080 output, Render
resolution 67%, V-Sync Off, uncapped, no window (headless); median and p99 frame time from the frame trace, 40 s warm-up then
60 s, three interleaved pairs after a warm-up run of each. Skip title screen does nothing on 038beefa (its system mod does not
start), so each run pressed A on the title, the file list and its Yes until play, the same for both builds.

Before: mod-api @ 038beefa (the merge base) After: this PR @ f971453d (Headset Off)
pair 1, median / p99 7.93 / 10.46 ms 7.97 / 10.79 ms (its shader cache prepared again at the start: none in the measured minute)
pair 2, median / p99 7.89 / 10.51 ms 7.93 / 10.75 ms
pair 3, median / p99 7.95 / 10.79 ms 7.94 / 10.57 ms
median of the three 7.93 / 10.51 ms 7.94 / 10.75 ms

Headset On, with the stand-in runtime at 90 Hz, one run (not interleaved): 8.00 / 10.92 ms.

On 3b5ef5be, Headset On, with the stand-in runtime and a timing patch (built for that run, then removed), per 10 s:

90 Hz 120 Hz
game median frame, Off then On 7.72 / 7.76 ms 7.72 / 7.74 ms
the queue's lock held in xrAcquireSwapchainImage, mean / max 0.52 / 2.59 ms 0.51 / 1.89 ms
held in xrReleaseSwapchainImage, mean / max 0.16 / 1.94 ms 0.16 / 1.97 ms
held in vkQueueSubmit2, mean / max 0.004 / 0.02 ms 0.004 / 0.02 ms
fence wait (no lock), mean / max 0.28 / 1.6 ms 0.29 / 2.0 ms

These are the stand-in's own calls; a real runtime's times were not measured. The log and frame-trace lines are in the
comments.

No switch is added. vk_headset.cpp and the sandbox read the existing LONGSHOT_PREPARE_ONLY (default off) so that a
shader-preparation run starts no headset and gets no rule.

Risks

  • The shared queue. The headset's runtime calls that may use the queue are made under the same lock as the game's own
    submits (dev.present_mu). A runtime that blocks inside one of those calls blocks the game's submits for as long: a
    stand-in that held its acquire call for 1.5 s every 10 s gave the game frames of about 1.0 s (on 3b5ef5be). Real runtimes
    were not measured. A second queue is not added: the device makes one queue of the graphics family, and the existing
    comment in vk_main.cpp records that a second graphics queue made presents slower.
  • V-Sync On was not run with the headset. A present that waits under the same lock (FIFO, a covered window) could hold
    headset frames to the window's pace. If it does, V-Sync On also becomes Off with the headset on (one token, one test row).
  • The row is in the settings file, which the confined game writes: a run taken over can turn it on for the next run (the
    bar the sandbox keeps for HOS_SANDBOX itself). What that run gets is still bounded: only the active runtime the player
    installed (the manifest is chosen by the real environment and the user's config, which the game cannot write), and its
    socket only while its service runs. If you want it tighter, the alternative is a switch from the real environment or the
    launcher (as HOS_SANDBOX is) for the sandbox's part instead of the menu row: your call, and a small change either way.
  • With the row on, the confined game can reach the runtime's service and ask it whatever any client of that socket may
    (the OpenXR calls, and the service's own control messages, such as Monado's client list and focus), and the service is not
    confined; the sandbox docs' "What stays open" says so. The library's folder is read and run, never written: a game taken
    over can read what else is in it, as with the Vulkan layers' folders today.
  • A runtime the rule does not know gets its manifest and library alone and may fail at its IPC: the same warn line as
    without the rule.
  • The sandboxed headset test needed a shim: the sandbox cannot open an X11 window on this PC (Landlock's abstract-socket
    scope makes libxcb's connect fail with EPERM, and libxcb falls back to the path socket only on ENOENT/ECONNREFUSED:
    reported separately). That test ran with a test-only LD_PRELOAD shim that maps that EPERM to ECONNREFUSED; it is not part
    of this PR and not in the tree.
  • Not run: Windows (not compiled), AMD, Intel, SteamVR, Meta's runtime, Monado, two GPUs, a runtime that refuses a 16:9
    swapchain or lists UNORM formats alone, a close during the headset's start.
  • Turn it off: the row, Off by default. With it Off the options file's headset= line is read once and nothing else is
    done: no library opened, no extension asked for, no thread, no sandbox rule (read in the code, and the start logs measured
    above). A revert is enough.
  • After updating: nothing for a player who leaves the row Off. The row uses one of the menu's restart slots.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. (One topic: the headset, with its sandbox rule. On mod-api, as asked, not main)
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). (tests/run_all.py --changed for each part, failures named against 038beefa; the whole suite not run)
  • Measured against main, or Measurements says why there is nothing to measure. (against 038beefa, the merge base with mod-api; its Baseline line says why)
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible. (third_party/openxr is a new part, upstream headers with its PROVENANCE, check_third_party.py and test_menu_credits.py pass; no existing part changed)

When it applies

  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Linux only; Windows not compiled; the sandbox rule is Linux-only code)
  • Screenshots of the same spot on main and here, for a change that shows on screen. (The window is unchanged; a picture from the headset to add)
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary There was no way to play in a VR headset, and with the sandbox on a headset's runtime could not be reached at all. This adds a **Headset** row (Graphics, Off by default, after a restart) and, for it, one narrow sandbox rule. With the row On, the game's picture is shown on a flat screen set in the room in an OpenXR headset, at the headset's own refresh rate, whatever the game's frame rate, with the sandbox on. The window is unchanged. This is the first of three PRs for OpenXR in the engine, as agreed with HumanBean; it targets `mod-api` (10 commits: 9 for the headset, then 1 for the sandbox rule). **The headset** (9 commits). What it does: - Opens the OpenXR loader by name at run time (no link), then the active runtime and its headset, before the Vulkan instance. - Runs the session on the game's own device and queue, on a thread of its own, with one quad layer: 70 degrees wide at 3.5 m, placed in front of the head at the start and after a recenter. - Copies the picture the game presents into one of six images in the frame's own recording; the headset's thread takes the newest finished one. Neither side waits for the other. - Any failed step turns the headset off for that run with one warn line (`vk: headset: ...: off this run`); the game goes on in its window. - With the headset on: no HDR surface, no frame generation, and V-Sync Auto means Off. **The sandbox rule** (1 commit, written as HumanBean asked, since there is no headset on his dev machine). Before it, with the sandbox on, the OpenXR loader was refused the active runtime's manifest when it is in the home folder (a per-user `active_runtime.json`, `XR_RUNTIME_JSON`), then the runtime's library when that is in the home folder, and Monado's and WiVRn's clients would then be refused their service's socket in `$XDG_RUNTIME_DIR`: the player saw one warn line ("no OpenXR runtime is active, or the sandbox keeps it out") and only the window. The rule applies **only when the Headset row is on** (`headset=1` in the settings file, read before the lockdown as `vk_headset.cpp`'s `asked()` reads it, and never for the Builder's shader preparation). With the row off not a rule changes. With it on, `host/sandbox_linux.c` `openxr_runtime` finds the active runtime as the OpenXR loader's `manifest_file.cpp` does on Linux and gives: | Given | Rights | Why | |---|---|---| | the manifest (`XR_RUNTIME_JSON` alone when set; else the first `openxr/1` of `$XDG_CONFIG_HOME`, each `$XDG_CONFIG_DIRS` folder and `/etc` with `active_runtime.<arch>.json` or `active_runtime.json`, both when both are there; a link followed to its target, as the loader does), only a file with a `library_path` (a folder named there is never given) | read, the file alone | the loader reads it | | the folder of its `library_path` (relative: against the manifest's real folder, as the loader does) | read and run | the loader loads the library; never the home, the root or a system folder itself (`sbx_folder_narrow`); a bare name is the system's search, read already | | the runtime's one socket, by its library's file name (`sbx_openxr_socket`), when it is there | reach (Landlock ABI 9; below it, bound back into the private folders) | the client talks to its service through it | | Runtime (library) | Socket | Read in | |---|---|---| | Monado (`libopenxr_monado.so`) | `$XDG_RUNTIME_DIR/monado_comp_ipc` | Monado's `src/xrt/ipc/client/ipc_client_connection.c` (a pathname socket at `u_file_get_path_in_runtime_dir(XRT_IPC_MSG_SOCK_FILENAME)`; the name's default in its `CMakeLists.txt`) | | WiVRn (`libopenxr_wivrn.so`) | `$XDG_RUNTIME_DIR/wivrn/comp_ipc` | WiVRn's `server/CMakeLists.txt` (`set(XRT_IPC_MSG_SOCK_FILENAME "wivrn/comp_ipc" ...)` before Monado is added); the same string is in the shipped client library | | any other | none | | Each grant writes its `sandbox: allowed ...` line ending `(Headset)`; below ABI 9 (every kernel before 7.1) the socket shows as its `sandbox: bound back` line instead. What is not given writes one `sandbox: Headset: ...` line saying why. With the sandbox on, the row takes a quit and a new start, not a restart from the Insert menu: a restart keeps the rules of the run before. What it does not do: - No head tracking: the view does not follow the head. That is the next PR. - No controllers, no hands, no Stereo: one picture, the same for both eyes. - **The mods' output effects are not in the headset's picture**: Colour vision correction and the CRT filter run in the window's scaling pass, at the window's size, after the picture is copied for the headset. With one on, the window is corrected and the headset is not, and one warn line says so. Two ways to close it, neither written: run the output effects again at the headset image's size (an image set per caller in `vk_effects.cpp`, and twice their GPU time), or copy the window's finished picture (the window's size and aspect, and a second seam in the presenter's recording). Which one is the maintainers' call. - The sandbox gives nothing else of `$XDG_RUNTIME_DIR` (the socket file alone, not `wivrn/`); no `/dev/shm` (Monado's service makes its shared memory with `shm_open` and unlinks it at once; the client gets the fd over the socket and only maps it); not the OpenXR API layers' folders (a layer in the home is not seen); nothing more for SteamVR (its client is closed source: its manifest and library's folder alone); no socket made after the start (start the runtime's service before the game). - **Windows' sandbox gives a headset nothing yet.** The loader beside the game and a runtime in Program Files are readable, and the active runtime is named under HKLM; but a runtime in a Steam library is not granted, and the runtimes' services are reached through their own named objects, which an AppContainer with no capability cannot open unless the runtime lets ALL APPLICATION PACKAGES in. Not written, not run: a later change, when someone can run it. Until then `HOS_SANDBOX=0` there. Read first: `gpu/vk/vk_headset.h`, `gpu/vk/vk_headset.cpp`, `gpu/vk/vk_headset_picture.cpp`, `gpu/vk/headset_rules.h`, `docs/dev/reference/headset.md`; for the rule, `host/sandbox_linux.c` (`headset_on`, `openxr_runtime`, the call beside `vulkan_libs`), `host/sandbox_plan.h` (`sbx_openxr_socket`, the three `SbxInput` fields, their rules at the end of `sbx_rules_build`) and `docs/dev/reference/sandbox.md` ("A headset", and the Windows paragraph). The renderer's own files change by 28 lines in and 11 out, the seams (`vk_main.cpp`, `vk_replay.cpp`, `vk_menu.cpp`, `vk_menu.h`, `vk_internal.h`, `vk_framegen.cpp`, `vk_fsr3fi.cpp`). The row is a module of its own (`gpu/vk/menu/headset.cpp`), so the menu mod draws it from the declarations (`game/mods/menu/test/menu_rows.json` has it); the About page credits the headers (`game/mods/menu/src/credits.ts`). `json_lib_dir`'s parsing of `library_path` moved into `json_library` for both, unchanged for the Vulkan files. The OpenXR headers in `third_party/openxr` are byte for byte those of Khronos' OpenXR-SDK tag `release-1.1.65` (compared by git blob id; `PROVENANCE.md` names the commit). Nothing else of the SDK is included. Players supply the loader: on Windows `openxr_loader.dll` in the game folder, on Linux their distribution's package (`docs/user/advanced.md`, "Headset"). Next, each its own PR: head tracking (a camera mod on existing sites and the eyes' projection layer), then an Output resolution shaped like the headset's eye. The code was written with Claude (Anthropic's model) and reviewed with it in a separate pass before the runs; I read it and tested it. Every commit carries a `Co-Authored-By` trailer. ## Testing **Tested:** Linux Mint (Cinnamon, X11), kernel 7.0 (Landlock ABI 8, the private folders on), RTX 4070, NVIDIA 595.99.02. The headset's numbers are from build f971453d (the 9 headset commits) on 038beefa, the merge base with `mod-api`, unless a line says 3b5ef5be; the sandbox rule's from the 10th commit on top. The headset: - In the headset (Meta Quest 3 on WiVRn 26.9, sandbox off, 26 Nov): the title screen and the game on the screen in the room, fixed in place; recenter works. The thin line along the screen's edge seen on 3b5ef5be (it moved with the head) is not seen on this build. On 3b5ef5be also: sharp, right colours, steady; headset off and back on, and quit. - Row Off: the start log has the same lines as plain 038beefa (but thread order, timings and the shader cache's own lines) and no headset or OpenXR line, in all three pairs below. - Row On with no loader, and with no active runtime, sandbox on and off: one warn line each ("the OpenXR loader (libopenxr_loader.so.1) is not installed, or cannot be opened"; "no OpenXR runtime is active, or the sandbox keeps it out"), the game runs and quits with status 0. - A stand-in OpenXR runtime (loaded by the system's loader from its manifest, 90 Hz): every runtime frame ended with a layer (869-901 per 10 s) while the game ran at about 122 fps; the screen held the game's picture (2.4-3.9 of 255 from the window's shot, mean absolute difference at 192x108); session states 1-5 at the start, 4 3 6 1 8 at the quit, quit in 0.46 s. On 3b5ef5be also: 120 Hz (1,200 of 1,200), STOPPING then READY, and a lost session, each with the game running on. - `tests/run_all.py --changed` (270 checks that read the changed files): 262 pass, 7 fail, 1 skipped. The 7 fail the same on plain 038beefa (crt_shaders, gfx_world, gfx_effects, scene_format, settings_table, framegen_resources, present_source_crop). The skipped one needs a Vulkan device (present_aspect_vulkan). New: `tests/test_headset_rules.py` (each rule broken on purpose; the off path; the locks). The sandbox rule (the sandbox on; a stand-in runtime in the home folder, loaded by the system's OpenXR loader 1.0.20, 90 Hz; it runs in the game's process, so it has no socket): - In the headset (Meta Quest 3 on WiVRn 26.9, the Flatpak, 26 Nov): `sandbox: allowed r .../openxr_wivrn.json (the active OpenXR runtime's manifest (Headset))`, `allowed rx .../lib/wivrn (the OpenXR runtime's library (Headset))` and `sandbox: bound back /run/user/<uid>/wivrn/comp_ipc` (ABI 8: the socket through the private folders); WiVRn reached, 2064x2162 an eye, session states 1-5 and at the quit 4 3 6 1 8; the game shown on the screen in the room. On this setup the manifest and library are under `/var/lib/flatpak`, which the system rules read already, so **the headset run proves the socket alone**; a manifest and library in the home folder are proven by the stand-in runs. The window opened only through a test-only `LD_PRELOAD` shim (Risks): the sandbox cannot open an X11 window on this PC. - Before the rule, `XR_RUNTIME_JSON` naming the stand-in's manifest in the home folder: refused at the manifest (the loader's "failed to open .../standin.json. Does it exist?", then "no OpenXR runtime is active, or the sandbox keeps it out (-51): off this run"). On 3b5ef5be also refused as `active_runtime.json`, and at a library in the home folder. - With the rule, the same: `sandbox: allowed r .../standin.json (the active OpenXR runtime's manifest (Headset))` and `allowed rx` of its library's folder; the runtime loaded, session states 1-5, 900-901 frames ended per 10 s with a layer each, quit in 0.26 s, exit 0. With no `XR_RUNTIME_JSON`, the manifest as `$XDG_CONFIG_HOME/openxr/1/active_runtime.json`, a file and then a link to the manifest elsewhere: the file, then the link's target granted; 900-901 frames per 10 s each, exit 0. - Row off (`headset=0`), the stand-in still named: the same 109 `sandbox:` lines as without the rule (the run folders aside), no `Headset` line, no headset started, exit 0. - `tests/test_sandbox_linux.py`: new rows for the rules (the manifest read alone, the library's folder read and run, the socket reach alone, nothing else of the runtime folder or the home, three rules more and the rest the same, no socket right before ABI 9, the socket table) and for `sandbox_linux.c` over made-up folders (an absolute and a relative `library_path`, a linked `active_runtime.json`, `XR_RUNTIME_JSON` alone, a manifest not there, a folder as the manifest, a manifest with no `library_path`, a bare library name, a runtime found in `$XDG_CONFIG_DIRS`, a library in the home itself, a socket not there, both names in one folder, the socket bound back below ABI 9, `headset=0`, the shader preparation, and the row off byte for byte against no runtime at all), and a source check that the rule is called only behind `headset_on`. Each part was broken on purpose once: every one fails a row. `tests/run_all.py --changed` for this commit: 40 pass, 5 fail, the same 5 without it (dev_ab, release_workflow, windows_on_linux, job_queue, settings_table). - The commit that adds the manifest's file check (a folder or a file with no `library_path` is not given) is checked by test rows; the headset and stand-in runs above ran the rule before that check, which gives their manifests the same. Lint: every pre-commit hook passes on the sandbox commit (end-of-file, whitespace, gitleaks, ruff, the commit message). On the headset's commits: actionlint passes; ruff's one error (F401, `tests/test_recorder_sync.py`) is a line already on 038beefa. **Still to test:** - Linux, V-Sync On, with the window covered: the headset keeps its own rate, expecting no frames held at the window's rate (by hand) - Windows 11, any Tier 1 GPU, `openxr_loader.dll` in the game folder: it compiles with llvm-mingw, and the row starts the headset with `HOS_SANDBOX=0`, expecting the same start lines (by hand) - AMD RX 6000-9000 on Mesa RADV, and Intel Arc: the screen in the headset, expecting the same as on NVIDIA (by hand) - Monado (monado-service), sandbox on: the session starts through `monado_comp_ipc`, expecting the same as on WiVRn (by hand) - SteamVR and Meta Quest Link: the screen in the headset with the sandbox off, expecting the same as on WiVRn; with it on, SteamVR is expected to be refused with the one warn line, and whatever it needs shows in the log (by hand) - Linux, Landlock ABI 9 (kernel 7.1+): the socket by `RESOLVE_UNIX` instead of the bind (by hand) - Linux, a real runtime whose manifest and library are in the home folder (a self-built WiVRn or Monado): the sandbox on, expecting the same as the stand-in (by hand) ## Measurements **Verdict:** no cost with the row Off: median frame time 7.94 ms against 7.93 ms on plain 038beefa, within the spread of the pairs. With the row On and a stand-in runtime, one run: 8.00 ms median. The sandbox rule changes what the sandbox lets through at the start, never a frame; with the row off its rules and log lines are the same as without it (Testing). Baseline: 038beefa, the merge base with `mod-api`, which has none of what this changes. Setup: Linux Mint, kernel 7.0, RTX 4070, NVIDIA 595.99.02; Kokiri start save (assets/saves), 1920x1080 output, Render resolution 67%, V-Sync Off, uncapped, no window (headless); median and p99 frame time from the frame trace, 40 s warm-up then 60 s, three interleaved pairs after a warm-up run of each. Skip title screen does nothing on 038beefa (its system mod does not start), so each run pressed A on the title, the file list and its Yes until play, the same for both builds. | | Before: mod-api @ 038beefa (the merge base) | After: this PR @ f971453d (Headset Off) | |---|---|---| | pair 1, median / p99 | 7.93 / 10.46 ms | 7.97 / 10.79 ms (its shader cache prepared again at the start: none in the measured minute) | | pair 2, median / p99 | 7.89 / 10.51 ms | 7.93 / 10.75 ms | | pair 3, median / p99 | 7.95 / 10.79 ms | 7.94 / 10.57 ms | | median of the three | 7.93 / 10.51 ms | 7.94 / 10.75 ms | Headset On, with the stand-in runtime at 90 Hz, one run (not interleaved): 8.00 / 10.92 ms. On 3b5ef5be, Headset On, with the stand-in runtime and a timing patch (built for that run, then removed), per 10 s: | | 90 Hz | 120 Hz | |---|---|---| | game median frame, Off then On | 7.72 / 7.76 ms | 7.72 / 7.74 ms | | the queue's lock held in xrAcquireSwapchainImage, mean / max | 0.52 / 2.59 ms | 0.51 / 1.89 ms | | held in xrReleaseSwapchainImage, mean / max | 0.16 / 1.94 ms | 0.16 / 1.97 ms | | held in vkQueueSubmit2, mean / max | 0.004 / 0.02 ms | 0.004 / 0.02 ms | | fence wait (no lock), mean / max | 0.28 / 1.6 ms | 0.29 / 2.0 ms | These are the stand-in's own calls; a real runtime's times were not measured. The log and frame-trace lines are in the comments. No switch is added. `vk_headset.cpp` and the sandbox read the existing `LONGSHOT_PREPARE_ONLY` (default off) so that a shader-preparation run starts no headset and gets no rule. ## Risks - **The shared queue.** The headset's runtime calls that may use the queue are made under the same lock as the game's own submits (`dev.present_mu`). A runtime that blocks inside one of those calls blocks the game's submits for as long: a stand-in that held its acquire call for 1.5 s every 10 s gave the game frames of about 1.0 s (on 3b5ef5be). Real runtimes were not measured. A second queue is not added: the device makes one queue of the graphics family, and the existing comment in `vk_main.cpp` records that a second graphics queue made presents slower. - **V-Sync On** was not run with the headset. A present that waits under the same lock (FIFO, a covered window) could hold headset frames to the window's pace. If it does, V-Sync On also becomes Off with the headset on (one token, one test row). - **The row is in the settings file, which the confined game writes**: a run taken over can turn it on for the next run (the bar the sandbox keeps for `HOS_SANDBOX` itself). What that run gets is still bounded: only the active runtime the player installed (the manifest is chosen by the real environment and the user's config, which the game cannot write), and its socket only while its service runs. If you want it tighter, the alternative is a switch from the real environment or the launcher (as `HOS_SANDBOX` is) for the sandbox's part instead of the menu row: your call, and a small change either way. - **With the row on**, the confined game can reach the runtime's service and ask it whatever any client of that socket may (the OpenXR calls, and the service's own control messages, such as Monado's client list and focus), and the service is not confined; the sandbox docs' "What stays open" says so. The library's folder is read and run, never written: a game taken over can read what else is in it, as with the Vulkan layers' folders today. - **A runtime the rule does not know** gets its manifest and library alone and may fail at its IPC: the same warn line as without the rule. - **The sandboxed headset test needed a shim**: the sandbox cannot open an X11 window on this PC (Landlock's abstract-socket scope makes libxcb's connect fail with EPERM, and libxcb falls back to the path socket only on ENOENT/ECONNREFUSED: reported separately). That test ran with a test-only `LD_PRELOAD` shim that maps that EPERM to ECONNREFUSED; it is not part of this PR and not in the tree. - **Not run:** Windows (not compiled), AMD, Intel, SteamVR, Meta's runtime, Monado, two GPUs, a runtime that refuses a 16:9 swapchain or lists UNORM formats alone, a close during the headset's start. - **Turn it off:** the row, Off by default. With it Off the options file's `headset=` line is read once and nothing else is done: no library opened, no extension asked for, no thread, no sandbox rule (read in the code, and the start logs measured above). A revert is enough. - **After updating:** nothing for a player who leaves the row Off. The row uses one of the menu's restart slots. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. (One topic: the headset, with its sandbox rule. On `mod-api`, as asked, not main) - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). (`tests/run_all.py --changed` for each part, failures named against 038beefa; the whole suite not run) - [x] Measured against `main`, or Measurements says why there is nothing to measure. (against 038beefa, the merge base with `mod-api`; its Baseline line says why) - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. (`third_party/openxr` is a new part, upstream headers with its PROVENANCE, `check_third_party.py` and `test_menu_credits.py` pass; no existing part changed) ### When it applies - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Linux only; Windows not compiled; the sandbox rule is Linux-only code) - [ ] Screenshots of the same spot on `main` and here, for a change that shows on screen. (The window is unchanged; a picture from the headset to add) - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
game/DESIGN.md: the contract the Rust port of the game side and the mod API follows: the crates and what each owns,
the Mod trait, the threads and the MainThread token, the undo journal, settings by key, the script engine, the site
chains, the post-process interface, the native C mods removed, the bugs fixed on the way, and where each C file goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
As the full mod API (2596a0e3) vendors them, unmodified: the interpreter the script crate binds, with Longshot's one
translation unit beside it, and the usingCtx helper compiled TypeScript may import.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
As Phase 5's tip (2596a0e3) has them: modapi/'s schema and shipped JavaScript moved to game/modapi/ (the layout of
the game/ boundary), assets/modding/ (docs, examples, packages, templates, the system mods) and tests/mod_vectors/.
modapi/generate.py is not taken: the schema crate replaces it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
No C mods and no wasm (game/DESIGN.md, "What was removed"): the module longshot/native and the permission native
leave the schema, with the example native-hello, the guide's native.md and the fake game's stand-in for a native
library. A mod.json that asks for native is refused by the loader. The generated files (longshot.d.ts, the reference,
the permission table) follow at the next schema-gen run; the guide's links to native.md go with the docs pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The workspace at the repository's root (the builder joins it with the game/ boundary; until then it keeps its own,
left out here), with the builder's edition, Rust and rustfmt, and clippy's pedantic group for the game's crates.
longshot-rs is the one staticlib the game links. guest is the only crate that touches guest memory: GuestPtr<T>
checks every access (the null page, alignment, the window) and marks what it writes, Pod and pod! say what a guest
address may hold, GuestCtx wraps a hook's registers and calls into the game. host-sys stands in for host/game_host.h:
its C declarations, a safe wrapper for each, and a stand-in host for game-free tests (the feature fake). The other
crates are empty for now, each with its place in game/DESIGN.md; the design names the hook-site runtime game-sites,
since the builder has a crate sites.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The flags and slots the lifted code names, made from game/sites.def by build.rs (with each site's form from the site
table), and the runtime behind them, ported from host/game/sites.c, phases.c and modsites.c, with #2272's
self-review fixes:

- a site's chain: handlers around the core, the core its owner and subscribers with one answerer, published whole;
  the owner alone in the slot as before (a C owner directly, a Rust one through a plain trampoline);
- the site's callee kept and put back before each handler and the core (a handler's own game calls reach other
  replace sites);
- the chain's place is the guest context's, for a C handler's hos_site_next, so a fiber that resumes on another OS
  thread goes on in its chain; a Rust handler carries its place in its SiteCx;
- a removed handler is let go only once the site's readers are seen at zero (remove_then);
- outcome sites take no owner, handler or subscriber at run time: only the engine's, installed at start;
- a live rule table published again is not retired;
- the frame phases, with the MainThread token only the acquire phase makes, and MainCell;
- the mods' slot pool and its one call.

game/sites.def is the union of #2272's list (with its outcome lines) and the mod API's sites and tables. The C
functions (hos_site_set, _add, _subscribe, hos_table_publish, game_phase_run ...) stay, for the host's own C on
sites. Vslot sites are not ported: the list has none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The game's C is ported from 0fc27a42, where #2272's self-review fixes already are: they are listed as ported, and
only the two Skip title bugs remain fixed on the way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The parts every service, engine and native mod builds on: Value (and ToValue/FromValue with the schema's checks:
an int's range, finite numbers, bytes and values' limits), ErrorClass (the C's status numbers kept as stable codes)
and ApiError, CallCx (the main thread's token when the call is on it, the mod, its context, what the engine lends),
Promise and the settlements queue, the Mod trait and ModCx of native system mods, the settings' declarations, the
loader's ScriptHost, and the bindings' contract, which build.rs makes from the schema.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/modapi/journal.c: a mod's writes to the game's saved state (flags, items, memory, placements) with
their values before and after, following the game's saves (asked, written, loaded), undone newest first where the
game still holds the mod's value, items waiting for play, bounded with "at least" counts. New: live effects (a
handler, a rule, a row, a pass, a claim...), each with its undo, all taken down when the mod is turned off, so
system mods and script mods are undone the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
A stand-in for the header the game/ boundary writes, by what longshot-game exports: start-up and the frame phase,
the input hooks, the control bridge's game commands, the input movie's hooks, the mods' RomFS layers and sound
mix, the game's menu rows by key (laid out by the Game settings mod), and the post-process passes the renderer
draws (CRT, colour vision, a mod's shader).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The content crate's foundation: the strict JSON reader of host/mod_json.c over
serde_json (its depth, members, size, duplicate-key and NUL rules kept, the
differences documented), BYML read into a tree and written back (host/byml.c,
every limit kept), and SARC's members, puts and merge (the archive half of
host/restbl.c). miniz_oxide is added for the zip packages' and PNGs' inflate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/texts.c: HOS_TEXTS read by the switches' rule,
<game>/texts/<name> served for mals/<name>, a mod's own file wins, the first
four served are logged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/romfs_layers.c/h. Last layer wins with every copy kept, made
files, the served paths (at most 4), the map reload's opened-paths set
(lock-free, capped), dev-mode rebuilds (changes, keep, publish), dir extras.
A lookup takes the live Arc<Table> under a read lock that only a publish's
pointer swap holds for writing; a replaced table is freed when its last
reader drops it (no 16-table retired list, no leak past it). The Mods tab's
move copies the table and publishes the copy instead of writing the live one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/mod_archive.c/h, the zip format read here instead of through
miniz's reader, with every check the C made: the end record (two records,
several disks, Zip64 and its locator, nothing between the central directory
and its record), each entry's central and local headers, methods,
encryption, UTF-8 names (Info-ZIP 0x7075 with its CRC-32), every name rule
and the case folding, overlap, a name twice and file-and-folder. Entries are
inflated with miniz_oxide's streaming core, held to their size and the
ratio, their CRC checked and archive magic refused. Also SHA-256 (whole and
incremental), the unpack into a fresh .unpack-* folder renamed into
<cache>/<sha256>, and the sweep. Without unsafe there is no openat walk:
folders are made with create_dir and checked not to be links, files with
create_new (O_EXCL / CREATE_NEW).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/mod_patch.c/h: patch files read strictly (crate::json's
rules, then the patch rules and every message of the C), conflicts between
layers, and the ops applied to a byml::Document, with failures returned in
Applied. Texts ops are parsed here and applied by content::text. A second
read of the text keeps how each number was written (an int or a float, a
64-bit int's exact digits), which decides a new value's type as in the C.

Fixed on the way: a placement set to an array made every int in it a float
for any key (now only Translate, Rotate and Scale, as the C's comment said);
hash map keys past 64 bits were read as 2^64-1 (now refused); and past 64
reported paths a conflict could be reported twice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/mod_assets.c and the formats it needs: PNG decoded to RGBA8
(host/png_decode.c, inflate by miniz_oxide, CRC-32 built at compile time),
BFRES models read and their textures renamed (host/bfres_edit.c), and
one-texture BNTX files written from RGBA8 (host/bntx_write.c: the GOB
swizzle, NVN's block heights, the sRGB mip halving and the header bytes
kept). BC7 blocks are encoded by the host's bc7enc through a host-sys call
proposed with this port (host_sys::image::bc7_block). A skin's files come
back together, so a failure part way no longer leaves some written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/mod_text.c at 336075ba: MSBT read and written with every
limit and message of the C; the named tags as a Tags table passed by
parameter, Tags::game() the build's seven rows (the C's global
msbt_tags_use had no caller); the tagged check, encode and text; and texts
patches applied to a text archive over sarc::put (256 MiB). Ops the C left
out without a word (a message file over 16 MiB, an archive over 256 MiB, a
created file's name the archive refused, which it even counted as applied)
are now failed with their reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/mod_read.c/h: BYML read in place with no tree, the JSON
byte for byte the C's (its own %.9g and %.17g formatting), the table index,
row and document JSON, placements whole or in parts, text archives (32
message files kept read; a failed read no longer takes a slot), plain text,
archive codes and name checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
content::ainb::model (host/mod_ainb_model.c): behaviour trees read strictly
into their sections and written back with every offset computed again, the
same bytes when nothing changed; nodes appended, strings found or appended,
links, node comparison. content::ainb::add (host/mod_ainb_add.c): the schema
builder and its text format, new nodes added to a tree against it, and the
check of a tree that gained nodes. Schema lines are no longer cut at 511
bytes (a long tags list ran into the next line), nor shapes and values at
the C's buffers. The files join the crate with content::ainb, next.

Ported from untested C (Phase 5's behaviour-tree calls).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
content::ainb ports host/mod_ainb.c: the AINB 0x408 reader with bounds, its
JSON view laid out as the C's, the param/input/blackboard/link/root changes
(an op now given as JSON, not re-read from text), the bones a tree names,
renaming, and a content stage's tree (new nodes through ainb::add, then the
changes, then ainb::add::check). A link or table offset outside the file is
no longer read as 0 (which let a change write over the header), and a vec3
with a non-number is refused before anything is written.

Ported from untested C (Phase 5's behaviour-tree calls).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The content stage's pack builder (host/mod_content_pack.c): pack specs read
(names, donors, skin), the new or in-place ActorParam, component changes
through Work references (copied under the new name), relative changes,
add-file and add-from (with the files a donor's component needs), removals
checked against the actor's behaviour trees, two mods' clashes on one game
actor, and a component as its actor sees it. A changed game actor whose
ActorParam is no dictionary is now refused (the C wrote its Components into
the root array, or said out of memory). Every limit of the C is kept.

The tree lines (content.tree) are behaviour-tree calls: ported from
untested C.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/mod_content.c: each kind's checks with the C's messages,
the mod-owned names (word, placement hash, flag and tree names), plan.json
and its read-back, and every output file byte for byte as the C wrote them
(rows, texts, placements, changes, flags, typed patches, pause-menu slots,
pack specs, trees, copied assets), returned as a list in the C's order.
Values are copied out of a declaration as the mod wrote them. The cases of
tests/mod_vectors/content.json run as a data-driven test.

Fixed on the way: the C checked only the first 162 component names of a kit
for one named twice, where a kit can name 192; every name is checked now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Two host calls content needs: hos_prompts_romfs (the prompts the host builds over a RomFS path) and
game_host_bc7_block (bc7enc stays the host's third-party C). miniz_oxide joins the workspace's libraries, for
content's zip packages and PNGs, with its reason in game/DESIGN.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
discord and mod-inspector join the native system mods' place (game/DESIGN.md): their packages' paths, the fake
game's lookup of a checkout's system mods (mod-tools' systemModFolder and isSystemFolder) and the schema's notes
follow. The guide's pages follow with the docs pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The first of game.h's functions: hos_game_layout (ported from host/game_layout.c: cache/ and logs/ made, an older
build's files moved once, never over one there), the host's RomFS calls over content's layers (hos_romfs_resolve,
_file, _dir_extras, romfs_opened, and their game.h names), game_post_passes (the list the gfx service publishes,
kept until the generation changes twice) and game_free.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
docs/dev/reference/hooks.md names game/sites.def and game-sites for each site's slot and what runs there, the
core's callbacks installed at start, the Rust callback's shape, the C functions kept for the host's own C, and the
tables as Rust values retired by their readers. The site tables' paths stay the host's until the game/ boundary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/oot_autoload.c, the game and the host behind a trait, for the system mod the API wires later:
the hook path (A on the title, the file list and the check as the game waits on each, the repeats, the 4th wait
ending it, no more once a load begins after the check's A), the fallback after 45 s and the timed path, the
newest save's lookup, and the waits the sites tell.

Fixed (game/DESIGN.md, "Fixed on the way"): the skip's clock stops while the Insert menu holds it, so a menu left
open on the title past 120 s no longer makes it give up; and a press a screen took as it opened (the fallback's A
landing as the file list opened) is counted as that screen's own, so it is not pressed again on top and the
presses match the log.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Ported from host/oot_area_names.c: the table, the suffixes taken off (_MQ, _Alternative, _Child, _Adult), a map
the table lacks spelt out. The export other mods call is wired with the API.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
A mod's JavaScript and TypeScript formatted by oxc's formatter (oxfmt's engine) from the game binary, so a mod's
author needs no Node to keep its sources tidy (Node stays optional, for type checking). The crate mod-format: the
author's files (.ts, .tsx, .mts, .cts, .js, .mjs, .cjs, .jsx; not node_modules, dist, dot files or the made .d.ts),
oxfmt's defaults 120 wide or the mod's .oxfmtrc.json, a file that does not parse named and left alone, --check
writing nothing and exiting 1 for each file not formatted. game.h's game_mod_format runs it for the exe's mod tool;
longshot mod's command table gets format (Node's host has none and says so), and longshot-mod forwards it to the
game. oxc does not publish its formatter: it comes from oxc's repository at crates_v0.157.0, the compiler's
release, with the shared oxc crates patched to that tag (game/DESIGN.md, "Libraries"). The guide's tools page says
how.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The design's rule: a mod's author needs the game binary alone; Node is for type checking, and for the three
commands that still need it until they move into the binary (the fake game's tests, shaders, sites port).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The strict JSON rules of host/mod_json.c (api::json, shared with the
mods.json and store readers), then serde's tree, then every check of
host/mod_manifest.c with its top-level field at fault, passing
tests/mod_vectors/manifest.json. A manifest that asks for the removed
permission native, or has a native block, is refused saying native
mods are no longer supported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
api::loader ports host/mods.c's list and host/modapi/loader.c: the mods
folder's emulator mods, manifest folders and packages, one row each in
mods.json's order (system mods first, a legacySwitch carried once), the
manifests resolved (api::loader::resolve, passing
tests/mod_vectors/resolve.json, Tarjan without recursion), each mod's
start prepared and made one a frame in load order through ScriptHost or
Mod, the switches that take effect at once, and the Mods tab's snapshot
and edits. api::loader::list and trust keep mods.json and
mods-trust.json byte for byte; api::loader::switch is mod_switch.c's
decision as data. api::system checks script system mods against the
build's SystemTable by their tree hash. Files go through api::disk.

Builds once api::perms and api::services land (next commits).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
api::perms ports host/modapi/perms.c: each mod's grants (origins
normalized, at most 64; names this Longshot does not know kept as
mods.json has them), the four prompts and their caps, the menu's answer
from its own thread applied at the next acquire phase, permissions.has
and request, the page's switches and permissions.changed. The grants an
answer gives are handed to the loader to write on the main thread.
api::claims ports host/modapi/claims.c: a declared claim is kept for its
declarer, a holder is counted, a refusal names the holder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
api::storage ports host/modapi/storage.c: each mod's global, profile
and save data in its files (format 1, byte for byte), written by one
writer thread from shared snapshots, global and profile a second after
their last change; a newer version's or format's file refused and kept,
one that is not a store kept aside as .bad; the game's save notes from
any thread acted on at the frame (request, read, written, created,
deleted, staged, unstaged), driving the undo journal's save_asked,
saved and loaded; the title screen; storage.save.loaded; the settings'
own store beside the data. storage.save.flags is ported from untested C.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
api::settings::Settings ports host/modapi/settings.c: a script mod's
declared settings kept in its settings store, read back checked
(the default when a value is no longer one of its values), changed by
the mod, the player (the Mods tab's rows, the host's $soundVolume and
$debugKey) and a save, told once a setting a frame; legacyOption taken
once from the options file; a system mod's settingSwitches for the run.
The game's own settings (native SettingDecls) live in
longshot_options.ini through the OptionsFile trait, reach the menu as a
published snapshot of rows with a setter from its thread, and site
handlers through Published<T> atomics stored on each change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
api::services::Services holds the journal, permissions, claims, storage
and settings typed, the manifests the loader chose and the mods that
run: a mod's start opens its storage and settings (a system mod's
legacyOption taken once), its stop undoes every live effect newest
first and frees its claims and grants; the services' events
(storage.save.loaded, settings.changed, permissions.changed) are handed
to the loader's frame to fire. ModCx now lends a ModApi: its id, its
grants, and typed accessors to settings (with Published<T>), storage
(checked against storage), claims and its journal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The storage writer now keeps the job it runs where a slot's load looks
(a slot read while its write ran was read from the disk's older copy);
permissions.request lets go of its lock before it drops a promise it
could not queue; a mod.json refused as a whole says mod.json: <why>.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Schema::load(root) reads game/modapi/schema/*.toml and makes every check
modapi/generate.py's load() made (keys, names, since, types, functions,
events, filters, interfaces, handles, features, the write rules, the C
names' uniqueness, every permission and unit used), each refusal a
SchemaError naming the file and the item. The schema's sha256 is
generate.py's schema_hash, byte for byte (SHA-256 written here: the
workspace has no hashing crate).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
system_mods reads the script system mods (game/mods/<name> first, then
assets/modding/system/<name>; a folder with a Cargo.toml is a native mod
and left out), hashes each as nx2/system_mods.py's tree_hash does (the
same files left out, the same order, links refused) and checks its
manifest's "system" object, permissions and "ipc" as generate.py's
emit_system_mods did.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
emit makes every repository file generate.py made from the schema and
still has a reader, byte for byte as the Python made it (its wrap,
md_anchor, ts_type, json.dumps of a string, the blank line before a
brace taken out): longshot.d.ts, the fake game's schema.json, reference.md,
permissions.md, scripting.md's generated blocks and the fake game's
copies of the shipped JavaScript; and the packages' version and the fake
game's services checks. The first lines name game/tools/schema-gen and
game/modapi/schema/ instead of modapi/generate.py and modapi/schema/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
What api's build.rs writes into $OUT_DIR/bindings.rs, as api/src/bindings.rs
describes: the version and hash; Permission (name, risk, told, bit, ...),
Risk, Feature, Namespace, Phase, Thread and HandleType; one enum per
schema enum and one struct per record (ToValue, FromValue for the ones an
argument or a filter takes, valid(), a field whose feature the build lacks
read as null); one <Namespace>Api, <Interface>Api and <Handle>Api trait
for the services and ApiServices to reach them; FUNCTIONS with a thunk
each that checks the context, the permission, the feature, the handle and
every argument as emit_header's C thunks did, then the result; EVENTS
(with their filters), FILTERS, CONSTANTS, MODULES (the shipped JavaScript
by include_str!), the write rules, typed resolvers for the async
functions, and checks at compile time (and in a test) that the schema's
error classes and contexts are api's ErrorClass and Context.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
What generate.py's host/modapi/system_mods.h held, as Rust for a build
script to include: each system mod's name, tree hash, flags (on, always,
required) and legacy switch, the local endpoints their "ipc" declares,
their off and setting switches, and system_switch_of.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
schema-gen [--check] [--root <repo>] loads the schema, writes every file
emit::outputs makes that differs (CR LF read as LF), or with --check
writes nothing and exits 1 naming each stale or missing file, a package
whose version is not the API's and a fake the fake game lacks, as
modapi/generate.py --check did; 2 for a schema that fails its checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The vendored interpreter (third_party/quickjs-ng: longshot_quickjs.c, libregexp, libunicode, dtoa) and
shim/qjs_shim.c compiled with the cc crate, with nx2/build.py's QUICKJS_FLAGS. qjs::sys declares the C the
crate calls; qjs wraps it in counted values (a context freed after its last value), native functions as
Rust closures, and an allocator that charges a mod's heap counter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Every limit of modrt_internal.h keeps its value (crate::limits). The accounting is game-free and tested:
deadlines on the thread's CPU time with the wall clock's hard cap, the cost line a warning or fault says,
a slow frame's numbers, the history inspect() reads, 3 faults a minute, 100 log lines a second, the
collector's plan. The watchdog's registry is the crate's one shared structure. A mod's own files are read
inside its folder, never through a link (loader.c's and files.c's rules).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
runtime.c's calls under budgets (the frame's 8 ms cut, the wall clock's cap, the 500 ms overrun stop, the
cost line, rejections, 3 faults a minute), the entry's 1 s, the collector at the frame's end; bindings.c's
API objects from api::bindings (read in one file, bind/tables.rs), values both ways with every check, the
thunks' CallHost (the call's promise, a callback called now or kept), subscriptions, events, filters'
drafts, promises' settling, handles and the prelude (unchanged JS); modules (the API's, Longshot's own
JavaScript with its native parts, the mod's files, JSON modules). TypeScript, workers and the test mode
come in their own commits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
script::ts calls oxc 0.157.0 directly (host/ts's transform, same options and VERSION): no library of its
own and no C ABI; the usingCtx helper of third_party/oxc-runtime served by include_str!. The modcache/js
records (LSTS2, SHA-256 keyed), system mods' modules compiled ahead in memory and never from the cache,
the compile's time out of every budget. sourcemap.c's mapping of a fault's first frame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
worker.c's pool, owned by the host (no global list): a worker's interpreter charges its mod's heap,
runs its entry then one message a turn under 10 s, the longest-waiting worker first, one thread at a
time (its runtime moved whole between the pool's threads); messages as checked JSON, 1 MB each, 64 and
8 MB waiting each way, charged to the mod's heap; faults and stops told to the mod, and a worker still in
its turn when its mod goes left to end on its own thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The running mods in load order; start (the runtime made, its entry run within 1 s), the frame's begin
and end (every mod's budget, the 4 ms all-mods warning), events (a scope-mod event to its one mod, a
handle's to its subscribers), filters' rounds (exclusive last), the promises' settlements within 64 or
2 ms a frame, kept callbacks, the together source's deliveries and the workers' step, stop and reap.
Each call lends the runtimes the services and the main thread's token for its length.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
testing.c's runner: tests:<id>'s runtime, its made entry over test/'s files, longshot/testing (runner.js
over its native part: mod, save, destinations, teleport, age, result, faults, say, report, filter) and the
live run of mod_test with results.json's shape. modrt_eval_start/poll: the code compiled as a module of
the mod's folder and evaluated as one of its callbacks, its promise handled, its default export as JSON.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
FilterSpec gains check_draft (the draft read as its record, as an argument is) and gives readonly as the field
names; the script adapter reads the generated tables as they are: &dyn ApiServices thunks, EventFilter's parse,
ConstValue's Text and Record, Namespace's member and parent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The range check took abs(), which i64::MIN has none of.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
build.rs writes $OUT_DIR/system_mods.rs from game/mods (api::system::built); bindings.rs's doc says the services
take &self, a left-out options record is &R::default(), and what the filters and constants carry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The oot crate's module tree, and what every service builds on:

- mem: bounded reads and writes of the game's records (game_peek_at,
  game_guest_at), and Field<T>, a typed field offset;
- locations: the named locations of locations.def, resolved from the host
  once (a test sets its own);
- call: the Caller trait over a hook's GuestCtx and the thread's own
  context, and GameCallError;
- flags: GameDataMgr's containers (host/game/flags.c, flag_set.c), with
  game_flag_number_as_game's past-the-count-reads-entry-0 rule;
- layout:🎏 the containers' layout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
video: the camera's turn-speed scale, the movie frames, the whole-frame
counters, the loops kept on one pose, the ocarina's note wait and the
game's part of the present step (nn_vi.c, nn_hid.c and their oot_sites.c
callbacks). bridge: the control bridge's oot_state, oot_sample, oot_watch
and oot_poll as typed functions (control.c).

Fixed on the way: a stale ocarina note wait no longer clears a wait a site
re-armed at the same moment (compare-exchange), and the graphics module's
and the loops' reads are bounded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The mod API's game services of host/game/{camera,pad,player,rays,state,
texts,watch}.c, typed: the camera's last view and override under sequence
counts, the pad over the host's publish, Link and the game's state read
bounded, the rays' lock-free slots, the texts' pool and the watches of maps,
saves and flags.

Fixed on the way: a build naming no actors.vtable took any actor whose
first word is 0 for Link; a NaN replacement stick was undefined behaviour;
the texts' reads of the screen and names are bounded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Holding the pause through DebugPause, the pause types, the 2D layers found
and hidden (host/game/pause.c). The pause-menu slots (game_pause_entry,
game_pause_row_bit, and DebugPause's camera row cleared while held) are the
mod API's Phase 5: ported from untested C.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The game parts of host/hos_main.c and host/input_movie.c: the destinations,
teleports, age switch and their ticket queue, the map lock and the
Inventory page's counts (travel); the opening skip with the mods' skips
first, the save trace and Transition autosave, loading and Link seen
(session); Link's update, flight, Movement speed and the free camera
(debug); with their engine callbacks from host/oot_sites.c. The options
they read become typed knobs the API sets.

Fixed on the way: the age switch compared an unread map name; the
teleport follow-up's log printed a map the resend had cleared; with no
hold, a controller or actor of 0 matched the flight's; ticket 0 read as
waiting; the free camera's view reads are bounded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
oot::sysmods: everything the system mods (Field of view, text speed and
size, Damage taken, sprint, widescreen UI, Skip title, cheats, heart
containers, shadows, Voice language, area names, Discord) read, write or
call in the game, so each mod is written on the api crate with no raw
offset. The one system-mod outcome site, options.voiceWritten, gets its
engine callback here; it follows the saved option while the published
knob sysmods::knobs::VOICE_FOLLOW is on (off: the game as shipped).

Fixed on the way: a refused call in the voice callback answers "not
written" rather than a stale x0; an area name over 95 bytes is cut on a
character boundary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/game/{items,rewards,rules,skips,songs}.c, typed: the items' watch on
its own sites, give, take and the pouch's counts; the placement drops,
event gifts, shop prices and bottle fills; the damage, actor-life and
scale rules with their tables laid out as the C's; the mods' skipped
events and the song names. Caller gains stack_pointer, for the bindings
that build a frame below the caller's stack; travel takes the pouch's
counts as the service now gives them.

Fixed on the way: a build naming no life vtable took a component reading 0
named Player for Link; the song list read before the RomFS index was ready
stayed empty for the run; the items' sinks are told after the poll lets go
of its state, so a sink that gives an item no longer deadlocks; the damage
and actor-life tables are published both or neither.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/game/{actors,spawn,queries}.c, typed: the actors.update site's
lock-free record, the list and its generations, the mods' writes with
their tickets and lit bombs, spawning and despawning with #68's gate and
the respawn flags, and the answers to the behaviour-tree queries. Their
tables keep the C's layout; longshot-game exports the hos_* functions the
lifted rule C calls around the safe Rust.

Fixed on the way: a build naming no controller method or no actors.vtable
matched a slot or first word of 0; a write its site marked dropped was
counted as made; a list slot's generation could wrap to 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/game/attach.c: models bound to an actor's bones, the slots' hand-over
and generations, and the actors.binds table the bind site reads. The C's
model bind was read from the lifted code and never run in the game.

Fixed on the way: a bind whose guest cells were half written called the
game anyway; it now ends Refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/oot_high_fps.c and its oot_sites.c callbacks: the sound job at 60 Hz,
the music's time and flags, the physics solver's steps, the horse's jump,
the floor carry, the drive target, the cloth's gate and time, the song
cues, the steering rates and the jump's takeoff, each rule a pure function
with its tests. The time slot and the cloth's clock are named locations.

Fixed on the way: the time slot, the drive controller and target and the
body's position are read bounded; an unreadable one gives the game's own
value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/oot_barrier.c: the job threads wait for their work on the host's
wait-on-address, the protocol over traits and tested (a wake before the
arm, between the look and the wait, a stray wake, a timeout).
host/oot_heap_retry.c: the OptimizeChangeBank thread's allocations tried
again in the full heap's parents. With their engine callbacks.

Fixed on the way: an unreadable barrier word falls back to the game's own
sleep instead of faulting.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/oot_tex_compact.c, oot_ocb_hold.c (its switch now the setting
ocb_hold::set_hold_ms, 2000 ms by default as the C's) and
oot_damaged_files.c, with their engine callbacks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/oot_state_tap.c: the control bridge's samples, watches and flag
changes scan, its JSON lines kept byte for byte (tested), and the bridge
over it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
host/oot_menu.c: pointing and clicking in the game's own menus, with the
menu.focus and menu.update callbacks; the input movie's menu choices go
through the host's movie.

Fixed on the way: an item key set by the mouse is written through the
bounded write, which marks its pages for the renderer's watch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
engine::install installs every HOS_SITE_ENGINE line of game/sites.def
that belongs to the core (host/oot_sites.c): the features' callbacks from
their modules, Voice language's outcome site over its knob, the host's own
features on sites (the mouse look, the button prompts, the camera
centering, the upscalers' jitter) read here and handed over through
host-sys, and the host's C callbacks for the zstd decodes, the scene
format and dynamic resolution. A test checks that every outcome site has
its engine callback and none is a system mod's. The bridge and travel
agree on the game's situation and Link's progress.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The rewrite drops the environment switches that only kept a settled fix's
C-era A/B or an experiment: HOS_FPS_CLOTH, HOS_FPS_TAKEOFF, HOS_FPS_MOVIE,
HOS_FRAME_CARRY and HOS_REALTIME_WINDOW (each now its shipped default),
HOS_OOT_TELEPORT_EVENT and HOS_OOT_TELEPORT_STARTER (the teleport's event
and starter fixed), HOS_VOICE_OPTION_FOLLOW (the Voice language mod's knob
replaces it), HOS_TEXT_SIZE and HOS_SHADOW_STABLE (the mods' settings).
travel also hands Link's progress to the player service as it takes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
bridge::sample_ask, sample_cancel and watch reach state_tap::ask, cancel
and watch, the bridge's checked Watch handed over as the tap's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The game's state reads whether a movie plays from video's own record of
the movie players' updates (a quarter second, as nn_vi.c's
MOVIE_STALE_NS), not a host call; travel takes its guest strings from the
same system-region allocator as spawn, attach and texts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The Atmosphere cheat file read into its cheats (names, master cheats, words) and
each cheat's switch key, the C's "cheat_" and FNV-1a 32 of "<mod>/<name>"
with "#2", "#3" for repeats, hashed over the name's own bytes. A word is now
exactly eight hex digits: the C's strtoul also took 0x123456, +1234567 and
-1234567.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Opcodes 0 to A and C0 to C3 decoded as dmnt decodes them (C4, B, D, E and the
F.. extensions not supported), and run over a Memory trait (reads and writes of
the game's mapped ranges, the regions' bases, main's code) with the buttons
held. Registers clear per run, the static registers stay; a run stops after
1 << 20 opcodes.

Fixed on the way:
- regions 2 and 3 (alias, ASLR) were base 0 plus the offset, so a cheat of
  theirs read and wrote whatever guest address its offset happened to be;
  they now reach nothing.
- a write starting before main's code but running into it was let through
  (only its first byte was checked).
- opcodes 1 and 9 compared or computed with the whole value word at widths 1
  and 2; dmnt cuts it to the width.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Each mod's cheats/<build id>.txt (any case) found through a CheatSource, its
cheats classified (heading, data, master, not supported with the reason), the
switches read from and kept in a SwitchStore, and every cheat that is on run
at each presented frame from the 60th. Errors are a thiserror enum with stable
codes; the load's log lines are the caller's to write. A file that cannot be
read or is over 4 MiB is now reported: the C passed over it silently.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Heart protection, No-clip flight, Movement speed and Free camera as
api::settings::SettingDecl for the mod's manifest: the menu's labels and help,
the keys its ini_key makes of their labels today, Store::Options, shown while
debug_tools is on, and HOS_OPT_CHEAT_* 32, 33, 36 and 35 as legacy_id. The
cheat action (34), a one-shot command and no row, is declared apart.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The manifest, the permissions it needs (memory.read, memory.write, input.read,
and a read of other mods' cheats folders that no permission gives yet), what it
needs of the memory, input and storage services behind its traits, and its
start, frame and stop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
The high-fps A/Bs (HOS_FPS_CLOTH, HOS_FPS_TAKEOFF, HOS_FPS_MOVIE, HOS_FRAME_CARRY), HOS_REALTIME_WINDOW, the
teleport's experiment overrides, HOS_OCB_HOLD_MS, and the switches the system mods' settings replace
(HOS_VOICE_OPTION_FOLLOW, HOS_TEXT_SIZE, HOS_SHADOW_STABLE): the Rust game side reads none of them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
hos_rules_*, hos_rewards_*, hos_actor_{writes,binds,lights} and hos_query_answer: each casts the table the site
loaded back to oot's and calls its safe function; a null table leaves the game's value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3nBDxBnhodLguFyEt
CallOpts (sp, x8, LR) with GuestCtx::call_with and call_own_thread_with; GuestCtx::run, the lifted call a replace
site stands in for, over a new host/game/game.c game_run; vreg/set_vreg, z(); own_thread_sp. The stand-in host runs
a fake function on a context and gives a stack pointer of the own thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host-sys fpe::{fma32, div32} over builder/rt's recomp_fpe_fma32/div32 (the stand-in host: the host's own float ops);
GuestCtx::fpe_fma32/fpe_div32 take and give a float's bits as u32. oot's steer rate passed them as u64: now u32.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
GuestPtr<u8|u16|u32|u64>::{load_atomic, store_atomic, compare_exchange, fetch_or}: checked as read and write are,
sequentially consistent, a write's pages marked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A weak stand-in in host/game/game.c answers none until the lift writes the table; the stand-in host's are set by
the test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
features::{mouse_camera, prompts_text_draw, prompts_text_layout, prompts_glyph, jitter_clip} over mouse_native.c,
prompts.c and rx_backend.c; sites::{zstd_stream, zstd_frames, scene_format, dynres_*, fixed_scale_*} as function
pointers for Handler::C (hos_zstd.c's decodes, oot_sites.c's renderer callbacks); no-op callbacks under fake.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
mem::sys_alloc (hos_sys_alloc), romfs::{head, read_zs} (hos_romfs_head, zs.c's hos_zs_read_romfs),
files::{romfs_rel, resolve_read} (nn_fs.c), info::main_image (the generated image.c's hos_main_*), each with the
stand-in host's. On the way: romfs::stat answered a folder as a file of size 0, and romfs::list took an empty
folder for none and a missing one for an empty one (hos_romfs_stat gives 2 for a folder, hos_romfs_list -1 for none).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
input::{flight_axes, free_camera_axes, move_stick_held, stick, drag, clear_toggles} over nn_hid.c;
movie::{active, playing, action, action_taken, link, clock, menu, menu_take, menu_done, MenuChoice} over
input_movie.c; mouse::{game_menu, game_menu_gone, game_pointer, wheel_take, left_held} over display.c. Two small C
stand-ins declared in hos.h where the host had no function: hos_input_movie_clock (input_movie.c's static
movie_clock, -1 with no recording) and hos_mouse_left_held (oot_menu.c's own GetAsyncKeyState test). The stand-in
host keeps each as a test sets it and records what the code gave.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
sync::{available, wait_on, wake_all} and sched::{vcore_away, vcore_back, chain, note_slept, Chain};
paths::ab_value (hos_ab_side_now, hos_ab_value_at) and control::on (hos_control_on), the host's flags read as
atomics. C stand-ins in hos_thread.c, declared in hos.h, where the host had none: hos_wait_bound, hos_wait_on,
hos_wake_all (oot_barrier.c's WaitOnAddress binding, for any caller) and hos_note_slept (the thread-local
Breakdown counter, which Rust cannot reach).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A second context of a runtime (Context::new_realm), import() let through to
the loader, Hooks::normalize_with (attributes), ModuleKind::Own, the tools'
intrinsic (performance), resolve_module, set_import_meta and view_bytes_of. A
mod's runtime calls none of them: its behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
script::modtool runs an SDK's lib/game-cli.js main(argv) in QuickJS-ng: a
loader for files (TypeScript compiled as it loads), node:* (shim.js, the C's
subset plus structuredClone, URL and node:module's SourceMap) and longshot:*;
longshot:native (files, the process, processes, the bridge's socket, deflate,
CRC-32, SHA-256) and longshot:host (the game's parts through ToolHost, and
realms: contexts of the runtime whose modules a linker names, for the fake
game's node:vm). Errors are Node's, a time limit is node:vm's, and
process.exit stops the interpreter instead of the process.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game.h's game_mod_tool(argc, argv) takes the whole command line: --help and
--version [--json] answered here, mod <command> run by script::modtool with the
game's parts (GameParts: the version, mod-format, the manifest reader,
content's BYML, SARC and MSBT readers, the BARS asset names ported from
host/audio_source.h, and the host's zstd decoder); -1 for any other line.
game_mod_format stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Both mains (Windows' and Linux') call game.h's game_mod_tool before anything
of the game starts, and return its exit code when the command line is the
tools'.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The fake game's node:vm is lib/vm.js: Node's own in Node, and under the game
host-game.js's subset over the tool's realms (createContext, Script,
SourceTextModule, SyntheticModule, runInContext, runInThisContext), which the
link check and runScript use too. node:assert/strict is lib/assert.js, the same
on both hosts. The entry's exports are taken once its evaluation began (both
hosts give a namespace then); the test runner registers Node's TypeScript hooks
in Node alone (the game's loader compiles a test itself). longshot mod test
with no --game runs the fake game on either host.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
bin/longshot-mod.js hands test (against the fake game) to the game the mod
belongs to when its tools run the fake game (they have lib/vm.js), else runs
it in Node as before; a checkout is now known by game/crates/script's modtool.
tools.md: test is the game's own, with lib/assert.js; Node keeps shaders and
sites port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The generated <Namespace>Api traits take &self, so the journal, permissions, claims, storage, settings and the
mods' manifests move into RefCells; the loader borrows them. A live effect's undo is given &Services, so a service can
run it from its own release as well as from a mod's stop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
services.c's has() and version, and longshot/log (a line each call, controls and direction marks shown as spaces,
100 lines a second a mod, the last 200 kept for the inspector), over host-sys. The feature list of every build
(services.c, services_game.c, services_input.c) by schema name, over what oot finds in the build. The Store,
storage.save, storage.save.flags, settings and permissions traits wired to the first pass's services. A slot table
for the objects mods hold by handle (owner and generation, so a reused or another mod's handle is stale).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
services_game.c, game_events.c and text_shown.c over oot: the state and Link read once a call, the frame they
were read in; game.flags read by the game's own hash. The game's moments (map loads, save requests, watched flags,
the pause) watched only while a running mod with state.read listens, polled once a frame and fired in order; the
textShown filter over content's tagged text, a changed text handed back to the game.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
writes.c: game.flags.set and player.set checked in the C's order (deny list, play, the flag, its kind, its range
read now), queued and made after the frame's update listeners, each a write in the undo journal; Link's life held to
a write for four frames. The deny list and ranges are game.flags.toml's, as tables (the bindings do not carry them).
The journal's game half (UndoGame) over oot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
timers.c: time.after, every and gameStarted, and game.after in game time, called in load order at the frame's
timers point through the script host's kept callbacks. dev.c: dev.enabled and dev.keep (the init's value kept for
the next instance of the mod).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
camera.c and input.c over oot's camera, pad and pause: camera.state and the override under the claim camera,
game.pause counted over every mod's pauses, the HUD hidden while any hide is held, the projection of a world point
through the frame's view; input's actions, pad state, presses, rumble, the pointer's capture and the pad filter.
Each override, pause, hide, action and capture is a live effect in the journal: a stopped mod's are taken back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
items.c over oot's item service: items.checked and items.granted polled while a mod holds items.read or
items.grant; grants queued in longshot_mod_items.txt (queued, given, saved), one given a frame, a save loaded puts the
given ones back; held and remove. Each give and take is a write in the undo journal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
rules.c: every running mod's rules made into oot's tables at the rules point, in load order then the order added,
only for a kind that changed; rewards and prices under their claims, taken with a mod's first and given back with its
last; the host's map published for rules that name one. One handle type for every kind (a slot table), each rule a
live effect in the journal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
actors.c, attach.c and spawn.c over oot: the list watched while a mod needs it, its events and hits fired in the
schema's order, list() answered once a frame per query (result_key), writes and lights handed to the game after
update, bones bound and unbound, the mods' answers to behaviour queries published per query, spawns followed to their
key and despawns' respawns journaled as placement writes. Attachments, answer hooks and spawned actors are live
effects in the journal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
world.c, travel.c and worldstate.c over oot's rays and travel queue: rays settled once cast or given up after 4
frames, travel and setAge settled by ticket, the world's states read and set through the game's Bool setter (each a
journaled flag write).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
What only longshot-game can give the services (the memory map, the files the game is served, the post-process
passes' and the world layer's sinks, the audio output and decoder): traits here, set once at start; the services run
without them, a part missing reading as absent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
memory.c: ranges checked against the host's map (one part, never code or read-only data for a write), reads at the
call, writes queued and made after update, each journaled with the bytes it replaced; immediate in-order reads and
writes for system mods. romfs.read and size over the files the game is served (the host's index when no layer map is
given).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hooks.c: mod_sites.txt read and its slots defined and chained, listen, sites and setValue; every visit recorded
on its thread and told at the next frame's hooks point. Unlike the C, a serial site's listener no longer runs inside
the game's code on the main thread: no script runs off the acquire phase (DESIGN, Threads). A row hooking one of the
game's own sites by name is listed but not hooked here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
gfx.c and gfx_world.c: an effect's .glsl and its .glsl.spv read from the mod's folder, checked by the renderer's
template through PostSink and held to the source it was compiled from, its params set by name; the CRT and
colour-vision system mods' passes beside them; every pass published whole when one changed, by point, load order and
the order made. The world layer's shapes checked and capped, followed actors placed each frame, published through
WorldSink. Each a live effect in the journal. PostSink and WorldSink are implemented by longshot-game.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
files.c: paths kept inside the mod's folder (no link followed, the author's dot folders and node_modules unread),
text, bytes and json read on a reader thread of their own and settled there, the sync reads at the call, list, exists
and size.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
content.c's declarations into content's plan for the running content module, every mod's kept for the session so
its own names resolve (items, actors, spawns, answers); content.read's calls checked and read on a reader thread
through the host's ContentReader (the layers' files and their zstd are the host's).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
audio.c, audio_mix.c and audio_groups.c, ported from untested C: sounds of the mod's folder decoded on a thread
of their own (WAV here, Ogg Vorbis through the host's AudioDecode), voices with volume, pan, pitch, loop, a low pass
and a send to the mod's reverb, placed voices heard from the camera each frame, the bus's limiter, the game's groups'
gains and ducks under the claim audio.groups. The host's mixer thread runs Mixer::mix and groups_frame. Streaming is
not ported: a streamed sound is decoded whole. Sounds and ducks are live effects in the journal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Services::frame(main, phase, frame, dt, scripts) steps every service once a phase in the events' order (frame,
storage.save.loaded, update, the items' and actors', settings and permissions changed, the actions', the game's
moments), runs the filters at their points, the journal's undos, and the frame's end (rules' tables, the world's
answers, placed sounds, passes and the world layer). The storage's own step is now save_frame. ScriptHost gains
fire_handle, filter, filter_subscribed, subscriptions, call_kept, callback_live, release_callback and deliver, each
with a default that does nothing so the script crate builds until it overrides them. Services implements ApiServices:
every accessor is the services themselves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
For the cheats mod and the post-process system mods, each refused to any mod that is not a system mod: memory
written and read at once (journaled), the main module's and heap's bases and the code's end, the pad as raw
HidNpadButton bits, the build id, whether mods were on at the start (not Safe start), the other mods' cheats/ files
listed, and post-process passes of their own. The loader tells the services the mods' folder and Safe start.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Generated pages (permissions.md, the reference) are made again by cargo run -p schema-gen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The text.letterStep site's handler, the text_speed and text_size settings
(same keys and HOS_OPT numbers), over oot::sysmods::text. Replaces
host/oot_text_step.c, host/oot_text_size.c and nn_vi.c's text scale.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The camera.lens site's handler and the field_of_view setting (same key,
HOS_OPT_FOV's number), over oot::sysmods::fov. Replaces host/oot_fov.c and
oot_sites.c's hos_site_camera_lens.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The player.lifeHit and player.lifeWrite sites' handlers and the
damage_taken setting (same key, HOS_OPT_DAMAGE_TAKEN's number), over
oot::sysmods::damage with the Debug tab's heart protection. Replaces
host/oot_damage.c and oot_sites.c's hos_site_life_hit/hos_site_life_write.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
HOS_SHADOW_STABLE's three choices become the setting shadow_steady_fit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The services are `&self` throughout (each keeps its state in a cell), so the
engine lends them as a shared borrow (`LentRef`) in place of the
once-at-a-time `LentMut`. A callback a service calls now (`call_now`) may
call the API again: the refusal "the API cannot be called from a callback the
API is calling now" is gone, as the adapter already puts back what the outer
call holds (`CallFrame`) and no service holds a borrow across a call back
into a script.

`NativeSpec::call` and `HostHooks` take the concrete `&Services` (lent
beside the thunks' `dyn ApiServices`, on the main thread only). The hooks'
defaults ask the services themselves (`ServiceHooks`, was `NoHooks`): a
filter's claim through `Services::claims`, `game.flagChanged`'s refusal
through `Services::flag_watch_refused` with every mod's live subscription to
it (the runtimes of a thread are kept weakly in `Shared` for that).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
`fire_handle`, `filter`, `filter_subscribed`, `subscriptions`, `call_kept`,
`callback_live`, `release_callback` and `deliver` are the trait's now (they were
inherent methods the services never reached, or missing): handle events,
filters, timers, hooks' listeners, answer hooks and the game's watches reach
the scripts.

`call_kept` gives back what the callback returned (`undefined` as null, so a
timer that returns nothing keeps running; a result that is no value as null,
said in the log), `None` when it is gone, threw or ran out of time.
`subscriptions` lists each running mod's live subscriptions to an event with
their filters, in load order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
`script::NATIVES`, the game's table: the together source's `running`,
`claimant` and `claims`, and the UI's `project` (state.read) and
`hideGameHud` (camera.write, its undo `showGameHud`), over
`api::services::Services`. The engine defines `self`, `checkPermission`,
`caller` and `callerHas` (no call between mods is made in this build, so none
has a caller) and the UI's `actorRef`.

An undo now hands the service's result back unchanged, not made the script's
and read back. The members without a service side yet are listed in the
module's documentation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
`api::bindings::MODULES` carries each JavaScript module's source and path;
the adapter kept only whether it had one and embedded the three sources a
second time with include_str!. The table is the one source now (no second
copy in the binary, no list of sources by specifier to keep in step with the
schema), and a source's group is its folder (`game/modapi/ui/runtime.js`: ui).

The rest of script::bind's reading of the tables matches what
game/crates/schema/src/emit/rust.rs writes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The machine's Env wired to the game: the row (skip_title_screen, legacy id 44),
the Insert menu's hold, Link in play, the loading flag, the newest save (oot's
finder: saves.rs was a copy of it), the build's two sites, the frame and A
pressed through oot::pad. Its handlers on menu.buttonWait and
menu.buttonWaitNoDecideAnim are journaled and taken off when the skip is over.
The crate is sysmod-skip-title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
HOS_OPT_CHEAT_ACTION (34) carried one action at a time and was set back to 0
once taken: no setting. It is the command cheat_action, its old number kept
for input movies (command::by_legacy_id), run from the Debug tab, the bridge's
!cheat and a movie's replay while the mod runs with the Debug tools on.

The Debug tools row (debug_tools, saved by the menu) is declared by the mod
its cheat rows hang on. The cheat rows were never saved by the menu (no value
in its table), so they hold for the run only: settings::PER_RUN, put back to
their defaults at each start. The crate is sysmod-cheats.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Memory, Buttons, CheatSource and SwitchStore over memory_read_now and
memory_write_now, memory_bases, pad_hid (0 while the Insert menu is open, as
the C), cheat_files, build_id, mods_on_at_start and the mod's global storage
(the switches move out of mods.json's "cheats"). The rows set oot::debug's
knobs while the Debug tools (or HOS_OOT_CHEATS) are on; heart protection
follows HOS_OOT_PROTECT_HEARTS until its row is touched, as the C's -1 did.
The Mods tab's list and switches go through tab (for game.h's cheat_info and
cheat_set). The journal puts the knobs back and empties the list at the stop;
the cheats' memory writes stay, as the C left them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The crate's copy of the table goes: name() is oot::sysmods::area_names's. The
C showed the names only in the Discord status, which is the discord script mod
now and names places as the player's game does; a native mod cannot export to
a script yet, so the mod declares itself and changes nothing until it can.
The crate is sysmod-area-names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Ported from host/oot_heart_containers.c's taken and want: the count of the
boss containers Link took, given to the game side through
oot::travel::set_heart_containers_source, for player.state()'s heartPieces
and the Discord status's pieces of heart. The ids are read once, on a thread
of their own, at the first ask; off, the count (and so the pieces) is not
known, the game as shipped. The crate is sysmod-heart-containers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A cheat rewriting a value the game keeps changing made one entry a frame, filling the journal's 4096 in about
70 s and pushing out other mods' changes. The entry keeps its first "before" and the latest bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The mods' cameras' field of view and the Debug tab's heart protection no longer depend on the Field of view and
Damage taken mods running: the core serves them, and Field of view's handler takes camera.lens's place while it
runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Debug tab's cheat rows were never saved by the menu; as Store::Options they were written to the options file
and put back at each start. Store::Run keeps them in memory, the default at every start.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
ModApi::site_handler puts a handler on a site the mod's manifest lists (hooks.unsafe), journaled so the mod's stop
takes it off; ModApi::log writes under the mod's id; ModSettings::get_of and published_of read another system mod's
setting, and a row's shown_if may name one (system/<name>:<key>).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Text, Field of view, Damage taken, Skip title and Shadows put their handlers on through ModApi::site_handler, which
checks the manifest's sites, in place of each calling the chain itself; Shadows logs its fit through ModApi::log;
Damage taken is Normal, and its row hidden, while the Cheats mod's Debug tools are off, as the C had it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
PaneSizes::restore writes the game's value back into every field still holding the scaled one; the mod's journal
runs it after its handler is off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
longshot-game gives api's services what only it can (Services::set_hosts): the game's memory over
hos_mem_region and the guest window, the files the game is served (a mod's layer, else the RomFS
folder), the post-process passes for the renderer (with spirv, block, enabled, revision, owner, and the
renderer's reports through game_post_report), the world layer as a list (game_world_draws), the mods'
audio mix pulled by the host's mixer (game_audio_mix, called in nn_audio.c after the game's frame),
content.read's reader (content_read.c's reads over content::read and the RomFS layers) and the loader's
packages over content::archive. fx_spirv_check and fx_spirv_source are ported (spirv.rs) for the
PostSink's check. host/nn_applet.c exports hos_game_language for the reader's default language.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_init installs oot's engine callbacks and adds the runtime's step to the acquire phase (order 50);
the runtime (Services with its hosts, the loader over content and the options file, QuickJsHost) is made
at its first run, on the game's main thread, and the loader finds the mods there. Each frame: the loader's
frame, the workers, Services::frame, the control bridge's jobs. NATIVE_MODS is the compile-time list of
native system mods, empty with its spot marked. --mod-dev is read in game_mod_tool; game_shutdown writes
the stores (hos_close_finish). game.h follows what is exported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The travel bridge and the state tap's exports keep their C names (hos_oot_destination, _teleport_ask,
_teleport_result, _teleport_cancel, _age_ask, _state, _current_map, _stats, _player_seen(_ns), _loading,
_flight_shortcut_ready, _sample_ask, _sample_cancel, _sample, _watch, _poll) over oot's travel, bridge,
session and debug, with game.h's game_control_* beside them. game_control_mods ports control_mods.c as one
JSON request and answer: the list, the lines, and mod_restart/mod_test/mod_eval jobs (script::eval, the live
test runner) with eval's gates. game_input_line takes "!cheat <n>" (nn_hid.c calls it in place of
hos_oot_live_action); game_movie_age, game_movie_setting (by legacy id), game_camera_scale, game_presented.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_menu_* lay the settings service's rows (api::settings::MenuHandle) out as GameMenuRow, made again when
its snapshot changes, the list before kept; a set goes through the handle to the next acquire phase.
The options file's lines go through game_options_load (vk_menu.cpp's reader hands every line), and the lines
the game side read or set are written back by the renderer's save (game_options_key/_value), which leaves
them out of the file's lines it keeps (game_options_has), so no key is written twice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
nn_fs.c's OpenFile keeps its call: the export takes oot::fixes::damaged_files::stand_in's answer and writes
the stand-in's host path back when it fits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_cheat_action, !cheat <n> and a movie's option 34 run the mod's command (refused unless it runs with the Debug
tools on); game_cheat_count, game_cheat_info and game_cheat_set replace host/cheats.c's hos_cheat_info and
hos_cheat_set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Ported from host/oot_sprint.c's hos_sprint_input and hos_sprint_step. A toggled sprint that a reset ends while
the game's menu is up is now logged as every other end is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Ported from host/nn_hid.c's walk_held, walk_percent and move_keys_stick: the keyboard stays the host's, which
hands this what it read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The handlers on sprint.link and sprint.stance over oot::sysmods::sprint, the input and Walk key entry points
the host's controller reads reach through game.h, and system/sprint-walk: its manifest, its rows published to
the threads that read them, everything taken down by its journal when it stops.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The rows of gpu/vk/menu/widescreen.cpp with their keys, and the Custom placement's transform of a HUD group
(host/hos_wide_ui.c's place_axis and hud_transform).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The widescreen part of host/hos_main.c's boot over oot's size math, the keep mask of host/rx_backend.c's
host_wide_menus, and the picture's values the sites read on any thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/hos_wide_ui.c's layout lists, its RULES and classify, over names given as text or as the game's strings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Ported from host/hos_wide_ui.c (ozwaldorf's pane planner, NotRexed/Hookshot#2843): the node table, the shape's
numbers of each present, the plan across and up and down, the custom groups, and the game threads' side that
notes each pane as its transform is made and moves it by the plan. The panes' memory goes through a trait,
the game's over oot::sysmods::widescreen, so the planner is tested on fake panes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Its lists' widths restored and every noted pane's transform marked to be made again: the C never stopped, so
this is new.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/rx_backend.c's host_wide_menus around the planner's tick, and host/hos_wide_ui.c's hos_gameplay_hud_screen
split in a begin and an end the host's wrap calls around the game's update.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/hos_wide_ui.c's hos_wide_ui_bg and hos_wide_ui_bg_draw over oot's picture record, pack and draw. No lock
is held across a call into the game, and a drawer whose pieces are being drawn is left alone at its own
draw's site, in place of the C's per-thread flag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Every wide.* and ui.* site of game/sites.def handled over oot::sysmods::widescreen, and system/widescreen: its
manifest, its rows published to the presenting thread, Reset HUD placement, and everything taken down by its
journal when it stops.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Each function is declared once, with one signature, in #2411's sections (the
start, the frame, input, the control bridge, the renderer's table, files,
audio, the Insert menu's rows) plus the game side's own (settings, the options
file's lines, post-process passes, the world layer). Where the Rust replaces a
#2411 C function it takes #2411's name and signature: the control bridge's
game_state, game_current_map, game_destination, game_teleport_*, game_age_ask,
game_sample_*, game_watch, game_poll; game_flight_shortcut_ready;
game_live_action; hos_sprint_input; hos_wide_ui_tick; hos_gameplay_hud_toggle;
hos_cheat_info/hos_cheat_set; hos_perf_info/hos_perf_tracking;
hos_mods_romfs/hos_mods_file/hos_mods_dir_extras; hos_stand_in_damaged;
hos_game_layout(_log). Ours that duplicated those (game_control_*,
game_cheat_count/_info/_set with GameCheatRow, game_romfs_resolve,
game_romfs_opened, game_input_line, the second game_phase_run) are gone; the
(C) mark is on what is still #2411's C (the Mods page's list in mods.c, the
GameMenuRow data in menu/rows.c).

Kept ours on purpose:
- game_init returns int (1 made, 0 made before): the Rust start is safe to call
  twice and says so, where #2411's void one only read a switch
  (HOS_OOT_PROTECT_HEARTS, now the cheats system mod's). It is called once,
  after the RomFS index (hos_mods_init) and before the guest's first
  instruction: the mod runtime's layers and loader need the index, so the early
  call before the renderer is gone.
- The game's settings come from the system mods' declarations through the
  settings service's MenuHandle, not from static rows: a setting is its mod's,
  turned off with it and laid out by the Game settings mod. Both stay, so ours
  is renamed: GameSettingRow, GAME_SETTING_*, game_settings_generation,
  game_setting_count/_row/_get/_set/_text/_hint. #2411's GameMenuRow and
  game_menu_rows are unchanged, so gpu/vk/menu/game_rows.cpp still builds.

Call sites the header changes: hos_main.c calls game_init and game_mod_tool
through game.h; the Discord status (now the discord script system mod), the C
cheats' start and frame (now the cheats system mod) and Skip title's per-poll
presses (now the skip-title mod through the input service) are no longer
called from hos_main.c, nn_vi.c and nn_hid.c; nn_hid.c's !cheat writes
game_live_action again, as #2411 has it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
longshot-game exports what #2411's host and renderer already call, by #2411's
names and signatures, so the C it replaces can go without touching a caller:

- the control bridge: hos_oot_* and the game_control_* copies become
  game_current_map, game_state, game_destination, game_teleport_ask,
  game_teleport_result, game_teleport_cancel, game_age_ask, game_sample_ask,
  game_sample_cancel, game_sample, game_watch (HosControlGameWatch), game_poll;
  game_control_mods stays (the bridge's mod commands are the game side's own).
  hos_oot_stats, hos_oot_player_seen(_ns), hos_oot_loading and
  hos_oot_flight_shortcut_ready are no longer exported: their only callers were
  #2411's discord_rpc.c and oot_autoload.c, which system mods replace, and the
  shortcut is game_flight_shortcut_ready.
- the live input's !cheat: game_live_action, an exported int (AtomicI32) that
  nn_hid.c stores into as #2411 does; the acquire phase takes it and runs it
  through the Cheats mod's command. game_input_line is gone.
- the Mods tab's cheats: hos_cheat_info (texts kept for the run, as cheats.c's
  were) and hos_cheat_set, in place of game_cheat_count/_info/_set and
  GameCheatRow. game_cheat_action stays.
- the performance summary: hos_perf_info and hos_perf_tracking (new module
  perf), over oot::travel's place, with the host's hos_movie_stats and version.
- the RomFS: hos_mods_romfs, hos_mods_file, hos_mods_dir_extras(rel, all, fn,
  arg) in place of hos_romfs_resolve/_file/_dir_extras and the game_romfs_*
  copies; all 0 leaves out what the game's own folder lists, in any case (as
  hos_romfs_case found it), from the host's RomFS listing. romfs_opened is not
  exported (its C caller, romfs_layers.c's reload, is the Rust's now).
- the game's settings: GameSettingRow and game_settings_generation,
  game_setting_count/_row/_get/_set/_text/_hint.

vk_menu.cpp takes game_options_* from game.h, which it includes, instead of
declaring them again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The lines the host's reads, the present and the site handlers keep (log::say,
at most 64, from any thread) are written at the mod's frame, and at its stop,
through ModApi::log, under the mod's id, as shadows does. Nothing outside the
mods takes their queues any more (log::take was waiting for longshot-game to
drain it). Reset HUD placement's failure, which runs with the API at hand,
goes to ModApi::log at once, as a warning.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The two system mods join the workspace (members, sysmod-sprint-walk and
sysmod-widescreen), longshot-game's dependencies and NATIVE_MODS, and
longshot-game exports what the host calls of them (new module sysmods):

- hos_sprint_input, #2411's signature (blocked: SPRINT_BLOCKED, _AWAY,
  _PAUSE), over sysmod_sprint_walk::input;
- game_walk_read(down, readable) and game_walk_stick(x, y, walking, out[2]),
  new in game.h: nn_hid.c's walk_held and move_keys_stick, with the Walk mode
  and speed the mod's settings. nn_hid.c is not switched to them here: its
  statics would be left unused, and deleting them is the lead's step;
- hos_wide_ui_tick, #2411's signature: the host's hos_wide_keep_mask (set by
  rx_backend.c's host_wide_menus just before) is the renderer's mask, forced
  when HOS_WIDE_KEEP is set (read once, as strtoul did);
- hos_gameplay_hud_toggle, #2411's;
- hos_gameplay_hud_screen, the builder's wrap of the HUD screens' update
  (not game.h: the lifted code calls it): hud_update_begin, the update,
  hud_update_end;
- game_wide_picture(want, output_w, output_h, out), new in game.h: the boot
  picture, Picture::for_screen at HOS_WIDE_MAX_PX, given to the mod's sites
  and logged. hos_main.c's start calls it in place of its own size math and
  keeps its hos_wide_* words for nn_applet.c and rx_backend.c.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hos_guest_bytes is hos_guest_range out of line, for the game's Rust (guest::GuestPtr) to copy in and out with
volatile accesses; hos_free frees what hos_romfs_read and hos_zs_read_romfs allocated, by the C library that
allocated it. hos_guest_mark marked only the pages of a range's first and last byte (A64_MARK): a write of the
Rust's longer than a page left the pages between unmarked, so the renderer's captures missed them. It marks
every page.

hos_guest_wait32 and hos_guest_wake32 move beside hos_wait_on in hos_thread.c, on the same WaitOnAddress bound
from kernelbase.dll: game_guest.c called WaitOnAddress and WakeByAddress* directly, which on Windows needs
Synchronization.lib, which the game does not link.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hos_site_callee is a C thread-local the lifted code's replace-site hooks store, which Rust cannot name: the site
chains (game/crates/game-sites) keep the site's own and put it back before each handler, through
hos_site_callee_get and hos_site_callee_set (host/game_call.c). The weak hos_locations_resolved's comment named
game.c, which has none: it is host/game_call.c's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
What the mods' time budgets count (hos_thread_cpu_ns: Windows' GetThreadTimes, the thread's CPU clock on Linux)
and what the game side's notes of a slow call name (hos_thread_major_faults: getrusage's on Linux, -1 where they
are not counted), in host/hos_thread.c, for game/crates/host-sys's time module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hos_game_folder (a new host/game_host.c, for what game_host.h gives out of line) is the game folder in UTF-8,
the executable's or the one above bin/, worked out once with hos_paths.h's hos_game_path_*. The RomFS and user
folders (hos_romfs_dir, hos_user_dir: host/nn_fs.c's, set by hos_main.c at the start) and main's extent
(hos_main_base, hos_main_size, hos_main_code_end: the lift's gen/image.c) are declared in game_host.h, where
game/cheats.c and the game's Rust read them, instead of where each reader used them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hos_switch is getenv as longshot_env.h's env_on reads a switch (inline there), and hos_write_whole is
hos_atomic_file.h's hos_atomic_write (inline there): the game's Rust reads its switches and writes its stores and
the options' game lines through them, in host/game_host.c.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A setting kept in longshot_options.ini that a mod changes, not the menu, reached the file only at the menu's next
write. hos_options_save (host/game_host.c) asks the menu's writer (gpu/vk/vk_menu.cpp save) through
rx_option_set's new HOS_OPT_OPTIONS_SAVE, a number no row has: the file is written again under the menu's lock,
the game side's lines with it (game_options_value).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Debug tools' free camera read its keys with GetAsyncKeyState and tested the window in front and the Insert
menu itself (game/oot_tools.c); the game's Rust (its Debug tools, the mods' keybinds) asks the host instead:
hos_input_taken (the Insert menu open, or another window in front) and hos_key_down by a Windows key code, up
whenever the input is not the game's (host/game_host.c, on host/posix's keyboard on Linux).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hos_mouse_camera, which game/oot_sites.c declared where it called it, is in game_host.h's input part. The header's
list names what the game's Rust binds besides and where each is; hos.h's host-memory word wait says it is not the
guest word's (hos_guest_wait32).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Every extern declaration of host-sys is now a function or global the host defines: game_host_guest_range is
hos_guest_bytes, game_host_mark hos_guest_mark (in 1 GiB parts: its size is 32 bits), game_host_ctx hos_ctx, the
site callee hos_site_callee_get and _set, the clocks hos_thread_cpu_ns and hos_thread_major_faults, the present
count the host's hos_present_count, the build id hos_main_build_id, the folders hos_game_folder, hos_romfs_dir
and hos_user_dir (mods, cache and system_mods worked out from them, HOS_MODS first), switches hos_switch, the
options' write hos_options_save, files hos_write_whole and hos_free, keys hos_key_down (by a Windows key code: the
keybind names' table moves here from oot::pad, which forwards to it) and hos_input_taken. The guest-word waits
hos_guest_wait32 and hos_guest_wake32 are bound (mem::wait32, mem::wake32). The menus' mouse is Windows only, as
host/display.c is.

What game_host.h has no function for answers as a host without it: the network engine (never available, every
open refused), the mod API's controller watch, presses, rumble and pointer capture (no read, nothing applied).
BC7 blocks have no host encoder in this tree (bc7enc is not in it): image::bc7_block encodes mode 6 in Rust.
hos_wait_on and hos_wake_all stay: they wait on the job barriers' own words in host memory, which
hos_guest_wait32 cannot address. The fake host gives a guest thread a context of its own (set_own_sp), keeps
guest-word wakes, and keys folders by paths::Dir.

longshot-game's host.rs still names game_host_free: ffi keeps it as a deprecated Rust forward to hos_free.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Debug tools asked for "Page Up" and "Page Down", which are no keybind's names ("PageUp", "PageDown"):
the host's key table knows neither, so the keys read up and the free camera and the flight could not climb or
sink by the keyboard, as game/oot_tools.c's VK_PRIOR and VK_NEXT did.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The rebase onto #2411 kept this branch's guest (GuestPtr over Pod, GuestError, GuestCtx with calls) and left
#2411's src/host.rs and src/atomic.rs orphaned. One implementation remains: GuestPtr's atomics, which check the
address as a read does and mark every write, gain #2411's swap, fetch_add, fetch_sub and fetch_and (for u8 to
u64), and a 32-bit word's wait, wake_one and wake_all over hos_guest_wait32 and hos_guest_wake32 (through
host-sys's mem::wait32 and wake32, as every host call goes). host.rs's declarations were host-sys's already
(hos_guest_load and hos_guest_store are not needed: reads and writes copy through hos_guest_bytes), and its
option() is host_sys::options::renderer. #2411's API migrates so: Scalar is Pod, GuestCtx::read/write/read_ptr
are GuestPtr::read/write/read_non_null, GuestCtx::regs is gone (x, vreg_* and the rest remain), and
GuestAtomicU32/U64 are GuestPtr<u32>/<u64>'s own methods. Its one caller, oot::fov, is rewritten over
oot::sysmods::fov in its own commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
#2286 made game_call refuse a null context: host code calls the game only with the calling thread's own. The
guest crate's call_own_thread and call_own_thread_with (oot's OwnThread caller: the flags, items, pause,
respawn and verb-name calls from the acquire phase) still passed null, so every one was refused. They pass
hos_ctx's context (host_sys::call::current_ctx), and refuse at once with the new CallError::NotGuestThread
(code 3) on a thread that is no guest thread. game_call.h's comment still said NULL meant the calling thread's
own: it says NULL is refused. The fake host's set_own_sp gives the test thread a context of its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Field of view is a system mod (game/mods/fov, over oot::sysmods::fov::lens), but game/oot_sites.c's camera.lens
still calls #2411's hos_oot_fov, whose oot::fov and oot::options the rebase left out of the crate (and over
#2411's own guest API, gone with the merged guest crate). oot::fov is the C site's export again: the row's
percentage from the option the Insert menu row keeps (HOS_OPT_FOV, oot::options::FOV), and the mod's
lens for the rest, so the C site and the mod do one thing. oot::options keeps #2411's id, which the C site and
the parity test read.

tests/test_oot_fov_rust.py builds a library of the oot crate alone (guest, host-sys, game-sites and oot in a
workspace of its own, a staticlib over oot) instead of liblongshot_rs.a, which now holds every game crate and
the mod API, whose host calls a test program cannot give; the program links it with --gc-sections and gives
hos_guest_bytes and hos_guest_mark, which the Rust's reads and writes now go through. The planted changes move
to where the logic is (layout/sysmods.rs, sysmods/fov.rs): the clamp's bound and the event check as before,
and the row's range in place of the 100 % shortcut, which lens's second return at 100 % hides.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The guest and host-sys crates' parts, Field of view's pattern (the C site's hos_oot_fov over the system mod's
lens, guest memory through GuestPtr), and the stand-ins: host-sys binds game_host.h by its names, what has no
host function answers as a host without it, every host function the Rust needed and where it is, and where
hos_site_callee and oot_sites.c's hos_site_* go next.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The scene format for Native HDR, the dynamic resolution's three sites and the
fixed scale's two read and write host/nn_vi.c's variables: they move out of
game/oot_sites.c into host/render_sites.c and are declared in game_host.h,
which host-sys binds them by. The core still installs them as the engine's
callbacks on their sites. test_scene_format, test_dynres_sites and
test_fixed_scale_sites cut the callbacks from their new file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
HOS_WIDE_UI, HOS_WIDE_UI_LOG, HOS_HUD_MAX_RATIO and HOS_HUD_FULL_RATIO were read by game/hos_wide_ui.c, which the
widescreen system mod replaces (its HUD layout setting, the limits as constants): GONE, 2026-11-23. HOS_DISCORD and
HOS_DISCORD_APP_ID stay: the Discord system mod's mod.json names them (offSwitch, settingSwitches), so their rows
say that now. A64_CAMERA_DIAGNOSTICS is not an RX_/HOS_/LONGSHOT_ name, so it has no row to mark GONE; its read goes
with game/oot_wide_sites.c. The other dropped switches of the reports were marked GONE already.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
What the game's C fed the host, or read from it, now goes through game.h's
Rust:

- nn_hid.c: the Walk key and the movement keys' tilt are the sprint-walk
  mod's (game_walk_read, game_walk_stick); walk_held, walk_percent and
  move_keys_stick go. The ocarina's note wait, which oot_sites.c wrote into
  hos_oc_wait, hos_oc_last_kind and hos_oc_beat, is read with game_note_wait,
  game_note_wait_poll (the stale wait and its log line) and game_note_kind.
- nn_vi.c: realtime_step's game part (the limiter, the engine's rate, the
  frame's seconds, the Camera and Game speed rows) is game_presented; the
  text speed's and camera's scales (hos_text_scale, hos_camera_scale) are the
  text mod's and game_camera_scale. The movie pacing reads
  game_movie_seen_ns; hos_movie_frames, the whole-frame counters and the
  loops' step (frame_whole.h, loop_step.h, carry_fractions) were only
  reached from oot_sites.c and are oot::video's now.
- hos_thread.c: GetSystemTick tells the game side who read the clock
  (game_clock_read), which finds its graphics module there; hos_gfx_module
  goes.
- input_movie.c: a replay sets the settings it recorded through
  game_movie_setting instead of answering rx_option (hos_input_movie_option
  goes), and a recording reads them with game_movie_setting_value. The
  file's option lines keep their ids.

game.h gains game_note_wait, game_note_wait_poll, game_note_kind,
game_clock_read, game_movie_seen_ns and game_movie_setting_value
(longshot-game's input.rs). game_host.h drops what only the game's C read
(hos_oc_beat, hos_text_scale, hos_frame_whole*, hos_loop_*,
hos_movie_frames).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Deleted, each replaced by the Rust game/DESIGN.md's map names:

- oot_barrier.c/h: oot::fixes::barrier
- oot_heap_retry.c: oot::fixes::heap_retry
- oot_high_fps.c/h: oot::fixes::high_fps
- oot_ocb_hold.c/h: oot::fixes::ocb_hold
- oot_tex_compact.c/h: oot::fixes::tex_compact
- oot_damaged_files.c: oot::fixes::damaged_files (hos_stand_in_damaged,
  longshot-game's romfs.rs)
- oot_menu.c: oot::menus (the menus' mouse)
- oot_state_tap.c: oot::state_tap (game_sample_*, game_watch, game_poll,
  longshot-game's control.rs)

Their engine callbacks are oot::engine's; the host calls the exports by the
same names, which the C defined too (a clash at link).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Deleted, each replaced by its system mod (game/DESIGN.md's map):

- oot_text_step.c, oot_text_size.c: mods/text
- oot_damage.c: mods/damage
- oot_sprint.c: mods/sprint-walk (hos_sprint_input, game_walk_read,
  game_walk_stick: longshot-game's sysmods.rs)
- oot_autoload.c/h: mods/skip-title (game_autoload_input's work is the mod's
  own frame)
- oot_heart_containers.c/h: mods/heart-containers
- oot_shadow.c, oot_shadow_fit.c: mods/shadows
- oot_voice.c: mods/voice-language, over the core's options.voiceWritten
  callback
- oot_area_names.c/h: mods/area-names
- oot_wide_sites.c, hos_wide_ui.c: mods/widescreen (hos_wide_ui_tick,
  hos_gameplay_hud_toggle, hos_gameplay_hud_screen, game_wide_picture)
- cheats.c: mods/cheats (hos_cheat_info, hos_cheat_set, game_cheat_action:
  longshot-game's cheats.rs)
- discord_activity.c/h, discord_rpc.c: the discord script system mod, which
  already did this over longshot/ipc (its test/make-golden keeps showing how
  golden.json was made from the old C, which it takes from history)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Deleted, each replaced by the Rust game/DESIGN.md's map names:

- oot_tools.c (hos_main.c's game half: the Debug tab's tools, the bridge's
  game commands, the opening's skip, the save trace, Link's pose, game_init),
  oot_teleport_check.h: oot::{travel, session, debug, player} and
  longshot-game's control, input, cheats and perf (game_current_map,
  game_state, game_destination, game_teleport_*, game_age_ask,
  game_flight_shortcut_ready, game_live_action, hos_perf_info,
  hos_perf_tracking, game_init)
- game_layout.c/h: longshot-game::layout (hos_game_layout,
  hos_game_layout_log)
- flags.c/h: oot::flags

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Deleted: game/sites.c and sites.h (the sites' flags and slots, the handler
chains, the data rules' values and tables), game/phases.c (the frame phases)
and game/oot_sites.c (the engine's callbacks). game-sites' build.rs makes
every hos_site_on_*/hos_site_fn_* and hos_table_* the lifted code names from
sites.def, its ffi.rs the hos_site_*/hos_table_*/hos_value_* functions and
game_phase_*; the mod-site pool (hos_modsite_*) is modsite.rs's; each engine
callback is installed at start by oot's engine.rs (the renderer's from
host/render_sites.c, the zstd decodes from host/hos_zstd.c).

hos_site_callee, the thread-local a replace site's hook stores, was defined
by sites.c and read by host/game_call.c's accessors: it is the host's now,
in game_call.c. sites.def stays the list; its HOS_SITE_ENGINE names are the
C's old callback names, labels for the reader.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods.c's RomFS index (every mod file indexed at the start), the
resource size table's merge and its fallback, hos_mods_romfs, hos_mods_file
and hos_mods_dir_extras go: longshot-game's romfs.rs exports those names over
content::layers, which serves the mods' files, the size table with the
button prompts' entries, and the prompts' and the texts' own files. Its
cheats' part goes too (hos_mods_count, hos_mods_dir, hos_mod_cheats_dir,
hos_mod_cheat_count, hos_mods_cheat_switch, hos_mods_cheat_set): the cheats
system mod finds the cheat files and keeps its switches in its own storage;
mods.json's "cheats" is kept as the file has it.

What stays is game.h's (C) part: the Mods page's list, its order and
switches in mods.json, the ExeFS patches' state (hos_mods_init,
hos_mod_info, hos_mod_edit, hos_mods_changed). A mod's line on the page no
longer counts its RomFS files nor the files a mod lower takes (the index
that counted them is gone): it says what the mod has.

game/texts.c (the texts' PC wording, hos_texts_romfs) goes: content::texts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
With game/oot_sites.c gone nothing calls hos_oot_fov: the Field of view mod's
handler on camera.lens is the lens's one caller (over
oot::sysmods::fov::lens), and the core's engine callback there serves the
mods' cameras at the game's angle. oot::fov (fov.rs, the crate's one
no_mangle and its #[allow(unsafe_code)]) and oot::options (the option id it
read) go: oot exports nothing and has no unsafe.

fov.rs's tests move to sysmods::fov as tests of lens, with the cases of the
C check they replaced: the percentage and a zoom from its angle, the bounds,
non-lens angles, 100 and unknown percentages untouched, and another view, an
event or any broken link keeping the game's angle.

Deleted: tests/test_oot_fov_rust.py, tests/oot_fov_parity.c and
tests/fixtures/oot_fov.c. They linked an oot-only staticlib and compared the
old C with hos_oot_fov case for case; the export they drove is gone, the C
is no longer the reference (its cases are the Rust tests above), and
retargeting them to sysmods::fov::lens would need a new export from oot,
which exports nothing now. tests/test_oot_fov.py keeps the site's place and
words, and checks the core's and the mod's hold on the site and the
setting's key, range, default and old id (51) instead of cutting the C
callback from oot_sites.c and compiling the fixture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Ported, each still checking the host code it was written for:

- test_input_background, input_background_test.c, test_walk_key: nn_hid.c
  hands the Walk key and the movement keys to game.h's game_walk_read and
  game_walk_stick (the sprint-walk mod's, tested by its walk.rs); the
  fixtures give a stand-in that does what the mod does, so the cases keep
  checking the host's key reads, gates and bindings. test_walk_key's wiring
  reads the mod's settings (keys walk_mode and walk_speed, old numbers 49 and
  50, the speed's range and default) and nn_hid.c's calls instead of the
  renderer's rows.
- test_ocarina_notes: the note wait comes from game_note_wait,
  game_note_wait_poll and game_note_kind; a stand-in over the fixture's wait
  and beat keeps the cases (the stale wait itself is oot::video's NotePoll,
  tested by a_wait_nobody_ticks_goes_stale).
- test_hold_toggle: the Linux pause focus hook that drops the latch is
  oot::menus' focus; read from its source.
- test_hle_guest_ranges, test_host_guest_writes: the entries of
  game/oot_tools.c, oot_menu.c and oot_high_fps.c go with those files (the
  Rust reaches guest memory only through guest's checked, marking
  GuestPtr).
- test_no_release_lookup reads longshot-game's lib.rs for oot_tools.c.
- screensaver_test.c: a comment.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods.c keeps the Mods page alone (the list, its order and switches,
the ExeFS patches' state); its RomFS index, the size table's merge and its
cheats' functions are gone.

- test_mods_list.py: built from mods.c, mods_list.c and options_path.c
  alone (no romfs.c, restbl.c, romfs_index.c, nor the zs, prompts and texts
  stubs mods.c no longer reaches). The "cheat" and "switch" ops go:
  the cheats' switches are the cheats system mod's own storage now
  (game/mods/cheats), and mods.c passes mods.json's "cheats" through as
  the file has it. Each cheats check is now that check: the file's
  "cheats" (a switch, a value that is not one, a key twice, the old
  longshot_mods.txt's cheat line imported) is written back exactly, and a
  start with no change writes nothing. Every check of the list stays.
  New mods_page(), from test_mods_sizes.py: the Mods tab's lines (RomFS
  files, ExeFS patch files built in or waiting against exefs_patches.txt,
  cheats, past the last mod), a move and its move back counting as no
  change, and the order and switches read at the next start.
- test_mods_sizes.py deleted: the rest of it drove the deleted index
  (which mod serves a path, a long path left out, nothing served with no
  mods) and the size table's merge. Serving is content::layers' now, with
  its tests (the_last_layer_wins_and_keeps_the_others,
  a_folder_and_a_file_keep_the_last_alone, made_files_and_served_paths,
  lists_a_folders_extras, an_entry_the_games_folder_lists_in_any_case_is_not_added,
  keys_are_lower_case_with_slashes ...). Not ported, so this coverage is
  lost with the C: the resource size table fitted to mods' grown files
  (each served file's entry raised, the mods' own tables merged in) has
  no Rust counterpart yet (content serves a table whole or with the
  prompts' entries; RESTBL fitting is SARC parts only).
- test_mods_size_table.py: keeps merge_restbl's checks (host/prompts.c,
  which stays); its Linux fixture over game/mods.c and prompts.c (what the
  size table, the font and a mod's file are served as, and the documented
  file-mod example of docs/dev/reference/mods.md) goes with the index it
  drove.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The key that says whether the prebuilt liblongshot_rs.a is a tree's read
longshot-rs/ and game/crates/ only. The native system mods (game/mods/*) are
crates linked into it, api's build makes its tables from game/mods and the
mod API's schema (game/modapi), game-sites' build makes the sites' slots from
game/sites.def and game/sites/sites.toml, and script compiles QuickJS-ng and
includes oxc's usingCtx helper: a change to any of them left the key as it
was, so a developer's tree linked the stale prebuilt library. They are the
key's now (a script mod's node_modules and cargo's target left out). The test
tree no longer names oot's fov.rs, which is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
realtime_step's game part (the engine's limiter, its nominal rate, the frame's
seconds) is game.h's game_presented, oot::video's, and the movie pacing reads
game_movie_seen_ns.

Ported:
- test_frame_rate_cap_30: the movie's last update comes from a stand-in
  game_movie_seen_ns.
- test_pacing_policy: the host's cap, ticker, interval, acquire sleep, overlay
  and swapchain rows stay; a spy checks realtime_step hands the game the cap
  it paces at (the movie boost and its expiry too). The rows' game-step and
  nominal-rate columns go with the code that made them.
- test_video_hold_early: its note names the game side's movie.frameCount.

Deleted:
- test_realtime_rate: realtime_rate is gone; oot::video's
  the_rate_follows_the_clock_and_its_debt checks the quantizer and its debt.
- test_frame_carry_cap60: carry_fractions and the host's whole-frame and loop
  counters are gone; oot::video's fractions_are_carried_by_the_rule_of_the_c,
  a_counters_fractions_are_carried_only_when_asked,
  substeps_are_handed_out_when_carried and
  a_loop_of_one_frame_moves_in_whole_frames_and_draws_its_start cover them.
- test_frame_rate_cap_step: the step above 60 is oot::video's
  (real_time_writes_the_frames_rate_and_a_timed_cap_its_seconds,
  the_limiter_is_raised_for_the_cap_and_put_back_at_60,
  per_frame_at_60_gives_the_game_its_own_step); the frame.seconds rule's
  text is builder/crates/sites' (its MulF32 tests); the cap's selection stays
  checked by test_frame_rate_cap_30 and test_pacing_policy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/DESIGN.md's "Where each C file went": every file on the left is
deleted; what is left of the game's C is the Mods page (mods.c, mods_list.c)
and the static menu rows (menu/rows.c). The rows say where hos_site_callee
went (the host), the renderer's six site callbacks (host/render_sites.c),
oot::fov and oot::options (gone with hos_oot_fov), mods.c's parts, and the
host's game parts with the game.h functions that replace them.

game/README.md: what is here now; the Rust's pattern told by the Field of
view mod's handler rather than the C site's hos_oot_fov; the stand-ins for
hos_site_callee and host_sys::sites updated, and two new ones: the two
lists of mods (the Mods page's and the loader's), and the size table's
merge for grown files that content::layers does not do.

docs/dev/reference: the mods, input, control bridge, hooks and upscalers
pages name the Rust where they named the deleted C.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/input_movie.c no longer answers rx_option with a replay's rows
(hos_input_movie_option is gone): a recording reads the game's settings it holds
with game.h's game_movie_setting_value, and a replay sets the recorded ones
with game_movie_setting where the game's differ. The fixture keeps a fake
game's settings behind those two; the option lines and a recorded replay's
lines are checked as before. One check follows the new behaviour: a setting a
replay set stays after the replay ends (the old rows went back to the
player's menu then).

The wiring's game parts read the Rust that replaced oot_tools.c and
oot_menu.c: oot::menus' tick plays the recorded menu choices while a replay
plays and records the mouse's, and oot::debug gives the recording Link's
position (read only while one is active, under the tools' lock, put back
through his controller) and the Debug tools' actions before and after they are
taken. rx_option is checked not to ask the recording any more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The rows the system mods now own leave gpu/vk/menu: crt.cpp, colour_vision.cpp, walk.cpp and widescreen.cpp go whole,
Sprint's row (sprint.cpp keeps apply_sprint_layout), Shadow resolution (detail.cpp) and their opts fields (sprint,
walk_mode, walk_speed, hud_*, crt_filter, crt_lines, colour_vision, shadow_res, damage_taken) with them. Keys are unchanged:
each is the owning mod's SettingDecl now, placed by game/mods/game-settings.

- MkwVkHost version 49 replaces version 48's game_menu_rows (game/menu/rows.c) with the game side's table: the settings
  (game_setting_count/_row/_get/_set/_text/_hint, game_settings_generation), the options file's game lines
  (game_options_*), the Debug tab's actions (game_cheat_action) and the post-process passes (game_post_passes). The
  renderer's module never names a game.h function directly: the options file's direct game_options_* calls
  (unresolvable in longshot_vk) go through it too. vk_api.h includes game.h for the types.
- gpu/vk/menu/game_rows.cpp draws every game setting in place by key (tab, section, after/before, order), as an unsaved
  row that reads the game's value before it is drawn and sets it as the player does; Sprint's controls follow the Sprint
  setting (apply_sprint_layout). It makes the Accessibility section when a row goes there.
- The Debug tab's panel keeps its layout: Heart protection, No-clip flight, Free camera and Movement speed show and set the
  cheats mod's settings by key; Debug tools and Damage taken (debug_tools.cpp) are unsaved rows mirroring the cheats and
  damage mods' settings. Option 34's plumbing goes: each action (mark, return, clock, pouch, age, teleport, inventory) calls
  game_cheat_action when pressed (cheat_action, menu_take_cheat_action, HOS_OPT_CHEAT_ACTION's answer gone), as do
  HOS_OPT_CHEAT_HEARTS/FLIGHT/CAMERA/SPEED's answers, the renderer's flight state and its HOS_OOT_PROTECT_HEARTS read (the
  cheats mod reads it).
- The CRT and colour-vision passes read game_post_passes (menu_game_passes: the CRT pass's filter and lines, colour
  vision's mode) in place of opts; the Ultrawide menus side reads the widescreen mod's setting.
- vk_replay.cpp's option callback no longer answers the game's rows (Walk, Sprint, the HUD, Shadow resolution, Damage
  taken, the cheats); the Quality preset puts Shadow resolution back to Auto through the shadows mod.
- HOS_SKIP_OPENING's override of the old Skip opening row goes: the renderer cannot set a game setting for one run.
- menu_i18n.h: the HOS_WIDE_UI hint, no text of anything now, leaves every table.
- docs/dev/reference/architecture.md: the game's rows as the system mods' settings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
- test_menu_ini_keys.py: the system mods' keys count, from the Game settings mod's table (game/mods/game-settings
  LAYOUT), each held to its owner (MOVED: the old opts value to "game:<owner>"); FROZEN keeps every key, and gets
  shadow_steady_fit, the shadows mod's new line, on purpose. The cheats mod's run-only rows and Reset HUD placement save no
  line. A game/menu row from before is not counted twice.
- test_menu_modules.py, test_menu_sections.py, test_menu_slider_ends.py, test_settings_table.py: the menu built with no
  game has none of the system mods' rows (CRT, Accessibility's Colour vision, Ultrawide menus, Shadow resolution, the HUD,
  Walk, Sprint...): they are left out, and the settings page's lines for them are checked to be there by label.
- test_menu_i18n.py: the system mods' texts (game/mods/*/src) are the menu's texts too: the menu draws and translates them.
- test_damage_debug_menu.py: Damage taken is debug_tools.cpp's own int now (menu_damage_taken_row); the Debug tools'
  warning sets the cheats mod's setting. What Damage taken does while the tools are off is the damage mod's (the
  renderer's menu_damage_taken is gone), so that assert goes with it.
- test_menu_save_atomic.py: stand-ins for menu_game_options_* (save() reaches the game side's lines through them).
- test_crt_policy.py, upscale_independent_test.cpp: the CRT filter is read from the CRT system mod's pass
  (menu_game_passes).
- test_option_ids.py: Sprint's 97 stays reserved beside Walk's 49 and 50 (the sprint-walk mod's legacy ids).
- test_crt_options.py is deleted: it compiled gpu/vk/menu/crt.cpp's two rows (defaults, labels, keys, presets), which are
  gone; the rows are the CRT system mod's settings, checked by game/mods/crt's unit tests (off_makes_no_pass,
  the_slot_follows_the_rows, the_rows_keep_their_keys), and the pass by test_crt_policy.py and
  upscale_independent_test.cpp.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Ported to read the Rust that replaced game/oot_tools.c, oot_state_tap.c,
flags.c and game_layout.c:

- test_pipeline_tour and scripts/tours/route.py: the bridge's teleport and age
  actions, the hour action, the destinations (child and adult maps), the
  refusals' texts and the state tap's event, loading and age are read from
  oot's debug.rs, travel.rs (DESTINATIONS, Refusal) and state_tap.rs; the
  cache files from longshot-game's layout.rs; the switches from the game
  side's crates and mods; the options' keys also from the system mods'
  settings. The menu's actions are matched in either form
  (cheat_action.store or menu_game_action). scripts/pipeline_tour.py drops
  HOS_TEXT_SPEED, a switch gone (text_speed=3 in its options stays).
- test_cheat_items: also checks oot's travel.rs INVENTORY_ITEMS and
  INVENTORY_PROBES are the header's, in its order (the game side's copy of
  the list an edit's action indexes).
- test_bug_report (the map line, oot::travel), test_perf_report (the pose's
  gates, oot::travel's perf_pose and perf_place), test_parity_gates (the save
  trace's line, oot::session), scripts/parity_gates.py, scripts/tours/
  drive.py, control_test.c, display_startup_failure_test.cpp: the new place.

Deleted, the C they built gone:

- test_debug_tools_linux: it followed oot_tools.c's #ifdefs; the Rust tools
  have no platform condition (oot::debug, the cheats mod).
- test_game_flags, game_flags_test.c: oot::flags' tests (the_hash_is_murmur3,
  a_flag_is_found_by_probing_past_a_collision, bools_floats_and_texts,
  bool64_finds_then_remembers and the rest).
- test_game_layout: longshot-game's layout.rs
  (moves_once_renames_the_pipeline_cache_and_never_overwrites).
- test_teleport_check: oot::travel's only_a_dropped_request_is_sent_again.
- test_teleport_minimap_flag: the repair is travel.rs's teleport, through
  GameData::set_bool_queued (no unit test drives it: a gap).
- test_oot_song_inventory: oot::travel's songs_and_masks_are_counted_their_way.
- test_oot_first_night: the C it built (oot_inventory_refresh's repair of the
  first adult night's time lock, Longshot #1064) has no Rust: the repair is
  not ported, reported to the lead rather than kept as a test of nothing.
- test_perf_pose, perf_pose_test.c: the angles are oot::debug's
  (angles_stay_within_the_relays_range,
  camera_angles_come_from_the_eye_and_target); the gates (rate, event,
  stale, title) are read from travel.rs by test_perf_report.
- test_oot_state_tap: oot::state_tap's tests (the_core_line_is_the_cs_byte_for_
  byte, a_request_is_answered_by_the_next_tap, the watches' and the
  changes').

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/oot_sites.c and the core's C (oot_high_fps.c, oot_barrier.c,
oot_heap_retry.c, oot_ocb_hold.c, oot_tex_compact.c, oot_menu.c,
oot_damaged_files.c, oot_tools.c's update hooks, phases.c) are gone, and with
them nn_vi.c's whole-frame counters, loops and movie frames: the tests that
cut and compiled them go. Each site's registration is oot::engine's, checked by
its every_callback_names_a_site_of_the_def_once and
every_outcome_site_has_its_engine_callback; the behaviour by the modules'
own tests:

- test_high_fps_fixes, test_drive_target, test_floor_carry_step,
  test_horse_jump_step, test_jump_takeoff_step, test_oot_cloth_60,
  test_oot_cloth_time, test_song_note_cue, test_saved_turn_rate:
  oot::fixes::high_fps (a_driven_target_carries_last_updates_shortfall,
  a_floor_carries_in_full_on_a_short_frame,
  a_horse_step_of_the_whole_frame_is_not_slow_motion,
  a_backflip_gets_the_rest_of_its_takeoff_step,
  the_cloth_keeps_the_clock_below_60_fps, the_cloth_solves_once_a_60th...,
  a_note_flag_read_again_before_the_job_ran_is_the_same_note,
  the_steering_rate_divides_only_for_a_step_under_one, ...).
- test_oot_barrier: oot::fixes::barrier (ten, the wakes and waits).
- test_oot_heap_retry: oot::fixes::heap_retry (seven).
- test_ocb_hold: oot::fixes::ocb_hold (eight).
- test_tex_compact: oot::fixes::tex_compact (three).
- test_oot_menu_mouse, test_menu_hooks: oot::menus (seven).
- test_camera_speed, test_movie_frame_count, test_ocarina_wait,
  test_loop_step, test_frame_whole, test_scarecrow_timing,
  test_water_substeps, test_web_floor_steps, whole_sites.py: oot::video
  (a_turn_speed_is_scaled_and_left_alone_at_100_percent,
  the_camera_scale_takes_50_to_400_percent,
  a_movie_player_counts_the_frames_time_and_keeps_its_fraction,
  the_note_sites_arm_and_end_the_wait,
  whole_frames_are_cut_as_the_lifted_code_cuts,
  substeps_are_handed_out_when_carried,
  a_loop_of_one_frame_moves_in_whole_frames_and_draws_its_start, ...).
- test_camera_centering, test_oot_jitter: oot::engine
  (the_follow_yaw_skip_keeps_the_base, the_jitter_goes_to_the_third_lane_only).
- test_player_update_sites, test_movement_speed,
  test_flight_yields_to_events, test_free_view_anchor: oot::debug
  (movement_speed_scales_only_walking_speeds, the flight's and the view's
  tests).
- test_opening_skip, test_oot_transition_autosave: oot::session
  (the_opening_skip_arms_on_its_requests_and_skips_its_timelines,
  the_opening_skip_off_drops_the_arm, only_the_transition_autosave_is_dropped).

Ported, keeping what is still the host's:
- test_game_phases: the empty run's one relaxed load is read in game-sites'
  phase.rs (the phases' behaviour is its tests'); the acquire's wiring in
  nn_vi.c and nvn_native.c stays checked. game_phases_test.c goes with
  phases.c.
- test_damaged_rom_files: the stand-in's choice is oot::fixes::damaged_files';
  the test reads the table's three pairs, OpenFile's call for a read and the
  export.
- test_hos_ab: HOS_OOT_BARRIER_WAIT's reader is found in the game side's Rust
  (paths::ab_value).
- test_present_trace: hos_cheats_frame is no stub any more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The renderer draws every game setting from game.h's game_setting_* now
(gpu/vk/menu/game_rows.cpp, MkwVkHost 49), so #2411's static rows
(Field of view, Text speed and size, Skip title screen, Skip opening,
Discord status, Ultrawide menus), each a system mod's setting with the same
key, go with game_menu_rows and game.h's GameMenuRow block.
host/rx_backend.c's vk_host gives version 49's entries in their order:
game_settings_generation, game_setting_count, game_setting_row,
game_setting_get, game_setting_set, game_setting_text, game_setting_hint,
game_options_load, game_options_key, game_options_value, game_options_has,
game_cheat_action, game_post_passes. The builder's plan no longer looks for
game/menu/*.c. What is left of the game's C is the Mods page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/nn_hid.c read No-clip flight and Free camera with rx_option
(HOS_OPT_CHEAT_FLIGHT, _CAMERA) and set flight with rx_option_set: the
renderer no longer keeps those rows (they are the cheats system mod's), so
the double-tap shortcut and the free camera's input routing were off. They
read the settings by key through game.h (no-clip_flight, free_camera, -1 /
off while debug_tools is off, as the hidden rows were) and the shortcut sets
no-clip_flight with game_setting_set, made at the game's next frame.

game/options.h says what its ids are now: the system mods' settings' old
numbers (legacy ids), for input recordings, and names the mods where it
named the deleted C.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The system mods' C (oot_text_step.c, oot_text_size.c, oot_damage.c,
oot_sprint.c, oot_autoload.c, oot_heart_containers.c, oot_shadow.c,
oot_shadow_fit.c, oot_voice.c, oot_wide_sites.c, hos_wide_ui.c, cheats.c,
discord_*) is gone; the tests that compiled it go, each covered by its mod's
crate and oot::sysmods:

- test_text_size, test_text_speed: game/mods/text and oot::sysmods::text.
- test_oot_damage: game/mods/damage and oot::sysmods::damage.
- test_skip_title: game/mods/skip-title (machine.rs, told.rs) and
  oot::sysmods::skip_title; test_dev_ab keeps the bench's key and screens.
- test_heart_containers: game/mods/heart-containers and oot::sysmods::hearts.
- test_oot_shadow, test_oot_shadow_fit: game/mods/shadows and
  oot::sysmods::shadows.
- test_oot_voice_option: game/mods/voice-language and oot::sysmods::voice.
- test_wide_sites, test_wide_ui, test_hud_layout, test_hud_layout_row,
  test_oot_wide_bubble, test_oot_wide_save_picture,
  test_oot_camera_clearance, test_movie_shape, widesites.py:
  game/mods/widescreen (panes.rs, hud.rs, picture.rs, names.rs, ...) and
  oot::sysmods::widescreen. (Two host checks went with them: rx_backend.c
  calling hos_wide_ui_tick each present, and hos_wide_keep_mask's narrow-screen
  rule.)
- test_discord_activity: the discord script system mod's own tests
  (game/mods/discord/test, golden.json).
- test_cheat_vm: game/mods/cheats (vm.rs, program.rs, parse.rs).
- test_prompts_size_table: it served the size table through game/mods.c's
  hos_mods_romfs and its fixture (test_mods_size_table.build_fixture), both
  gone; the serving order is content::layers' (made_files_and_served_paths).
  host/prompts.c's raised font entry has no test left: a gap.

Ported:
- test_sprint: the fake-game check of oot_sprint.c and the sites' callbacks
  go (the sprint-walk mod's machine.rs, oot::sysmods::sprint); the host's
  binding, read_input and npad_states checks stay, the Sprint row is read as
  the mod's setting (sprint=, HOS_OPT_SPRINT 97, off) with the renderer's
  apply_sprint_layout.
- test_dev_ab: the Skip title setting's key, sites and screens from the mod.
- test_native_zstd, test_mouse_native: the zstd decodes' and the mouse look's
  sites are checked by the core's registrations in oot's engine.rs and
  host-sys's bindings (the C callbacks they cut are gone).
- sitecheck.py, sitetable.py: their default source is host/render_sites.c,
  the callee the host's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
test_site_chain compiled game/sites.c (hos_site_add, hos_site_remove,
hos_site_next) with a stand-in site list. The handler chains are game-sites'
chain.rs now, whose tests check the same rules:
an_owner_alone_is_called_through_the_plain_trampoline,
handlers_wrap_the_core_lowest_priority_first,
one_answerer_and_the_outranked_are_told_or_left_out,
outcome_sites_take_nothing_at_run_time,
the_callee_is_put_back_before_each_handler,
a_removed_handler_is_let_go_after_the_grace. tests/run_all_times.json drops
the one deleted test it timed; scripts/devtools' and the tour's notes name the
Rust the C became.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
tests/test_oot_state_tap.py went with game/oot_state_tap.c; oot::state_tap's
own tests check the snapshots, the watches and the changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/menu/rows.c's row went with the C and no mod declared it, so oot::session's knob was never set. The mod
declares the row (same key, old number 52), sets the knob at its start and when the row changes, and puts the
game's opening back when it stops.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The renderer builds its menu once, at its first use, which can come before the first acquire phase makes the mod
runtime; the game's rows were then missing for the run. Until the settings service publishes, the rows are the
native mods' manifests', with the options file's values, laid out as Game settings does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Mod-to-mod exports and calls, the network and IPC through game_host.h,
the UI channel and the inspector, hot reload and settling in parts,
serial in-place listeners and engine rows, Ogg streaming (lewton), the
batch --mod-tests run, the controller, and the Mods page in Rust, with
their game_host.h and game.h functions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
longshot-game's host.rs declared hos_zs_read, hos_fs_save_root/_end, hos_mem_region, hos_game_language,
hos_movie_stats and hos_wide_keep_mask itself; host-sys binds them now (files::zs_read, files::save_root,
mem::region, info::{game_language, movie_stats, wide_keep_mask}), each with its fake branch, and game_host.h
declares the save root's and the language's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The design says turning a mod off undoes everything it did; the port only undid live effects and left writes for
the Mods tab's undo. mod_stopped asks the journal's undo too, which puts each write back at the next frame where the
game still holds the mod's value. The cheats mod's writes, merged by address, are undone the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/oot_tools.c's oot_first_night_fix went with the C and was not ported: a save outside Hyrule Field that
still held HrlField_isFirstNightTime_Adult could never leave night. The map refresh clears it, once, never while
an event plays; HOS_OOT_FIRST_NIGHT_FIX=0 leaves it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
oot::travel published them for the menu, but nothing sent them on: the Switch age row and the Inventory page showed
unknown. The acquire step sends the renderer what changed (rx_option_set, OOT_CHEAT_ITEM_BASE + i and
OOT_CHEAT_AGE_ID), as oot_tools.c did; host-sys binds rx_option_set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The renderer answers HOS_OPT_MEMORY_TIER (3998) with the tier its Quality preset or Auto picked, and the Shadows mod
reads it: Auto is the game's size on Minimum and Low, Highest from High up, as menu_shadow_res chose, in place of
High everywhere.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A build's locations.toml may now hold [[location]] tables beside its sites
(the C era's format: a function = "f_<address>" or a data = <address>).
sites::named checks each against the lift's functions, main's data and the
game's list (game/crates/oot/src/locations.rs); locations_c writes the
host's hos_locations_resolved from them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The 72 names game/crates/oot/src/locations.rs reads, each its function or
datum in build e0f3ccfa, as the C era's host/game/sites/<build>/locations.toml
gave them ([[location]] tables, names and addresses only).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The lift checks the build's [[location]] tables (sites::named) before it
lifts anything, and writes gen/locations.c every time: the host's
hos_locations_resolved with each name and address, or none for a build
without a table. The tables' key holds the game's list
(game/crates/oot/src/locations.rs), the compile builds locations.c with
the lift's other C, and the shader preparation's driver keeps it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The lift now writes gen/locations.c in every build, with the build's
named locations or none, so the host's stand-in is never the definition.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Points Location's doc at the lift's gen/locations.c, and checks each
variant's ident is its name with each dot an underscore, as the builder
reads the list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The pads' poll plays a mod's level on both motors while it lasts, at the
Vibration strength row's scale (and a pad's own percent), and the game's
own rumble resumes after it. Ported from the mod API branch's
hos_sdl_rumble_mod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/game/pad.c of the mod API branch, moved to the host as hos_pad_* and
hos_pointer_* (game/DESIGN.md, "The controller"), declared in their own
section of game_host.h. npad_states calls hos_pad_hook after the frame
step's buttons: the player's read recorded when watched, then a mod's
replacement, the buttons kept and the presses. A held pointer leaves the
mouse look (nn_hid.c mouse_stick, mouse_native.c) and hos_pointer_take
hands the mod the motion at the menu's sensitivity. The mouse tests'
stand-ins gain hos_pointer_held, and mouse_stick's checks a held capture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host_sys::input's pad_watch, pad_read, pad_publish, pad_press, rumble,
pointer_take and pointer_hold call game_host.h's hos_pad_*, hos_pointer_*
and hos_rumble_mod in place of answering as a host without them. HID_BITS
maps the API's button order to the HID's bits both ways and the sticks
scale between -1..1 and +-32767; the fake keeps the host's records (HID
bits, +-32767 sticks, presses by bit, the pointer, the rumbles), so the
tests see what reaches the host. native.rs's HID map is now this one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The player's read reaches the service in the API's order from the host's
HID bits, once a frame, a torn copy keeping the last; a stopped mod's
presses are let go to the other mods' end and its rumble ended, another
mod's left alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The mod tool's file natives (and its module loader, and host.format) now
check each path against a fence (script::modtool::fence). game-cli.js
confines the command once, before any of the mod's code runs, with
native.confine(write, read); a second confine is refused. The SDK's
folder (read only) and the run's own scratch folder in the system's temp
folder (os.tmpdir()) are always in it. A path outside, or one that
reaches outside through .. or a link, is refused with ERR_ACCESS_DENIED
and a stable .reason (modtool.fence.outside, .dotdot, .link, .loop).
A command that never confines itself is confined to its default (the
current folder, the mod's) when the mod's code could first run: a realm
made, or a module loaded from outside the SDK.

Paths are resolved as the system walks them (links followed, .. the
real parent), the roots the same way; a stat on the way to a root and a
mkdir on the way to a writable root are allowed, so mkdirSync's
recursive works.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A realm's code can outlive realmDispose: QuickJS keeps a context while
its objects live, and the realm's handle stays alive while a call into
it is on the stack (a mod's code that stops its own realm). An import
then reached the module hooks with a context the tool no longer listed,
which they took for the tools' own: the tools' loader, which gives
longshot:native and every file. The hooks now give the tools' loader to
the tools' context alone and refuse any other they do not know.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
lib/fence.js works out the folders a command needs from its arguments
(its mod's folder by default; new's mod in mods/, data --out's file,
dev's copy in mods/, run's and allow's Dev profile, the game folder to
read, where a tsc, node or git was found) and game-cli.js's main
confines the command to them (host.confine) before it runs, so before
any of the mod's code. The game a command finds then is pinned
(game-find.js's pinGame): finding it again would read folders above the
mod's. Node confines nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Under the game each vm context is a realm of the tool's one runtime,
which keeps it, and its modules, until H.realmDispose: nothing called
it, so a test run's memory grew with its tests. lib/vm.js now has
disposeContext, contextMark and disposeContexts (the game's realms
disposed; nothing in Node, whose collector frees its contexts). The
test runner disposes every realm a test made at its end; the fake game
disposes a mod's old realm at a hot reload and a worker's when it ends;
the link check and runScript dispose theirs when done.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The finish copies mod-tools' bin/, lib/ and package.json from the tree
(assets/modding/packages/mod-tools) into the game folder's sdk/tools/,
where the game's longshot mod looks for its entry, so it runs with no
LONGSHOT_SDK. They go in with the build's other files, each by its bytes
(a changed file is copied again), and a file of sdk/tools/ the builder
put there that the tools no longer have is taken out. A tree without
mod-tools ships none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A release's longshot-builder builds from its carried tree, which the
finish now takes the game folder's sdk/tools/ from: SOURCES adds
mod-tools' bin/, lib/ and package.json (not its tests).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
tools.md says which folders each command reads and writes under the
game, the scratch folder, and the ERR_ACCESS_DENIED refusal and its
reasons (and that the programs a command starts are not confined).
game/README.md's stand-ins: the game folder carries the SDK's tools
alone, the processes and the bridge's socket are not confined.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host_sys::paths::options_file binds host/options_path.c's hos_options_file
(game_host.h includes options_path.h): mods.json sits beside the settings
file, which the loader needs to find it as game/mods.c did (the user folder
--user names, not only HOS_OPTIONS_FILE's).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
api::services::features::present lists the features of this build from
the oot probes and whether the audio mix knows the game's groups, so the
loader's resolve can be given them at game_init, before the services are
made (game/DESIGN.md, Still to port 9: Loader::scan). Services::feature
asks the same function.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The loader's start is two parts (game/DESIGN.md, Still to port 9). Loader::scan
needs no MainThread nor services: the folders, mods.json, packages, the
system mods put first, the resolve, and the Mods tab's first snapshot (its
page rows without settings or permissions until the services are made).
Loader::start, at the first acquire phase, lists each mod's grants and
manifest with the services, declares the native mods' settings and
prepares the chosen mods with code; it scans first when nothing did.

What game/mods.c did besides the list is the loader's now:
- the game folder's mods.json copied into the user folder once, when that
  has none and it is a list (carry_state), else this run keeps the game
  folder's;
- modcache/mods_json.txt naming the list's place for the builder, taken
  away when the list is the game folder's or not there (note_state_file),
  and written again after a write makes the list first;
- longshot_mods.txt read once when there is no mods.json, written into it
  and kept aside as longshot_mods.txt.imported.
None of the three runs with a list of the run's own (LoaderConfig::own_list:
HOS_OPTIONS_FILE or HOS_MODS_LIST) or in Safe start.

The tab's snapshot gains changed (0 while the order and the switches are
the start's, else a number for them: mods.c's state_key, a live row's
switch left out since it takes effect at once), list_bad and unsaved. The
log says "mods: none in <folder>" and "mods: N mods from <folder>" as
mods.c did (scripts/parity_gates.py's gate 5 reads them).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The loader's scan reads the build's exefs_patches.txt as game/mods.c's
exefs_status did: each patch file of a mod of the emulators' layout
(exefs/*.ips, *.pchtxt) hashed (FNV-1a, the build's third column) and
found built in, waiting for the next build, for another game version, or
not applicable with the build's reason; the files built in whose mod is
off or gone counted in the log. A row's lines say it as mods.c's mod_text
did (Row::exefs, exefs_note).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The tab's rows gain asks and warning (a manifest mod's sites.toml, its
code, waits for the player to accept the warning: docs unsafe.md) and
build (its sites accepted and not in the game's build as they are now, or
ExeFS patches of a mod that is on waiting for the next build), as
game/DESIGN.md's GameModRow has them. The code is hashed as sha256 of
sites.toml, kept as the mod's "accepted" in the trust file when the
player accepts (Edit::Accept, game_mod_edit's op 4), and found built when
the build's mod_sites.txt names the mod with that hash; until then the
mod is held back whole, and its switch is the start's (not live).

The permission prompt's answer is an edit too (Edit::Answer), made at the
next acquire phase: the menu's thread reaches the prompt through the tab's
handle, before the services are made as after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Nothing filled content::layers since game/mods.c's RomFS index went
(92416923): hos_mods_romfs answered the game's own file for every path, so
no mod's RomFS file was served. Loader::publish_layers builds the start's
table from each mod that loads with a romfs folder, a layer each in the
list's order (a mod lower in it wins a file two have), and publishes it
whole; a package that loads with RomFS files is unpacked into the cache
first, and its start uses that folder. Links are left out, as the disk's
reads leave them (a mod's files are its own folder's); the C's walk left
out folder links only. The log says "mods: <mod>: N RomFS files" as the
C did.

Disk::meta gives a file's size and last write, which the layers keep.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game.h's new section (game/DESIGN.md, Still to port 9): GameModsSnapshot,
GameModRow, GameModPage, GameModSetting, GameModPermission, GameModPrompt
(the mod API branch's MkwVkMod* of gpu/vk/modpage.h, field for field) and
game_mods_snapshot, game_mod_edit, game_mod_setting_set,
game_mod_permission_set, game_mod_prompt_answer. longshot-game::mods_page
turns the loader's newest TabSnapshot into that C block (built again only
for a newer snapshot; the newest two kept, so a pointer stays valid until
the next call as the contract says) and queues the menu's edits by id; a
setting's value is checked against its row before it is queued.

game_init makes the loader (runtime::loader_config: mods.json beside the
player's settings file, host_sys::paths::options_file, as game/mods.c had
it; the features from api::services::features::present), runs its scan,
publishes the start's RomFS layers and hands the tab to mods_page, all
before the guest's first instruction; the runtime takes the scanned loader
at the first acquire phase and starts its mods.

game/mods.c's (C) part of game.h is still there: the renderer moves to the
new functions next, and the C goes after it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
MkwVkHost's mod_info, mod_edit and mods_changed (game/mods.c's, by index)
are replaced by mods_snapshot, mod_edit_id, mod_setting_set,
mod_permission_set and mod_prompt_answer, filled by host/rx_backend.c with
game.h's game_mods_snapshot, game_mod_edit, game_mod_setting_set,
game_mod_permission_set and game_mod_prompt_answer (game/DESIGN.md, Still
to port 9). cheat_info and cheat_set stay.

gpu/vk/vk_menu.cpp's Mods tab reads its lines from the snapshot and sends
its edits by id: a picked-up mod is followed by its id once the game made
every edit sent, never moves above a system mod, and a required system
mod is not switched off; Enter on a mod whose code asks accepts its warning
(op 4); the help line says what waits for a build and which switches apply
at once. The restart question reads the snapshot's changed. The permission
prompt and a script mod's page are drawn when the branch's modpage drawing
joins, from the same snapshot.

Left out of version 50: ui_snapshot and ui_post (Still to port 3), whose
game.h functions do not exist yet; they come with that part.

Tests: test_mods_menu ported to a fake host of snapshots and edits by id
(the same checks, and the system mod, the moves by id and the acceptance);
test_hos_ab's table order and test_menu_text_field's cut of restart_values
follow the new fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Mods page's C is gone with hos_mods_init, hos_mod_info, hos_mod_edit
and hos_mods_changed (game.h's last (C) lines): the loader's scan in
game_init does what hos_mods_init did, and the renderer reads
game_mods_snapshot (MkwVkHost version 50). host/hos_main.c calls
game_init alone where it called both. One reader of mods.json is left in
the game, api::loader::list.

Tests, each with its reason:
- tests/test_mods_list.py is removed: it built game/mods.c and
  mods_list.c into a stand-in game and compared their reading of mods.json
  with the build's. The game's half is the loader's now, tested over
  MemDisk in game/crates/api/src/loader/tests.rs (where the list is, the
  carry into the user folder, the build's note, longshot_mods.txt's import,
  a list that is not one, what a write keeps, Safe start, the restart
  number); api::loader::list's own tests check the text. Its check that
  the game and the build take and refuse the same texts has no game program
  to drive any more: it needs one of the Rust reader to come back.
- tests/test_fs_links.py loses its RomFS-walk part: it cut index_romfs out
  of game/mods.c, which had not had it since 92416923 (the walk is
  Loader::publish_layers', which leaves out links, tested in the loader's
  tests). Its file system checks stay.
- tests/test_parity_gates.py reads gate 5's two log lines in the loader's
  source; tests/test_crash_dialog.py and test_low_memory_notice.py anchor
  on game_init() where they anchored on hos_mods_init(image).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
DESIGN.md: Still to port 9 says it is ported and where the port departs
from the design (MkwVkHost version 50 without §3's ui_snapshot and ui_post,
the prompt and a mod's page not drawn yet, no frame times, a native mod's
buttons, changed and live rows, a list of the run's own, the sites'
acceptance, the RomFS layers the scan publishes); the map moves game/mods.c's
Mods page and mods_list.c/h to api::loader and longshot-game::mods_page,
and says no game C is left; Fixed on the way 42: the tab's edits wrote
mods.json on the menu's thread. game/README.md: no C of the game's own,
game.h has no (C) line, the scan runs in game_init, and the Mods tab's
stand-ins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
docs/dev/reference/mods.md's code table and parity-gates.md's gate 5 rows
name api::loader (Loader::scan, publish_layers, list, tab) and content's
layers where they named game/mods.c and mods_list.c; game-files' README
and its mods example say the test that compared the two readers went
with the C.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_mods_snapshot moves the newest block into before in two statements
(not two borrows of the guard in one), its test checks a setting's number
within a margin (clippy's float_cmp), and runtime.rs brings AudioOut into
scope for groups_known.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The renderer hands the options file's lines over (game_options_load) when
it starts, which is after game_init now that the loader's scan runs there:
the system mods' switches from before they were mods (legacySwitch) were
not there to carry over. game_init reads the file's lines first
(options::preload, split as the renderer splits them); the renderer's own
hand-over gives the same lines again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
content::assets::bc7 is Richard Geldreich, Jr.'s bc7enc (the encoder host/bntx_write.c
compiled from third_party/bc7enc) in Rust: opaque blocks in mode 6 or mode 1 over the
estimated partition (the 64 patterns by use, with the filter bank), blocks with alpha in
mode 6, 5 or 7; principal-axis endpoints refined by least squares, the single-colour
tables, the perceptual YCbCr error, the uber levels. Params::for_texture is the C texture
writer's settings. Tests decode every block and compare the error with the mode-6
stand-in's on made images.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The mode-6 stand-in in host-sys was arithmetic, not a host call: the texture writer
encodes with content::assets::bc7 and host-sys keeps only the boundary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_host.h's hos_zs_content_size, hos_zs_romfs_content_size, hos_zs_write,
hos_romfs_case and hos_prompts_font_entry, which the size table's fit needs:
host_sys::files::{zs_content_size, zs_write}, host_sys::romfs::{zs_content_size, case}
and host_sys::prompts::font_entry, each with its stand-in host's answer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
content::restbl ports host/restbl.c and game/mods.c's fit_sizes (deleted with #2411):
the RESTBL read and written, entries raised, a mod's table merged over the game's,
the estimates and the growth in proportion; restbl::fit makes the game's table with
every mod's table for this version merged, another version's only for its own mod's
files, the prompts' font entry raised, and each served file's entry raised to its size
(in the game's case when the mod's differs). The host is a trait (HostSizes, through
host-sys), so the tests run on a made-up game.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The fit is written to modcache/rsizetable.zs and served whole at the game's table's
path, where the host's opens (hos_mods_romfs) and the prompts (hos_mods_file) already
ask the layers; a rebuild drops the live table's merged one first. Without a fit the
last mod's own table is served as before, the prompts' entries merged in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_host.h gains hos_mem_copy_out (host/game_guest.c): the guest range checked against
the window, then ReadProcessMemory on the own process on Windows, which neither faults
into commit_on_touch nor commits a page the game has not touched or gave back, and
fails for it; a plain copy where the window is mapped whole (Linux, the web). As the
mod API branch's hos_mem_copy_out. host_sys::mem::copy_out binds it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
GameMemory::copy_out read the guest window directly: on Windows a read of a heap page
the game had not touched, or had given back, faulted and committed it. It is refused,
as the C's memory.read refused it ("unmapped").

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Fixed on the way 42 and 43 (the fit sizes the file served; a rebuild fits again);
the stand-ins lose the mode-6 BC7 encoder and the unguarded memory read, and the size
table's says who calls the fit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Spelled out where the tables of different lengths meet in one expression, so the
types never rest on inference through a tuple.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_host.h gains the three functions game/DESIGN.md's "Still to port" names for the mods' image
thread (3) and batch --mod-tests (7): an environment switch set at the start, the game quit with an
exit code through the close's own path, and a thread run below the game's priority.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/broker_net.c, broker_net.h, broker_net_frame.h and ipc_endpoint.h come from the mod API
branch unchanged but for one line: bnet_ipc_allowed reads the build's system mods' endpoints
from game.h's game_system_ipc (longshot-game::net) instead of modapi/system_mods.h.

host/net_link.c holds the one link and gives the game side game_host.h's hos_net_*: opened at
the first grant or open, let go when the engine goes (no new link for 10 s), and closed with its
engine's threads waited for at hos_close_finish. broker_net.c includes broker_grants.h, which the
sandbox's port brings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host_sys::net binds game_host.h's hos_net_* (available, grant, open, send, close, poll ->
Poll::{Event, None, Gone}), its fake an in-memory engine a test scripts (fake::net); the stand-in
that answered every open "no engine" goes. host_sys::run binds hos_switch_set, hos_quit and
hos_thread_background. has("net") and has("ipc") ask the engine for their own kind.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
HeapCounter moves from script into api::call (script::heap re-exports it), so a service can hold
a HeapCharge of a mod's heap: bytes given back when it is dropped, from any thread. CallHost gains
charge (bytes counted against the calling mod's heap) and fault (a fault of the calling mod's,
without a throw); the engine's two hosts implement them.

ScriptHost gains, each with a default that does nothing, what the together step crosses runtimes
with: caller_left_ns, export_call (ExportCall, ExportOutcome), settle_now, charge_ns, and two the
design did not name: heap_charge (an answer queued is charged to its caller's heap, as together.c
did) and workers (the workers' messages, moved into the together step). ApiError gains mod_call
and net.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The host's half of longshot/mods (together.c in the C): load, call, listen, emit and the
registries' add, remove, list and watch, each refused in a worker; mod: imports checked against
the importer's manifest (import_ok) and linked against what the loader resolved (set_resolved);
raw_data, has_net and holds_by_name for spec 12.5 and an export's guard.

Values cross as JSON text. Calls, answers and loads are queued and run at the together step
(together_step, in Services::frame after the game's events): at most 8 rounds, each delivering
the emits in order, telling each changed registry's watchers, then running the queue through the
engine (export_call, settle_now). The caller pays: a call or an answer of a caller whose budget
is spent waits for its next frame, and what waits holds a HeapCharge of its sender's heap. An
export answering with a pending promise answers later through together_answer.

The writes, memory and actor-writes steps and the journal's frame move after the together step,
so what an export or an event's listener asks to write is made in the same frame. A stopped mod's
listens, entries and watches are journal Lives; together_gone drops what is queued of it and
answers its callers not-running.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Rust's ipc_pattern_ok was reconstructed without the C, and differed from the grammar the
manifest reader, the game's side and the network engine share (host/ipc_endpoint.h): it took one
range of single digits, no $HOME, and any printable character in a part, so a manifest the engine
would open could be refused, and one it refuses taken. It is the header's now, with the endpoint's
check and match (ipc_endpoint_check, ipc_endpoint_matches) beside it, and bnet_headers_ok and
bnet_method_ok ported as headers_ok and method_ok, for services::net.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The game's side of mods' WebSockets, HTTPS requests and local IPC (net.c in the C): the natives'
service halves (net_connect, net_fetch, net_send, net_close, net_limits, ipc_connect, ipc_send,
ipc_close, ipc_connected, ipc_limits, ipc_pid), each refused in a worker, with the C's checks: the
origin granted, the scheme, the headers and method (the engine's rules), the limits, and ipc held
with the endpoint declared. A mod's grant is sent before its first connection and again when its
grants change (net_regrant, from the permissions' changes).

At the together step net_step polls at most 512 of the engine's events, settles promises and
delivers the rest (net-message, net-close, ipc-open, ipc-data, ipc-closed); the engine gone ends
every connection, marks every grant unsent, and asks for no link for 10 s. net_gone closes a
stopped mod's connections and withdraws its grant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The engine's side of calls between mods (game/DESIGN.md "Still to port", 1 and 2):

- NativeSpec gains rejects: a member that answers with a promise (load, call, netConnect,
  netFetch) makes it through the mod's own call host (bind::native_call), and an error it returns
  is that promise rejected, never a throw. A native member's object or list argument is a
  structured value (a list's trailing undefineds left out); one refused reaches the service as
  Value::Text with why.
- script::NATIVES wires load, call, listen, emit, regAdd, regRemove, regList, regWatch, netConnect,
  netFetch, netSend, netClose, ipcConnect, ipcSend, ipcClose and ipcConnected to their services;
  netLimits, ipcLimits and ipcPid are the engine's own (a worker's source reads them).
- caller() is the mod whose call of an export runs now (ModState::caller), callerHas asks the
  services what it holds.
- mod:<id> resolves through Services::import_ok and loads as a module of the callee's exports,
  each a function over the call path (always a promise).
- QuickJsHost implements caller_left_ns, export_call (script::export: the export run under the
  caller's budget, its time and its faults the caller's through ModState::fault_to, its answer
  converted under at least 1 ms, a pending promise answered by reactions), settle_now,
  charge_ns, heap_charge and workers. A delivery's or a settle_now's bytes are a Uint8Array.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Before the loader's frame, the runtime gives the services the manifests a mod: import or a call
links against (every mod that loads, and the build's system mods); the workers' messages are no
longer delivered from runtime::frame: the services' together step does it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
DESIGN.md says parts 1 and 2 of "Still to port" are ported and names each departure with its
reason, maps together.c, net.c and the network engine's files to their places, and adds two
fixes to "Fixed on the way". game/README.md names the new host functions and the engine's one
stand-in (broker_grants.h comes with the sandbox's port), and drops the network from host-sys's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
lewton 0.10.2 (with ogg 0.8 and tinyvec): pure, safe Rust that decodes
Ogg Vorbis a packet at a time, which streamed voices need, with no C to
vendor in place of the C's stb_vorbis (game/DESIGN.md, Still to port 6).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/audio_dsp.h ported for the mods' bus (api::services::audio_mix::dsp):
the transposed direct form II biquad, the cookbook's low pass, and the
I3DL2-style feedback delay network reverb, with their impulse tests. The
mixer takes them in place of its Schroeder stand-in in a later commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A fade of 0 takes one audio frame instead of jumping, and a duck's
release brings the music back only when it was the lowest standing, to
the next lowest. Taken by the mixer in a later commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
api::services::audio_mix::decode: a sound's Pcm is 16-bit samples, 1 or
2 channels, at its file's rate, as audio_mix.c kept them, so a mod's 32
MB is what the guide says (the stand-in kept stereo floats resampled to
48 kHz: up to 8 times the memory for a mono 22 kHz file, and a second
resampling). The WAV reader is the C's: its checks and messages, a
refusal before a result past the mod's bytes is made, and 5.1 mixed down
without its LFE.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
audio_mix as audio_mix.c: a sound loaded { stream: true } keeps its Ogg
file's bytes, each voice of it gets a decoder of its own (the new
AudioStreams and StreamDecoder traits) and a ring of 1.5 s, which the
decoding thread opens and tops up 4096 frames at a time with no lock
held, rewinding a looping one; the mixer reads the ring by the frame's
number, silent and counted on an underrun. Limits: a streamed file 32
MB, 8 streamed voices a mod, 64 in all.

The mixer's stand-ins go: each voice is resampled once from its sound's
rate by its pitch, its gains ramped across the audio frame (a change, a
placed voice's gain, a stop's fade), through its biquad low pass and
into its mod's audio_dsp.h reverb, which rings out its tail with the
mixer's gate open. Nothing is allocated or freed on the mixer thread.
The game's groups move as audio_groups.c's.

On the way: a file that cannot be read makes a failed sound, as the
guide says, instead of an ArgumentError; voice.moveTo places a voice of
play() from then on; setEffects past the mods' 8 reverbs is a
LimitError; a call of more than 1024 frames is mixed whole (the C cut
it short). longshot-game gives no decoder yet (the next commit).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hosts::Ogg decodes a file whole (AudioDecode) and opens streamed ones
(AudioStreams): 16-bit samples at the file's own rate, a file of more
than 2 channels mixed down in Vorbis's order, the length from the last
page's granule. A stream reads a packet at a time and rewinds by
opening its bytes again. Ogg sounds play again; the tests decode two
sine-wave fixtures made for them with ffmpeg's lavfi (nothing of the
game's).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
DESIGN.md: Still to port 6 says what was built and what changed from its
draft (decoders give 16-bit samples at the file's rate, the mixer
resamples once; a stream rewinds by opening again), lewton joins the
libraries, the map gains audio_dsp.h and stb_vorbis, and the C's cut of
a long audio frame is a fix on the way. README.md: the Ogg stand-in goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/broker_frame.h (the broker's frames and its policies' plain checks), host/json_keys.h (the top-level keys of a JSON
document, which broker_frame.h reads) and host/dbus_proxy.h (what the broker lets through to the session bus), as the
mod API branch has them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The broker (the game's executable started again as `longshot --broker`) holds a mod's network grant to its own
mod.json and keeps a confined game's change of the trust file only when it narrows it. The C manifest, package and
trust-file readers it used are gone with the C mod runtime, so it asks the Rust's, through four functions of
game/game.h that need nothing of game_init:

- game_mod_id_valid: the loader's id rule;
- game_manifest_net: a manifest's required network permissions and a system mod's ipc patterns, when it is that id's;
- game_package_manifest: a .lsmod's or .zip's mod.json, through content::archive;
- game_trust_record: api::loader::trust::record, a request kept only when it narrows the file, written in place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/broker.c: the process the game starts before it confines itself (`longshot --broker`), which keeps what the
confined game may not have: crash reports and performance summaries sent with the system's curl, links and folders opened,
a systemd scope, a file saved in Downloads, the session bus through host/broker_dbus.c's filter, the trust file's
narrowing, and mods' network on a channel of its own. host/broker.h is the branch's.

Fitted to this tree: the trust file's change is checked and written by the game side's reader (game_trust_record, the
request's payload made by host/broker_trust.h), and host/broker_grants.c reads manifests and packages through
game_manifest_net and game_package_manifest. Mods' network is served only once host/broker_net.h is in the tree (it
comes with the network engine); until then the net channel answers BROKER_E_NONE.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/sandbox_linux.c and host/sandbox_plan.h from the mod API branch: Landlock for files and a seccomp filter that leaves
no network socket, applied in main() before any thread, the broker started first. A run confines itself whatever mods are
on (HOS_SANDBOX unset or 1); 0 turns it off, strict refuses to start unconfined. The branch's look for a script mod that is
on is gone, and with it its C readers of mods.json, packages and manifests.

Fitted to this tree's host:
- the user folder is the one main() chose before the sandbox (saves_dir's move runs there, outside it);
- the player's .nup the RomFS is read from in place is read alone, its path taken from the index's header
  (hos_romfs_index_nup_of, new);
- mods.json, mods-trust.json and the items journal where the game side keeps them (the game folder's mods.json unless
  HOS_MODS_LIST or HOS_OPTIONS_FILE say otherwise; the journal in the user folder), each made before its rule;
- the user folder's recordings/ (input recordings) written, modcache/ always made;
- language.txt made first (hos_language_txt_ensure, from the branch's host/nn_applet.c).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/sandbox_windows.c, host/sandbox_win_plan.h and host/broker_windows.c from the mod API branch: the game starts itself
again inside an AppContainer with no capability (no network), granted the game folder read, its own folders, the user
folder's and the drivers' caches written, and the outer process stays outside as its broker over a named pipe. Every run
relaunches so by default (HOS_SANDBOX=0 off, strict refusing to start unconfined); a step that fails leaves the run
unconfined, with its log lines.

Fitted to this tree: no look for a script mod (and none of the C mod readers it took); mods.json, mods-trust.json and the
items journal where the game side keeps them; the player's .nup granted read; the user folder's recordings\ written; the
trust file's narrowing through game_trust_record; mods' network served once host/broker_net.h is in the tree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/hos_main.c starts the process sandbox: Linux's main() runs the broker's own work first (`--broker`), then chooses
the user folder (user_dir_early: saves_dir's move of an older build's user/ runs before the sandbox, which lets the game
write only the folders inside the new place) and confines the process before SDL, the sound or Vulkan start a thread;
Windows' main relaunches the game in the AppContainer after the settings file is chosen. Not for --prepare-shaders.
game_main logs what the sandbox did and calls game_set_confined with whether files and the network are both confined, so
a player's script mods start in a confined game, as the game side requires.

HOS_SANDBOX (0, off, false or no turn it off; strict refuses to start unconfined) has its row in gpu/vk/switches.def, with
the broker's own LONGSHOT_BROKER_FD, LONGSHOT_BROKER_PIPE and LONGSHOT_SANDBOX_NOTE and HOS_MODS_LIST, which the sandbox
reads; longshot_env.txt sets none of the first four. The game side takes HOS_SANDBOX's off words as the host does.

From the mod API branch: a restart hands the broker's channel to the new run (hos_relaunch.c), and the crash window's
helper sends its report, opens links and asks for its scope through the broker, which it is handed a channel to.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The trust file (mods-trust.json) is read-only to a confined game, and every run is confined now: a player's unsafe grant
taken back was written nowhere and came back at the next start. When its write in place fails, the loader asks the
sandbox's broker (host_sys::files::trust_set, over game_host.h's new hos_trust_set and host/broker.h's
hos_broker_trust_set), which keeps the change when it narrows the file and refuses the rest; a yes to the unsafe tier
still lasts the run alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A confined game has no network and may not write Downloads or start the desktop's browser. MkwVkHost (version 50) gives
the renderer the broker's broker_perf_send, broker_save_download and broker_open (host/broker.h), each -1 when no broker
serves the game: the performance summary is posted by the broker, and Save my pipeline list saves its zip in Downloads
and opens the folder and the issue through it, as on the mod API branch. Without a broker the renderer does each itself,
as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The renderer keeps the SPIR-V every game folder shares in a shader store outside the game folder (gpu/vk/spirv_pack.h:
LONGSHOT_SHADER_STORE, else $XDG_CACHE_HOME/longshot/shaders or %LOCALAPPDATA%\\Longshot\\shaders), which the mod API
branch's sandbox did not know: confined, it could not open its lock and every start ran without it. It is made first and
written (a folder LONGSHOT_SHADER_STORE names only when it is narrow, on Linux). On Windows DLSS's runtime
(%LOCALAPPDATA%\\Longshot\\ngx, RX_VK_DLSS_DIR) is granted read, as Linux's rules read it already.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
docs/dev/reference/sandbox.md from the mod API branch, fitted to this tree: every run confined by default, what
game_set_confined tells the loader, the .nup and the shader store, mods.json and the items journal where the game side
keeps them, the user folder chosen before the sandbox, the trust file and the broker's narrowing of it (a section of its
own), the game side's readers the broker uses, and the network engine still to come. Linked from the developer docs.

The modding guides (unsafe.md, scripting.md, lifecycle.md, dev.md) no longer say the game runs unconfined with no script
mod on: a player's script mod waits only in a game the system could not confine, and the loader's row and log line say
so. An unsafe grant given lasts the run; one taken back is kept by the broker.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Without host/broker_net.h in the tree, host/broker_windows.c's pipe_pair, give and the net thread, and the counters both
brokers keep for the net channel, were left unused, which a -Wall -Wextra -Werror build of the Windows files (the
sandbox's test with LONGSHOT_MINGW) refuses. They are built with the engine alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
tests/test_sandbox_linux.py, test_sandbox_windows.py, test_sandbox_save_folders.py and test_broker_frame.py from the mod
API branch, fitted to this tree:
- every run confined but with HOS_SANDBOX's off words (0, off, false, no), on Linux and in the Windows relaunch decision;
- the files where the game side keeps them (mods.json the game folder's, the items journal the user folder's, the trust
  file beside the list, the game folder's own for a list in its user/), the user folder main() chose, the player's .nup
  read alone, the shader store, DLSS's runtime on Windows and the input recordings' folder;
- host/hos_main.c telling the game side (game_set_confined with both confined), and the game side's HOS_SANDBOX=0 taking
  the host's off words and no other;
- the broker's trust-file gate (the game's channel, the file named at the start, the run's limit) over a stand-in of
  game_trust_record, whose narrowing api::loader::trust's test checks; its net channel tested when host/broker_net.c is
  in the tree, else answered BROKER_E_NONE; MkwVkHost's version 50.
None of them was run here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
tests/test_dbus_proxy.py as the branch has it: host/dbus_proxy.h's strict reading of the D-Bus format, its list of calls
and its authentication, and host/broker_dbus.c between a stand-in bus and a client. docs/dev/reference/sandbox.md names
it. Not run here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
broker_grants.c is the sandbox's, reading manifests through game.h; the net channel waits for the engine's files
(BROKER_HAS_NET); host-sys and longshot-game own the trust file's broker call and the broker's readers. Fixed on the way:
no host called game_set_confined, and a confined game's grant taken back was lost.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A serial site reached between two phases is told through the host's InPlace
(Hosts::in_place) and Services::visit_now: a filter's sealed draft read back
at each argument's type and written into the registers, its answer the
site's. A row naming one of the game's sites adds a handler to that site's
chain at its first listener and removes it at its last (the Retired guard
kept until the grace period); an outcome site or one this Longshot lacks is
listed with the chain's note and never hooked. Clashes are said once and
noted on each mod's Mods tab row. ScriptHost gains hook_filter and fault_mod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The switches HOS_MOD_TESTS_ONLY, _OUT, _PLAYER_LIST and _TIMEOUT get their
rows, from the mod API branch's, with the Rust files' paths. Skip title is on
for a test run; a live mod_test is refused in the test mode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/mod_watch.c and mod_watch.h of the mod API branch, unchanged but
the header's comment, which names the game side's api::watch as what
reacts. inotify on Linux, ReadDirectoryChangesW on Windows, a sleep a
wake ends elsewhere; game-free. game_host.h re-exports the header
(game/DESIGN.md, Still to port 4).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
mod_watch.h's open, wait, wake, stats and close as ModWatch (closed when
dropped; wait and stats one thread's at a time under a lock, wake any
thread's), and the walk's mod_watch_hash and mod_watch_file_sig. The
stand-in host has no notices: open gives None and the walks 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/modapi/watch.c in Rust: the folder table (256 folders) under a lock,
each notice placed by its path (a script folder's reload, a served
folder's layers, the mods folder looked at again, mods.json read again,
an overflow a look at everything), a change due once its folder is quiet
0.3 s and its files' hash moved (where walked, once two walks agree), and
the thread lsmod-watch over host_sys::watch. Watch::frame hands the main
thread what is due unless a co-op room holds the mods; Watch::request,
all and hold are any thread's. Unit tests: the debounce, which changes
count, the walked mode, the requests and their limit, a hold.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The loader owns hot reload's watch (Loader::watch), started at the end
of its start unless HOS_MODS_WATCH=0, the game's test mode or a safe
start; a folder script mod's folder is watched from its start (even when
its entry fails) until it is turned off. At the frame's end, before the
switches' stops: Shift+F8 (an edge), then what is due. Loader::reload:
dev.reloading (order 17, to the mod alone), its dev.keep values taken as
JSON as it holds them (ScriptHost::take_kept; one that cannot be keeps
its last copy, logged), what the listener asked to write dropped, its
stop without lifecycle.stopping, and a start from its files at the next
frame with the grants of now. A mod that faults in its listener stays
stopped until its next change; one that does not run starts again.

The engine hands back the same object for a key dev.keep holds
(CallHost::kept_as) and reads it back at the reload under the callback
budget. HOS_MODS_WATCH gets its row in switches.def.

Fixed on the way: QuickJsHost::stop destroyed a mod without telling the
next reap, so a script mod turned off in the Mods tab never had what it
made undone (Services::mod_stopped). The reap now tells it, as the
trait says and the loader's tests assumed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
{"cmd":"mod_reload","mod":id} answers {} once Watch::request queued the
reload (made at the next frame's end), or refused: no such mod, no
folder script mod (a package, a system mod), or 32 waiting. The watch is
taken from the loader at the bridge's first frame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Settlements queue Settled::{Whole, Part}: Settlements::part (and
Promise::part) take an answer in parts from any thread, pending_bytes
counts the parts not yet handed to the mods, and set_hooks tells a
reader of a promise let go (its mod stopped) and of a settle that took
answers. The engine parses each part in the mod's runtime and defines
its members on the promise's array (one settlement of the frame's 64
each); the last resolves it, a rejection drops the parts, and a part
that does not fit in the mod's heap rejects it with LimitError.

content.read's reader thread sends what ContentReader::read_parts makes
through a PartSink that waits while more than 8 MiB wait to be handed
and stops a read whose promise was let go. longshot-game's reader sends
a map's placements in parts of about 64 KiB (the C did; the whole answer
was past what a value holds for a large map). Unit tests: the queue's
bytes and hooks, the parts in order, a rejection after parts, and
dev.keep's held object read back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
DESIGN.md: section 4's Built note (the public calls, Watch::request's
signature for the inspector, where the reloads run and the order that
changed, the engine's new methods, what is not built, the host's part,
the parts' calls and where the waiting is), host-sys's and api's rows,
the C files' map, and fixed on the way 42. README.md: the stand-in line
for what the watch finds besides a folder script mod's files, in place
of mod_reload's refusal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Watch::start takes Option<&Path>; Some(&list) was an Option<&PathBuf>.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The schema's TOML comments, its permissions' host lines and a few doc texts named host/modapi/*.c, host/game/*.h,
host/mod_manifest.c, generate.py and the C bindings' lsapi_* names. Each now names the Rust module that does it
(api::services::*, api::loader, api::manifest, oot::*, game_sites::modsite, content::*, longshot-game::*), or says
it is still to port. Doc text only: no id, name, type or permission changed. reference.md, permissions.md and
longshot.d.ts are not regenerated here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The contributors' page on the schema named the C that is gone: host/modapi/*.c and its generated headers, the
lsapi_* bindings, generate.py, the C runtime's step names and its tests. It now names the crates (schema and
schema-gen, api with its services and its build-time bindings, script with QuickJS-ng and oxc, oot, game-sites,
content, longshot-game) and the system mods under game/mods; lists what schema-gen writes and what api's build.rs
makes; says how the Rust bindings, handles, filters, interfaces and the value model map onto the schema; gives the
acquire phase's order as Loader::frame and Services::frame run it; and rewrites "Adding to the API" for a service
in api::services. The UI's host side and the inspector are said to be still to port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
api::services::writes keeps the deny list and the ranges as tables of its own (DENY, RANGES); the generated FLAG_*
tables are not read by it. Say so in game.flags.toml and api-schema.md, and that the two change together.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The authors' guides and their "For contributors" sections named host/modapi/*.c, host/game/*.h, host/mods.c,
host/mod_manifest.c, host/mod_archive.c and the C runtime's functions. A guide for authors now names no source file
where one did not help (lifecycle, packages, rules, manifest, settings); a contributors' section names the Rust module
(api::services::*, api::loader, api::system, api::claims, script::worker, script::natives, game_sites::modsite,
oot::flags, content::archive, longshot-game::*). ui-channel.md says the UI's game side is still to port (its Rust
names are game/DESIGN.md's design), textures.md that the texture packs' and recipes' code is not in the Rust yet,
and system-mods.md that the inspector's service is still to port. Paths of game/modapi's JavaScript gain their game/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hooks.md said a change to host/game/'s C compiles only the host again and that game_call is host/game/game.h's: the
game side is Rust under game/crates/, and game_call is host/game_call.h's, reached through host-sys. The
architecture's texture flowchart named oot_damaged_files.c, now oot::fixes::damaged_files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
NaN-safe comparisons spelled out, iterators for index loops, the TAU
constant, const assertions for the layouts, a type alias for a test's call
log and doc lists that no longer start a line with '+'.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A Safety section on each table site's function, a '?' for the runtime's
start and a doc list item that no longer reads as a link definition.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A type alias for the published tables' list, and the chain's next() kept
by name (every mod calls it) with an allow and its reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
One allow(unsafe_code) on the qjs module (lib.rs's) instead of two, and a
type alias for a module record's parts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
as_chunks for the build id's digit pairs, a type alias for a test's cheats
folder and a doc list item that no longer reads as a link definition.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
as_chunks for the MurmurHash3 words and the tree's commands, iterators for
index loops, struct update syntax in two tests and a type alias for the
message files written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Error types for a refused settings file (storage::Refused) and a setting
that is not a keybind (settings::NotKeybind) in place of (); type aliases
for the setting switches, a keybind, the reader's requests; a write's
refusal boxed and a UI undo's mount boxed; iterators for index loops; a
const assertion; and the mix-down's 0.7071 kept as a named constant (the
C's value, not quite 1/sqrt(2)) with an allow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The guide and the C both refuse exports, net and ipc without "runtime" (and a
runtime needs "api" and "entry"), so the together and net tests' manifests
were the wrong side. "con~x.json" is no Windows device name (the stem ends at
the first '.'), as the C's device_name says; the test now checks "con.x/y".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/restbl.c restbl_grow gives a .bgyml or .byml file at least 8 bytes an
added byte plus 4 KiB (a ControllerSetParam grown in proportion failed to
load); the port had dropped it. The test's bfres case wanted an allowance
the C never gave a bfres (1120, not 2112); it now checks both kinds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
word_in took "liftable" in "QueryUnliftableState": after a lower-case letter
only a word starting with a capital begins (the C had the same slip).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
bc7enc's mode 6 (the C's encoder) writes alpha 254 for that cut-out's solid
pixels; the clear ones must stay 0. serde_json writes 1e300 as 1e+300 (as
JSON.stringify does). The C's put_str, which read.rs ports, escapes a byte
that is not UTF-8 as \ufffd; the docs said a bare U+FFFD.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The bridge queue's "none taken" is taking 0, so asking after ticket 0 (never
issued) said Waiting once an ask was done; it is Gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
ACTOR_SIZE is the actor's bytes checked before its fields are touched; the
serial at 0x458 is past it and read on its own, checked (the C's game_peek_at),
so the test now checks the fields the spawner does touch. The skips test's
player hold (+0xf25 from BASE + 0x3100) lay past its 0x4000 map.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
QuickJS-ng 0.18 loads and resolves a module's imports while it compiles it,
so realmModule's compile asked for every import before link() had given a
linker, and any module with an import failed ("this context links only in
link()"). realmModule now checks the syntax with oxc (Node's constructor
throws a SyntaxError at once) and keeps the source; link() compiles it with
the linker set, and a module it imports is compiled as it is loaded. The
unused Context::resolve_module goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The export test's manifests export without a runtime, which the guide and the
C refuse. A raw context has no eval until JS_AddIntrinsicEval. The runner's
entry is run([[file, ns], ...]) as the C's entry_of writes it. The fence test's
path.join took its ".." out, so the refusal was "outside", not "dotdot".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The cheat rows are Store::Run, as the module says (the menu never saved
them). The opcode C0 test's store, 0410_0000, offsets by r0, which the test
had set to 7, so it wrote heap + 0x87; it now offsets by r2 (0), as dmnt's
0TMR00AA reads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The mod declares two rows, Skip title screen and Skip opening (52); the test
counted one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
As hos_wide_ui_tick's ui_on, the plan runs whenever fill_x is not 1, which a
wider picture always makes; the HUD stays in the middle (ex and ey 0).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The rows the system mods took over lost the menu's value texts: Field of view showed "100" for "100% (original)", and
Walk speed and the HUD placement rows lost their "%". A SettingDecl has a Format now (its unit, and the default's own
text), which the menu's row text and the settings' spec (unit) use; the 13 "100% (original)" translations are back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Since the game's rows became the system mods' settings, kept by the game side outside opts, the report's "Changes from
the defaults" skipped them all. GameSettingRow carries its default now (MKWVK_API_VERSION 53), and the report takes each
game row's value now and default from the game side (menu_game_row_values), so Field of view at 110 reads
"Field of view: 110% (default: 100% (original))". tests/test_bug_report_defaults.py checks it is listed, from the game
side's value rather than the menu's copy, and that one at its default is not.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The game's table of its script system mods (game/mods/<name> with no crate: Discord status, the mod inspector) is
hashed from their shipped files, and the game trusts a system_mods/<name>/ folder only when it hashes to that entry;
but no step of the build put them there, so a run logged "the built-in mod system/discord is not installed". The
finish copies each one's shipped files (the schema crate's system_mods::folders and shipped_files, the same rule as
the table's), and takes out one the build no longer ships. A test installs one and checks its hash against the
source's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A Windows game cross-built on Linux stopped at the game's Rust: the build scripts' cc looked for
x86_64-w64-mingw32-clang on the PATH, and cargo for a linker of that name. rust::cc_env gives cargo's run the
toolchain's own clang and clang++ with its target flags, llvm-ar, and llvm-mingw's driver as the target's linker (else
its clang told the target). With it the whole Windows game folder links here (longshot.exe, longshot_vk.dll, the
AppContainer sandbox and the broker's Windows C among them).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The sandbox lets the game write only its own folders and the control socket's (host/sandbox_plan.h control_dir, which
says shots go there), but the client asked for shots in the run's shots/ folder or wherever the caller named: with the
sandbox on, as by default, every shot failed ("the PNG could not be written"). The client library asks the game to
write a shot into the socket's folder under a name of its own, then moves it to the asked path itself, reading it
through no link (the game can write that folder) and at most 256 MB. Game-free tests: the fake game refuses a path
outside its socket's folder, as the sandbox does, and a session's shot still lands; a link left in the stage is not
followed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A confined game hung in "loading" after its save's file list: gmd::SaveDataMgr called nn::fs::Commit again and again
(every sample of it in save_copy's flush or save_journal's directory syncs), each one refused. save_journal syncs the
user folder and the folder it is in, and the sandbox (host/sandbox_plan.h) lets the game only list the user folder and
not open its parent at all: the open failed with EACCES, the commit with it, and the game asked again without end.

Those two folders' entries are made at the start, before the game is confined: host/sandbox_linux.c now syncs them
there, and save_sync_outer counts a folder the game may not open (ERROR_ACCESS_DENIED) as one this run did not change.
The save's own folders are synced as before. tests/test_fs_save_commit.py's new case refuses the parent's open as
Landlock does (its mode 0311) and commits: it fails on the old source and passes here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A check run's Discord status system mod connected to the PC's Discord and set a live status from a headless test.
Every run a tool starts, longshot_bridge.start_session (launch, ab, the parity gates, the routes) and tours/drive.py's
start_game (the pipeline tours), now has HOS_DISCORD=0, the mod's offSwitch, unless the caller's env sets it. A
player's game is unchanged. tests/test_longshot_ctl.py checks the fake game is started with it, that a caller's own
value stands, and that drive's start drops a shell's value for the run's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The launcher's save picker sets HOS_START_SLOT=<0-99> for one run. The Skip title mod then presses through the title as
it does for the newest save, and on the file list moves the cursor from the newest save to slot_NN (d-pad down or up,
one slot a press, the list taken to show the profile's saved slots in their numbers' order) before its A. It is
followed with the Skip title row off too, and the row is never changed. A slot with no save (no progress.sav, or an
empty one), or a value that is no slot, leaves the title screen's file list for the player with a log line; with no
save at all the title screen stays, so nothing starts a new game or loads another slot silently. A build without the
button-wait sites, or a game that tells no wait in 45 s, gets no blind presses with a slot chosen.

Unset, nothing changes. In gpu/vk/switches.def (test_switch_table), docs/dev/reference/switches.md and the user docs.
Game-free tests in the mod: the slot's resolution against save folders (moves, a missing or empty slot, no slot, no
save), and the machine's presses (the row off, moves down and up, the list left, never blind). The list's order is an
assumption until a game run on a profile of several saved slots checks it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
#2286 keeps a run's saves in a launcher profile's folder (host/save_dir.h, HOS_SAVE_DIR or LONGSHOT_PROFILE's saves/,
an unusable one refusing the start). This is the game side's and the sandbox's part of it.

- The sandbox gives the folder's save/ and save-work/ the user folder's rights, the folder itself listed (Linux's
  sandbox_plan.h, made and synced before the rules; Windows' sandbox_win_plan.h). Both mains choose the folder before
  the sandbox starts (hos_save_dir_choose), so the rule names the folder game_main uses.
- The game side: host-sys's Dir::Saves (game_host.h hos_saves_root); the Skip title mod's newest-save lookup, and with
  it HOS_START_SLOT's slot check, read it.
- sandbox.md says so.

Game-free tests: test_sandbox_linux and test_sandbox_windows (the rules, another profile's not granted),
test_sandbox_save_folders (the folders nn_fs writes there are the ones granted), oot's newest-save lookup.

A --user named on the command line is seen before that early choice (user_named_early sets hos_user_named, as game_main's own parse does later), so a developer's --user still wins over a profile's saves/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The mods' per-save data (modstore/save/<uid>/slot_NN) stayed in the user folder, so two profiles sharing it shared a
mod's data for their slot 0. With a save folder of the run's own (HOS_SAVE_DIR, or a profile's saves/: host/save_dir.h,
#2286's) it goes to <saves>/modstore/save/<uid>/slot_NN (api's storage save_root, longshot-game's runtime
save_storage_root); the global and profile stores stay in the user folder. save_dir.h makes the folder's modstore/
with save/ and save-work/, before the process sandbox, and both sandboxes grant it as they do those. Unset, as before.

Tests: api's storage (the per-save stores under the profile's folder, never shared, unset as before), longshot-game's
runtime, test_sandbox_linux, test_sandbox_windows and test_sandbox_save_folders (modstore/ granted),
test_fs_save_commit (made).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
#2286 moved a Windows game's saves to %APPDATA%\Longshot (hos_main.c
saves_dir) when no --user names a folder. The Windows sandbox still granted
the game folder's user\, so a confined game could not write its saves.

- main chooses the user folder before the sandbox, as Linux's does
  (user_dir_early, now on both): an older build's user\ is moved before the
  grants.
- sandbox_windows.c's found_of grants that folder, and the broker tells the
  confined game which one it granted (LONGSHOT_SANDBOX_USER, set by the outer
  process alone: refused from longshot_env.txt, a switches.def row), so the
  game does not choose again from inside the container.
- HOS_SAVE_DIR's paths are as long as the host's (SAVE_DIR_MAX is
  HOS_PATH_CAP, hos_paths.h), and user_dir_early's buffers too.

An unset HOS_SAVE_DIR keeps the saves in that user folder (hos_saves_root).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
- host-sys: romfs::read_zs_named over game_host.h's hos_zs_read_romfs_named
  (#2286): the heart containers' map files are read with bcett.byml.zsdic
  named, for a frame that names no dictionary.
- oot::sysmods::fov's tests take #2411's new parity cases: a null first
  camera refuses, no EventMgr (or its slot holding null) is no event.
- tests/test_game_boundary.py plants its game-side crossings in the script
  crate's shim: game/oot_menu.c is gone.
- build-compile's host_sources test: the checkout compiles no C of game/ (the
  game side is Rust); game/menu/ no longer is a source folder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
gate_now (Link's update's gate for the spawns and despawns) was only tested
through the pure gate(); this runs it over the stand-in's memory: the play
clock ticking, and EventMgr's event word behind the named location's holder,
with an unrelated word of the holder at the same offset. It fails today: the
gate reads the holder's word.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
state.eventMgr is the manager's holder: the spawner's gate read the word at
+104 of the holder itself, an unrelated field. Non-zero, every spawn and
despawn was held until its 20 s timeout; zero, they ran during cutscenes, which
the gate is there to stop. It now asks state::event(), which follows the holder
as the state line and the C (oot_sprint.c) did; the spawner's own copy of the
offset goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The C's wide.movie (game/oot_wide_sites.c) had two branches: wider than 16:9 it
narrowed the viewport's x to the middle 16:9, narrower (below 16:9 x 0.99) it
moved y in, bars above and below. The port kept the first only, so on a Steam
Deck (16:10) or a 4:3 screen movies fill the height, stretched. This checks
both over the stand-in's memory, at 16:9, 21:9, 4:3 and 16:10; it fails now.
The site hands movie the picture's ratio for it (unused yet).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The port of wide.movie kept only the C's branch for a picture wider than 16:9
(x narrowed to the middle 16:9) and returned otherwise, so on a Steam Deck
(16:10) or a 4:3 display a movie filled the height, stretched. Below 16:9 by
more than 1% its viewport's y is now moved in by (1 - ratio / 16:9) / 2 of its
height each side, as hos_site_wide_movie did (MOVIE_MIN_Y and MOVIE_MAX_Y, the
viewport's +12 and +20).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A player's fallback build of the game's Rust reads the tree the builder copies
(build-driver's TREE), which has no assets/modding/docs; api's build.rs loads
the schema, and the load refuses a module whose guide page is missing, so the
fallback build stops ("guide assets/modding/docs/ui.md is missing"). This
loads a small schema with a shipped JavaScript module and no docs folder; it
fails now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The schema's load (which api's build.rs runs) refused a shipped JavaScript
module whose guide page was missing from assets/modding/docs. A player's
fallback build (a key that does not match the prebuilt liblongshot_rs.a) reads
the tree the builder copies, which has no docs, so it stopped there. The guide
pages change nothing a build makes: their check moves to Schema::check_guides,
which schema-gen runs (and --check), and the repository's schema test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Two things the cheats' port lost:

- Knobs::apply put the flight away when its row was off but never turned it on:
  the row is the flight itself (the double-tap shortcut flips it, host/nn_hid.c),
  as menu_player_flight answered it to the C. The knob now follows the row while
  the tools are on.
- Damage taken read the Debug tools row of the Cheats mod's settings, so it
  ignored HOS_OOT_CHEATS and stayed on with the Cheats mod switched off and the
  row left at 1 (review S19). The Cheats mod now publishes the tools' state as
  it applies its knobs (oot::debug::tools_on: off when it stops), and Damage
  taken gates on that.

oot::debug also gives Movement speed's percent as Link's update takes it
(speed_percent), for the input movie's recording.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The old recorder wrote the renderer's answers for HOS_OPT_* 32, 33, 35, 36 and
55: 36 Link's speed in percent (100 to 300), 32 and 33 -1 while untouched or the
tools off. The port hands them to menu::set as row values, so every recording's
first line ({"cmd":"option","id":36,"v":100}) becomes choice 100, clamped to
3x, and -1 turns heart protection and flight on; a replay also wrote the
player's settings and needed the replaying run's Debug tools. This checks the
five at the first frame and changes after, with the tools off, and that a
recording takes the same values back; it fails now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_movie_setting handed an old movie's HOS_OPT_* values to menu::set as the
rows' values. They are the old renderer's answers: 36 is Link's speed in
percent (every recording's 100 became the 3x choice), 32 and 33 are -1 while
untouched or the tools off (-1 turned heart protection and flight on); and a
replay wrote the player's settings (Damage taken is kept in the options file)
and needed the replaying run's Debug tools.

The five Debug rows a movie holds (32, 33, 35, 36, 55) are now knobs of
oot::debug::movie: a replay sets them for the rest of the run, over the rows,
without the player's settings or the tools (-1 for heart protection: the run's
own), as the old replay answered rx_option; a recording takes them as the old
renderer answered them, so old and new recordings hold the same values.
Damage taken reads the movie's choice first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Nothing in this build's renderer draws or answers the permission prompt, runs a
mod's shader passes or draws the world layer. A player's script mod lacking a
grant waited for a prompt no one sees, permissions.request's promise never
settled, and gfx.effect and gfx.world were said to be there. These check that,
with no renderer drawing them, gfx.effect, gfx.world and permissions.request
are absent, and a mod lacking a grant waits with no prompt queued, its row
saying it cannot be asked and the mods.json line that grants it. They fail now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Nothing in this build's renderer draws or answers the permission prompt
(GameModsSnapshot.prompt, game_mod_prompt_answer), runs a mod's shader passes
(GAME_PASS_SHADER, game_post_report) or draws the world layer
(game_world_draws). With the sandbox on by default, a player's script mod that
lacked a grant waited for a prompt no one saw, permissions.request's promise
never settled, and has() said gfx.effect and gfx.world were there.

The host now says what the renderer draws (Hosts::drawn, api::services::host::
Drawn; longshot-game's: nothing yet). What it does not draw is absent:
permissions.request, gfx.effect and gfx.world are false in has() and a
manifest's requires, and their calls throw NotAvailableError. With no prompt
drawn nothing is asked: a mod that lacks a grant waits, its row saying this
Longshot cannot ask and the mods.json line that grants it, and a switch-on is
not held for an answer. The prompt's machinery is unchanged for the per-mod
page that will draw it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
GuestCtx held a &mut Ctx for the hook's length, while host/hos_thread.c sets
the same context's poll from another thread (an interrupt request): a &mut
claims every byte alone, so that store was undefined behaviour in Rust's model,
though nothing reads poll on this side today (review S15). GuestCtx now holds a
NonNull<Ctx> with the borrow's lifetime, and reaches the registers field by
field (a reference to x or vreg covers none of poll); host-sys's Ctx has poll
as an AtomicU32 (same layout, checked), so a shared &Ctx beside the host's store
is sound.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
SiteCx::site() read the site from the chain, and the plain trampoline (a site
whose only callback is a Rust owner) runs with an empty chain, so its owner was
told SiteId(0), another site's (review S16; latent: no owner asks today). The
SiteCx now carries the site's index itself; the chain no longer keeps it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hos_site_subscribe and hos_site_unsubscribe had no caller, and unsubscribe let
a subscriber go without the grace period the Rust's removals wait for, so a C
caller that freed its user pointer after it could be called on it once more
(review S17). Nothing in the tree subscribes from C; the Rust's chain::subscribe
stays. hooks.md no longer lists them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The port matched HOS_SKIP_OPENING against eight exact words, so =TRUE, =2 or
=" 1" (on for the C, as for every switch) and an empty value (off) fell
through to the row (review S18). It now takes the switches' one rule
(oot::sysmods::switch_value_off: empty, 0, false, off or no in any case, with
spaces around, is off; anything else on), and only an unset switch leaves it to
the row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Discord status sends only an art asset's key of the application as its
picture (a link would have Discord fetch it from outside the PC). A
discord_image=https://... carried over from an older build silently became
"longshot" (review S20): the log now says so once for each such value, and
graphics-and-controls.md's table says a link is no longer sent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The banner is new with the port (the C showed area names only in the Discord
status), English only, and changes what every player sees: its row is off out
of the box, for the player to turn on (review S21).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
graphics-and-controls.md still said HOS_WIDE_UI overrides HUD layout, a switch
switches.def marks GONE (review S25). The placement rows are listed from
Middle 16:9 on (the setting's shown_if takes no value yet) and used at Custom.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The deleted test_prompts_size_table (#1109, #1192: a table not the game's
crashed the start) left host/prompts.c's raised font entry untested (review
S24). test_mods_size_table now runs hos_prompts_font_entry, cut out of
host/prompts.c over a made-up game folder, with host/restbl.c's parse, raise
and write: the entry grows by what the prompts' font is larger than the game's,
stays when it has room, and nothing is raised with no prompts' font or no font
in the RomFS. (What the table is served for is content::layers', with its own
tests; the damaged textures' stand-in is oot::fixes::damaged_files', tested in
Rust, and nn_fs.c's two lines that ask it stay checked from the source.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The deleted test_oot_state_tap ran about 40 end-to-end modes; the Rust's tests
did not cover the changes scan meeting a table the game moved or resized (a
save loaded, a table grown), which parity gate 5 depends on (review S23). This
runs whole passes over a stand-in GameDataMgr: a change in place is reported, a
moved table with a value changed on the way is a fresh baseline with nothing
reported, a change after it is, and the same for a resized table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The mod's handler scaled the angle itself and never called next, so a handler
after it on camera.lens never ran (review nit). It now hands its row down the
chain (oot::sysmods::fov::with_row) and calls next; the core's callback, last
in the chain, scales once by that row (row_now, 100 without the mod) and tells
a mod's camera.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
HOS_TEXT_SPEED went with the Text speed system mod (switches.def GONE), so the
parity gates' runs no longer had text at once (review nit). A run now writes
its own options file with text_speed=3 and names it with HOS_OPTIONS_FILE; the
scenario's hash takes the options too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
mods_tick clamped the held mod's place to 0..count-1, undefined for std::clamp
when the snapshot had no rows (review nit). With no rows it now lets the mod go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
mod.d.ts's first line said 0.3.0, mod.json 0.4.0 (review nit).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The row's legacy id mapped HOS_OPT_SHADOW_RES 56 onto the row's choices, but the
old renderer answered 56 with the size it resolved (0 the game's, 1 2200, 2
3072), not the row's choice (review nit). No input movie holds 56, so the row
takes no legacy id; the constant stays, documented.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
set_life refuses a life outside 1 to the actor's most only when it knows the
most at the call; a write queued without it could put 0 or less, a defeat the
game did not make (review nit). write_life clamps to 1 to the most.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Two refused game calls (a function this build lacks) went on wrongly (review
nit): heap.cpuAlloc's tryAlloc left x0 the heap pointer, then taken as the
allocation; the barrier's sleep returned at once, so the job's loop spun. The
first now answers 0 (no allocation, the retry in the heap's parents follows);
the second waits the game's own 20 us on the host.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
gpu/vk/menu/crt.cpp's hint told the player a CRT filter is bypassed while the
game presents Native HDR (PQ); the CRT system mod's hints are static, and the
game side cannot see the renderer's present, so the line was lost (review
nit). game_rows.cpp's hint for crt_filter says it again from
present_native_pq, before asking the game side.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The groups' notes named host/game/*.c files that never existed (the mod API's
first plan) and the Text speed group the text size's file alone (review nit).
They name game/crates/oot's modules, and both text files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
take_shot opened want + ".part" with open(..., "wb"), which follows a link
there (review nit). It is now unlinked first and made with O_CREAT | O_EXCL |
O_NOFOLLOW, as the stage's read is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game_list skipped a locations! line with a trailing comment or the last line
without its comma, both valid Rust, so such a name went unchecked (review nit).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The builder picks a script system mod's shipped files with the schema crate,
and the table the game trusts was hashed by it; the game hashes the installed
folder with its own code (api::system::tree_hash). Nothing checked the two
agree, so a change of one (LEFT_OUT_TOP, the line format) would have the game
refuse its own mods (review nit). This installs each system mod of the tree as
the builder does and checks the game's hash is the compiled table's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A script's small keys were clamped to the most a dungeon holds, but the count
ever got and the grant reported added the whole ask (review nit: a grant of 5
with 8 of 9 held reported 5). Both now take what the clamp let in, and nothing
is reported when none went in; the count ever got cannot overflow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
has() answered by the build's named locations alone, so the damage, actor-life,
heal, fall, rupee, reward, price and bottle rules, item grants and actor writes
said yes in a build whose site table places none of their sites, and their
hooks never fired (spec audit, work item 1). game-sites now holds each build's
placed sites (game/sites/<build id>/locations.toml, read by its build.rs;
game_sites::placed, looked up once a run), and a feature whose sites none is
placed is absent: has() false, its calls NotAvailableError.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The C era's table placed text.opened, text.set, physics.stepped,
physics.steppedOther, items.pouchAdd, items.pouchAdded, save.load and
actors.update; the port's table did not, so the texts' filters, the rays'
physics step, item grants and their answers, the save's load and the actors'
list never ran (spec audit, gap 3). Their definitions and the supported
build's locations are back, from the C era's tables (masked words and offsets
only); their handlers are game/crates/oot's (texts, rays, items, actors). The
19 rule sites (rules.*, rewards.*, actors.write, actors.bind, the query
answers, actors.lights) wait for their rules in the Rust lifter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
longshot-mod reads mods_api= from the game folder's longshot_version.txt to warn
of a mod whose "api" the game keeps off, but the builder never wrote it (spec
audit, item 10). It is the tree's schema's [api] version.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Gate 5 (nothing started) reserved the process name longshot-broker for the mod
system, but the sandbox starts its broker in every confined run before it
confines itself, mods or none (crash reports, links and folders opened go
through it), so a vanilla run failed the gate (spec audit, item 10). The broker
is listed as the sandbox's; its mods' log lines stay reserved, and lsmod-
processes still fail.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The spec audit's docs pass (item 11): game/README.md's Stand-ins dropped the
stale game_set_confined line (the host calls it) and lists the content stage
and typed patches not run, the rule sites not placed, texture packs, recipes and
the BWAV writer not ported, and the unsafe tier's build side; DESIGN.md no
longer maps reload.c and recipes.c to ported services; content.rs no longer
says the loader drives the stage; textures.md and dev.md say packs and the
layers' rebuild while the game runs are not in this Longshot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
has() answered yes for content.item, content.patch and the other content
stage declarations, and for gfx.textures, but the game runs no content module
and has no texture packs (spec audit, item 1). A declaration is a feature once a
content stage has begun this session (Services::content_staged), so not at the
loader's resolve, and a manifest's requires of one is not met; content.read
stays (the game's data, read without a stage). gfx.textures is absent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
menu_game_setting is asked each present (the ultrawide menus setting) and went
through every game row with a strcmp each time (review nit). The place last
found is tried first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A retired table is kept until its readers' count is seen at zero, so a reader
that never left kept every table published after it, growing without a word
(review nit). Past 1024 waiting, the log says so once; they are still kept, as
freeing one under a reader would be worse.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The review's S22: a player's fallback build of liblongshot_rs.a needs the
network the first time (crates.io, and github.com for oxc's crates at their
tag); measured from an empty target folder with the crates fetched: 23 s,
189 crates, 115 of them oxc's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
request_in, the client's side of host/broker_windows.c, read every reply into
one static buffer, though the game's channel (chan_lock) and the side channel
(side_lock) each hold only their own lock. A performance summary sent on the
renderer's thread could then overwrite a NET_CHANNEL or TRUST reply the game's
thread was reading: a wrong status, a wrong handle taken or closed, or a channel
dropped. hos_broker_crash_send kept its reply in a static too.

The check reads both functions and refuses any static in them. It fails here.
(The source check's marker for start_confined is brought up to its signature,
which gained the user folder in the base: the check stopped there before.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
request_in (host/broker_windows.c) read every reply into one static buffer
while the game's channel and the side channel each held only their own lock:
a performance summary's send on the renderer's thread could overwrite a
NET_CHANNEL or TRUST reply the game's thread was reading, giving a wrong
status, a wrong handle taken (and used or closed) or a dropped channel.
hos_broker_crash_send kept its reply in a static too.

Each call now mallocs its own buffer, as Linux's client does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
On Windows the record of the grants (sandbox_grants.txt) was kept in the user
folder, which is the game folder's user\ (written by the container) when the
game keeps it there or --user names a folder under a written one. The
unconfined --sandbox-revoke then trusted the record's own SID line, which
sbxw_sid_ok let be S-1-15-2-1 (ALL APPLICATION PACKAGES), and its paths, to
which no never list applied: a game taken over could have the launcher strip
other apps' ACEs, rewrite a DACL above the player's folders, or wipe the record
so its grants were never taken back.

The checks: the record has no SID of its own (the first form, with one, is
refused); sbxw_record_keep drops a record's path at or above the never list's
folders; the record's folder is %LOCALAPPDATA%\Longshot\sandbox
(sbxw_record_dir), and the plan grants nothing at or above it; in the sources,
--sandbox-revoke derives the SID from the container's name and revoke rewrites
a DACL only when it holds an ACE of the container's. They fail here (the
functions are not there).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The record of the grants (sandbox_grants.txt) was kept in the user folder,
which the container writes when it is the game folder's user\ (an older
layout kept) or a --user under a written folder; and the unconfined
--sandbox-revoke took the record's own SID line (sbxw_sid_ok let it be
S-1-15-2-1, ALL APPLICATION PACKAGES) and its paths with no never list. A game
taken over could have the launcher strip other apps' ACEs or rewrite DACLs
above the player's folders, or wipe the record so its grants were never taken
back.

- The record is now %LOCALAPPDATA%\Longshot\sandbox\sandbox_grants.txt
  (sbxw_record_dir): this PC's, as ACLs are (%APPDATA% may roam), outside every
  grant; the plan refuses any grant at or above that folder
  (SbxwInput.record_dir), so a switch naming %LOCALAPPDATA%\Longshot is not
  granted. One record serves every game and user folder; --sandbox-revoke's
  --user is taken and left.
- The record names no SID (its form is 2; the first, with one, is refused):
  --sandbox-revoke derives the container's from CONTAINER_NAME.
- sbxw_record_keep drops a record's path at or above the never list (the
  player's folders, Windows', Program Files, ProgramData, the record's own),
  and revoke rewrites a DACL only when it holds an explicit ACE of the
  container's.
- sandbox.md no longer says the container cannot change a file it could.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
broker_url_allowed matched the prefix alone, so
https://<pages>/Longshot/../../evil and %2e%2e (or %2f, %5c) after it passed,
and a browser opens them above the prefix: a link the broker was meant to
refuse.

The path after the prefix (before its query or fragment) now has no "." or
".." segment and no '.', '/' or '\\' percent-encoded (broker_url_rest_ok). The
query and the fragment are left as they were (the issue form's body is there).
tests/test_broker_frame.py has the cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The filter refused only socket families and io_uring_setup. A user namespace
(clone or unshare with CLONE_NEWUSER) and a network namespace with it make the
confined game root of a network of its own: netlink then reaches nf_tables and
the rest of the kernel's root-only code, the commonest way from a process to
the kernel. setns, userfaultfd, keyctl, add_key, request_key, perf_event_open
and bpf stayed open too, and the game uses none of them.

The filter now refuses clone and unshare with a namespace flag, setns,
userfaultfd, the keyrings' calls, perf_event_open and bpf with EPERM, and
clone3 (whose flags are behind a pointer) with ENOSYS, so glibc falls back to
clone. A thread's or a process's clone and unshare of the files or the cwd
pass. The filter's labels are worked out once (a table of the calls per
architecture), and the test's BPF interpreter takes AND. HOS_WATCH's data
breakpoints (perf_event_open) now need HOS_SANDBOX=0, as sandbox.md says.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Below Landlock ABI 9 (every kernel before 7.1, SteamOS 3.8's 6.16 among them)
pathname UNIX sockets are open: a script that took the confined game over
could reach the session bus and ask systemd --user (StartTransientUnit) to run
a program unconfined. host/hos_main.c still told the game side the run was
confined, so a player's script mods started.

hos_main.c now tells the game side hos_sandbox_lets_scripts(): on Linux files
and the network confined and Landlock ABI 9 or later (sandbox_plan.h
sbx_lets_scripts, a restart's too); on Windows the container and no
capability, as before. Below ABI 9 the log says why a script mod is held;
HOS_SANDBOX=0 runs them unconfined, the player's own choice. Mods of files
alone and the system mods load as before.

Chosen over stating the gap: there is no other way to close a pathname socket
from inside on those kernels (seccomp cannot read connect's address, Landlock
cannot before ABI 9), and a mount namespace would need user namespaces, which
the filter now refuses and some distributions turn off. The cost: on kernels
before 7.1 a player's script mods need HOS_SANDBOX=0 until the kernel is newer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The rules gave /dev/shm read-write on every run, and with it the Steam
client's and JACK's shared memory, though only the Steam overlay needs it; and
Mesa's and NVIDIA's shader caches were the ones the compositor and the
browsers share (~/.cache/mesa_shader_cache*, ~/.cache/nvidia), where a game
taken over could plant an entry another program's driver reads. Neither was in
sandbox.md's "What stays open".

- /dev/shm is granted only when Steam started the game (SbxInput.steam, set
  where Steam's folders are found), and the log says so. Wayland's buffers and
  the sound's shared memory are memfds, not files there.
- When neither the player nor Steam names one, the game names its own caches
  before any thread starts: MESA_SHADER_CACHE_DIR=$XDG_CACHE_HOME/longshot/mesa
  and, on NVIDIA, __GL_SHADER_DISK_CACHE_PATH=$XDG_CACHE_HOME/longshot/nvidia
  (both drivers make their folders under it). The first start after this
  compiles Mesa's shaders once more.
- sandbox.md lists /dev/shm under Steam, a cache someone named, AMDVLK's and
  /proc's oom_score_adj (another review nit) under "What stays open".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
#2286's HOS_SAVE_DIR takes a share's whole path on Windows (\\server\share\...). The sandbox's AppContainer has no
network, so a start whose saves are on a share is not relaunched into it (the log says why; HOS_SANDBOX=strict
refuses), rather than confined with saves it cannot write.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
sandbox.md and sandbox_plan.h say HOS_SANDBOX is read from the real environment
only, but the file HOS_ENV_FILE names set anything, HOS_SANDBOX and the
broker's LONGSHOT_BROKER_* and LONGSHOT_SANDBOX_* among them; such a file can
lie where a confined run writes.

The sandbox's switches are now one list (hos_main.c env_sandbox_own), refused
from longshot_env.txt as before and from HOS_ENV_FILE's file too, with a line
on standard error. tests/test_env_file.py has the case.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/json_keys.h, the strict JSON reader the C broker's checks once used, has
no user left but its test: the trust file's change is the game side's
(game_trust_record) now. It goes, with its checks in test_broker_frame.py and
its line in sandbox.md. broker_frame.h and broker.h named host/mods_trust.h
and host/mods.c, and ipc_endpoint.h host/mod_manifest.c and
host/modapi/net.c, all gone: they name the game side's code that took their
place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
crash_send and perf_send checked the file the game handed over with fstat (a
plain file, at most 8 MiB or 1 MiB) and then gave curl that same file, which
it read to the end: the game could keep writing it in between and have the
broker send more than the limit.

The broker now copies the file into a memfd of its own, refusing it when it
holds more than the limit by then, and gives curl the copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
curl_common pinned the checked address with CURLOPT_RESOLVE only when its
list entry could be made: out of memory, the pin was skipped and libcurl
looked the host up itself, past the private-address rule. curl_common now
says when it could not pin the address, and the fetch or WebSocket fails
("out of memory") instead of connecting.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
- read_message kept an assembler for every connection a peer started a
  message on and never ended, each up to 1 MiB: the game's side (untrusted
  to the broker) could grow the broker without end. A side now has at most 64
  messages in progress and 16 MiB in all; past either the link ends.
- On Windows pipe_put wrote under the pipe's lock with a blocking WriteFile
  that has no time limit, and pipe_close took that same lock before its
  CancelIoEx: a peer that stopped reading held the close forever. pipe_close
  now cancels the pending write until it has the lock, and a write checks
  the pipe is not closing once it has the lock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
- game/sites/sites.toml's notes on frame.whole* and anim.loopStep named
  host/frame_whole.h, host/loop_step.h and game/oot_sites.c, which are gone:
  they name game/crates/oot's video.rs and engine.rs.
- tests/test_ocarina_notes.py's staleness case reads as if it checked the
  half-second timeout, which is its stand-in's: it says the timeout is
  NotePoll's (with its own Rust test) and that what it checks is the host
  giving the keys back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The stand-in host's mapped ranges were byte vectors, aligned to 1, against
GuestPtr's assumption that an aligned guest address is an aligned host one
(review leftover); they are 8-byte words placed to keep the guest's alignment.
ffi.rs's doc said the network engine had no declarations; hos_net_* are there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Two of the move's leftovers: the base's Python tests that fed the game the
builder's exefs_patches.txt and checked mods.json was read by one rule went
with the C. The loader now reads a list written by game-files' list_text, and
ModsList::parse and game-files' parse_list take and refuse the same lists, with
the same ids and switches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
About 55 notes in game/sites/sites.toml and the supported build's
locations.toml named game/oot_*.c files and host functions that went with the
move to Rust (review leftover). They name the Rust module or system mod now
(oot::fixes::high_fps, oot::session, mods/shadows, ...), and the host's C
where it is still the host's. Comments only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The mid IR read and wrote the host's globals with volatile loads and
stores alone, so a rule over a table could not count itself into the
table's readers or load its pointer with the orderings the retirement of
an old table relies on (docs/dev/reference/hooks.md, when a replaced
table is freed). HostAtomicLoad and HostRmw are a host global's atomic
load and read-modify-write of an ordering, written to LLVM as load atomic
volatile and atomicrmw volatile, as clang writes C's __atomic builtins on
a volatile object; Order has Relaxed (monotonic) for a first look.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Rust lifter knew mul_f32, scale_f32 and note_u64 alone, so the mod
API's rule sites (damage, actor life, heals, falls, rupees, rewards,
gifts, prices, bottles, actors' writes and binds, query answers, lit
bombs) could not be placed. The fourteen rules over a table of
nx2/hooks.py at 2596a0e3 (life_rules_hit, spawn_rules_max/life,
scale_rules(_by), reward_rules_drop/gift/count, price_rules,
bottle_rules, actor_writes, actor_binds, query_answer, actor_lights) are
in sites' Rule with their arguments, and their lowering is
builder/crates/edits/src/rules.rs: one relaxed load of the table's
pointer while off (the life rule tests next < old first); while on, the
readers' counter's sequentially consistent add, the pointer's
sequentially consistent load, the call of the game side's function
(longshot-game's tables.rs) with the context, the table and the
registers, the answer's 32 bits zero-extended into its register, and the
counter's release. game/sites.def's HOS_TABLE lines are read as values of
the type table, and a table's line whose identifier is not its name's
stops the lift (its readers' counter would be another's).

The C read the pointer into a local it tested in another block; the mid
IR keeps a value in its block, so the call is made with the pointer as
loaded, and a table unpublished between the two loads reaches the game
side's function as null, which answers the game's value or does nothing
(the register is kept by a select).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The C era's table placed rules.lifeHit, rules.lifeInitMax, rules.lifeInit,
rules.heal, rules.fall, rules.rupees, rewards.drop, rewards.dropOther,
rewards.gift, rewards.giftCount, rules.price, rules.priceOther,
rules.bottle, actors.write, actors.bind, the three actors.answers and
actors.lights; the port's did not, as the lifter had no rules over a
table, so their features were absent (has() false). Their definitions
and the supported build's locations are back from 2596a0e3's tables
(masked words, offsets and guards only), rules.lifeHit before
player.lifeHit and actors.write and actors.bind after actors.update, as
there. The repository check holds rule sites to their line of the rule's
type and to no word count, as the C era's did (actors.answers.isThrown's
signature is 13 words).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The content context had no runtime: Place::Content was only compared against, so a manifest's "content" module could not run at all. api::script::ContentRunner is the stage's engine side, and script::ContentModules runs a module once in a runtime of its own, the services lent and no main thread (as a worker's are). settings.get works in the content context (read only, off the main thread), as the schema says.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
host/romfs_merge.c had no port: content::patch, content::text and content::pack were library-only, so nothing a mod's patches/ or a content stage made reached the game. content::merge makes them into files the layers serve: typed patches onto the served or game file (or onto a pack member in every pack that carries it, via modcache/members.txt), member files (romfs/<archive>.zs/...) into their archive and the carriers, and the stage's new packs; each written once in modcache/files/ by the content it is made of. Conflicts and failed ops are logged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Services::content_begin/end/added had no caller and Loader::publish_layers served each mod's romfs/ alone, so content.* declarations were unreachable, owner/name:id names never resolved and save.flags was checked nowhere. Loader::content_stage (game_init, before the first file opens) runs each loading mod's content module in list order, keeps its plan in modcache/content/plans/ (a kept plan goes through content_added), writes its outputs to modcache/content/<key>/, and hands the declarations to the runtime's services at start. publish_layers adds each layer's stage outputs, member files and patches/ and runs content::merge before the size table's fit. The stage's declarations are features at the loader's resolve now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/README.md's stand-ins, DESIGN.md's port map, and the modding docs (content.md, files.md, dev.md) say what the Rust game side does now and what it does not make yet (archive merges, skins, tree schema, sounds, the cache sweep, rebuilds while running).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The C's host/bwav_write.c, host/ktx2_decode.c, content.c's make_bntx and make_bwav, and the rules of
host/texture_packs.c and host/modapi/recipes.c had no port: content.sound's bwav: recipe and the bntx: one
had no maker, and the game side could not read a texture pack or a recipe.

content::assets::bwav writes a 48 kHz DSP-ADPCM BWAV (the coefficient pairs by k-means of the frames'
predictors, each frame's pair and scale by least squares), reads one's tables and decodes as the mixer's
step does; its tests are tests/bwav_write_test.c's (a sweep, a chord with noise, silence, a click, a
full-scale square, files of 1 to 15 samples, the loop's context, the CRC, the resampling).
content::assets::ktx2 reads an uncompressed 8-bit KTX2's first level; content::assets::recipe parses
bntx:, bwav: and zs: and makes a model's texture from a PNG or KTX2; png gains an RGBA writer.
content::textures holds the numbers the renderer knows an upload by (XXH64 in 64 MB pieces, the
shape-free signature), the BRTI walk, the texture index (keyed by the RomFS's texture files and sizes),
the kept hashes, recipe.json (render targets, the upscale recipe checked and keyed) and an upscale job.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Texture packs (gfx.textures) were gone from the Rust tree: no game side read a pack, the renderer had no
override, and has("gfx.textures") was false.

api::textures::start runs in game_init after the layers are published: each mod that loads and lists
gfx.textures (Loader::texture_packs, a minimal hook beside romfs_root) has its recipe.json read and its
textures/ named from the texture index (made once from the RomFS's .bntx.zs headers through the host's
new zs stream binding), a later pack winning; each replaced texture's numbers come from the file the game
is served, kept in modcache/texture_hashes.txt. An upscale recipe's job is written on an lsmod-upscale
thread (the pictures decoded by the renderer's mkwvk_texture_decode, given the game as
hos_texture_decode), and a done job's images serve the mod under its own. longshot-game exports
game_texture_replacement*, which MkwVkHost version 54 hands the renderer.

The renderer's half is the C era's: gpu/vk/texture_pack.h's two-stage lookup at a first whole upload,
the override image used by sampled views of the whole texture, dropped when the GPU writes the texture
or its storage changes, the resolved views and reused descriptor sets stale by texture_pack_generation;
texture_decode.cpp decodes block-linear plain, BC1-BC5, BC7 and ASTC level 0. has("gfx.textures") is true.
Game-free tests: api::textures's (ported from tests/test_texture_packs_host.py), tests/test_texture_pack.py
and tests/test_texture_decode.py.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A mod's recipe.json could ask for the sun's shadows at 2200 or 3072, and nothing read it: the C's
menu_shadow_res took gfx_recipe where the row was Auto, and its Rust port did not.

resolution_with takes the recipe's level (api::textures::target_level) where the row is Auto; a size the
player chose wins. Tested game-free.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
textures.md said the game side was not ported and named nx2/texture_index.py, which this tree has not;
api.toml's gfx.textures note, game/README.md's stand-in and DESIGN.md's C-file table said the same, and
the architecture had neither the packs' nor the recipes' rules.

Each now says what the code does: the index's format, the hashes' file, the modules that hold the
packs, the recipes and the BWAV writer, and the renderer's rules (Texture packs replace at upload,
Render-target recipes). README keeps one line: the output recipes' makers have no writer to call them
until the content stage runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The stage's writer refused bwav: outputs ("the BWAV writer is not ported") and
made bntx: from a PNG alone. It now makes each recipe with the content crate's
makers: bntx: with recipe::make_bntx (PNG or KTX2), bwav: by decoding the mod's
WAV or Ogg Vorbis (the audio service's decode, given the stage's Ogg decoder),
reading the game's stream it replaces for its channels and loop, and writing the
BWAV with bwav::from_sound. A game-free test makes a mod's mono WAV a stereo,
looping stream served in the game's place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The self-test's planted side door, hos_romfs_dir, is declared in
host/game_host.h now, and its planted game header, game/flags.h, is gone, so
the self-test stopped proving the check sees either crossing. It plants
hos_broker_launch (host/broker.h) and game/oot_cheat_items.h.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Every play(), playAt() and playOn() takes one of the 512 voice handles every mod shares, and only a stopped mod
gave its handles back: neither voice.stop() nor a voice that ended freed one. A mod that played a click 512 times
left every mod's next play() refused with "the mods' voices are full".

The tests play a 10 ms sound 600 times, stopping each voice, and 600 times letting each end; both fail at the 513th
play now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The audio service's 512 voice handles, shared by every mod, were freed only when a mod stopped: voice.stop() left
its handle taken, and so did a voice that ended on its own. After 512 plays every mod's play() was refused. And when
the handles were full, the mixer had already started the voice: a looped sound played on with no handle to stop it.

voice.stop() now takes its handle out (and its place); each frame's audio step gives back the handles of voices the
mixer no longer plays (one lock: Mixer::heard_voices), and so does a play that finds the handles full before it
refuses. A refused play stops the voice it started.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
draft_back reads a filter's draft back with no depth cap and no limit on what it visits. A filter that sets a field
of the draft to the draft (`d.n.back = d`) makes it recurse until the stack overflows, which aborts the game; a draft
whose objects each hold the next one twice, 48 deep, makes it visit 2^48 objects.

The test reads back both: the cycle overflows the stack now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
draft_back recursed into every object a filter left in its draft, with no depth cap and no count of what it read.
The draft is only sealed, so a filter can set a field to an object, the draft itself included: `d.n.back = d`
recursed until the stack overflowed and aborted the game, and a chain of objects each held twice by the one before
made it visit 2^depth of them. No JavaScript runs while it reads, so the deadline it runs under could not stop it.

The draft is now read at most VALUE_DEPTH (64) records deep and VALUE_BYTES (256 KB) of names and strings in all, as
json_value holds a value; past either the draft is refused with why, as a draft of another kind already is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
spirv::check adds 1 to a decoration's value (`Location 0xFFFFFFFF`) and sums a params member's offset and size in
u32 (`Offset 0xFFFFFFFC`), both values the mod's .spv gives. With overflow checks on and panics aborting, either one
aborts the game when a mod asks for its effect.

The test builds the least module the template takes, checks it passes, then gives it such a location and offset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
check kept a decoration's value +1 (`words[w + 3] + 1`) and summed a params member's offset and size in u32
(`o + 4 * n`), both numbers a mod's .spv gives. The C wrapped silently; here overflow checks are on and a panic
aborts the game, so `OpDecorate %1 Location 0xFFFFFFFF` or a member `Offset 0xFFFFFFFC` killed it when the mod asked
for its effect.

A decoration's value +1 is now checked, and one that has no room refuses the shader; the offset's end is summed in
u64. The rest of spirv.rs swept: a counted loop's last value is checked arithmetic (its step is any 32-bit constant),
the nested loops' product saturates, and the loop scans read an instruction's operands only when it is long enough to
have them (they read in bounds before, but another instruction's words).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
sourcemap.rs sums a map's VLQ values in i32 (two `+/////D`, i32::MAX each, overflow the column), adds 1 to a source
line of i32::MAX when it shows it, and reads the four bytes before `sourceMappingURL=` as a str slice, which panics
when they split a character (`€€sourceMappingURL=`). Each aborts the game when a mod's error names its module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The source map decoder summed a map's VLQ values in i32 with plain +, so two segments of i32::MAX (`+/////D`)
overflowed and aborted the game the first time the mod's error named its module; a source line of i32::MAX
overflowed again when shown 1-based. And the look for `//# sourceMappingURL=` sliced the four bytes before each match
as a str, which panics when they split a character of the mod's .js (`€€sourceMappingURL=`).

A VLQ value past i32 and a sum that leaves i32 now end the map there (what came before is kept, as for text that is
not VLQ); the line and column are shown through i64; the comment's prefix is compared as bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
trimmed walked a list's trailing undefineds back from its `length`, one native property read each. A mod that passed
`a.length = 2 ** 32 - 1` to a together native (emit, call, a mod: import's function) made about 4e9 reads in native
code, which the interrupt never sees: the game froze for minutes.

A list longer than a value's bytes (VALUE_BYTES) is now passed on as it is, and the conversion refuses it at once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
After a kept callback returned, its result was converted (its toJSON run, its getters read) with the deadline the
call put back, none: the mod's code in toJSON ran with nothing to stop it but the stray-poll guard, and nothing said
why. A callback returning `{ toJSON() { for (;;) {} } }` was cut only by that guard, silently.

Both conversions (bind's callback_call and the engine's Runtime::call) now run under DESCRIBE_NS, as a filter's draft
is read back and an export's answer is; a conversion the interrupt cut is the mod's OverBudget fault.

The test needs the stand-in host's clock to move while the script runs (it stands still between a test's moves, so
no deadline could pass): host_sys::fake::set_tick makes each read of it move it on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The fence's doc and tools.md read as if a test file could not reach outside the mod's folder. It cannot through
`fs`, but the mod's code runs in the tools' own context: that context keeps eval and Function, shares its objects
with the realms it makes and holds the natives on its global (`__longshotNatives`), so the mod's code can reach
longshot:native's unfenced spawnSync and spawnDetached, and node:child_process, and a program it starts runs with the
user's rights.

Confining those modules to the SDK's own importers would not close that while the natives sit on the shared global,
and taming the tools' realm (a realm of its own for the mod's tests, no shared objects) is a redesign of the tool. So
the docs now say what the fence is: it keeps a mod's fs calls inside its folder by accident; a command runs only on a
mod whose code you trust, as npm test does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Two findings of the review in the one file (S4, S6):

- An undo that waited for play (items out of play) kept the mod in the asked list, and the next frame undid every
  unsaved write of that mod's: when the mod had started again meanwhile, what its new run wrote was undone too. The
  writes an undo covers are now marked when it is asked; the frames undo those alone, and a later write is never
  merged into one of them.
- A flag write was a new entry each time, so a mod writing a flag every frame filled the 4096 entries in about 68 s
  and then evicted other mods' undo entries, each eviction a Vec::remove(0); and every write rebuilt every mod's
  counts from all the writes under the counts' mutex. A mod's writes of one flag are now one entry until a save takes
  it (its first "before" kept, dropped when it is back to it), as memory writes already were; the writes are a
  VecDeque; the counts are kept per mod as writes come and go, recounted only after a save, a load or an undo.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The journal learns of a save (asked, written, loaded) from the storage service's notes, and the notes were wanted
only once some running mod had storage, settings, audio or UI settings attached. A mod that only writes flags, alone,
never had its writes marked saved: the player saved, the mod stopped, and its saved flag was reverted, against
game/DESIGN.md's "a save asked marks what was made so far, that save written makes it saved".

Every mod's start now turns the notes on (Storage::watch); they cost a queue push per save event.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
romfs.read with an offset and a length, on a game file no mod overrides, read the whole file through the host's
index on every call and cut the part out: a mod reading a large file in parts read it whole each time (a 500 MB file
read 500 MB per call). host_sys::romfs::read_at reads the part through the host's open/read-at calls (the stand-in
host slices its own bytes), and the service reads only the part asked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Each visit of a serial site, told in place or at the frame's end, cloned every Row of its slot whole (its owner,
hash, engine and note Strings, its argument list, its retired handlers) and formatted the listener's name for each
row, whether or not a listener was there to be told; the frame's step also built every row's argument record.

The visit now takes what its listeners need (a Told: the name, the form, the listeners, and the arguments and their
places as Arcs the row shares), only for rows with listeners, and builds the record and the name once a row, when a
live listener is there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A text a mod sets (content.texts, its patches) was refused only for a NUL. U+000E and U+000F went into the message
file as they were, and the game's MSBT reader takes them as a tag's header: it reads a group, a type and a size from
the text after, and reads past the text's end.

The C0 controls but tab, line feed and carriage return are now refused (text.control), naming the character; a tag
is written {...}, which the game's files decode to.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
write went through every entry for each of the label table's slots, hashing each label again: slots x entries x a
label's length, about 6e13 steps for a crafted 15 MB message file with many slots and labels. The labels are now put
in their slots once (in their texts' order, as before), then written slot by slot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The sweep of the content crate's parsers for overflow on a mod's bytes (overflow checks are on and a panic aborts the
game) found two sums in bfres::rename_textures, which a skin's texture renames run on a model a mod serves: the string
pool's count + the names added, and relocation section 0's size + the pool's growth, both u32 words of the file that
nothing checked. A count or size of 0xFFFFFFFF aborted the game. Both are now checked, and refuse the file
(bfres.no_string_pool, bfres.relocations_past_end).

Swept and found bounded: read.rs, bin.rs, byml.rs, sarc.rs, archive/ (zip, names, sha256), text/ (msbt, tags),
restbl.rs, assets/ (png, bntx, bc7 spot-checked, mod.rs's fska and anim checks, the rest of bfres), ainb/, json.rs,
patch/, pack.rs, plan/, layers.rs, texts.rs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The sweep of the api crate's handlers of mod input for overflow found one: an image's id is a process-wide counter's
fetch_add(1) + 1, never given back, so after 2^32 images (64 a batch, about an hour of a mod's batches that each
show new files and reset) the plain + overflowed and aborted the game. It wraps now, skipping 0 (no image's id).

Swept and found bounded: manifest/ (version, permission, setting), json.rs, value.rs, storage.rs, settings/,
services/ui/ (ops, tree, props, canvas, snapshot), loader/ where it reads a mod's files, and mod-format.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
parse_arg sliced `&reg[1..]` before checking the register's letter, so a list line whose register starts with a
character of more than one byte panicked. The list is the build's, not a mod's, but a panic aborts the game: the
first byte is checked to be ASCII first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
rules.skips.add refused a skip past every mod's limit (SKIPS_MAX) with a message naming the per-mod one
(SKIPS_PER_MOD). It names SKIPS_MAX now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Each visit where two mods answered at one point ran the whole clash path again: the site's name scan
(SiteId::by_name), the game-sites registry's global lock for report_clash, and the notes' text formatted, all before
anything said it was known. The pair of rows is now checked first (the hooks' table is set once, so its indexes stay
the rows'), and a pair seen goes no further.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
apply_one cloned the patch, all its ops, to apply one op of it, for each op: quadratic up to the 10k ops a patch
holds. It now makes the one-op patch from the patch's other fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The size table's fit gave a file the game has not an estimated entry by its CRC, unless the table had an entry of
that CRC already. When that entry was the game's own for another file (a CRC-32 collision), the new file was left
with the other file's size, and raising it would have raised the other's. Such a file now gets a named entry of its
own (Restbl::raise_named), which the game reads before the hashed ones.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
sarc's merge (and put) wrote every member it was given, sorted by hash, without checking that two members of
different names had different hashes. A mod's member whose name collides with another's made an archive in which the
game, which finds members by hash, reads one of the two for both. arc_write now refuses it (sarc.hash_clash); a name
held several times (the layout archives' groups) is still one name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
to_json and bones walked each node's tables as far as the file's counts said, up to 65535 entries a table, and
to_json wrote one of the file's strings for each: a crafted tree made billions of steps and a text of gigabytes.
Neither is reached by a mod's call today; bounded before they are: at most 4M entries looked at, a JSON text of at
most 64 MB (to_json gives None past either), and at most 4096 bones.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The comment said an odd side's last row or column was "taken once"; the code makes the level half the side rounded
down and reads only the 2x2 blocks inside it, so that row or column is left out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hand_over cleared a scope's dirty mark as it queued the write, and the writer thread only logged a write that failed:
the data stayed unwritten until the mod changed it again (perhaps never, then lost at the close). The writer now
notes a failed global or profile write, and the next hand-over marks that scope dirty again, so it is written once
quiet (a second later) or at the close's flush.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
write_in_place (the trust file, which the sandbox's rule names so it cannot be moved over) wrote, cut and returned
with no fsync: a crash or power cut soon after could lose the player's answers while the game took them as kept. It
syncs the file now. (Written in place, a crash in the middle of the write can still leave it half old; the file is
small and written whole in one call.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The menu thread's edits for the main thread went into an unbounded Vec: with the main thread stalled (a long load),
a menu sending edits grew it without end. At most EDITS_QUEUED (256) wait now; past them the newest are dropped,
and the log says so once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
`longshot mod format` wrote each changed source over itself with fs::write: a crash or a full disk midway left the
mod's source half written. It now writes a temporary file beside it, syncs it, keeps the file's permissions and moves
it over the source.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
closure_trampoline gave JS_EXCEPTION with no exception pending when its context's Rust side was gone (a realm
disposed while one of its functions was still reachable): the caller's catch got whatever the context last held. It
throws a ReferenceError saying the context was disposed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
file_is, which an import's resolution uses to pick ./x.js, ./x.ts or ./x.tsx, looked at the joined path without the
name checks read_file makes (part_ok): on Windows a part a mod's file may not have (a drive, a device, a trailing dot)
could look outside the mod's folder and tell whether a file is there. It checks each part first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
content::merge served the copy lowest in the list whole when several mods shipped one archive, passed a pack spec's
skin lines over, never checked a mod's model or animations, refused every tree that adds nodes (no schema was made)
and never swept modcache/files/. Ported from host/mods.c's merge_archives, romfs_merge.c's content_skin and model,
skeleton and animation checks, host/modapi/content.c's ainb_schema and modcache.c's modcache_trim:

- several layers' whole copies of a game archive are made one (sarc::merge), with a record beside it so a start with
  the same copies reads none of them and still says the conflicts; a member file decides against the copy that changed
  the member, not the lowest copy;
- a new pack's model (the mod's, or a game model of modelOf) and animations are checked against it, a model that
  cannot be used leaves the actor out; its skin is made after it and served under the skin's project;
- ainb_schema makes modcache/ainb-schema.txt from the game's NodeDefinition files and trees, and the packs' trees
  read it as schema:ainb;
- sweep removes the files no mod uses, oldest first, past about 1 GiB (Rom gains host_files and remove).

Game-free tests for each over the in-memory Rom.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A change of a folder mod's served files while the game ran was only logged for the next start, the content stage
never made the tree schema, and modcache/files/ was never swept. Now:

- Loader::hot_layers (loader/hot.rs, from host/mods.c's hos_mods_hot and hot_layers): the changed mod's content
  stage run again (content_stage_one, through LayersHost::stage), the layers built again beside the live table with
  the merged-file step, a path wanting a larger size-table entry than the start's held to the next start, the table
  published, each path said 'served anew from its next load';
- api::services::reload (from reload.c): the map's reload offered when a rebuild changes a path the map loaded, made
  at once in dev mode; services::game polls the map loads for it;
- publish_layers enables the layers' rebuilds while the watch is on and sweeps modcache/files/;
- the content stage makes the tree schema when a mod's tree adds nodes;
- longshot-game sets runtime::HotLayers with the RomFS game_init read.

The Mods tab's line for the offer is not drawn (another change's page).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/README.md's stand-ins, DESIGN.md's port table and hot reload notes, and assets/modding/docs content.md,
files.md and dev.md no longer say archives are not made one, skins and trees that add nodes are passed over, the cache
is not swept or the layers are not rebuilt while the game runs; they say what is still not ported (the rescan,
mods.json read again, the Mods tab's reload line, changeActor clashes, a pack copying a later new pack).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Below Landlock ABI 9 (kernel 7.1) Landlock has no right for a pathname socket, so a confined game could reach the
session bus (and through it systemd --user), the system bus and every other local service of the user's, and a
player's script mods were held there (SteamOS 3.8's 6.16 among them).

Now, as Flatpak and bubblewrap do, the game hides them before Landlock and seccomp: a helper process (fork, one thread)
makes a user and mount namespace mapping the user's own ids alone (setgroups deny), makes / private, mounts a private
tmpfs over /run, /tmp and $XDG_RUNTIME_DIR, and binds back only what the rules name there (Wayland, PipeWire,
PulseAudio, X11's folder and cookie, the broker's bus filter, TMPDIR, udev, the system log, Steam's runtime, the
control bridge, the working folder), links on the way made again. The game joins it (setns) and drops every
capability, so it cannot unmount a tmpfs. A failing step leaves the game as it was. The broker starts first and stays
outside; seccomp still refuses namespaces after. Abstract sockets are scoped from ABI 6 with the folders.
DBUS_SESSION_BUS_ADDRESS names the broker's filter, or is unset.

sbx_lets_scripts stays the one gate: files and the network confined, and ABI 9 or the private folders. Where they
cannot be made (Ubuntu's AppArmor restriction, kernel.unprivileged_userns_clone=0, user.max_user_namespaces=0, a
Flatpak, a thread already running, root, a bus outside the hidden folders, an abstract bus below ABI 6), script mods
are held and the log line, and hos_sandbox_held_why for the Mods tab, say why and what lets them. A restart finds the
folders the run before made in /proc/self/mountinfo.

tests/test_sandbox_linux.py: the folders hidden and the paths bound back for given environments, the bus's address,
the gate for every combination, the held reasons, mountinfo, the order (broker, private folders, Landlock, seccomp)
and the fallbacks over the stand-in, and the real namespace in a child process over the test's own folders when the
system allows one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
docs/dev/reference/sandbox.md: the ABI table's row for 9, the abstract sockets' paragraph, SteamOS (script mods run
there now), the session bus, and a section on the private folders: what is hidden and bound back, whole or not at all,
a restart, what stays open, and each reason they cannot be made with what lets them (an AppArmor profile, the
sysctls). No new switch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The sandbox now knows why it holds a player's script mod (host/sandbox.h
hos_sandbox_held_why: user namespaces blocked by a sysctl or AppArmor, a thread
already running, a bus it cannot hide), but the Mods tab said only "the game is
not confined". The host hands the reason over (game/game.h game_set_held_why),
and the loader's held line says it, with HOS_SANDBOX=0 as the player's own
choice; with no reason given the general line stays. A game-free test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
pad.state() had the buttons and sticks alone; the spec's gyro and device kind were never built. The host now
gives the game side the newest motion reading by the rule GetSixAxisSensorStates hands it out with
(hos_pad_motion, host/nn_hid.c: Motion controls on, a pad with a gyroscope, its motion counting now) and Auto's
button prompts face of the first controller (hos_pad_device, host/prompts.c). PadState gets device (PadDevice:
nintendo, xbox, ps4, ps5, steamDeck, keyboard) and gyro (PadGyro: rate in degrees a second, accel in G, the
Switch's frame; null while the game is given a pad lying still), both read once a frame and read-only in a
filter's draft. The bindings' record reader takes a nullable record field (a draft hands gyro back).

Tests: the state's kind and motion from the stand-in host (turns a second as degrees, a reading that is no
number none, every host number's kind), and the draft's read-only fields. The fake game's setPad takes device
and gyro. Docs: input.md (author's and developer's).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
camera.override(rig) took only { fov }; the spec's rig (an eye attached to Link, a look by input, pitch limits,
a blend) was never built, and first person (10.5) needs it. A rig is now data oot::camera's view hook works out
each time the game builds its view, so a view on Link has no frame of delay: attach "player" puts the eye at
Link's feet plus an offset turned by his facing (his actor's position and rotation, bounded reads), look
"input" or "fixed" looks along a yaw and pitch (the right stick turns an input rig at the acquire phase,
120 and 90 degrees a second, held to pitchMin and pitchMax), look "target" at setTarget's point, and
blendSeconds eases in from the game's view. The handle gets setOffset, setAngles and angles(); a setter that
does not fit the rig is a ContextError. bone, near, collide and drivePlayerFacing need what the game side cannot
reach without new sites or layouts (game/README.md's Stand-ins says which).

Tests: the rig on Link (his feet, facing, absent), its look by angles or point, the blend; the API's defaults,
refusals and the stick's turn within the limits. The fake game draws a rig on game.player. Docs: camera.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The manifest's "saves" was parsed and never read, and nothing kept a progression mod away from the player's own
saves. Every save now lives in a profile (api::profiles): with no such mod the player's own, byte for byte as
before, with nothing written beside them; with mods that declare "saves": "separate" or ask for save.flags,
a profile of theirs, <saves>/save/.profiles/<ids@names>/, with its own save/, save-work/ and modstore/ (so the
mods' per-save data goes with it). game_init chooses it after the loader's scan, before the guest's first
instruction, and the host keeps the run's saves there from then on (hos_saves_profile, host/nn_fs.c: made and
checked as HOS_SAVE_DIR's folder is, a dotted folder inside the save folder the sandbox already gives the game;
one that cannot be used ends the start rather than open the player's saves). A profile records its mods and
versions (profile.json, the log says what changed) and whether it is vanilla-compatible (not, with a save.flags
mod). longshot/storage's saves.profile(name) picks one per seed or room from the next start (names.json beside
the profiles); saves.current() says which plays. Services::saved_flags_allowed is the content stage's
allow_saved: a mod's saved flags only in its own profile that is not vanilla-compatible.

Tests: the choice (default, separate, one per name, save.flags, hashed long names, names checked), the names and
record files, the service's profile() and current(), and game_init's move of the saves and the mods' save data
into the profile over the stand-in host. Docs: storage.md, docs/user/saves.md, docs/dev/reference/saves.md,
game/README.md's Stand-ins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The save profiles' hook was left for the content stage: the stage gave
content_begin allow_saved from the grant alone, so a save.flags mod could add
flags in a run playing the player's own saves. The stage's services now hold the
run's profile (game_init chooses it before the stage, and hot reload's stage
keeps it), and allow_saved is the grant and Services::plays_in_flags_profile: the
run plays in the mod's own profile that is not vanilla-compatible. A game-free
test; the README's stand-in is now what is done.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A launcher's profile (HOS_SAVE_DIR) and a mod's own profile compose: the mod's
folder is <HOS_SAVE_DIR>/save/.profiles/<id>, inside the save subtree the
sandbox grants for HOS_SAVE_DIR, with its record and the mods' per-save data
there, never the user folder's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The lift writes a hook as hos_site_on_<ident> and hos_site_fn_<ident>; the mods' pool had one array of flags and
values the lifted code could not name, so a mod's site could not be placed without new forms in the edits. build.rs
now makes, for each of the 256 slots, hos_site_on_modsite_s<k>, hos_site_fn_modsite_s<k> (a trampoline that calls
hos_modsite_call(c, k)) and hos_modsite_value_<k>: the build places slot k as the site modsite.s<k> with the forms
and code it already has. enable and set_value go through tables of them; tests call a slot's trampoline.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A manifest mod's sites.toml (the unsafe tier, spec 8.3) was read by the game, but no build ever placed it. sites'
new modsites module ports nx2/mod_sites.py: a mod's table checked with the mods' rules, each site found by its
signature (or the function its builds name for this build), its guards checked, placed by the same place() against
the lift, each mod whole or not at all: one that does not resolve, fit, or that meets a game site at a branch, a
replaced instruction, a jump or a host-wrapped function leaves the mod out with why, never stopping the lift. Sites
of several mods at one point share a slot; a row naming a game site by name is checked against the build's table.

The lift takes the build's tables in LiftOptions::mod_sites (in its key; none changes nothing), places them after the
game's own into the same placement and writes gen/mod_sites.txt (format 2, the game's reader's). Tests: the mods'
rules, placement over the made-up lift (sharing, whole-or-nothing, builds, rules, engine rows, a branch clash) and a
whole lift that hooks f1 and keys and lists the mods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The builder never gave the lift a mod's sites.toml, applied a folder with mod.json's exefs/ as an emulator mod's
(local/<folder>, on, with no permission or acceptance: the game says those are not applied), and had no switch
tables, so loader::switch had nothing to read.

- game_files::code_mods: the manifest mods as the game walks them (packages read from the game's unpacked copy),
  mods.json's order, mods-trust.json's acceptances, and the code hash the game makes (sites.toml alone: its SHA-256;
  with exefs/ patch files: one SHA-256 over each file's name, size and bytes).
- build-driver's modsites: each mod with sites.toml taken when it asks for hooks.unsafe and its code is accepted,
  on or off; handed to the lift; the game folder's mod_sites.txt is the lift's list with a whole-mod line for each
  mod left out before it.
- patches::collect: a manifest mod's exefs/ only under the permission exefs and its acceptance, under its id at its
  place in the list.
- game_files::switches: a mod whose patches write data only is built in on or off behind a switch; exefs_switch.txt
  lists each switched byte, the game's own first; exefs_patches.txt notes the switch. Mods with code stay as before.

Tests for each (code_mods' hash, trust path, order and exefs gate; the switch plan and table; modsites' collect and
list).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Services::sites_read had no caller, so a mod's own sites could never be listened to; loader::switch::apply had no
caller; a manifest mod's exefs/ was never its code.

- Loader::start reads mod_sites.txt into the hooks service when a mod has code.
- code_status hashes a manifest mod's code as the builder does (its sites.toml, and with the permission exefs its
  exefs/ patch files), waits for a build until mod_sites.txt and exefs_patches.txt have it as it is now, and holds a
  mod whose sites the build could not place with the build's reason (not available for this game version).
- exefs_status lists a manifest mod's exefs/ files under its id, and a switched file as built in, on or off.
- loader::switch::parse reads exefs_switch.txt whole or not at all; longshot-game's switches::apply sets each switch
  as its mod is at the start (Loader::switch_on) and writes the bytes into main before the guest's first instruction.
- The exefs permission's host line says where it is used now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The table's format had vslot sites (a virtual method's slot), but the lift stopped on one. The lift now checks each
(sites::vslot): the slot, the vtable's address plus 8 bytes a method, lies in main's data and holds the address of a
function the lift found (and the one a location's function names); one that does not stops the lift naming it. The
slot's address goes into gen/locations.c as vslot.<site>. At game_init, game_sites::vslot::install puts in each such
slot a host call (hos_hostcall) whose thunk runs the site's flag and slot, as a code site's hook does, then calls the
method the slot held (a64_icall). Tests: the slot checked and named over a made-up image, a bad slot refused, the
thunk calling the method after the site.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
unsafe.md pointed at nx2/mod_sites.py, which this tree has not, and said code modules are built in and free space is
moved, neither true; manifest.md said a manifest mod's exefs/ is never applied; hooks.md had vslot sites as planned
and no section for a mod's own sites; game/README.md's Stand-ins said nothing of the build side was built. Each now
says what the code does, and what is still to come (code mods switched without a build, code modules, a table
checker, sites port).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A mod's exefs/subsdk0..9 was never loaded: six of nine public code mods ship one (spec 8.5). game_files::modules
ports nx2/exefs_modules.py: the module files of the mods that are on (a manifest mod's only under exefs with its code
accepted; its modules are now in its code's hash on both sides), each left out with why when it is not an NSO the
loader reads, is past 64 MB (128 MB in all), or holds a system call that makes or maps code memory (exlaunch-style
start-ups write branches into code the lift has no instructions of). A replacement main, sdk or rtld is never
loaded. The read stage appends the taken modules after the game's last module (named mod<n>.<file>), so the image
builder relocates and binds them, the lift translates them and image.c starts them after the game's. The game folder
gets exefs_modules.txt; the loader gives each row its modules' state (built in, waits for a build, left out with why)
and the Mods tab note says it. Tests: taken and left out, the code-writer refusal, the loader's three states.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
unsafe.md, using-mods.md, mods.md and game/README.md's Stand-ins said code modules are not loaded. They now say a
module is built in after the game's modules, which ones are left out and why, and that an exlaunch-style start-up run
at build time and switching code mods without a build are still to come.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
With no menu open, a click on one of the mods' windows went where any other
click goes: on Linux it captured the mouse for the camera, on Windows it went
to the game's menu, and the window never saw it. The C era's host kept the
windows' places (MKWVK_UI_RECT_MSG, which the renderer still posts) and
published such a click for the renderer alone.

The pointer test checks both hosts: on Windows a click published as the
mod window's reaches the renderer's mailbox and not the game's; on Linux a
click inside a posted window's place is published without a capture, one
outside it captures the mouse as before, and none once the windows are gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The renderer posts the mods' windows' places (MKWVK_UI_RECT_MSG, WM_APP + 13)
whenever they change, but neither host read them: with no menu open, a click
on a mod's window captured the mouse on Linux and reached the game's menu on
Windows, and the window never got it.

As the C era's host did: display_pointer.h keeps the places (HosUiRects, set
where the message arrives, read at a click), and a click inside one while no
menu has the mouse is published to the renderer's mailbox only (Windows:
mod_window_press, before the game's menus; SDL: before the capture).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
GameModPage's frame_ms and frame_avg_ms were always 0: the C block was made
from the loader's rows, which know nothing of the script engine. While the
Mods tab is read (game_mods_snapshot with reading 1), the runtime's acquire
phase now publishes each running script's last frame and running average
(script::ModStats) to mods_page, and the next block's pages carry them; a page
that is not running shows 0. A closed tab costs the runtime nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The game side's snapshot (game_mods_snapshot) carried a manifest mod's page and
the permission prompt, but the renderer drew only the list: a player could not
grant a permission, answer permissions.request or change a script mod's
setting in the game, and vk_modui.h named a draw_mod_page_view that did not
exist.

Ported from the C era's vk_menu.cpp (Longshot-mods-full-api), over the
snapshot's rows by id:
- the list: Left and Right switch a mod, Enter opens its page (picking a mod
  up moves to its page's Move in the list);
- a mod's page: its switch (Enter accepts a code's warning; Off for a mod
  running mods need is asked twice), its Permissions page (an optional one
  switched, asked twice to grant: game_mod_permission_set), its declared
  settings as the menu's own rows (game_mod_setting_set by the setting's id:
  toggle, choice, slider, number and text typed, color, keybind; Delete its
  default), the debug page's key, its own SettingsPage in the rows' place
  (modui_draw_settings), what it has, Start again, Move in the list, Debug;
  its help box shows the script's frame times;
- the permission prompt (page 6), over everything, answered by the player's
  own fresh presses only (prompt_keys, as the C era's: a quiet time, nothing
  held, a move never confirms), by the prompt's serial (game_mod_prompt_answer);
- menu_mod_keys and menu_mods_debug_closed answer vk_modui.cpp: a mod's bound
  keys close its window, and a debug page closed goes back to its mod's page;
  a debug page's key opens it in play.

tests/test_mods_menu.py drives the list and the page against a fake snapshot;
tests/test_mod_prompt_keys.py (the C era's) checks the prompt's keys.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The B9 fix made permissions.request absent and the prompt never queued while
no renderer drew it (Hosts::drawn, all false in longshot-game). The Mods tab
now draws the prompt and answers it (gpu/vk/vk_menu.cpp page 6,
game_mod_prompt_answer), so hosts::drawn says prompts: a switch-on, a start
that lacks a grant and permissions.request ask the player again. A mod's
shader passes and the world layer are still not drawn and stay absent.

longshot-game's test checks what its renderer draws and that has() follows
it; the B9 tests, which run over a host that draws nothing, say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Spec 11.5's <SettingRow id> was missing from longshot/ui: a custom
SettingsPage had to lay out its own rows from the input elements and keep
them in step with mod.json's settings by hand.

SettingRow is a component of the reconciler (runtime.js): it reads the
setting's description from the game (native.settings.spec(id), script::natives
setting_spec_json over the mod's manifest; the fake game's uiSettingSpec over
the same declarations) and its value with useSetting, and draws the input its
type takes, labelled: a Toggle, a Choice, a Slider, a Keybind, or a TextInput
that sets a number, a text or a color on Enter (a value that is not one of the
setting's leaves it as it was; a secret's value is never shown). An id
mod.json does not declare is UnknownNameError, as settings.get's.

Declared in longshot-ui.d.ts (and longshot.d.ts, ui-runtime.js made again by
schema-gen); the ui-cases example has a case and a test for it, and
natives.rs a test of the description of each type. ui.md shows it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/README.md's stand-ins said the permission prompt and a script mod's page
were not drawn, their frame times 0, and a click on a mod's window reached
the game; game/DESIGN.md said the same of section 9 and of the window's
thread. All three are built now. settings.md describes the page as this
tree draws it (Delete puts back a default, the cheats are on the list, Start
again and Move in the list, the frame times), and scripting.md the
Permissions page a mod's page opens.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A page just opened has its title at the selection's place until the next
key settles it on the first line that can be chosen (mods_tick); the check
read the selection before that. It presses Up once first, as it does on a
mod's own page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The renderer drew neither: gpu/vk/modui_world_off.cpp stood in for the
world layer (every World root over the picture, never tested against the
scene), the Insert menu's pass rows took only the CRT filter and colour
vision, so a mod's GAME_PASS_SHADER pass was never drawn, and nothing
called game_post_report. The C era's renderer half is brought back over
the game side's lists:

- Screen effects (vk_effects.cpp, fx_spirv.h, the fx shaders): the
  GAME_PASS_SHADER passes of game_post_passes taken when its generation
  moves (fx_list.h, their SPIR-V and params copied at once), checked
  against the template again, made pipelines and drawn before the upscale
  and after it; each one's state, GPU time and reason reported through
  game_post_report. A mod's page in the Mods tab lists its effects with a
  switch of the player's for the session, and its help gives their GPU
  time beside its script's.
- The world layer (vk_world_layer.cpp, vk_world_depth.cpp, the world
  shaders): game_world_draws copied into the renderer's primitives when
  its generation moves (world_list.h: a box its 12 edges, a circle its
  48 segments, a billboard's image copied once by an id the game side
  now gives it, GameWorldDraw.image_id), drawn on the gameplay upscale's
  picture with the scene's depth; the World roots tested at their point
  and drawn in the scene with occlude="depth" (the overlays' offscreen
  atlas in vk_imgui.cpp, the scene camera kept in vk_temporal.cpp).
- MkwVkHost version 55: game_post_report and game_world_draws, last, in
  host/rx_backend.c's table too. Switch rows RX_VK_FX, RX_VK_FX_BUDGET_US
  and RX_VK_WORLD.

With no mod's effect or shape, each poll compares one generation and the
dispatch path asks one relaxed load. Game-free tests: test_gfx_effects.py
(the template, fx_list.h, the wiring), test_gfx_world.py
(world_list_test.cpp, world_layer_test.cpp, the wiring),
test_world_depth.py (world_depth_test.cpp), and test_mods_menu.py's
effect lines; the MkwVkHost tail checks of test_broker_frame.py and
test_texture_pack.py take version 55's two members.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
hosts::drawn() said the renderer drew neither a mod's shader passes nor
the world layer, so gfx.effect, gfx.world and its members were absent
(has() false, NotAvailableError). The renderer draws both now
(gpu/vk/vk_effects.cpp, vk_world_layer.cpp), so Drawn says so, and the
test that held them absent holds them present.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A World root was mounted under ui.hud, as a label drawn over the picture
with the HUD. It is drawn in the scene now, tested against its depth, as
the world layer's shapes are: the spec's 11.6 gives it gfx.world. The UI
service's grants (UiGrants.world), its surface's permission, longshot/ui's
mount(), the fake game and longshot-mod's scan ask gfx.world; enemy-names
asks for it; the schema's notes and the generated files follow. A test
mounts a World root with ui.hud alone (refused, naming gfx.world) and with
gfx.world (taken).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/README.md's stand-ins and DESIGN.md said the world layer and the
effects were not in this tree; architecture.md's rule 5 named the
stand-in. They say what is true now, architecture.md has the rules of
both again (screen effects, the world layer), and the authors' docs
(gfx.md, world.md, ui.md, ui-channel.md) say the renderer draws them, not
yet seen in a game run, with the player's switch of an effect and a World
root's permission gfx.world.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
longshotCheckout and trustedCheckout told a checkout by its scripts/dev.py and host/modapi/. The mod API moved
to game/modapi/ with the game side's port to Rust, and host/modapi/ is gone, so no folder was a checkout any
more: `longshot-mod test --game` on a mod inside the checkout (or with LONGSHOT_CHECKOUT set) no longer went
through the checkout's dev.py, and longshotCheckout(HERE) returned null. The mod tools' tests 67 ("the game in
its test mode, or dev.py game-tests inside a checkout") failed on its assert that the checkout is found, and 68
(audit N12) on path.join(null) when it set LONGSHOT_CHECKOUT to that checkout.

The marker is now game/modapi/. Test 68's stranger repository makes an empty game/modapi/ in place of
host/modapi/, so it still looks like a checkout and the audit N12 case (a dev.py found by walking up is never
run) is still the one tested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The test that each library mod's committed mod.d.ts is what `longshot-mod types` writes now walked
assets/modding/examples/ and assets/modding/system/. The system mods moved to game/mods/, so the second
readdirSync threw ENOENT and the test (92) failed before checking anything.

It walks assets/modding/examples/ and game/mods/ now, and asserts the Discord system mod (game/mods/discord,
the system mod with exports) is among the libraries found, so a later move cannot drop the system mods
from the check without failing it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The game's test runner (game/modapi/testing/runner.js, copied for the fake game into lib/testing-runtime.js)
lists in FAKE_ONLY the FakeGame members a test may use only in the fake game, so that the real game refuses
them with FakeOnlyError. It still listed "native", the fake game's stand-in for native C mods, which was
removed with them (feat(mods)!: native C mods removed): FakeGame has no native member. The mod tools' test 63
("the fake game's helpers the real game refuses are the fake game's own") failed on it: "native is in the
runner's FAKE_ONLY but not a FakeGame member". The list was wrong, not the test.

"native" is out of FAKE_ONLY in runner.js, and lib/testing-runtime.js is written again from it by
cargo run -p schema-gen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Nothing ran assets/modding/packages/mod-tools/test/*.test.mjs: not tests/run_all.py, not a mise task, not the
Forgejo or CircleCI workflows. The C era's tests/test_mod_tools.py did, and the test files still say it runs
them, but it did not come over to this tree. So they broke unseen when the system mods moved to game/mods/,
the mod API to game/modapi/ and the native C mods went (four of 92 failing).

tests/test_mod_tools.py runs them with node --experimental-vm-modules --test and fails when node fails, any test
fails or is cancelled, none passed, or the Node is older than 22 (the package's engines). Node is PATH's (or
--node); with none it prints "SKIP: node not installed" and exits 0, the tests/ convention for a skip found at
run time. It declares no {tool} placeholder on purpose: run_all.py's --strict fails any check whose declared
tool is missing, and no CI image has Node yet. Its docstring says CI should install the Node release pinned in
the file (NODE_VERSION v24.22.3 and its NODE_SHA256, release.yml's) once CI's migration is done.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
longshot-mod test --game takes a checkout's dev.py game-tests for a mod inside the checkout its tools come
from (or with LONGSHOT_CHECKOUT naming one), as assets/modding/docs/testing.md, game/DESIGN.md and
HOS_MOD_TESTS_OUT's switch say, but this tree had no such command: the C era's scripts/devtools/gametests.py
did not come over. Once the checkout was found again (game/modapi/), that route ended in dev.py's "invalid
choice".

scripts/devtools/gametests.py is the C era's command fitted to this tree: the game's test mode is the Rust
side's (game/crates/longshot-game/src/mod_tests.rs; test files as game/crates/script/src/testing.rs
find_tests takes them: no .cts, four folders deep, no links), the bridge's start_session without the romfs it
no longer takes, and its start one job of the PC's queue in shared mode (dev.py queue run game-tests --mode
shared). Each run gets a folder of its own under the development folder's runs/game-tests/ for its reports
(HOS_MOD_TESTS_OUT), user folder and log; the shell's game switches are left out and said; the reports are
taken only whole and with the game's own exit code. The target is required: the C era's suite,
tests/game-features/, is not in this tree. A save that is not in assets/saves/ and a run folder too long for
HOS_MOD_TESTS_OUT are refused before anything starts.

tests/test_dev_game_tests.py (the C era's, ported) checks it game-free: the mods a target holds, the test
files, the plan, --dry-run, the refusals, the arguments longshot-mod passes, the queue job, and a run with the
bridge stood in for. The mod tools' game-test.test.mjs runs the checkout's dev.py with what gameCommand
builds plus --dry-run, and checks the choice of route: a system mod of the tools' own checkout goes through
its dev.py, a mod elsewhere runs the game, and a LONGSHOT_CHECKOUT that is no checkout runs the game.
docs/dev/developing.md and testing.md say how it runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The built-in registries (keybinds, hud, markers, commands) were lists mods
shared with nothing in the game reading them: no keybind conflicts, no command
palette, no marker layer, no way to move or hide a mod's HUD.

services/shared.rs is the engine's side of them:

- keybinds: every running mod's keybind settings (and its debug page's key),
  with the "keybinds" entries for keys bound another way, as one list; two
  that share a key (any case) or a chord (its buttons as a set, a setting's
  Switch labels read as PadButton's names) clash.
- commands: { id, label, help?, args? } entries, each argument a toggle, a
  choice, a number or text with a default. Services::command_run checks the player's
  arguments against the entry as the mod gave it now and delivers "command"
  to its mod at the next together step; longshot/mods' command(entry, run)
  adds the entry and hears it.
- hud: each mod's HUD roots by key (a <Hud id>, which Hud now takes with a
  title, else "#n" by mount order), labelled by the mod's "hud" entries; the
  player's place (another region, or hidden) is kept in the mod's store
  ($hudLayout, a host setting never on its page) and applied as the UI's
  snapshot is built.
- markers: { x, y?, z, map?, label?, color? } entries of running mods on this
  map, as world-layer shapes (a ring, a line up, the label), published with the
  mods' own shapes by gfx.rs; made again only when the entries or the map
  change.

The Mods tab's snapshot carries the view (TabSnapshot::shared), and its edits
run a command (Edit::Command) and move a HUD root (Edit::Hud). A malformed
entry stays in the registry and is left out of what the game resolves, counted.

Tests: chords, clashes, the strict reading of commands and markers, the HUD
layout's text; a command run reaches its mod once with its arguments; the
keybinds list and its clashes across two mods; the marker layer by map; a HUD
root moved and hidden in the snapshot and kept in the store.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The engine's view of Longshot's own registries reaches the menu: game.h's
GameModsSnapshot carries the bindings with their clashes (GameModKeybind), the
palette's commands and their arguments (GameModCommand, GameModCommandArg) and
the mods' HUD roots (GameModHudRoot), built by mods_page.rs from the loader's
TabSnapshot::shared.

The Mods tab's list has an "Across mods" part under the mods, each line a page:

- Keybinds: every running mod's keys and chords, a clash marked and named in
  the help; a keybind setting is rebound there as on its mod's page (its row's
  setting, game_mod_setting_set), an entry the mod binds itself is shown only.
- Commands: the palette, each command with its arguments under it (Left and
  Right choose a value); Enter runs it, sent as game_mod_setting_set's
  "$command" key with the arguments' JSON.
- HUD layout: each mod's HUD roots, Left and Right through its own place, the
  nine regions and hidden, sent as the "$hud" key.

The two keys go through game_mod_setting_set so MkwVkHost is unchanged; the
game side reads them as the Commands and HUD pages' edits (shared_edit). These
are the Mods tab's own lines, not the model's rows, and save nothing in
longshot_options.ini (a HUD root's place is kept in its mod's store).

tests/test_mods_menu.py walks the three pages against a fake snapshot; the
game side's tests check the C block and the edits' JSON.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Icon was the built-in vector set alone, so a tracker could not show the
game's item pictures (the Ship of Harkinian item tracker's case).

Icon takes `item`, an item's name ("Item_Bomb", a mod's new item's too). The
mod's image set reads it as a source of its own beside the mod's PNGs: on the
images' thread, the host's ItemIcons (longshot-game's textures.rs) reads the
file the game is served for UI/Tex/Icon/<item>.bntx.zs, takes its first plain
2D texture and has the renderer's decoder make level 0 RGBA8. The pixels go to
the UI snapshot alone (the renderer draws them in the Icon's square, tinted
only when the Icon gives a colour); no script sees them and nothing is kept or
written. An item with no icon, or one the decoder does not take, is drawn as
an empty place, said once in the log.

The image set's sources are now a file, an item's icon, or a thumbnail's src
(`capture:<n>`, for longshot/capture next, which fails until then), all under
its caps (64 images, 16 MiB). The types and the fake game take `item`, and the
Hud's `id` and `title` that the HUD layout page goes by.

Tests: an item's icon through a reader of made-up icons, one it has not, the
name's check, and an Icon's image in the snapshot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The enemy editor's thumbnails (spec 18) had no way in: longshot/capture was
named in spec 9's table and not built.

capture.toml: thumbnail({ rect?, size? }) gives a Thumbnail handle (src(),
state(), failure(), save(name), release()); load(name), saved() and
remove(name) give back the ones a mod kept. Permission ui.window. A handle has
no read: its src (capture:<n>) is what an <Image> (or a Canvas's image
command) shows, and only the mod's own src resolves.

The game side (services/capture.rs) lists each ask in the mods' UI snapshot,
version 11 (MkwVkUiSnapshot.captures: an id, the part of the picture as
fractions, the size 16 to 256 a side) until the renderer answers. The renderer
(vk_modui.cpp thumbs_tick, vk_replay.cpp thumb_ask) copies the part at the
present's point the control bridge's shots are taken from (the scene, no
overlay, no menu, no mod UI), blitted into a 256 x 256 image of its own, reads
it back once the GPU is past it and posts MKWVK_UI_EVENT_CAPTURED with the
RGBA8 rows (MKWVK_UI_VALUE_PIXELS), or none when it could not. longshot-game's
game_ui_post keeps such an answer apart from the mods' events (8 at most) and
the next frame's start takes it (capture_frame); an ask unanswered for 4 s
fails. The pixels stay with the service and the mod's image set (counted in
its caps). save() writes a PNG under <user>/modstore/captures/<mod>/, which no
mod's file API reads. MkwVkHost is unchanged; rx_backend.c's and ui.rs's
layout checks hold the snapshot's new size.

Caps: 16 thumbnails a mod, 4 pending; 64 saved. has("capture") is the host's.
The fake game takes a thumbnail at the frame after it was asked (or fails it,
game.captureFails) and keeps saved ones in game.thumbnailsSaved.

Tests: the ask's checks; a thumbnail asked in the snapshot, answered through
the sink, shown, released; one unanswered failing and the pending cap; one
saved to the game's folder and loaded again; the C block's captures and the
answer's checks; the image set's thumbnail source.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The guides said the engine's side of the built-in registries, the game's item
icons and longshot/capture were not built.

- mods-together.md: what the game does with keybinds, commands, hud and
  markers, each entry's shape, and command() of longshot/mods.
- input.md: two mods' keys that clash are shown and rebound on the Keybinds
  page.
- ui.md: <Icon item>, thumbnails of the picture (longshot/capture), and the
  player's HUD layout by a Hud's id and title.
- ui-channel.md: the image set's two new sources, Icon's item, and the
  snapshot's version 11 with the thumbnails' asks and answer.
- game/DESIGN.md: api::services::shared in the together step's section.
- game/README.md's Stand-ins: what the pages leave out (native mods' keybind
  settings, Longshot's own bindings, a text argument), the icon's path, the
  marker layer drawn only with the world layer, and that none of it has run in
  the game.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The builder and the game each find the player's mods their own way, but a
check that the game's build still matches the mods needs both to describe
them identically. The new crate mods-stamp (game/crates/mods-stamp, no
dependency but serde) takes the facts each side found (each mod's code files,
its code hash and acceptance, mods.json's order and switches, the build's
switch table) and makes the stamp: the mods whose code a build takes, the
parts it takes (sites on or off; patches when on or a switch; code modules
when on), in mods.json's order, with a hash of the canonical list and of the
accepted set. compare() says what needs a build: a mod added, removed or
changed, a move among the mods whose order matters (patches, code modules),
or the accepted set; switching a data-only switch or a sites mod, or moving
sites-only mods, is none. SHA-256 and hex move here from api::system (which
re-exports them) so both sides hash with one code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A build left no note of which mods' code it took, so nothing could tell,
before the game starts, that a mod added, changed, accepted or reordered
since needs an update. A build now writes the stamp (mods-stamp) into the
game folder's record as "mods" (absent in an earlier builder's record), made
by game_files::code_mods::stamp from the same mods folder, list, trust file
and switch table the build read. game_files::code_mods::current_stamp(game,
user, env) is the one call the builder makes before it starts the game:
mods_stamp::compare of the record's stamp with it says what needs an update
first. A package's code is its sites.toml alone, as the game hashes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The game side makes the stamp from its own scan (Loader::mods_stamp: each
manifest mod's code files and hash, each emulator-layout mod's ExeFS files and
code modules, the trust file, mods.json and the build's switch table), so the
two sides can be held to one answer. A test builds a mods folder on disk
(accepted and unaccepted manifest mods, a data-only switch, code patches with a
module, a files-only mod), and checks the game's stamp is the builder's
current_stamp, before and after switching mods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Turning on a mod with code patches or code modules, or accepting a mod's
code, in the Mods tab changes nothing until the game is built again, and the
menu's restart only started the same build again. The loader now names the
mods that are on and whose code waits for a build (Loader::rebuild_needed:
the existing waits-for-a-build state, ExeFS files not in the build's list, a
code module not taken), puts them in the tab's snapshot, and counts them in
the restart question's key, so accepting a mod's code asks for the restart
too. At the window's close for that restart the host asks
game_restart_via_builder (game.h): when such mods are waiting and the game
holds the channel of the builder that started it (#2286's
host/builder_channel), the game sends restart_to_apply over it
(bc_restart_to_apply) and the host exits normally with 0; the builder builds
the game and starts it again. With no channel the game starts itself again
as before, and the Mods tab says the code applies once the game is started
from the builder. Switching a data-only switch, a sites mod, files or scripts
needs no build and restarts as before. No exit status of its own: the
channel says it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The cheats of the mods that were on at the start (the cheats system mod's list) were all on the Mods
tab's list, under the mods, a heading each folder. A mod's things are on its page everywhere else, so
its cheats go there too: under Cheats, before About, switched as before.

The tab's row names the folder it brings cheats from (TabRow::cheats_folder, GameModRow.cheats_folder:
the name the cheats system mod lists them under), and the menu lists each cheat on the page of the row
that names its folder. A cheat whose folder has no row (none today: every folder with cheats/ is a
row) stays on the list. The row's detail says its cheats are on its page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The list gets lines of its own:

- Reload the map to see the change, first, while services::reload offers it (a rebuild changed files
  the map loaded): Enter calls MapReload::now, made at the next frame. Its offer was ready with no
  line to take it. The line stays to say how the last reload went (busy, or why it failed).
- Restart now, while the order or a switch waits for the next start: the restart question's own
  Restart now (everything saved, the window closed), so a mod whose code waits for a build goes
  through the builder (game_restart_exit, unchanged); the line says when a build comes first.
- Safe start, last: the next start loads no mods but Longshot's own, once, and the game restarts now.
  The ask is a file in the user folder (safe_start_once) that the next start's loader config takes
  (deletes), so it holds for that one start whatever starts the game again (the restart, the builder
  after a build, the player). In that start the line restarts the game with its mods; in a game
  started with HOS_NO_MODS, which a restart keeps, it only says so.

The snapshot carries the offer, whether this start is a Safe start (and whose) and how many mods wait
for a build (TabSnapshot::reload and ::safe_start, GameModsSnapshot.reload_*, .safe_start,
.nrebuild); game_mod_edit takes the two actions as ops 6 and 7 with no row (made at once on the
menu's thread: neither is the loader's edit).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
What the build did with a mod's code modules (exefs/subsdk*: built in, waiting for a build, or left
out and why) was run into the end of its note, after the list's and the ExeFS patches' notes. It is
now its page's Code modules line (TabRow::modules, GameModRow.modules: modules_note), between what
it has and its notes, and what it has counts its modules; the note no longer carries them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A TextInput on a mod's own settings page (a mounted SettingsPage, and a SettingRow of a text, number
or color setting, which is one) was drawn in the Mods tab but never typed there: Enter did nothing,
and only a window took typing. Enter on it now opens the menu's own field over it (modui_settings_text;
its text drawn in the TextInput's place, modui_settings_typing), and the field's Enter sends a change
and a submit to the mod as a window's Enter does (modui_settings_text_set). Text the field cannot
hold (past 63 characters, or not printable ASCII) is not cut short by an edit: the help says to type
it in the mod's window.

The menu's field types without a keyboard when it is given characters to cycle (the D-pad at the
caret, the shoulders add and remove one), as the Custom output size's is; a mod's text, number and
color rows and the settings page's field now have them, so a controller alone never meets a dead row.
In play, a window's TextInput takes a keyboard's typing alone: opened with the controller, its prompts
now say a keyboard types there instead of waiting for typing that cannot come.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Mods tab's Keybinds page showed the keybind settings of mods with a manifest's settings and the
registry's entries. Two kinds of key a mod can clash with were missing:

- A native system mod's keybind settings (the game's settings menu's rows, declared through
  Settings::declare_native): Settings::native_keybinds reads them, and Services::keybinds lists them
  with the mods' (shown only: the game's settings menu sets them), their clashes found with the rest.
  None declares one today; the next one is listed without more.
- Longshot's own keys, which the renderer alone knows: the menu's (Insert, F1, Esc, as the Menu
  shortcut row says) and the game's keyboard controls (the Controls page's). The page lists them
  under their own heading after the mods' keys, read only, each saying where it is set; a mod's key
  that is one of them is marked as a clash, and both helps name the other.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Commands page set a toggle, a choice and a number argument with Left and Right, but a text
argument kept its mod's default: the menu typed none. Enter on it now opens the menu's own field
(keyboard and controller alike, as a mod's text setting is), drawn in the argument's place; its
Enter keeps the text as the argument's value until the command runs, Esc puts it back. A default
the field cannot hold (past 63 characters, an escape other than a quote's or a backslash's, a byte
past printable ASCII) is kept, and the help says so, rather than cut short by an edit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The command palette was the Mods tab's Commands page alone: reaching a mod's command in play took
the menu, the Mods tab and its line. A key of its own now opens it over the game: the Controls tab's
Command palette key (key command_palette_key, frozen: None or F2 to F9, None by default so no key is
taken from the game or the mods unless the player picks one; gpu/vk/menu/menu_settings.cpp). Pressed
in play, the menu opens straight on the Commands page, and Back closes the menu there rather than
going up to the list. With no command offered the key does nothing. The key is listed with
Longshot's own on the Keybinds page, so a mod's key on it shows as a clash.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The undo is automatic, as game/DESIGN.md and the code have it: any stop of a mod (the player's
switch, its faults, a failed start, a reload) puts back its writes to the game's state that no save
holds, at the next frame's writes, each only where the game still has the mod's value; writes already
in a save stay, and a save loaded drops the unsaved entries. The modding guides described a player's
Undo line on the page instead (lifecycle.md, writes.md, actors.md, and respawn's lines in the schema:
actors.toml, types.toml, regenerated into reference.md and longshot.d.ts); they now say what the game
does.

The page of a mod that is off or stopped says what its stop did, on a Changes line: "Turned off: 12
changes undone, 3 kept (already saved)", with those left as the game has them and those that wait for
play. The journal keeps each mod's last stop's undo as far as it went (Counts::undone and ::left,
reset at the next stop and at a load); loader::tab::changes_text words it, TabRow's page carries it
(Page::changes, GameModRow.changes).

A new game-free test covers the stop around a save and a load: the saved write is not undone, one the
game changed since is left, the rest is put back, and writes a load dropped are never undone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A mod's ExeFS patches that write the game's code were translated as the
build found the mod, so turning such a mod on or off needed a build (the
Modding API spec's 8.4 says it should not). The lift now takes the
switches' table (LiftOptions::switches, the read stage's exefs_switch.txt:
for every byte a switch writes, the game's own and each switch's) and, for
every function holding a code word a switch writes, walks the function
again over each other state of its switches (cfg's Discovery::over and
walk_again: the plan's entries and jump tables known, the misses tried
again as the discovery does), growing its switches when a walk meets
another one's words. Each state is a version, f_<entry>__s<state>, lifted
from that state's words and tables beside the function in its unit
(Program::version); the function itself, lifted with every switch on,
starts with a test of its switches' bytes, hos_patch_on[n] (an element of
a host array: mir's Global::element), and tail calls the version of their
state when they are not all on (lift::switch::dispatch, mir's
Dest::Version). The places a version calls are entries: the game's own
words' calls where a switch writes, before the discovery, and any further
call a version's walk meets, the discovery done again with them (at most
three times).

The lift's key holds the switches' numbers and bytes, not which is on, so
flipping a switch keeps the lift; a function's key holds its switches and
each version's inputs. The cost is a switched function's versions: one more
function lifted and compiled per state (a function one switch changes, one
more). No switch, no change to the lift.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A function a switched mod's code changes is lifted for every state of its
switches and picks its version at its entry from hos_patch_on[n]. The game
defines that array (longshot-game's switches.rs, exported by name) and sets
each switch's byte, 1 while its mod is on at this start, with the switch
table's bytes, before the guest's first instruction.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The read stage made only mods of data switches; a mod with code was built
as the build found it, and switching it waited for a build. Now that the
lift translates a switched function for each state of its switches, the
read stage makes a switch of a mod with code too (game_files::switches::
plan), on or off, and gives the lift the switches' table. Not switched, and
built as before: a mod with code past the first eight in the list
(CODE_SWITCH_MAX: each costs the build its functions once more per state),
one with a code module (taken only while it is on, and its patches call
into it), one that writes one of main's import stubs (the lift sees a call
of a stub as one of its target, found in the image as every switch has
it), and one sharing a byte with a mod that is no switch (now until no
switch shares one with a mod left out for that). The game lists such a mod's
files as switched, so turning it on or off asks for a restart and no build
(Loader::rebuild_needed, and so the builder's Restart to apply); the stamp
already counted a switch as built whatever its state. Docs: the builder's
"Switching a code mod", mods.md, unsafe.md, using-mods.md, game/README.md.

Measured (this PC, the builder's own timings, shared store, fresh work folder each): no mod 53.3 s
(lift 4.9, compile 44.9, 2 of 888 units compiled); two code mods as switches changing 3 functions, one of them
by both (5 more versions lifted) 55.6 s (lift 5.1, compile 45.9, 3 of 888 units compiled): about +2 s, the
switched functions' units compiled again. The cap of 8 code switches stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A code module that writes the game's code at its start-up (exlaunch and the
like) is left out by the build with its reason, which the log and the Mods
tab's left-out line show. The spec's plan, running that start-up once at
build time in a confined AArch64 emulator, is deferred with no stand-in:
game/DESIGN.md's new Deferred section (revisit after #2286 and the new IR
settle), unsafe.md, using-mods.md and game_files::modules say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
`camera.override({ near })` sets the gameplay projection's near plane, 0.01 to 10 metres, so a view inside Link's
head does not draw the inside of his face. It is written at `camera.lens`, where x20 is the camera's
sead::PerspectiveProjection (the site's next instruction stores the angle at its +0xa0): the near plane at +0x98 and
the dirty byte at +0x8, which agree with the ratio at +0xb0 and the dirty store `wide.cameraRatio` already read. The
game's own near plane is kept and put back at the first update with none; a projection other than the one written
is never written back (its camera may be gone).

`has("camera.override.near")` follows `camera.lens` being placed; a rig giving `near` on a build without it is a
NotAvailableError, in the game and in the fake game. Read from the code, not yet seen in a run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
`camera.override({ drivePlayerFacing: true })` turns the game's own player camera with the mod's view, so the left
stick walks Link where the view looks and the game's camera is behind him when the override ends. At
`camera.update`, the player camera's update's entry, the core's callback now sets the camera's yaw (+0x1a4, the
field host/mouse_native.c turns, in oot::layout::camera) in place of the mouse look for that update: one of the two
turns it, never both. The mouse look starts again from the camera's own angles after an update it missed, instead
of putting back where the mouse had left them.

The view's yaw less the player camera's is not assumed: the view site compares the game's own view with the yaw the
camera had at its update and takes the nearest multiple of 90 degrees (within 20), so the rig drives the yaw once
the game has built one view of its own. Only while the camera is the view (its state 3 or 4, its angles a camera's).

`has("camera.override.drivePlayerFacing")` follows `camera.update` and `camera.view` being placed; a NotAvailableError
otherwise, in the game and in the fake game. Read from the code, not yet seen in a run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
`camera.override({ collide: true })` keeps the eye out of the walls between it and its pivot (Link at the offset's
height on a rig on Link, the target on a "target" rig in the world; another rig is an ArgumentError), 0.2 m in front
of what a ray from the pivot hits and at least 0.1 m from it.

The ray cannot be cast at the view site: the game's query takes the physics world's lock, which the step holds
while it waits on job batches (oot::rays). So the camera service asks one ray a frame through oot::rays, from the
pivot to the eye as the rig puts it and a clearance beyond, takes its answer the next frame as the rig's reach, and
the view site pulls the eye in along the line to the pivot within it. A wall is felt a frame or two after the eye
reaches it. A ray not cast in 4 frames is asked again; releasing the override cancels it.

`has("camera.override.collide")` is false while `world.ray` is (Preview: no run has shown the game's rays), like it
through the same casts; the fake game has it once a test gives a world to cast against (allowRay), and casts at once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
content::assets::gltf reads a .glb (its JSON and BIN chunks) or a .gltf (its buffers and images
beside it, or data: URIs) into one static mesh: the default scene's triangles with each node's
transform applied (normals by the inverse transpose, the winding turned round under a mirroring
node), each material's base colour (factor, PNG texture, alpha mode and cutoff). The file is a
mod's, untrusted: every offset, stride, count and index is checked with checked arithmetic and
every size capped (Limits: the world layer's 200,000 triangles, 64 MB), nothing panics on any
input (a test truncates and flips every byte of a GLB). Written on serde_json and the PNG decoder
the crate has rather than the gltf crate: no new dependency in the game binary, and no reader
whose accessor iteration trusts the file under panic=abort.

Not read: skins, animations, morph targets, the other PBR inputs, vertex colours, samplers; a JPEG
texture, a sparse accessor or a required extension is refused, saying so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A handle may be an async function's result (load.rs ASYNC_RESULTS), its resolver settling the
Promise with Value::Handle, which the engine already makes the handle's object (bind::to_js). For
gfx.model, whose Model is made off the game's thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
gfx.model(path) reads a mod's .glb/.gltf on a reader thread of its own (api::services::models,
over content::assets::gltf; files beside it in the mod's folder only, never through a link) and
settles with a Model handle once it is held; a mod's models hold at most 64 MB once read (charged
while a handle, a shape or a published list holds them) and 4 read at once. gfx.world.model(model,
at, options?) draws it as a WorldShape: yaw, pitch, roll, scale, a tint, occlusion and distances;
setRotation and setScale; follow(actor) moves and turns it with the actor. A mod's model shapes
draw at most 200,000 triangles. has("gfx.model") and has("gfx.world.model") follow Drawn.models.

The game side publishes the models as their own list with the shapes (game_world_models,
GameWorldModel and GameModelMesh in game.h; MkwVkHost version 56). The renderer copies and checks
each mesh once by its id (gpu/vk/world_models.h: every index, part and texture in range, a bad
mesh never drawn), uploads it once into a buffer and images, and draws the models before the
shapes in a pass of their own (draw_models; shaders/model.vert, model.frag): vertices pulled by
the index buffer, a depth image of the picture's size so the parts hide each other, opaque and
masked parts then blended ones, both sides lit by one light from above, each fragment tested
against the scene's depth as the shapes are. The mod tools' fake game checks a model's path and
that it is glTF 2.0.

Not done: skinning and animation, the other PBR inputs, JPEG textures, bone attachment, the
scene's sun direction (one fixed light), sorting blended parts. Not run in the game yet: the
checks a run must make are in assets/modding/docs/world.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
`camera.follow(view, actor)`, also `view.follow(actor)`, puts the override's eye on any actor in Link's place: its
feet plus the rig's offset, turned with its facing, worked out where the game builds its view, as `attach: "player"`
is on Link. An Actor is a handle, which an options record cannot hold, so it is a method of the override (the
camera namespace's, as `actors.attach` is the actors'), with its own feature `camera.follow`.

The view site reads the actor at the address the main thread published, checked as a game actor each time; the
main thread marks it gone once the actors' list drops it, and the game's view is drawn from then on. It returns
false for an actor the list does not have now.

A view on a bone goes through it: attach a hidden actor to the bone with `actors.attach` and follow that actor
(assets/modding/docs/camera.md has the recipe, for Link's "Head"). A rig's own bone, read at a site after the
skeleton's update with no frame of delay, stays a later improvement, and hiding a part of Link's model a leftover;
game/README.md records both.

`has("camera.follow")` follows the actors' list and the game's state; the fake game follows its listed actors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
#2286 moved the launcher profile's reader and writer to builder/crates/launcher-profile, which keeps profile.json's
"mods" as a key it does not read. The Mod API's part goes on top of it, in game/crates/profile-mods:

- ProfileMods on launcher_profile::Profile: "mods" read and written in its place (ModEntry: id, on, and the entry's
  other keys as written, the loader's "granted" and "version"); parse and read refuse a "mods" not of the format
  (an array of objects, each one "id" string and at most one "on" boolean).
- The folder's trust.json (the game's rule for a profile.json's trust file) and mods/, read_trust.
- expand: the switches a profile stands for that are the game's to set, HOS_MODS_LIST (profile.json) and HOS_MODS
  (mods/), an explicit one winning; the settings, saves and start slot are the host's (host/longshot_profile.h).
- stamp: the mods' stamp (mods-stamp) of the code mods found in the profile's mods/ with its order, switches and
  trust.
- build_driver::play::mods_stamp, #2286's extension point, filled: the profile's code mods (game_files::code_mods::found,
  split out of stamp) stamped by profile_mods::stamp name its build folder (builds/<the list's hash, 16 hex>), none
  when no mod's code is taken.
- The build's mods are the profile's alone (#2286's one mod format, BuildOptions::profile): game_files::code_mods reads
  the profile's mods/, its profile.json's order and switches and its trust.json (no game-folder list, no --user, no
  package or emulator-layout mod), and build_driver::read::manifest_mods fills patches::collect with the accepted
  manifest mods' exefs/ (exefs_mods); the code modules, the sites (modsites::collect) and the record's stamp follow
  the same list. mods_stamp takes the profile alone.

Tests: profile-mods' own (the mods read, written in place with the rest kept, refused when not of the format, the
switches, the stamp from the profile's list and trust), play's a_profiles_code_mods_name_its_build, read's manifest_mods, code_mods' order and
exefs gate on a profile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A launcher profile's list of mods is its profile.json (HOS_MODS_LIST names it): the same list as mods.json, but each
mod's switch is "on", and the file is more than the list (its name, its game, its upscalers, the launcher's and the
builder's keys). The loader read and wrote only "enabled", and wrote "mods" first whatever the file's order, so a
switch on the Mods tab would have written "enabled" beside the launcher's "on" and moved the profile's keys.

ModsList now takes the switch's key (SwitchKey: "on" for a file named profile.json, profile_mods::FILE) and
keeps "mods" where the file has it among the other keys (mods.json too); a profile's file without "mods" gets it
after its keys. A profile's file that is not a list is never put aside as .bad (it is the launcher's): the change is
kept unsaved, and the log says so. The trust file's rule (trust::path) gives a
profile.json trust.json beside it (on Windows in any case); every other list keeps <stem>-trust.json.

Tests: a profile's list read and written (on, the keys in place, "enabled" no switch of a profile's), mods.json's
"mods" kept in its place, the Mods tab's switch written into profile.json as "on" with every other key kept, and a
profile's file that is no list left as it is. trust::path's place for a profile.json.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The builder starts the game with the profile's folder (LONGSHOT_PROFILE), and #2286's host takes its settings.ini,
saves/ and start_slot from it (host/longshot_profile.h). The mods are the game side's: at game_start_args, before the
sandbox and the loader look, the game sets the switches the profile stands for (game/crates/longshot-game/src/
profile.rs over profile_mods::expand): HOS_MODS_LIST its profile.json, HOS_MODS its mods/; one the environment set
already wins, and the start's standard error says what was set. The host chooses the settings file and the save folder
before the sandbox too, so the sandbox grants exactly the profile's mods/ (read), saves/ (its save tree), settings.ini
and profile.json (in place) and trust.json (read), and nothing else of the folder. The sandboxes' trust_path_of
(host/sandbox_linux.c, host/sandbox_windows.c) follow the game's rule for that trust file: a profile.json's is
trust.json beside it (on Windows in any case).

Tests: the expansion through the host's switches (an explicit one kept, the host's three left alone), and
tests/test_sandbox_profile.py: the switches the game sets are the ones the sandbox reads, the settings file's and the
save folder's choices take the profile's from longshot_profile.h and come before the sandbox, which grants what they
chose, and Linux's and Windows' plans over a profile grant exactly its parts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The cheats' switches moved from mods.json's "cheats" to the cheats mod's global storage (the same keys), and the
loader only kept the old object as written: a player's cheats switched on in an older build started off. A launcher
profile has no "cheats" at all.

The loader hands the list's older switches to the services at its start (each key once, its last switch; a value
that is no switch left out), the native API gives them to a system mod (ModApi::legacy_cheats), and the cheats mod
takes each key its storage has not got yet (cheats::carry_legacy: a switch set since is the player's and wins), with
a log line. The list is left as it is, for an older build.

Tests: the loader's hand-over of an older list's cheats, and carry_legacy's once-only take.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
docs/dev/reference/profiles.md, #2286's contract for the launcher, the builder and the game, gets the Mod API's part:
the folder's trust.json, mods/ and saves/modstore/; profile.json's "mods" (its order, "on", the loader's keys, the
rules a list must keep); the trust file's rule; the mods' switches the game sets from LONGSHOT_PROFILE (HOS_MODS_LIST,
HOS_MODS); the sandbox's grants; the build's mods stamp (play::mods_stamp over profile_mods::stamp); and the cheats.

The pages it touches say the same: mods.md (a profile's list, its "on", HOS_MODS; the cheats' switches the cheats
mod's own), sandbox.md (a profile's grants, its trust file), saves.md (a mod's own save folder), switches.md
(LONGSHOT_PROFILE's mods), builder.md (features=), using-mods.md, game/README.md and DESIGN.md (the profile-mods crate).

"Profile" now means the launcher's alone: what spec 9.6 calls a save profile is "a mod's own save folder" in the
storage guide, saves.md and the schema's texts (storage.saves, SaveProfile; the API keeps its names), and
storage.profile is the launcher profile's list. The schema's outputs are generated again (schema-gen).

game/DESIGN.md's Deferred: a game→launcher action (open Mods) is a separate design, later; the game knows no launcher.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The contract for the settings menu as a system mod: the renderer declares every row of its Insert menu as data
(MkwVkSettingDecl: key, page, section, kind, label, help, range, default, choices, opens, verb, widget, flags, in
the menu's order) and keeps each row's effect; a row's state (value, shown, fixed, text, hint, locked) and its
set, press and typed text go by key, in the shape of game.h's game_setting_* the other way round. The host wraps
them as rx_setting_*, the game side reads them through host_sys::renderer_settings (with a stand-in renderer for
game-free tests). Version 57: 56 is another branch's. docs/dev/reference/settings-declarations.md is the contract,
for a Rust renderer to implement the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
gpu/vk/vk_menu.cpp's decl_build walks the rows as drawn (row_order of every tab and page, the core's own and every
module's, the game's rows among them) and makes each one a declaration: its key as the options file holds it, its
kind (a debug tool's row CUSTOM debug_tool, Custom output size TEXT, the Controls row a LINK to its page, whose grid
is the CUSTOM bindings row), its texts translated, its default from a fresh Options, its flags from its setting.
Built again when the menu's language changes. A state, a value's text and a set (menu_setting_set, as the control
bridge's) answer by key under the menu's lock; a press and a typed text wait for menu_tick, the menu's own thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/settings reads the renderer's declarations when their generation moves on, and the rows of the page
shown while the Insert menu is open, and draws them as one tree of the generic elements: Tabs, a Section a heading,
a Toggle, Choice, Slider, Button, TextInput or Text a row, focusKey the row's key (view::build). A slider whose texts
are its number and a unit is a Slider with that unit; one with texts of its own a Choice of them. A link opens its
page under a Back button; a button that asks again is armed by its first press. The player's changes go back by key
(set, press, text). A native mod hears its UI through ModApi::ui_take_events (the events of a mod with no onEvents,
kept for it). It is mounted as its own settings page, beside the menu that still draws the rows itself.

tests/test_settings_decls.py makes the menu as built (tests/menu_model_fixture.py) the declarations list
game/mods/settings/tests/menu_rows.tsv, as decl_build does, and checks FROZEN's renderer keys are declared; the
mod's test draws that list whole, every row and heading of every tab and page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A handle whose release is one of its own methods (a camera override, pause, pointer capture, effect, model, world
shape, sound, duck, thumbnail, action) never got [Symbol.dispose], so `using` threw "not a function" in the game.
Its release is now its dispose too, as a namespace's release is; a test checks every such handle of the schema.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
With HOS_HEADLESS on Linux the menu's Restart now (the Mods tab's too) and Quit did nothing: the menu posted only to a
window, and the main thread waited on the game's thread without looking at the asks. The menu now posts either way
and the windowless main thread takes Restart now and Quit as a window's loop does, so a scripted run can restart over
the builder's channel (restart_to_apply) or quit from the menu.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
longshot-builder play --safe-start (the launcher's Safe start) sets LONGSHOT_SAFE_START=1 for one start. The game reads
it at its loader config: no player mods start that run, system mods still do, and the Mods tab's last line says
"Started without mods (safe start)". The old ask, a safe_start_once file in the user folder, goes: the user folder is
not the profile, so the builder never saw it. The tab's line now only says how to ask for one. Its switches.def row,
docs and a game-free test of the variable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The loader reads mods only from LONGSHOT_PROFILE: its profile.json is the one list ("on"), its trust.json the one
trust file, its mods/ the manual mods ({id, path: "mods/<name>", on}). A source mod ({id, version, hash, on}) is
read through loader::source's ModStore/ModFiles, which the modtool's mod-store implements later; this build has
NoStore, so one is logged as not readable yet and its entry kept. LONGSHOT_DEV_MODS (mod run, and now the test
mode's tested mods) adds development mods, never written into the list. No profile: the system mods alone.

Gone: HOS_MODS, HOS_MODS_LIST, HOS_MOD_TESTS_ONLY, HOS_MOD_TESTS_PLAYER_LIST (GONE rows), mods.json and its
"enabled", <stem>-trust.json and the game folder's user/ trust rule, the carry of mods.json into the user folder,
modcache/mods_json.txt, longshot-game's profile.rs and profile_mods::expand. The sandboxes (Linux, Windows) and the
broker take the list, trust file, mods/ and the development mods from the same variables.

Hot reload follows the profile: <profile>/mods/ and profile.json by notices, LONGSHOT_DEV_MODS folders walked
(scripts, served files, shape). A profile.json change applies its switches while the game runs (the Mods tab's own
write changes nothing, so it logs nothing); a code change re-checks the mods' code against the build (Restart to
apply). The builder channel's profile_changed is not read: the game side has no event reader.

Also: the Mods tab's Has row lists what a mod has (script, hook sites, ExeFS patches, code modules, RomFS files,
patches/, textures, content module), the code warning names what the mod brings and drops Rebuild for mods, and a
confined game with no builder channel sends the player to the launcher or Longshot.exe mod to accept code (a
trust_request hook is left for the channel's request_trust). mod-tools' mod run plays <game>/dev as a profile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
storage.save data has one store, <saves>/modstore/save/<uid>/slot_NN/. A mod's separate saves keep their game saves
in their own tree (save/.profiles/<p>), unchanged; their mods' data is slot_NN/.profiles/<p>/ of the one store
(StorageConfig::save_profile), never <p>/modstore. Data an older Longshot kept there is moved once at the start that
plays the profile (api::profiles::move_mod_saves: written, checked, then deleted; never over a file the store has).

Also: build-driver's verify no longer treats mods.json as the player's; docs for portal mods as source mods, the
profile's mods folder, and five dead anchors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
How the camera API works in the game, linked from the modding docs but missing: the view read at the view and lens sites through the shared records, an override and its rig (near plane, driving the player facing beside the native mouse look, colliding by rays), what is not yet there (a bone rig, hiding Link's head), and the pause manager and the 2D layer behind game.pause and hideGameHud.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Linked from the modding docs and the code but missing: the rays cast on the physics step and their slots, travel and the age switch through the one map-change queue, the world's state by name, the shapes and models handed to the renderer, and the actors' places these follow; what a game run must confirm of the rays and the states.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
content.md and items.md linked docs/dev/game-tests.md, which does not exist: they point at developing.md's section on a mod's own tests in the game. tools.md named four Python checks of which only test_mod_tools.py exists: it names the Rust tests that check longshot mod now, and says sites port cannot run yet (its nx2 script went with the Python lift).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Linked from the modding docs and the code but never written: the actor list and its fields, writes, bombs, answers, attaching, spawning and the rules' hooks; the packs and scripted components; the trees' changes, new nodes and calls into a mod. With the anchors the links use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Linked from the modding docs but never written: placements, shops, bottles and rupee gains; the merged data and new flags; the asset formats and the glTF state (no BFRES conversion yet). With the anchors the links use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Linked from the modding docs and the code but never written: the map, save, flag and pause events, textShown and the three read fields; the audio threads, sounds, streams and groups; the input frame, actions and rumble. With the anchors the links use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The help said "Windows' volume" on Linux too. On Windows it still does; elsewhere it says the system's volume, translated
into every language of gpu/vk/menu_i18n.h.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The user's rule for the settings' contract: no CUSTOM kind. MKWVK_SETTING_CUSTOM (and its widget) goes:

- The Controls page's grid is a BINDING for each control (bind_<name>, under the bindings heading): its state's value
  says it is at its defaults, its text names its two gamepad inputs, two keys and toggle; renderer_setting_set(key,
  MKWVK_BIND(slot, code)) binds one input, taking it from the control that had it; a press puts its defaults back.
  Reset to defaults is a BUTTON.
- The Debug tools' panel's 12 rows are TOGGLEs, CHOICEs, BUTTONs and LINKs, set and pressed by key; their presses go to
  game_cheat_action as the panel's do. A CHOICE's verb is a press acting on the value chosen (Set time, Change
  quantity). Teleport and Inventory are pages of their own: a BUTTON for each place, a TOGGLE or SLIDER for each item.
- A declaration's confirm is the question asked before a press acts or a toggle is turned on (Restart, Quit, Debug
  tools, the resets): the CONFIRM flag goes (menu::Setting.confirm is the question now, translated).

The Settings mod draws a binding as a line of Choices, Keybinds, a Toggle and Reset, a choice's verb as a button beside
it, and a question as a dialog in the page's stead. tests/test_settings_decls.py makes the new rows (and fails on a
CUSTOM one); menu_rows.tsv made again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Setting a BINDING to an input another control uses no longer takes it silently. renderer_setting_text(key, value |
MKWVK_BIND_ASK) is the question ("F7 is used by Jump.", translated; "" when no other control uses it); a set of such
an input returns -3 and changes nothing, and value | MKWVK_BIND_SWAP is the player's Swap: each control that used the
input gets the slot's old input in its place. The host's rebind_control learns three flags for it: HOS_REBIND_PROBE
(report the conflicts only), HOS_REBIND_SWAP and HOS_REBIND_ONE_KEY (a key binds that slot alone, where the Controls
grid's one key cell clears the second).

The Settings mod asks the question as a dialog, Swap chosen first, Cancel beside it (sysmod-settings'
a_binding_asks_before_it_takes_another_controls_input); tests/test_settings_decls.py checks the flags are the same bits
on both sides and that binding_take takes an input in use only with Swap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A setting's declaration was the place of its row only while Game settings was off: the mod's LAYOUT table put its own in
its stead. Now the declaration is the place. The rows keep today's places on screen, so the menu looks the same:
widescreen's rows are in the Screen section (its declaration said the tab's top), Damage taken and the cheat rows sit
after Debug tools and Heart protection at the tab's top with LAYOUT's orders (theirs said Player and Camera & world).

- game/mods/game-settings goes, and with it the settings service's layout hook (ModApi::menu_layout, set_layout) and
  longshot-game's startup lay_out.
- A system mod's mod.json setting may say its "place" (tab, section, after or before, order), as a native one's
  SettingDecl section does; a player's mod naming it is refused (assets/modding/docs/settings.md).
- game/crates/longshot-game/tests/menu_places.tsv is LAYOUT's places, and longshot-game's
  every_system_mods_row_keeps_its_place checks each declaration against it (tab, section, order, anchor, owner);
  tests/test_menu_ini_keys.py and tests/test_recomplauncher_json.py read it in LAYOUT's stead.

Discord's discord_status keeps its line in the table as its mod.json's legacySwitch: no row of the menu draws it today.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The mods' UI had no way to keep a chosen line of a long column in view: a Scroll scrolled with the wheel and the focus
of a window, and a settings page (the Mods tab's area, soon the Insert menu's body) did not scroll inside at all, so a
line the keys reached below the area's end stayed off it.

- A Scroll takes `selected` (a child's index, MKWVK_UI_FLAG_HAS_SELECTED as Tabs' and List's): the renderer scrolls
  it the least that shows that child whole each time it changes, the wheel free between (vk_modui.cpp).
- modui_draw_settings lets the page's Scrolls and Lists scroll and its uncontrolled Tabs switch, as a window's, and
  keeps the focused control in view: its Scroll moved, else the page's own scroll, now in and out (*scroll).
- modui::reveal_delta is the one rule for both and for a window's focus.

tests/test_modui_scroll.py compiles modui_layout.cpp with a Scroll of 30 rows whose 21st is past the view's end and
checks it is brought in; api's a_scroll_takes_the_child_it_keeps_in_view checks the prop. ui.md, ui-channel.md and the
types say it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The user's decision: Discord's discord_status is no row of the Insert menu and has no place. It was in
menu_places.tsv as the mod's legacySwitch though no row drew it; the line goes, and tests/test_menu_ini_keys.py keeps
the retired key from the system mods' manifests' legacySwitch instead, so FROZEN is unchanged. game/mods/discord's
README.md says so beside its manifest (a manifest holds no note), as do system-mods.md and architecture.md, whose list
of the game's rows named Discord status.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
system/mods-tab (longshot-game's mods_tab: it reads the loader's tab, which lives there) draws the Mods tab with the
generic elements, mounted in a slot the Settings mod puts in its Mods tab's body. Its texts are today's: the old
drawing's (vk_menu.cpp draw_mods) and the loader's (detail, note, state, warning, the Changes line).

- The list: Reload the map, Restart now (Build, then start with the builder's channel), each mod a line (its name
  opens its page, a Toggle its switch), Across mods (Keybinds, Commands, HUD layout), Safe start (the builder's: said, nothing to press); a mod picked up from
  its page moves with Move up and Move down until Put down.
- A mod's page: its switch (Off for a mod running mods need asked once, naming them), its code's warning and Accept,
  Permissions, its settings as inputs, About (Version, State, Changes, Has, Code modules, Notes), Start again, Move in
  the list. Back (@back, focused first) goes up a page to the line that opened it.
- Its edits are the loader's by id, the reload of the map and Restart now (the menu's restart row). A code mod the confined game cannot accept has its warning (the loader's) and no Accept.
- Another page joins as a view::Extra (ModsTab::add_page): a line on the list, its own nodes and events. The
  modtool's Get mods is meant to be one.

Its lines reach past the area: the settings page keeps the focused one in view (the commit before). Not on it yet: a
folder's cheats, screen effects, a mod's own settings and debug pages, a command's arguments, a key rebound on the
Keybinds page, the permission prompt. mods_tab's tests and the Settings mod's
the_mods_tab_is_a_slot_the_mods_tab_mod_fills check it; settings-declarations.md and game/README.md say it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Debug tab's Menu drawn by mods row (menu_mod_ui, off by default, a module of its own: gpu/vk/menu/mod_ui_menu.cpp,
its key in FROZEN) makes the menu draw the Settings system mod's tree as its body, the Mods tab mod's in its Mods tab,
instead of its own tabs and rows, so the two drawings can be compared in the game before the old one goes. Nothing of
the old drawing is removed; the restart and close posts are untouched.

The menu keeps its frame (the banner without its tab strip, opening and closing, the help box, the prompts) and gives
the tree its keys (menu_host_draw, menu_host_tick): Up, Down, Left, Right and Enter as on a mod's settings page, a
TextInput typed in the menu's field, the tab keys to the page's Tabs (modui_settings_tab), Back to its @no or @back
control (modui_settings_back), else the menu closes; the help box shows the focused control's help
(modui_settings_help). The page keeps the focused control in view. The row is in the hosted tree's Debug tab too.

settings-declarations.md, architecture.md, ui-channel.md and game/README.md say it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Main's #2452 (game/oot_heap_retry.c, game/oot_sites.c) came in beside this stack, which had moved that C to
game/crates/oot. Ported to the Rust: the five more CPU allocations of a material block's build (heap.objectAlloc,
heap.objectBuffer, heap.objectBufferOther, heap.blockBuffer, heap.blockObject, each reading the heaps' holder where
its function keeps it), the hand-over of the rest of a build to the parent that had room (HOS_GPU_ALLOC_REST) with
f_804566e0's two free-size reads given the build's own heap (heap.restOwn, heap.restEnd), the third count of
HOS_GPU_ALLOC_TEST_FAIL and HOS_GPU_ALLOC_TEST_FILL. The sites, their locations and switches.def's rows came with
main; the game-free tests are the module's own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Main's #1841 (game/hos_wide_ui.c's title strips, tests/test_title_card_reveal.py and test_title_card_strips.py) came
in beside this stack, which had moved that C to the Widescreen system mod (game/mods/widescreen). Ported there, on the
pause background's own way of packing and drawing a picture in pieces: at ui.pictureConstants each of the area card's
eight frame quarters is packed three times, a strip each (the ornaments at their own size, the plain line between
drawn to reach the picture's side, every texture's and generated coordinate set's cut composed in so the reveal runs
on); the drawer keeps the first strip's pack and the other two are drawn before it at ui.pictureDraw. The plan names
the quarters (Rule::TitleFrameLeft, TitleFrameRight), leaves them unwidened across on a wider screen and publishes how
far the frame reaches (Shape::title_ex: the whole extra half width above 16:9, the HUD's move below, 0 at Middle 16:9).
A record or material the guards do not know is drawn as the game packed it.

On main the strips had lost their hooks in the builder's rewrite (no site or patch called hos_wide_title_prepare,
_draw or _reset); here they need none of their own. The two Python tests compiled the deleted C and go; the module's
Rust tests stand in for them (the strips' geometry and mirroring, short and long widths, the record's cut and the
generated coordinates meeting at the joins, the guards, the slots) and panes.rs's for the plan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
api::system::tree_hash hashes through mods_stamp::tree_hash, which the mod tools' content hash uses too: one hash of a
folder's files for a system mod, a store entry and a repo's release.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A crate for every mod tool in the builder: run(args, cx) is what the builder's mod command calls, with its context
(BuilderCx: the profile, the game input, the version folder, the cache, the output mode, the play path and the
confirmation window). The commands are stubs but format; a mod's shipped files and its content hash are shared; the
mod operations (ops) are defined once for the CLI and the builder's channel (modhook::serve).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs/dev/reference/mod-ops.md: every operation the builder's modtool answers (sources, browsing, the store and the
profile, trust), its arguments, result and errors; the three front ends (the builder's channel, mod serve, the
command line) on one dispatcher; what the game may not do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
modtool runs the game's crates on host-sys's fake host (and oot's and game-sites'), and oxc_resolver turns on
serde_json's preserve_order. One cargo invocation unifies features, so clippy and cargo test over the whole workspace
would compile the game's real host paths out of the checks. ci.yml and mise.toml's rust task now check the workspace
without modtool, then modtool alone; tests/test_game_features.py fails if the game's own build (longshot-rs) ever
gets fake, preserve_order or modtool.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A new crate low in the graph (the game's api and the builder's modtool both
depend on it; it depends on neither api nor script), and blobstore, the blob
layer under it, shared with the builder.

- blobstore (builder/crates/blobstore): files kept once by their SHA-256 at
  blobs/<h[..2]>/<h>, put through a temporary file beside them (hashed while
  written, flushed, checked against an expected hash, renamed with
  build_core::fsx), never changed, read with a size cap and re-hashed only on
  verify; listed and removed for a collection.
- mod-store: <cache>/mods/versions/<id>/<version>.json, one record per
  installed version (its source, its content hash, the trust hash, path ->
  size and blob for every file, installed and last used), written last and
  whole. Put from bytes, files or an opened .lsmod, refusing another content
  hash than the release's; remove, touch, keep; check_pin says what a pin
  lacks (no record, another hash, missing blobs) so modtool fetches it again.
  The collection removes versions no profile pins, keeping each mod's last
  used loose version for 14 days and versions the player keeps, then blobs
  no record names (never one written in the last hour).
- ModFiles: one mod's files read the same way over a record (RecordFiles), a
  folder (FolderFiles: a dev mod, a manual mod in the profile's mods/) or a
  package (PackageFiles: a manual .lsmod), every path checked by the
  archives' rules.

content gains check_file_name (the archive's name rules for one file's path)
and mods-stamp tree_hash_of_digests (the tree hash from each file's SHA-256,
for a store that hashed each file as it wrote it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`mod show <id>[@version]` says a version of the store (without a version,
the one installed last): its files with their sizes and blobs, its source,
content hash, install and last-use dates, blobs missing from a cleared
cache, and the mod's other versions; `--output json` gives the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs/dev/reference/mod-store.md: where sources' mods (the builder's cache)
and manual mods (the profile's mods/) are, the record's format with an
example, ModFiles and its three implementations, what a pin lacks, the
writes, the collection's rules, and what the game's sandbox must add.
mod-ops.md links it and gives store_gc's dry_run and result; the
builder's layout module lists <cache>/mods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The code files a folder mod's acceptance is of (its sites.toml, and with exefs its ExeFS patches and code modules)
are read by api::loader::folder_code_files, which the loader's own code status now calls, and api::loader::is_code_file
says the same rule for a reader that has a mod's file list rather than a folder (the mod store's records, modtool's
walk). Longshot.exe mod's request_trust hashes the same files, so the hash it records is the one the loader compares.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
profile.rs: profile.json's "mods" (each {id, on} with a source's version and content hash, or a manual mod's
path in the profile's mods/; every other key kept as written, in its place), read strictly and written whole
(profile.json.new moved over); add, move and remove a pin, a new order with switches; trust.json beside it in the
loader's trust format, written in place through api::loader::trust; a mod's files (a manual one's folder or .lsmod,
a source one's from the store: a hook for the store crate), its manifest, content hash and code hash; every known
profile's source pins for the store's clean-up. The edit lock is one function, a minimal stand-in of #2286's
launcher_profile::edit_lock until that crate is here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A profile's mod's files are mod-store's: a source mod's release through its store record (the pin's version and
content hash checked with Store::check_pin; a release not held whole is not_found, to install again), a manual mod's
folder (its shipped files) or .lsmod in the profile's mods/ read in place. Its manifest, code files (by the loader's
rule, a store file read against its blob's hash) and content hash come from them, and resolve sees every release the
store holds. The source shown in the trust window is the store record's URL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
modhook: Request (id, op, args and the cancel flag the builder sets), serve for the game's channel and perform for
every front end, a Task for the handlers (progress, profile_changed, check for cancel), unknown_op, bad_args and an
args cap; done ends every request. set_mods: a new order with switches, strict (an id not in the profile, twice, or
left out refused; only on set; granted and trust never touched), under the edit lock, profile_changed with
code_changed. request_trust: the builder's window with the mod's facts; on Accept the code hash and the required
unsafe grants written to trust.json as the loader reads them, after the files are read again under the lock; on
Decline nothing. resolve: the loader's own resolver over the store's and the profile's mods. mod serve: the same JSON
lines over stdin and stdout for a launcher, one request at a time, a pending cap (busy), cancel, a 1 MiB line cap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
CURL, CURL_SAFE and downloader move from build-driver's runtimes.rs into build_core::curl, so modtool's mod
sources download with the same curl and the same options as the runtimes and the tools' store (no .curlrc, HTTPS
alone and on every redirect, a stalled download given up) without modtool depending on build-driver. runtimes.rs
re-exports them; nothing else changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The source, browse and store ops of docs/dev/reference/mod-ops.md, one implementation for the game's channel, the
launcher and the command line (service.rs, through modhook::perform):

- net.rs, the one module that touches the network: HTTPS downloads with the system's curl (build_core::curl),
  capped in bytes, with progress and cancel; git's refs (ls-remote) and a shallow fetch of one commit with the git
  command (no prompt, no hooks, no links, https and ssh only). A FakeNet serves URLs and git trees in memory for
  the tests.
- repo.rs: longshot-repo.json v1 read strictly (unknown keys refused at every level, https URLs, content hashes,
  ids and versions as the manifest reader takes them) and its .sig, Ed25519 over the file's bytes in base64,
  verified with the key accepted when the repo was added (ed25519-dalek, verify_strict). A changed key is
  key_changed until source_add is sent again with accept_key. OUR_REPO is None: there is no key of ours yet.
- sources.rs: a source is a git URL (a repo with longshot-repo.json at its root, or a single mod with mod.json at its
  root or at ?path=/--path), an https longshot-repo.json, or an https .lsmod. The kind is found and shown;
  source_add adds only with yes. A single git mod's releases are its tags (v1.2.0, or the manifest's version at
  that commit), and with follow_branch its default branch's newest commit as a pre-release; their content hashes
  are computed here. An .lsmod is one release, a new one when its content changes. Kept per PC under the cache:
  <cache>/mods/sources.json in the player's order, each source's listing beside it.
- install/update fetch a release from git or its files (mirrors in turn), check our content hash before anything is
  kept (hash_mismatch otherwise), put it in mod-store and pin it in the profile (profile::edit, under the edit
  lock); ensure fetches a pinned version again by hash after the cache was cleared, and says the newest release when
  the source no longer has it. remove (all_profiles from the CLI), add_file (into the profile's own mods/),
  store_gc (mod-store's gc over every known profile's pins; also after an update).
- search (text, tags, sort, pages; one entry per id, the player's source order deciding, the clash listed),
  details (releases, readme, licences, vendored packages from vendor/vendor.json), installed and check_updates.
  Icons and screenshots are downloaded into <cache>/mods/media, PNG or JPEG only, capped in bytes and pixels
  (media.rs); the game is given local paths.
- import.rs: an emulator-layout mod (romfs/, exefs/, cheats/ and no mod.json) converted once into a manifest mod in
  the profile's mods/local~<slug>/, id local/<slug>, its mod.json made (exefs asked for when it has patches); its
  cheats are left out, since a manifest mod's are not run.
- The game may not add, remove or order sources, add a file, import, collect the store, read another profile or
  remove from all profiles, and installs only by id, configured source, version and sha256, all matching the
  source's listing; a URL a request names is never fetched.
- Commands: mod source add|list|remove|refresh|order, search, details, installed, install, update, remove, add,
  import, gc; --output json's result is the op's. error.rs carries an op's code (Error::Op) to the JSON document.

Tests on the fake network: each source kind, a repo's changed key refused then accepted, a bad signature, an unknown
field, a single mod's tags and followed branch, an .lsmod source's update, installs from git and from mirrored files
with a hash mismatch refused, update and remove, a clash between two sources and the order deciding, the game's
forged requests, a cleared cache fetched again, the command line in text and JSON, a file and emulator mods
imported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
mod check [folder] [--types]: the mod as the game would take it, without
running it. The manifest by api's reader; lib/lint.js's rules ported
(lint.rs): permissions the source uses against those declared, read with
the game compiler's parser (scan.rs: oxc's module record and tokens, so a
comment or a string is never code), API modules, mod: imports against
dependencies, JSON imports and literal longshot/files paths by the files
service's own path rule, net origins, the game's own formats outside
romfs/, mod data's output anywhere in the folder, budget hints. Every
shipped module compiled by script::ts (JavaScript parsed), and linked from
the entry and the content module as script::modules resolves imports;
PNGs and glTF models by content's readers; sites.toml by the builder's
sites::modsites. --types writes the API types and runs TypeScript 7's
tsgo when installed (exit 77 when not). Findings are lines, and
{file, line?, col?, severity, code, text} in --output json's result,
which a failure now keeps too.

mod types: types/longshot.d.ts (schema-gen's, built in) and
types/longshot-env.d.ts (the mod's required features and settings).
mod init: mod.json and src/main.ts from the template, tsconfig.json for
tsgo, .gitignore, README, the types; no Node or npm.

api::services::files::path_ok and script::modules::content_module are
pub for the check; oxc_syntax is a workspace dependency (the module
record's import names).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
mod pack [folder] [--out FILE]: <owner>.<name>_<version>.lsmod of the
mod's shipped files, after the same checks as mod check (without types).
The zip is written here (zip.rs: deflate by miniz_oxide or stored, UTF-8
names, 1980-01-01 times, so the same files make the same bytes) and read
back by content::archive before it is written, so what the game would
refuse is never made. The result gives the file, its size and the mod's
content hash (hash::of_files).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
mod anim <file.gltf|.glb> [--out FILE] [--fps 30] [--loop] [--name NAME]:
the port of mod-tools' lib/assets.js (readGltf, sampleGltf, writeAnimFile)
byte for byte: BFRES 10 of FSKA, the curves only. The examples' puff.gltf
makes puff.anim.bfres again exactly. mod check now takes an .anim.bfres
outside romfs/ that mod anim makes again from the glTF beside it as the
author's own (lint.js's authoredAnim), and says to keep the glTF when it
cannot; the example check has no exception left. content's glTF GLB, data:
URI and %-escape readers are pub for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
mod vendor [folder] [--condition NAME]: each npm import of the mod's scripts (src/, test/, tests/) is
resolved in the node_modules/ the author installed with oxc's resolver (exports with the conditions
import, module and default, then module and main), and only the files reached are copied into
vendor/<name>@<version>/, each package's own imports followed and rewritten to relative paths the
game's loader takes unchanged. The licence files and the TypeScript declarations beside each module
come along; vendor/longshot-vendor.json (shipped) records each package's name, version, licence,
content hash and files, and the specifier each import was, so a second run gives the same tree, takes
an update and removes a package no longer imported, and never touches a folder it did not make.

Refused: Node's built-ins, native addons (.node, binding.gyp), packages exported only for require,
and CommonJS that calls require(); CommonJS that requires nothing (module.exports, exports.x, UMD) is
made an ES module. An import TypeScript drops is left alone. Nothing of a package runs, npm is never
contacted, and nothing is written unless all of it can be done.

oxc_resolver 11.24.3 is new: from the same project as the compiler's oxc (its own release line, no
crate shared with oxc 0.157), and package.json's exports maps, their conditions and subpath patterns
done as Node and the bundlers do them, which a resolver of our own would have to match case by case.
It adds about 30 crates to the lock: simd-json (with halfbrown, value-trait, simdutf8, float-cmp,
ref-cast, ryu), dashmap (crossbeam-utils, lock_api, parking_lot_core, scopeguard, hashbrown 0.14 and
0.16, foldhash), tracing (tracing-core, tracing-attributes), json-strip-comments, once_cell, rustix
(errno, linux-raw-sys) on Linux and macOS, redox_syscall, and windows 0.62 (windows-core,
-collections, -future, -implement, -interface, -link, -numerics, -result, -strings, -threading) on
Windows. It turns on serde_json's preserve_order, but only in a build with modtool in it:
longshot-rs's own build keeps serde_json's default features (cargo tree -p longshot-rs). oxc_ast and
oxc_semantic are the compiler's own crates.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cargo turns a feature on for every crate of one invocation: a workspace-wide check (cargo clippy --workspace, cargo test
--workspace) builds the game's crates with host-sys's fake through modtool, whose mod test runs on it. host_sys::FAKE
says which a build has; game_init aborts with a line on stderr when it is on, so a game never runs on no host. DESIGN.md
says to build the game and the builder in separate cargo invocations.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
build_driver::modhook's stubs give way to the modtool crate: run calls modtool::run, serve calls
modtool::modhook::serve (an untrusted caller), and hello lists modtool::ops::HOOK_OPS (every op but set_mods, the
builder's own). with_modtool makes modtool's context of the builder's: the same profile, game, version and cache,
--output json as JSON and every other mode as text, its play and confirmation handed to the builder's own; channel
events map progress (done/total as a fraction), done and profile_changed.

The storage budget's "mods" kind is the mod store's: its entries are the versions its own collection would let go
(no profile beside this program's pins them, the grace period over), checked again before each removal, a removal
taking the record and the collection after it the blobs no record names. read::manifest_mods adds the profile's
source mods with ExeFS code (modtool::profile::store_code_mods: through the store's records, their code files put
once in <cache>/mods/code/<hash>/, taken when on and accepted as they are now) to the manual ones game_files finds.

modtool's edit lock is launcher_profile's (it waits for another edit, and has its stale rule), and
profile::profiles_beside gives the profiles beside one without a context.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The game's own test runner (runner.js, longshot/testing) gains a fake mode, for Longshot.exe mod test: TestHooks gives a
fake game's JavaScript (its members of a test's game), its calls (native.fake), and the one test to run; the runner then
reports game.isReal false, does not wait for play, and resumes a test after each whole frame (QuickJsHost::tests_step)
rather than at game.frame. start_fake_tests takes the test files it is given. The seams under the services: Services::
set_removed_features (a build that lacks features), oot::actors::fake_update (the site actors.update as a fake game
reaches it, feature fake). testing-runtime.js regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Longshot.exe mod test [folder] [--filter TEXT] [--echo] runs test/, tests/ and src/**/*.test.ts with a game of their own
for each test: the mod in the game's own script engine over the API's own services, and the game under them faked
(testing_game): GameDataMgr's flags, Link and the actors laid out in the stand-in host's guest memory as oot reads them
(the list watched from the mod's start), the clock, the controller and keys, the camera's hooks, the renderer's side of
the UI with each applied batch mirrored to the test, the stores in memory. A test's game is runner.js's in its fake
mode, with fake.js's members (setup, UI readers and the player's side, input, camera, actors, flags, settings,
permissions, features, claims, stored data). --output json gives each test's name, file, ok, ms and error. Rust tests
over made-up mods; every example's tests run as an ignored test (83 of 208 pass: the fake game is not whole yet).

Example tests changed to the real services' texts (no assertion removed): ui-cases' cut-short flush (/Timeout/ to the
engine's interrupt text) and refused batch (no "Refused: " prefix); rupee-alarm's off-step setting (/step of 10/ to the
settings service's "not one of the setting's values").

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The site actors.write as a fake game plays it (oot::actors::fake_writes over game_sites::rules::with_published, feature
fake): each actor's update makes its published writes the fake game's way (life, a hit, place, rotation, shown) and notes
them for game.actorWrites; each fake actor has a character controller whose vtable names the game's methods. A checked
place is its placement's Bool64bitKey flag set (game.checkPlace). Neither is seen by the example tests yet: see the
report.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An actor updates after the acquire phase in the game's frame, so a write published in a frame is made in that frame;
the fake game made it at the next frame's start, a frame late. A Rust test of a write made, and a diagnosis test that
runs one example with its log (MT_EXAMPLE, ignored).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
oot's scan treats an empty id taking one as the fake's fill, in fake builds only. item-tracker's reset test checks
its places after the first frame, as the game's watch takes its copy then.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pouch is recorded at oot's game-call boundary (pouchCount and addOrRemove as fake functions over counts by name);
an add hits items.pouchAdd/pouchAdded through game_sites::chain::fake_hit, so oot's watch and the api's items service
run as in the game. A pickup is the game's update's: seen at the next poll. check-gift's tests check their places
after the first frame, as item-tracker's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The content stage runs the mod's content module before its entry through the loader's services and the script
crate's content runtime, its outputs made by the content crate against the default fake RomFS (game.content). The
network plays the broker over host_sys::fake::net: a test's servers (game.net.server) are told after each frame what
the mods opened, sent and closed, and answer at the next frame's poll; an origin with no server cannot be resolved,
and a server on the player's own network is refused without net.lan, in the broker's words. runner.js tells the
fake game of each frame before the test resumes. echo-client's tests wait the frames the network takes, and expect
the broker's wording.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fake renderer takes the lists the gfx service publishes (a WorldSink, the renderer drawing the world layer and
its models) and gives a test what it would draw: a box as its 12 edges, a circle as its segments, a billboard as its
text or quad. game.gfx.world.shapes is the service's own list of a mod's shapes (Services::world_shapes_of).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
setActor's body, velocity, lift and thrownVelocity: the actor's physics' main rigid body and its velocity, and its
liftable component's state and thrown velocity, where oot reads them; a body's velocity is written through the
fake actors.bodySetVelocity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
saveGame, loadSlot, reload, deleteSlot and copySlot: the world keeps each slot's flags as the game's save does (a
load puts them back, the Bool64 container with them); the items' and longshot/game's watches hear the save request
and the save.load site, and the mods' stores hear the notes the game's file system sends (held until the mod has
started, as the game starts its mods before the player loads). seedStorage writes a store's file on the fake disk;
storedData(scope, slot) reads a slot's file. game.fresh({ strict }) starts the game again for the same mod, its disk
kept: save-tally and misbehaving use it in place of a second FakeGame. check-gift checks a place again through a
load of a save from before its check; its save and load are a frame apart. echo-client's long line comes from the
server: the broker stops the socket (1009).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Its update read its goal flags on the title screen too, where the game's flags still hold the last save's
(oot/src/state.rs: "the flags keep the last save's, which are not now's"), while storage.save there is empty
(storage.md: no playthrough on the title; api storage.rs Storage::frame empties the working save data when the title
is seen). game.update fires every frame, the title's included (api services/frame.rs), so the mod wrote firstDone
again on the title. It skips the title now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A mod's system/ dependencies run beside it, as the game runs the ones its build ships (from system_mods/ beside the
game, else this checkout's game/mods): started first with every permission they list, linked while switched off
(game.systemMod(name, { off: true })) so an optional import of one still resolves, their settings and logs reached
through game.systemMod(name). game.discord() is a fake Discord app at an IPC endpoint, played in Rust over the
network engine (the broker's "nothing listens there" when none): it answers the handshake with READY, each command,
each ping, and keeps what it was sent. discord-status uses it in place of system/discord's fake-discord.js, its frames
a tenth of a second (a whole second each way is longer than system/discord's handshake wait). turnOff() stops the mod
as the Mods tab does; longshot/time's gameStarted() is the fake game's fixed 1700000000. copySlot's comment cites the
launcher's slot copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
It depends on api alone, and mod test's fake renderer checks a mod's shader as the game does: one check, shared.
longshot-game's post sink calls api::spirv::check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fake renderer runs the gfx service's passes (Drawn: effects on): a mod's shader is checked by the renderer's own
check (api::spirv), and each pass reports what a test says (game.gfx.report), read back as the effect handle's info()
reads it. game.gfx.effects is the service's own list of a mod's effects (Services::effects_of: its shader's path, its
point, its params by name read from its block, each float's shortest decimal).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The game's Bool setter (flags.setBool) is a fake function that queues the value, made at the frame's end as the game
makes it at its next update; the fake game holds every container (Enum and UInt too), setFlag takes { kind }, and a
switch reads 0 or 1 as flags.get gives it. game.writes is the writes service's own trace of the mod's attempts. A test's
setters refuse a non-finite number before it becomes JSON. A restart reaps the old session's mod at once, so its stop
is not the new one's. misbehaving expects the real wording of the Timeout, has() and flags.has() faults.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The log's dropped lines are counted in the game's own log (api longshot.rs log_line, at the mod's next line after the
second), which game.hostLogs reads (the stand-in host's log). log's parts take anything (reference.md), so the lone
surrogate goes to a flag's name, an ArgumentError of script::bind::values. After the stop of 3 faults the game's
frames go on: the test checks the mod heard nothing (no new lines, no new faults). examples.md says so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
game.damage plays the site rules.lifeHit: the hit goes through the published "rules.life" table (oot::rules::life),
for Link through his own life component (the life components' class, named "Player"), its source Link or another;
game.rules and game.rulesPublished read the published table. The queries' sites are in the fake build, and
game.answers(query) reads what the mods answered from its table. Link is a GameActor updated each frame he plays, as
in the game, so the list removes a gone actor at the next frame. A stopped mod is let go at once, as the loader stops
one. damage-tuner waits the frame its stop takes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
It depends on api alone (and lewton), and mod test's fake game decodes a mod's sounds as the game does: one decoder,
shared. longshot-game's hosts re-export it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The spawner's routines (oot::spawn, #68's) are played at oot's game-call boundary: a create request the game takes is
made into an actor at its next update, taken, placed and deleted; Link's update (oot::spawn::fake_link_update) runs each
frame he plays, with the play clock ticking; game.spawned and game.refuseSpawn. The rewards' drop site is played after
the placements' drop reader (game.dropFor, game.rewards). game.memory maps parts of a host's GameMemory. The stores see
the title screen where the game starts, so a new game's playthrough opens; a load ends in play, a slot with no save a
new playthrough in the map played before the title; a restart waits for the store writer and holds its save notes for
the new session. game.claims lists the claims held. octorok-ambush and custom-enemy wait the second a spawn may take
(the play clock's tick after the ask), the two long ambush tests with a timeout of 4200 frames; chest-swap and
save-tally wait the frame a stop or the title takes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fake game decodes with the game's own Ogg decoder (api::services::ogg) and runs the mixer as the host's mixer
thread does: each frame the decoding thread waited for and a frame's samples mixed, so voices play on and end. The
mixer shows a mod's sounds and voices (Mixer::sounds_of, voices_of) and the service its placed voices
(Services::audio_of); game.audio's plays are the voices seen to start. The fake camera looks from (0, 1.6, 3) toward
(0, 1, 0) until a test sets it, as the fake game's always has, so a placed voice has its gain and side. The Ogg tests'
files move with the decoder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A profile entry {"id", "version", "hash"} is read from the builder's mod store (HOS_MOD_STORE, set by the
builder's play) at a folder in no disk: api::store_disk::StoreDisk lays each pin's record over the files the game
reads (Store::check_pin, RecordFiles), and the RomFS layers serve the blobs themselves (Disk::host_path). A pin the
store lacks whole is said and left out. The sandbox reads the store's blobs/ and versions/ (Landlock, the
AppContainer). The loader takes a list sink, so with a channel the profile is the builder's to write.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
builder_link: one client owns the channel for the run (the host hands it the ends, bc_take), says hello and sends
the ops, matching answers by id and keeping progress and profile_changed (now with code_changed from build-driver).
It keeps the game's limits first: only the game's ops, no URL, install and update only of a release search or
details listed. The Mods tab's switches and order go as set_mods, a code warning accepted as request_trust, a
restart through the builder as restart_to_apply. mods_store is the Get mods page's model (list, install, update,
remove, trust, status, Restart to apply), its view to come on the mods' UI; without a channel it is read only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- request_trust takes permissions to grant (the Mods tab's permission page sends them with a channel). The game is
  untrusted: at most TRUST_PERMISSIONS_MAX names (every permission the schema has), each known (else bad_args) and
  declared by the mod, required or optional (else refused), checked before the window shows anything. Each grant
  is a fact of the window; only Accept writes it, an unsafe one into trust.json, a safe one into the entry's
  granted.
- HOS_MOD_STORE is LONGSHOT_MOD_STORE, with its switches.def row.
- The loader's watch leaves store pins out (they never change). The builder's profile_changed is a tab edit: the
  loader reads the profile again, takes the switches it changed (a live one at once) and offers the restart that
  loads a pin added, moved or taken out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The loader takes each folder in LONGSHOT_DEV_MODS as a mod where it is: on with no list entry, in place of a mod of the same id, its script watched there for hot reload. The Linux sandbox and the Windows plan read the folders.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Moved from longshot-game's mod tool natives, which now call it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
mod run checks the mod and plays the profile with its folder linked in (dev mode). mod data lists the player's own game's names with the game's readers, marked with the game-data notice. mod publish makes the repo entry from a package or a git pin, and with --repo adds it to a static repo's signed longshot-repo.json; --new-key writes a key pair. pack's packing is shared; Net gains git_local.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The modtool stack was written on 563ca4e5, before this line's "the game's mods come only from its profile" gave the
loader its development mods (LoaderConfig::dev_mods, Row::dev) and its own list (list_path(), mods_dir()). Its copies
of the same go: find_dev_mods, its second Row::dev and DEV_MODS (its two tests, on the old /u/mods.json layout, with
them: the profile-only loader's own cover the same), and the Windows sandbox's second dev_mods list. On Linux the
modtool's dev_mod_dirs stays, the stricter of the two (never the home, the root or a system folder), in place of
dev_mods_read. find_pins and profile_changed read the profile's list through list_path() and ModsList::parse, and
find_pins runs with the profile's other mods; a source entry is find_pins' (the store read in place through
StoreDisk) when the builder's mod store is laid over the disk, find_sources' otherwise. The fake game's ServicesConfig names no save profile (save_profile, also this line's).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A source mod was read two ways: in place through StoreDisk when LONGSHOT_MOD_STORE names the builder's store
(find_pins), else through the loader's ModStore, which the game filled with NoStore and so only ever left it out.
LoaderConfig::store, ModStore, NoStore, the unpacking into modcache/sources and the folder reader go; source.rs keeps
the entry kinds. Without the store there are no source mods, and the log says so in one line. The test of the old
path becomes one of that; mods.md and profiles.md say the one path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Both platforms already hold development mods' folders (LONGSHOT_DEV_MODS) to the narrow rule: Linux through
dev_mod_dirs' sbx_folder_narrow, Windows through the plan's never list and its refusal of a drive's root, which every
grant goes through. Now each sandbox's test says it for these folders.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
assets/modding/packages/mod-tools (the Node tools and their fake game) and the game binary's
`longshot mod` (longshot-game's modtool.rs over script::modtool, which ran mod-tools' JavaScript in
QuickJS) go: every command is the builder's `mod` now. The game's exe keeps --version and --help,
and `longshot mod` says to use Longshot.exe mod. With them go tests/test_mod_tools.py, the SDK's
sdk/tools/ copy (an older build's is still taken out), the release sources' mod-tools paths,
schema-gen's schema.json, fake services check and JavaScript copies, the LONGSHOT_SDK switch,
and script's QuickJS realm and loader helpers only the tool used.

The test API's declarations, longshot/testing (Tests, FakeGame, Assert, the setup API), are
game/modapi/testing/longshot-testing.d.ts now, written by mod types into types/. mod init's
tsconfig.json and .gitignore are the template's files. mod format leaves types/ and vendor/ alone.
Messages that named longshot-mod shaders say to compile with glslang (docs/modding/gfx.md).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each example drops its package.json (and first-mod its mise.toml); its tsconfig.json and
.gitignore are mod init's; its tests import their types from longshot/testing; its README says
Longshot.exe mod test, check --types and pack. The new-mod template's README, AGENTS.md and test
say the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tools.md is every Longshot.exe mod command with its options and --output json result (run linking
the folder in, in dev mode, the game's own reload, the game's exit code; data's sources, refusal
inside a mod and notice; publish's package release or --git pin, --repo/--key/--url/--name, key
formats, --new-key, no version twice, the entry printed without --repo). testing.md: mod test on
the game's engine over a Rust fake game, longshot/testing, the strict frames() rule, the game's
test mode. publishing.md (new): sources (repos, single mods, git or release files), the
longshot-repo.json v1 format and its signature, key acceptance, the content hash, source order and
clashes, vendored npm packages. packages.md: mod vendor. The tutorial and every other guide and
dev reference name Longshot.exe mod instead of longshot-mod and the game's longshot mod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Builds carry no sdk/ any more. The guides, agents.md, api-schema.md, the tutorial and the template's
README and AGENTS.md point at assets/modding/ on the forge instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
host/control.c passes mods and mod_* requests to game_control_mods (a new mods hook of HosControlGame) and replies
with its answer's fields, or its {code, why} refusal as the bridge's error. The game had the commands
(longshot-game::control_mods) but nothing routed them. The protocol's mods section documents them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A control bridge client (bridge.rs) and the commands that talk to the running game: status, log [--follow],
reload, restart, eval, shot, press, stick, sequence, teleport, wait, raw, stop. mod run turns the bridge on at the
profile's own address (and --eval sets HOS_CONTROL_EVAL); mod dev is mod run. mod test --game plays the profile in
the game's test mode and reads its reports, --live runs the tests in the running game. where and doctor report the
builder's paths and the bridge; allow trusts a mod through request_trust and the builder's window. A negative number
is a plain argument (stick L -1 0).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Longshot.exe mod shaders [folder] [--check] compiles every .glsl in a mod's folder (outside dot folders,
node_modules and dist) into a .glsl.spv beside it, as the old Node command did with glslangValidator -V -g
-S frag --target-env vulkan1.0, but with shaderc (glslang inside the builder, built from source and linked
statically), so no author installs glslang. Each module keeps its source and is checked with the game's own
api::spirv::check; a shader error names its file and line. --check compares each .spv with a fresh compile.

naga was tried first: its GLSL reader takes no combined sampler2D, the effect template's picture.

The docs, the API's generated docs and the game's messages now say Longshot.exe mod shaders instead of the
hand-run glslang command.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
shaderc-sys builds glslang from source with CMake, and link-cplusplus links the C++ runtime as a shared library,
which a player's system may lack. scripts/longshot_builder.py now turns cc's C++ library off and links libstdc++.a
(Linux) or llvm-mingw's libc++.a and libc++abi.a (Windows) in; on Linux with the sysroot, C and C++ are compiled by
the bundle's clang against the sysroot (clang++ is a link to it), so glibc 2.35 and its GCC 13 libstdc++ agree.
It stops early, saying so, without cmake (or ninja on a Windows host). CI gets CMake and Ninja from
scripts/ci_cmake.sh: ci_rust.sh runs it, and the build-windows and vulkan-dlss jobs call it before
longshot_builder.py; build-linux's apt list has them. The developer docs say so.

sepia-photo's effects/sepia.glsl.spv is compiled again by Longshot.exe mod shaders, and a test keeps every
example's .spv what mod shaders --check asks. tests/test_gfx_effects.py passes on the new module unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The old tools' types --game, ported: longshot-components.d.ts and .json (each
actor component type's paths and their BYML types, through the Work/ files
they name, and ContentComponents augmented with each reference) and
longshot-ainb-schema.txt (content's SchemaBuilder over the game's trees),
written beside mod.json from the game's files where the builder has them
(mod data's romfs and zstd dictionaries; data.rs's open_romfs and decoder are
now the crate's). The files never ship (files::LEFT_OUT). Tested on a made-up
romfs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The old tools wrote a library's published declarations with tsc. Here each
module's declarations are oxc's isolated declarations (oxc_isolated_declarations
0.157, from the same tag as the compiler's oxc, added to the workspace's patch),
read from the AST and printed with oxc_codegen: each name of mod.json's
exports followed through export-from and export-star, its return type made
Promise<Awaited<R>>, its JSDoc and the package imports its types need kept.
What oxc cannot say of an export from its text (an unwritten parameter or
return type) is a problem naming the place, and nothing is written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The old tools' skeleton command, ported: Model/<model>.bfres.zs read where the
builder has the game's files (mod data's romfs and dictionaries), its bones
read by content's model reader (a new bfres::skeleton: each bone's name,
parent and rest pose, a quaternion or Euler angles by its flags), written as a
glTF of nodes (Euler angles made quaternions in the old order, quaternions
made unit with anim.rs's normalize). --out must end in .skeleton.gltf, the
name files.rs never packs. content's hand-made model file is offered to other
crates' tests behind a testkit feature.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The old tools ran nx2/mod_sites_port.py, which went with the old builder. Now
in Rust on the builder's crates: the table read by sites::modsites'
parse_mod_table, the --to and --from images by the lift's image reader, and
each site looked for in main's code step for step as modsites' find_one does
(the signature once, or the place builds names among several, then the
guards). find_one is not made public: the sites crate is in the whole lift's
key (EDITS_SOURCES), so any change there makes every player's next build lift
again. A longer signature is offered from --from's words; --write puts each
found site's function into its inline builds (or a new builds line after its
signature). Tested on made-up images.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
check makes the declarations again as mod types --lib does and compares them
with mod.d.ts (its first comment lines, which name the tool, aside): a stale
one, or one that cannot be made again, is a problem telling the author to run
mod types --lib.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When mod types --game wrote longshot-components.json and
longshot-ainb-schema.txt in the mod's folder, the fake content stage checks
each item's and actor's components and params, and each tree's new nodes,
against them, as the old JS fake game's checkComponents and checkTreeAdds did;
what it finds is in game.content's problems. Docs say so (and that check
finds a stale mod.d.ts).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The examples all pass on the fake game now (photo-mode's dispose included, fixed in #2434's line), so
every_example_passes_its_tests is no longer ignored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
manifest::native reads a built-in Rust mod's mod.json (included at compile time, parsed once) into the Manifest
the loader takes: the system mods' reader checks it first, then what is a built-in's alone: "rust", its crate,
and a setting's "native" object (store, legacyId, presetExempt, shownIf, defaultText, hints) and button type.
Every reader of files refuses "rust" (a mod's code is a script unless the build compiled it in): a game-free
test and a manifest vector. manifest.md lists description and rust.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A built-in mod's sites may be defined in its own game/mods/<name>/sites.toml: sites::Tables::definition_files finds
them in the mods' folders as a player's mod's are found, the core's table first, then the mods' by folder name, and
owned_definitions refuses a site defined twice. game-sites' build.rs reads the same files for the sites' forms, and
a lift's key covers them. A repository test checks that every site has one owner and that the sites are the one
table's before the split (site_owners.txt), sites at one instruction in the same order. hooks.md says where a
built-in mod's sites go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/fov/mod.json, in the player's format, declares the mod (its id, version, description, hooks.unsafe, the
camera.lens site it handles) and its Field of view setting with its place on the Gameplay tab; the crate reads it at
compile time ("rust": "sysmod-fov") in place of the Manifest it built in code, and a test checks that it parses
and that its setting's key is the code's. camera.lens stays the core's site: its core callback serves the mods'
cameras too (oot::sysmods::fov keeps the shared lens). test_oot_fov.py reads the manifest; test_menu_i18n.py takes
a built-in Rust mod's texts from its mod.json.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/text/mod.json declares the mod and its two settings with their places, read by the crate at compile time;
its site text.letterStep moves from game/sites/sites.toml into the mod's own sites.toml, and the site's callback
(the letter step, the panes' kept sizes) from oot::sysmods::text into the mod's src/hooks.rs: oot keeps the layout
it reads. A test checks the manifest and that its keys are the code's; site_owners.txt names the new owner.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/area-names/mod.json declares the mod (state.read, ui.hud) and its Area name banner setting with its place
on the Gameplay tab; the crate reads it at compile time in place of the Manifest and the setting it built in code.
A test checks that it parses and that its setting's key is the code's. The mod has no site of its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/colour-vision/mod.json declares the mod and its Colour vision correction setting in the Graphics tab's
Accessibility section; the crate reads it at compile time in place of the Manifest and the setting it built in
code. Its tests check that it parses, that its key is the code's, and that the row's choices are the modes the pass
takes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/crt/mod.json declares the mod and its CRT filter and CRT lines settings (their hints, the lines shown
only with a filter) in the Graphics tab's Screen section; the crate reads it at compile time in place of the Manifest
and the settings it built in code. Its tests check that it parses and that its keys and choices are the code's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/heart-containers/mod.json declares the mod (state.read, romfs.read; no setting, no site); the crate reads it at
compile time in place of the Manifest it built in code, and a test checks that it parses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/voice-language/mod.json declares the mod; the crate reads it at compile time in place of the Manifest it
built in code, and a test checks that it parses. Its site, options.voiceWritten, stays the core's: an outcome site,
which only the engine sets at start (oot::sysmods::voice, over the knob the mod publishes).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/settings/mod.json declares the mod (ui.settings; no setting, no site); the crate reads it at compile time in
place of the Manifest it built in code, and a test checks that it parses. Its UI code is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/damage/mod.json declares the mod, the two sites it handles and its Damage taken setting (after Heart
protection on the Debug tab, shown while Debug tools are on); the crate reads it at compile time in place of the
Manifest and the setting it built in code, and its tests check the manifest against the code's keys and choices.
player.lifeHit and player.lifeWrite stay the core's sites: heart protection's core callback is on them too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/cheats/mod.json declares the mod and its Debug tab rows (Debug tools, kept in the options file; the cheat
rows, kept for the run, shown while Debug tools is on, each with its old HOS_OPT_CHEAT_* number); the crate reads it
at compile time in place of the Manifest and the rows it built in code, and puts the run's rows back from it. A
setting kept on an options line may have a - in its key (no-clip_flight), as the menu wrote it. Its tests check
the manifest against the code's keys and Movement speed's percents.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/skip-title/mod.json declares the mod, the two button-wait sites it handles and its Skip title screen and
Skip opening settings with their places; the crate reads it at compile time in place of the Manifest and the
settings it built in code. menu.buttonWait and menu.buttonWaitNoDecideAnim move into the mod's own sites.toml, and
their callbacks' game access (the wait's screen, the newest save) from oot::sysmods::skip_title into the mod's
src/hooks.rs. test_dev_ab.py reads the built-in mods' settings from their mod.json.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/shadows/mod.json declares the mod, the three shadow sites it handles and its Shadow resolution (the
quality presets' row) and Steady sun shadows settings in the Graphics tab's Detail section; the crate reads it at
compile time in place of the Manifest and the settings it built in code. The three sites move into the mod's own
sites.toml, and their callbacks' game access (the cascade size, the steady fit) from oot::sysmods::shadows into the
mod's src/hooks.rs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/sprint-walk/mod.json declares the mod, the two sprint sites it handles and its Walk mode, Walk speed and
Sprint settings on the Controls tab; the crate reads it at compile time in place of the Manifest and the settings it
built in code, and its tests check the manifest against the code's keys, old numbers and Walk speed's range.
sprint.link and sprint.stance move into the mod's own sites.toml, and their game access (Link's state, the
stillness, the stance) from oot::sysmods::sprint into the mod's src/hooks.rs. test_sprint.py reads the manifest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
game/mods/widescreen/mod.json declares the mod, the 23 wide.* and ui.* sites its handlers use and its settings in
the Graphics tab's Screen section (Ultrawide menus, HUD layout, the Custom placement's nine rows, Reset HUD
placement); the crate reads it at compile time in place of the Manifest and the settings it built in code, and its
tests check the manifest against the code's keys, ranges, old numbers and sites. The sites move into the mod's own
sites.toml. Its callbacks were the mod's already (src/sites.rs); oot::sysmods::widescreen stays, shared with
longshot-game's picture and present tick.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
system-mods.md has the built-in Rust mods' layout (mod.json in the player's format with its rust entry and a
setting's native object, sites.toml, src/hooks.rs) as an example for authors, and notes that mod check does not yet
check a built-in mod (a hook to add: the system mods' reader for a script one, api::manifest::native for a Rust
one). game/DESIGN.md, game/README.md, api-schema.md, switches.md and oot::sysmods's docs say where a built-in
mod's sites and callbacks are now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
a_removed_handlers_guard_passes_after_the_grace counted its stand-in reader in after remove_retired, so another
test's retire::reclaim on its own thread could let the removal go in between and the guard passed too early (seen
once in a full workspace run). The reader is counted in first, as a hook that loaded the old chain is: no other
reclaim can let it go while it is in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The list was written with a stand-in moved over it. A confined game's sandbox names profile.json by its rule, so the
move was refused (and one that went through would lose the rule): a switch logged "switched on" and never reached
the file, so Restart to apply came back with the mod off. It is written in place now, as the trust file is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The builder wrote profile.json with a file moved over it (launcher_profile::Profile::write, modtool's Profile::write):
a confined game's grant names the file itself, so after the Mods tab's set_mods the game could no longer read the
profile (EACCES). Both write it in place now, profile.json.bak holding the text while it is written (inode test).
The game waits for the builder's answer to its last set_mods before it asks restart_to_apply, so a switch is in the
profile before the game ends. The Mods tab's batches take two id ranges in turn: a batch's reset no longer meets a
create of an id it removed (longshot/ui refused "node 1 was removed by this batch").

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The Insert menu's settings (the renderer's declarations, rows, texts, set/press/text and bindings) and the Mods tab's
data and edits (the list with each mod's page, cheats, keybinds, commands, HUD roots, the permission prompt; setMods,
edit, restartToApply) as two schema modules behind the system-only permissions settings.host and mods.host, so the
menu can be drawn by TypeScript system mods while Rust keeps the data. state() is { channel, why, ops }; errors
SettingsHostError and ModsHostError { code, text }; events only to holders; every API Promise now carries its call
number. longshot-game gives the tab's host part (mods_host.rs).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
system/menu (game/mods/menu) draws the menu's tabs, pages and rows from longshot/settings-host; system/mods-tab
(game/mods/mods-tab) draws the Mods tab in its slot from longshot/mods-host, now with the cheats, command arguments,
keybind rebinding and the permission prompt. The native Mods tab mod goes. The Menu drawn by mods row hosts
system/menu's page, or the engine's fallback (no mod: a UI tree of the engine's own, shown only while a menu mod does not run; resume, resolution, turn mods off, quit); a hosted Keybind waits for
its key and an @close control closes the menu. Parity tests draw the C++ menu's every row (menu_rows.json, written by
tests/test_settings_decls.py) through Longshot.exe mod test, which now reads a system mod's folder as the game does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The renderer declares its page-5 question (Restart Needed, Keep changes? with the Output resolution preview's
countdown) as a QUESTION, @ask: its state the text and seconds, its texts the title and answers, a set the answer.
The TS menu draws it over everything while it waits, so draw_ask is not needed with the menu drawn by mods. Each
confirm dialog and a binding's question get the old drawing's title and yes (Enable Debug Tools?, Reset bindings?,
Binding already in use / Rebind) through renderer_setting_text's MKWVK_TEXT_* values.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
onReset (Delete: an input's default asked for), a Slider's own value texts (options) and commitOnRelease, a multiline
TextInput, a pad Keybind (the next gamepad button, by its Switch name), Compare (a before and after split with a
divider the player drags: ReShade's comparison, and the screen effects' later), ModPage (another mod's settings page
in place: the Mods tab's page of a mod that draws its own), and a Window's dock and passInput (a strip over the live
game, for the tune bar). The menu hosts a page's mouse, Delete and pad Keybinds. The TS menu and Mods tab use them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The renderer answers @fx:<mod id> with a mod's screen effects as it runs them (point, the mod's and the player's
switches, state, GPU time, why), read-only but for the player's switch; longshot/mods-host gives them as each page's
effects and sets the switch with edit("effect"). The TS Mods tab lists them as toggles, and shows a mod's own
settings page in place with ModPage. Read-only on gfx: vk_effects' fx_effects_of and fx_player_set only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The old menu's tune mode as the TS menu's own: each slider row has Tune, an @close: control (pressed, then the menu
closes), which mounts the row's slider in a window docked at the screen's bottom with passInput, so the game keeps
its input and its picture while the value changes; Done takes it down. The menu mod asks ui.window for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The new props took the props' table to 70, past the 64 bits a node's has held: it is 128 now. The hosted question
(page 5) gives the page no wheel, as the old drawing's question did (tests/test_rumble_menu.py). Fixed after the
full check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Fixed after the full check: longshot-game's ui test says the snapshot's new version, and the menu's question test
gives the confirm dialog's words before declaring the rows (they are read with the declarations).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
options.voiceWritten moves from game/sites/sites.toml into game/mods/voice-language/sites.toml, and its callback (the
game's question asked, the saved option followed) from oot::sysmods::voice into the mod's src/hooks.rs. The site is an
outcome site, so it takes no handler at run time: the mod lists its engine callback (hooks::ENGINE_CALLBACKS) and
longshot-game installs it at start right after the core's (NATIVE_ENGINE), whether the mod runs or not. The knob it
read (oot::sysmods::knobs, one knob) becomes the mod's own switch, FOLLOW, on while the mod runs and back off through
the journal. oot::engine::MOD_OUTCOME_SITES names the outcome sites a mod's crate answers; oot's coverage test and a
new longshot-game test keep the two lists the same. site_owners.txt names the new owner; the site list is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
camera.lens is not moved into game/mods/fov: the core's engine callback there serves the public camera API (oot::camera's
fov_hook and near_hook, under api::services::camera) whether the Field of view mod runs or not, and the mod's handler
only hands its row down the chain. The site table's comment, the mod's docs and system-mods.md (a new table of the sites
that stay the core's, and why) say so. No site moves; the shared lens logic stays in oot::sysmods::fov.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
player.lifeHit and player.lifeWrite are not moved into game/mods/damage: the core's engine callbacks there are heart
protection (oot::debug::hearts_protected, set by the Cheats mod's row, an input movie or the test runs' switch), which
must work whether Damage taken runs or not. Owned by the damage mod, the sites would make Cheats depend on Damage taken,
and heart protection would go with it when it is off; kept core, each mod uses the site it needs and neither knows the
other. The site table's comment, the mod's docs and system-mods.md's table of core sites say so. No site moves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
oot::sysmods::cheats (the cheat file's name, the regions' bases, checked reads and writes) and its layout
(layout::sysmods::cheats::HEAP_BASE) had no caller left: the Cheats mod (game/mods/cheats) has its own build id and
file name (cheats::BuildId), regions (memory::Region) and memory (system_mod's ApiMemory, over the API's memory
service). The mod has no hook site, so nothing else moves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
oot::sysmods::discord (what host/discord_rpc.c read from the game: the map, the place, the age, life and rupees) and its
layout (layout::sysmods::discord's flag hashes) had no caller left: the Discord status is the discord script system mod
(game/mods/discord), which reads the game through the API (state, player, content.read.mapName). The layout test's
assertion on its Life hash goes with it. oot::sysmods::area_names loses its last caller in oot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
oot::sysmods::hearts (the containers' placement ids read from the player's RomFS, their flags, the pieces' sum) had the
Heart containers mod as its one caller: it moves into game/mods/heart-containers/src/containers.rs. The mod has no hook
site, so no sites.toml; it now names host-sys (the RomFS and the log) itself.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
oot::sysmods::area_names (each map's place in English, the suffixes' rules) had the Area names mod as its one caller
once the Rust Discord status was removed: it moves into game/mods/area-names/src/places.rs. The Discord script mod
names the place through the API (content.read.mapName), not this table. The mod has no hook site, so no sites.toml.
oot::sysmods now holds only what the core shares with the mods: Field of view's lens, Damage taken's life writes,
the widescreen picture and the event and switch helpers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
api::manifest::schema builds the draft 2020-12 schema of mod.json from the
reader's own limits, permission table and key names: every field described in
manifest.md's wording, enums for permissions, runtimes, scopes and places,
patterns for ids, versions, origins, paths and dependencies, the rules between
fields (runtime needs api, content needs content.add, local multiplayer, raw
game data never with a way off the PC). Built-in-only fields (rust, a setting's
native and place, legacyOption, ipc, system) are in it, described as such.

Longshot.exe mod schema prints it; mod init and mod types write
types/mod.schema.json and name the served copy in mod.json's "$schema"
(https://longshot.magicbean.dev/schemas/mod.schema.json, planned: the site has
no route yet). Every built-in mod's and example's mod.json names it. Tests: the
schema is a valid 2020-12 schema; every built-in, example and template manifest
passes it; the shared vectors agree with the parser, but for a named list of
rules a schema cannot say. jsonschema 0.29.1 (no default features) is api's
dev-dependency.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The schema is made by game/crates/api (manifest/schema.rs); `cargo run -q -p api
--example mod_schema` writes the copy in website/public/schemas/, and the test
the_website_serves_this_schema fails while it differs. public/_headers serves it as
application/schema+json, cached an hour, to any origin; npm run check checks the
built site has it at its $id.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
longshot/gfx's gfx.outputEffect (extension 1 of the built-in mods' audit): a mod's effect of 1 to 8 fragment
passes at present, after the game's HUD, frame generation's made frames and the window's scaling, before
Longshot's overlays. Each pass draws an image of a size and format the mod chooses ({ scale } or
{ lines, maxScale }, rgba16f or rgba8; the last draws the output) and samples up to four inputs (the pass
before's, the picture, an earlier pass's), nearest or linear, clamped or black outside. The renderer fills
the params named SourceSize, OutputSize, FinalViewportSize (libretro's names), hdr, paperWhite and peakNits.
On the SDR picture the passes see it as the display shows it; with hdr: true, while the game presents HDR,
linear nits (Rec. 2020): the HDR pass grades into an RGBA16F image first (hdr_encode.comp's HDR_NITS),
the effects run over it, and hdr_pq.comp encodes their image. An effect without hdr runs before the
expansion, and is bypassed (unsupported, saying so) while the game presents its own HDR.

The template's check (fx_spirv.h, api::spirv) takes up to four samplers and reports them (inputs);
gfx.effect's keep the picture alone. Built-in mods reach the same code through ModApi::gfx over the
shaders they carry. The fake game lists an output effect's passes, images, inputs and fills, and
EffectInfo.reason says why one is not drawn here. game.h's GamePass carries an output effect's passes
(GAME_PASS_OUTPUT_FX at GAME_PASS_PRESENT, GameOutStep): MKWVK_API_VERSION 58. The modding API's version
stays 0.1 (bumped when the release is cut: api-schema.md). Example: assets/modding/examples/scanlines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Extension 2 of the built-in mods' audit: each present tells the output effects whether the game drew its
3D world (vk_draw.cpp's world_drawn_at in the last 3 presents, the fact the ultrawide menu sides use, kept
in wide_sides_tick's world_now for frame generation's display thread too). A pass reads it as the param
worldDrawn the renderer fills (1 or 0), and an effect's when ("always", "world", "noWorld") draws it only
in frames with or without the world: in the others it costs nothing and is waiting. GamePass.when and
GAME_FILL_WORLD_DRAWN: MKWVK_API_VERSION 59. The fake game lists each output effect's when.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Extension 3 of the built-in mods' audit: gfx.renderer() answers { tier, hdr, nativeHdr, menuOpen }: the
memory and quality tier the Quality preset or Auto picked (1 to 5, null before it is known), whether the
renderer presents HDR10, whether that is the game's own HDR picture (Native HDR, where an output effect
without hdr is bypassed), and whether the Insert menu is open. The renderer answers one new option,
HOS_OPT_RENDER_STATE (its bits), beside HOS_OPT_MEMORY_TIER, read through the post sink when a mod asks;
built-in mods reach it through ModApi::gfx. The fake game's game.gfx.setRenderer sets what it answers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The CRT system mod draws the filter itself through the public longshot/gfx (ModApi::gfx, the code a script
mod's gfx.outputEffect reaches): game/mods/crt/effects/downsample.glsl into a raster of the mod's size
({ lines: 240/480/720, maxScale: 0.5 }, RGBA8), then lottes.glsl, hyllian.glsl or zfast.glsl at the
output's size, sampled nearest (zfast linear) with a black edge. The four are the renderer's compute
adapters ported to fragment passes with the same math (the pixel centre is gl_FragCoord, SourceSize and
OutputSize the renderer's params, style a float param; the box's loops counted, 32 texels each way, the same
sums in the same order), compiled beside them by Longshot.exe mod shaders and carried in the mod's code.
The effect takes the SDR picture only, so the renderer runs it before an HDR expansion and bypasses it on
Native HDR as before; the mod reads gfx.renderer() each frame and sets the filter row's hints to the
"Bypassed: ... Native HDR" line (ModSettings::set_hints, a native choice row's hints changed at run time).
crt_filter and crt_lines keep their keys. It stays a Rust mod: a script mod's settings have no
options-file line or Insert-menu place.

Gone from the renderer: crt_policy.h, the four crt_*.comp and their headers, vk_framegen.cpp's CRT pass,
the CRT decoding and hint in menu/game_rows.cpp, GAME_PASS_CRT and PostKind::Crt, scripts/shaders.py's
crt set. tests/test_crt_policy.py checks the output effects' lines size is the old raster for every output
size, test_crt_shaders.py the fragment ports against the pinned upstream math and their .spv's sources,
test_upscale_independent.py the scaler's routing into the output effects, test_gfx_effects.py the
renderer's taking of an output effect's passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The colour-vision system mod recolours the picture itself through the public longshot/gfx (ModApi::gfx):
one pass, game/mods/colour-vision/effects/correct.glsl, the renderer's colour_vision.glsl functions word
for word, at present after the CRT filter (order 10 after its -10) and before Longshot's overlays. It
takes nits (hdr: true): on the SDR picture it decodes the display's colours, corrects them in Rec. 709 and
encodes them again, as the present's pass did; while the game presents HDR it corrects the light in nits
(Rec. 2020, up to 10,000 nits) over the HDR pass's nits image before PQ, as hdr_encode.comp did, Expanded
and Native alike. Its mode is a param, set in place when the row changes; colour_vision keeps its key.

The Insert menu's palette correction stays the renderer's (it is drawn after every output effect): it
reads the mod's colour_vision setting (menu_colour_vision_mode) while the mod's effect runs
(fx_output_ran_of). Gone: vk_colour_vision.cpp/.h, colour_vision.frag and .glsl, the correction fused into
hdr_encode.comp (its push constants keep their 48 bytes), the present's colour-vision route, the pass
decoding in menu/game_rows.cpp, GAME_PASS_COLOUR_VISION, PostKind::ColourVision, the system mods' fixed
passes (ModApi::post_pass_*) and GamePass.params: MKWVK_API_VERSION 60. game/DESIGN.md's post-process
interface says what stays the engine's and why: present and capture routing (through the output effects
generically), the HDR pass's nits stage, the menu's palette, the Native HDR bypass of SDR-only effects.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
tests/test_output_fx_parity.py, game-free on a Vulkan device (run_vulkan_fixtures.py runs it on lavapipe):
the renderer's old passes, kept as fixtures (tests/fixtures/output_fx_parity: crt_*.comp, colour_vision.frag
and hdr_encode.comp with its fused correction), and the mods' shipped shaders with fx.vert, hdr_encode.comp's
HDR_NITS variant and hdr_pq.comp, each recorded as the renderer records it (record_crt's compute passes and
images; fx_output_run's fragment passes, images, samplers and fills; framegen_hdr's nits stage) over the same
synthetic pictures. Every CRT filter at each lines setting at 720p and 1080p, a larger and a smaller picture
(the raster compared too); each colour vision mode on the SDR picture (same size and scaled), in Expanded
HDR at 100% and 150% contrast, and in Native HDR. One 8-bit step or one 10-bit PQ code at most.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Effect.setSplit(share | null): an output effect's last pass is drawn right of a line at that share of the
width, and left of it the picture the effect was given (fx_copy.frag, in the same rendering, a scissor
each side), so the frame itself shows before and after with nothing captured and no pass more.
longshot/ui's Compare drives it as a divider alone (ui.md, gfx.md). GamePass.split: MKWVK_API_VERSION 61.
The fake game lists each output effect's split; the scanlines example has a Before and after setting
and its test. ReShade has no such hook yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
A release's risk is the riskiest of its permissions by the schema's tiers (low, medium, high, unsafe; a permission
the schema does not have counts as unsafe), with unsafe and replaces_game_files (a release that ships romfs/: a
repo says so, a single mod's is read from its files). search gives the newest release's tier for each mod and leaves
mods of the unsafe tier out unless asked (--unsafe, the op's "unsafe": true); details gives it for the mod and for
each release.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A release lists its dependencies as its mod.json writes them (a repo's release says so, a single mod's are read
from its manifest; checked by the manifest's own reader), and details gives them for each release. install plans
first: the release asked for, then every required dependency (and theirs) the profile does not have at a version it
takes, each the newest release its source lists that it takes; the plan installs what is needed before what needs
it, and a dependency no source can give stops the install before anything is fetched. --plan (the op's "plan":
true) only answers {plan: [{id, version, sha256, source, needed_by}], missing: [{id, needs, range, why}]}.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A release may give its API's minor number (api_minor, from a single mod's mod.json "api"); it fits this game when
its major is this game's and its minor no newer, or for a 0.x API the same: the loader's own rule. details gives
fits (true, false, or null when a 0.x release gives no minor) for the mod and each release, with the game's
game_api; search gives it for each mod's newest release and --fits (the op's "fits": true) keeps only those that
fit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A repo's release may give its licence (licence, or license as mod.json spells it; a single mod's is its manifest's)
and withdrawn: a release its source took back is never the newest, an update or a dependency, and is installed only
when named by its version. A mod may give categories beside its tags. search shows each mod's newest release's
licence and its categories; details gives each release's licence and withdrawn, the mod's categories, and the newest
release's licence among its licences.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
mod pin <id> <version> installs the mod at that release when the profile has another, then pins it there
("pinned": true in its profile.json entry); updates, check_updates and installed's update offer then leave it,
and an update named for it is refused saying so. mod unpin <id> lets it move again. installed gives "pinned":
the version it is pinned at, or null. Neither op is the game's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
tags (the op and mod tags [--source URL]) counts, over every mod the sources offer (each once, as search has it), its
tags and its categories, folded to lower case: {tags: [{name, mods}], categories: [{name, mods}]}, by name. The game
may ask it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
source_refresh (the op; mod source refresh [url]) fetches the named source again, or every source when none is
named, and answers the sources list (only the one refreshed when named). A failed fetch is kept in that source's
error, its listing before it kept, as sources --refresh does. Not the game's: it has sources' refresh.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
mod add replaced a mod of the profile with the same id without a word and kept what the player had granted it.
Now a replace is refused without --replace (the op's "replace": true), and one whose files are not the same
(another content hash) drops the mod's grants: its profile.json entry's granted and its trust.json acceptance and
unsafe grants, so the player is asked again. --plan ("plan": true) only answers what it would add: {id, version,
sha256, replaces, same_content, code, permissions}. The answer says {id, version, sha256, replaced,
grants_dropped, code, restart}.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A .zip is read as a package is (content::archive: no entry out of its folder, no link or special file, the size and
ratio caps). mod add takes a zip of a mod's folder (its one top folder holding mod.json is the mod) and unpacks it
into the profile's mods/<owner>~<name>/; mod import unpacks a zip of emulator mods into a scratch folder of the
cache and converts what it holds, a zip that is one mod named by the zip's own name. The launcher's own unpacker is
no longer needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
An emulator's own layout keeps a mod at contents/<title id>/<name>/romfs: import now looks up to four folders below
the one given for folders in the emulators' layout (a mod's own folders, a folder with mod.json, dot folders and
links not looked in), each named by its own folder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
import's --name (the op's "name") gives the one mod the path holds its name; its id is made from it (local/<slug>)
as from a folder's name. A path holding more than one mod with --name is bad_args.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
add's answer and each of import's mods carry code (true when it brings code: hook sites or ExeFS patches, which the
next start builds into the game) and restart (a running game must restart for it), as install's code does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The launcher's ModsEmulators.Scan, in the builder: Eden and its forks (one emulator where they share a data
folder), yuzu, suyu, sudachi, citron, torzu and Ryujinx, by their data folders on Linux and Windows; each one's
mods for this game's title id (yuzu's family: load/ or its qt-config.ini's load_directory, and sdmc's atmosphere
contents; Ryujinx: mods/contents and sdcard's), with the emulator's switch (DisabledAddOns, Ryujinx's mods.json;
null when not known) and whether it holds code (exefs). Read only, no link followed. Answers {emulators: [{name,
data_folder, mod_folders, problem}], mods: [{emulator, name, folder, source, enabled, code}], looked}.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Removing a mod of the profile's own folder (an add or an import) now deletes its folder or file in mods/ as well,
its read-only bits cleared first as the launcher's DeleteTree does; only a name directly in the profile's mods/ is
ever deleted, and no link is followed. --keep-files (the op's "keep_files": true) keeps them. The answer gives
"deleted": the paths deleted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
enable/disable (the ops; mod enable <id>, mod disable <id>) set a mod's "on" in profile.json in place, under the
profile's edit lock, the rest of the file as it was. The answer: {id, on, changed, code, restart} (code: a code
mod's switch changed, which the next start builds in). Not the game's: its Mods tab has its own switch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
tools.md's sources table gains tags, pin/unpin, enable/disable, emulators, source refresh [url], search's --unsafe
and --fits, install --plan, add's --plan/--replace and .zip, import's .zip, depth and --name, remove's --keep-files,
and a list of the JSON results a launcher reads (stable: keys only added). mod-ops.md's ops table, Summary and
Details follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(modtool): check_built_in is the built-in mods' test's, so it is built for tests alone
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 25s
CI / Workflow lint (actionlint) (pull_request) Successful in 43s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 44s
Third-party parts / As their notes say (pull_request) Successful in 58s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 1m1s
CI / What the change needs (pull_request) Successful in 1m3s
PR description / Description follows the template (pull_request_target) Successful in 1m20s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
3509a8a9b6
Clippy's -D warnings refused it as never used outside the test that checks every built-in mod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
style(modtool): rustfmt over repo.rs
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 28s
PR description / Description follows the template (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
b7c686a368
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
request_trust's confirmed (mod allow <id> --yes --sha256 HASH [--permissions a,b]) records trust with no window,
exactly as the window's Accept does: the mod's code accepted, the unsafe tier it requires granted, and only
permissions its mod.json declares (bad_args for one the schema lacks, refused for one it does not declare). It
needs the content hash the player was shown and refuses with content_changed when the files are not it now; the
game can never send it (refused). The answer is the op's {accepted}.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
order (the op; mod order <id> --up|--down|--to N) moves one mod in profile.json, in place under the profile's edit
lock, every other key kept. System mods stay first and in their place (system_mod for one; nothing moves before
them); a mod that is not there is not_found; one of up, down, to (bad_args otherwise). The answer: {id, from, to,
order} (places from 1, order the ids as they now are). Not the game's: its Mods tab moves them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
remove of a path (mods/<name>, a full path in the profile's mods/, or a bare name) that is not an installed id
deletes that folder or file, by the rules of a mod of one's own: only a name directly in mods/, no link followed,
read-only bits cleared. One that profile.json names is refused (remove it by its id); one that is not there is
not_found. The answer: {id: null, path, profiles: [], deleted}.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Each mod gains romfs_files and romfs_bytes, patches (its ExeFS .ips and .pchtxt) and modules (its other ExeFS files),
cheats (its cheat files), and already: the profile's mods/ folder with the same files, by the launcher's
fingerprint (the paths and sizes under romfs/, exefs/, cheats/, and the bytes of the code and cheat files up to
1 MiB), or null. Links are never followed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The launcher no longer checks these itself, so the builder does, for mod enable/disable and the channel's
set_mods alike (one check, switch_allowed): a required system mod cannot be switched off (system_required); a
system mod this build does not have cannot be switched (system_not_loaded); a mod the profile does not have is
not_found; and a mod whose code waits for the player's acceptance of its warning, or whose required unsafe
permissions are not granted, cannot be switched on (needs_trust). Switching off is otherwise always allowed, and a
switch to what it already is changes nothing. A refused set_mods writes nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
docs(modtool): order, allow --yes, removing a stray folder, emulators' details and the switch rules' codes
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 25s
PR description / Description follows the template (pull_request_target) Successful in 1m12s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 57s
CI / Workflow lint (actionlint) (pull_request) Successful in 45s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 41s
CI / What the change needs (pull_request) Successful in 1m15s
Third-party parts / As their notes say (pull_request) Successful in 54s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m0s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 5m50s
CI / Website build and checks (pull_request) Failing after 38s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m1s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m38s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 6m55s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
34995d71ef
tools.md's table and its launcher results, and mod-ops.md's ops and error codes, follow the last launcher gaps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The CRT, colour-vision and scanlines shaders compiled again by the builder's own glslang (shaderc, pinned by
Cargo.lock), so mod shaders --check matches them; the scanlines example names mod.json's schema as the others do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
test_gfx_effects refuses a sampler past bindings 0 to 3 rather than any second one (an output effect's pass may
sample four); test_vulkan_fixtures_ci's summary expects one passed fixture more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Colour vision's HDR parity failed with no clue where: mode-0 cases now separate the nits stage's round trip (one
code, or Native's codes kept exactly) from the correction, and a failing case prints its first differing pixels.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
Colour vision's HDR parity failed by up to 191 PQ codes: its correction takes small differences of large nits,
which RGBA16F lost in the dark channels of saturated colours (with no correction, the nits round trip matched).
One pass cannot avoid the image: its nits are the HDR pass's (the expansion, the contrast grade, Native's decode),
which an effect is given, not redoes. So, generically: an output effect's nitsFormat "rgba32f" makes the nits it is
given (hdr_encode.comp's HDR_NITS32) and its last pass's image full floats, allocated only while such an effect
runs; a pass's own image may be "rgba32f" too. On a small or integrated GPU (device_policy.h's low-VRAM rule,
small_vram_textures) they stay half floats, said once in the log. GamePass.hdr 2 and GAME_OUT_RGBA32F:
MKWVK_API_VERSION 62. The colour-vision mod asks for full floats; the parity test runs them so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016o1k1PPtvLKUijhrMa4pue
The same generic split as Effect.setSplit, for the player's ReShade preset: left of the line the picture without
it, right of it the preset's. No pass more: ReShade's last copy back (a blit, its ping images' format not the
picture's) covers only the right part. The game side sets it through rx_option_set(HOS_OPT_RESHADE_SPLIT = 3996,
ten-thousandths of the width, -1 none: reshade::set_split); the last mod to set it holds it, and its stop clears it.
The fake game keeps the line (game.gfx.reshadeSplit); ModGfx::set_reshade_split for Rust mods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
chore(gfx): the generated API files for nitsFormat and setReShadeSplit, and fmt
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 27s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 51s
CI / Workflow lint (actionlint) (pull_request) Successful in 55s
PR description / Description follows the template (pull_request_target) Successful in 1m4s
Third-party parts / As their notes say (pull_request) Successful in 1m4s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 1m7s
CI / What the change needs (pull_request) Successful in 1m33s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 2m48s
CI / Website build and checks (pull_request) Failing after 41s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 2m47s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m11s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 7m35s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 33s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m52s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
7f9f027e71
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The feature `runtime` (on by default) is the whole API. Without it, api is
json, manifest, settings::decl and mods::{Enabled, Manifest}, and its
bindings are their permissions' part alone (schema::emit::rust_permissions,
$OUT_DIR/permissions.rs), with serde_json and thiserror as its only
dependencies. A build script can then check a built-in mod's mod.json with
the game's own reader (api::manifest::native) without compiling the game's
crates for the build: longshot-game's registry of native mods, next.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
longshot-game's build.rs walks game/mods/*/: each folder with a Cargo.toml
is a built-in Rust mod (crate sysmod-<name>). Its mod.json is read by the
game's own reader (api without its runtime feature, a build-dependency), so a
bad one fails the build with the mod's name and the reader's error. The
generated registry (src/registry.rs) holds, for each, its folder's name, the
mod.json embedded, that text parsed once into a &'static Manifest, and its
constructor; and NATIVE_ENGINE, each crate's hooks::ENGINE_CALLBACKS. The
hand-kept NATIVE_MODS and NATIVE_ENGINE lists are gone.

No mod is made to read its manifest: the loader (its scan, its settings'
declarations, the sites a mod's handlers may use), the Insert menu's start-up
rows, the places test and the input movies' old option numbers read the
registry's. The constructor runs only when the loader starts the mod; a mod
that needs its manifest has cx.manifest() (the services keep it from the
start). Mod::manifest() is gone from the trait.

Each crate loses its MANIFEST, LazyLock, include_str, expect and manifest()
block and its parse test: its lib.rs keeps its code and one line,
api::native_mod!(<the mod>, keys: [..]), which is its pub fn new() -> impl
Mod, checks at compile time that each setting key its code reads is in its
mod.json (api::manifest::native::declares), and gives its tests manifest().
One registry test checks every built-in mod's manifest; tests/registry.rs
holds the workspace's members, its dependencies and longshot-game's to the
folders, and checks that longshot-game names a mod's crate only for its named
bridges to the host, never its constructor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The registry finds a built-in Rust mod by its folder's Cargo.toml, so its
mod.json names no code. The key goes from every built-in mod.json, from the
built-in reader (api::manifest::native) and from mod.json's schema (and the
website's copy); the readers of files no longer refuse it, so its shared test
vector goes too. modtool's check_built_in and the Python tests tell a Rust
mod by its Cargo.toml. The docs say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The help box read the focused row before the page was drawn, after the overlay had cleared the settings focus: it is
read after the page now. A text row with no text shows None, as the old menu; Tune and Done have a width of their own,
so the slider gives up the room instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The 6.4 ms frame was the menu's first read of the declarations at the game's start, which waits for the upscalers' start-up
probe: the menu now reads only while it is open. Open, a row whose state did not change keeps its object and the page's
ask and open functions stay the same, so its line is not drawn again (and asks the renderer no texts). The fake renderer
counts its reads (game.menu.reads), and a test holds both: no read while closed, no line drawn again with no change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
longshot/ui's memo(component, isEqual?) draws a component again only when its props changed by their parts (or as
isEqual says): the menu's lines use it instead of their own bookkeeping, and ui-cases' memo case tests it. The
declarations are read on a thread of their own: decls answers ready: false at once until they are, changed fires once
they are, and the menu shows Loading meanwhile (the fake renderer's hold tests it), so no system mod waits on the
renderer's lock or its list's first build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The fake renderer's declarations are read in decls itself unless held, as the tests expect; the memo test was put in
the wrong place in reconciler.test.ts; schema-gen's files for decls' ready.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
test(menu): the renderer's texts given before the page is drawn
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 26s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 48s
CI / Workflow lint (actionlint) (pull_request) Successful in 49s
Third-party parts / As their notes say (pull_request) Successful in 57s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 1m1s
PR description / Description follows the template (pull_request_target) Successful in 1m10s
CI / What the change needs (pull_request) Successful in 1m14s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 3m23s
CI / Website build and checks (pull_request) Failing after 36s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 2m29s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m24s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 7m51s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m44s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
c20a220fce
A value's text is read when its row is drawn (memo): the test gave them after the first drawing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The play and update paths check a game's patches against the hook sites (build-driver's clashes::refuse) through
the same Tables::load as the lift: a site defined in game/mods/<name>/sites.toml alone is read and placed, and a
location naming a site nothing defines still stops. (A builder older than the mods' own tables stopped on
menu.buttonWait this way.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
game-sites' build.rs and sites::Tables::host give each built-in mod's site that is not a data rule (and has no line)
a flag and a slot from the mod's own definition, under the same identifier, so the lifted code names the same two
symbols. Text speed and size's text.letterStep loses its HOS_SITE_ENGINE line: the mod puts its handler on it by
name at start. A test checks every built-in mod site has its slot and text.letterStep has no line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
oot::layout::sysmods::text moves to game/mods/text/src/layout.rs (only this mod reads it). Comments that cited the
gone host/oot_text_step.c, oot_text_size.c and nn_vi.c's text_scale, gameplay.cpp's game/menu/rows.c and
vk_api.h's option 5 now say what is there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Timed, ignored benches for extension 4's choice (in-place handlers on worker data sites): text.letterStep's
dispatcher alone, the text mod's native handler and a prototype handler language (option A) in
game/mods/text/tests/hit_cost.rs; QuickJS-ng calls of a small handler with its marshalling, bare and through the
mod runtime's budgeted call (option B) in script's runtime tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(api): mod.json's schema renders the same whichever crates are built with api
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 20s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 32s
CI / Workflow lint (actionlint) (pull_request) Successful in 33s
PR description / Description follows the template (pull_request_target) Successful in 43s
Third-party parts / As their notes say (pull_request) Successful in 38s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 43s
CI / What the change needs (pull_request) Successful in 58s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m12s
CI / Website build and checks (pull_request) Failing after 41s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 2m27s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 5m26s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m1s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 2m59s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 1m0s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 15m15s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Successful in 21m37s
a7229b13f8
The schema's objects kept their keys in serde_json's map order: sorted when
nothing in the build turns on serde_json's preserve_order, insertion order
when something does, as a workspace-wide build does. So text() depended on
the crates built together, and the website's copy (written sorted, by
`cargo run -p api --example mod_schema`) failed the_website_serves_this_schema
inside run_all's test_lifter while passing under `cargo test -p api`.

text() now sorts every object's keys before it writes (Value::sort_all_objects),
so the file is the same under either feature set. A test renders the schema
built in reverse key order and checks it is the same text, and that the top
level's properties are sorted in the file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A release's longshot-builder now carries liblongshot_rs.a for its own
platform the way it carries its pack: longshot-builder's build.rs embeds
the file LONGSHOT_GAME_RUST names (compressed with ruzstd), beside
LONGSHOT_SOURCES. scripts/longshot_builder.py build --sources builds the
library from the same tree first, with the pinned Rust, and from-source
does the same for the builder it makes. The library says its target: the
program's own, or LONGSHOT_GAME_RUST_TARGET's (a developer's test of
another platform's library, as a cross build of the Windows game).

A build of the tree the program carries links that library (build-driver
gives build-compile a rust::Carried for that tree alone, written to the
work folder's rust-carried/ when it changed); any other build (a
checkout, --root, another platform, a builder that carries none) builds
the tree's own Rust with cargo, as before.

Gone: longshot-rs/prebuilt/<platform>/ in the pack, its sources.key and
the key compare in build-compile's rust.rs (source_key, READ_TOO),
`longshot-builder dev rust-key`, and the release step that made them
(longshot_builder.py game-rust in build-linux.yml and build-windows.yml).
The Linux dry run still checks the program links the carried library;
the Windows one, run by the Linux builder over the unpacked pack, can't
see it, so the Windows program's own first start under Wine must say it
carries it (`sources`: "the game's Rust: carried for windows-x64").

Tests: the carried library is linked for the carried tree and its
platform, cargo builds any other (a stand-in cargo); the carried
library is written for the carried tree alone, again only when it
changed; the dry run's checks with and without --root.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A pure move, nothing in the files changed: assets/modding/docs/ is
docs/modding/, assets/modding/examples/ is docs/modding/examples/, and
assets/modding/templates/new-mod/ is docs/modding/template/ (beside
the examples, not among them: every examples walker would take its
{{id}} placeholders for a mod).
None of them is shipped by a build, so assets/ keeps only what one does.
The paths that point at them follow in the next commits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
After the move: the links of every doc, README and example (relative
ones recomputed for each file's new depth), mod init's include_str!s of
its template (docs/modding/template/), modtool's examples walkers (mod
check's, mod test's every-example test, the examples' shaders and their
.spv freshness), the manifest test's folders (the template now under
none of them twice), schema-gen's outputs and what its emitters write
(reference.md, permissions.md, the guide, the d.ts's and the mod.json
schema's doc links, the C and Rust comments), the doc-anchor test (one
docs/ root now; the old place refused), api-schema.md's layout, and the
gfx tests' example paths. The website and the release's tree read none
of these folders.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
assets/modding/packages/api/ (longshot.d.ts and a private package.json
whose version schema-gen checked) is gone, and with it assets/modding/:
api's build.rs writes the declarations into $OUT_DIR from the schema
(schema::emit::dts), beside the Rust bindings, and api::bindings::DTS
holds them; modtool's mod types writes that text into a mod's types/.
schema-gen no longer writes or checks the file, nor the package's
version (paths::OUT_DTS, PACKAGES, emit::check_packages). The docs say
where the declarations come from now, and the generated reference says
"included in the API's longshot.d.ts" for @longshot/api.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
refactor(mods): system mods are read from game/mods alone
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 25s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 50s
CI / Workflow lint (actionlint) (pull_request) Successful in 52s
Third-party parts / As their notes say (pull_request) Successful in 1m0s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 1m5s
PR description / Title and description (pull_request_target) Successful in 1m11s
CI / What the change needs (pull_request) Successful in 1m26s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m56s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 1m36s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 5m7s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 2m20s
CI / Website build and checks (pull_request) Failing after 39s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Successful in 6m55s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 1m40s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 19m26s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 15m20s
eb59967d64
The schema crate also looked in assets/modding/system/ for script system
mods, a folder they moved out of: the mod API has not shipped, so no
build needs the old place. paths::SYSTEM_MOD_DIRS is SYSTEM_MOD_DIR,
game/mods; the system mods' table and the declarations' list read that
folder alone (no name hidden by another place's), and the generated
table's first lines name it alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Since the modding docs moved to docs/modding/, the examples and the mod template `mod init` writes
(docs/modding/examples/, docs/modding/template/) counted as docs: no --tested-in-game asked for a change to them, a
switch their code adds unseen, the Docs box suggested for them. They are mods, code a game runs: MOD_CODE is in
GAME_PATHS, and is_code() says what counts as code for the switches and the tests' reads; their .md files are docs still.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The hosted page's help box had an empty title ("", not none) and the focused control's help alone: a row with no help
text drew an empty box, and no row was named in it as the menu's own rows are. The box's title is now the focused
control's name (its label, its title, or a Button's words: modui_settings_title), then its help and the hint; with none
of them, as on a tab's strip, the box is not drawn.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The renderer's layout took the room of a row too wide back from every child without a width of its own, in proportion:
a Slider, which takes the whole room it is given, and the Tune Button beside it both shrank, and the Button showed
"T...". The menu's fixed width={96} did not help: 96 virtual px is less than the word and the Button's padding. The
inputs that fill their room (Toggle, Choice, Slider, TextInput, Keybind) now give it up first, down to kInputMinW, and
only then does the rest give up its share. The menu's Tune and Done lose their fixed width.

tests/test_modui_row.py lays out that line with the real layout (gpu/vk/modui_layout.cpp) at the menu column's widths;
it fails before this change. The fake game's tests passed because the fake game lays nothing out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The row's key stays autosave: (a saved key does not change); its label, which the TS menu and the engine's both show, is
"Autosave" now. The golden row lists, the debug tools' order test and the player docs follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The TS menu's tabs were the window style's boxed buttons, at the page's left, and its first focusable control: the focus
started on the Graphics title and stayed on it while Q and E chose other tabs (the stale ring of the in-game shots), as
nothing moved it. A Tabs on a settings page the menu shows (any mod's: drawn by modui_draw_settings) is now the menu's own
tab bar: its titles centred, the shown one light on the dark inset with the gold line, the tab keys' caps (Q and E, L and
R with a controller) at its ends. The tab keys and a click choose a tab; the arrow keys never stop on a title, the first
focus is the first control they reach, and a tab change lets go of a focus left on the bar, so the new tab's first
control has it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
At the TS menu's first opening its script spent 3.0 ms in settingsHost.decls (5.3 ms in the frame, over the 2 ms a
script is warned at): the answer read off the script's thread was written as JSON on the script's thread, then read back
to be checked, then parsed by the script. It is written where it is read now, and decls hands over that text. And
Json::from_value, which every service's JSON answer goes through, checks the value itself instead of writing it and
reading it back. The menu starts the read at its start, so its first opening takes the answer ready.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The loader built the Mods tab's rows again at every frame the Insert menu was open, and stateChanged, fired for each new
snapshot, had system/mods-tab read modsHost.tab and draw the tab again at every frame (2.1 to 3.2 ms of its script a
frame, warned over and over; 4.4 ms the first time) on whatever tab the menu showed. The UI service now tells when a
mod's slot fills were all left out of the last snapshot though their owner has a UI (ui_slot_hidden: the menu on another
tab than the Mods tab); mods.host's step neither asks the loader for fresh rows nor fires stateChanged then, and fires it
only when the snapshot's content moved, not for each snapshot the loader builds. The tab's data is built when the Mods
tab is first shown, no longer in the frame the menu opens with its declarations' read. When it cannot be told (no
snapshot drawn, the owner with no UI: the fake game's tests) it is read as before. A screen effect's GPU ms on a mod's
page is the one read when the tab last moved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Colour vision's HDR fallback could not be told from the log: on a small or integrated GPU (RX_VK_TEST_VRAM_MB=4096 makes
one) an effect that asks for full-float nits gets half floats, and only a line said once for all of them told it. The
line logged as each output effect is made now names its nits: "HDR nits in rgba32f", "HDR nits in rgba16f (rgba32f
asked: a small or integrated GPU)", "HDR nits in rgba16f", or "SDR only".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
In the game the TS menu's tab strip, now the menu's tab bar, sat at the top of the page column, too narrow for its seven
titles: Debug was cut off past E (l4mf-1's shots). The page's first Tabs now has its strip on the menu's banner, where the
menu's own tabs are and which the hosted menu left empty (modui_settings_tabs_away, modui_draw_settings_tab_bar), and the
layout keeps no room for it in the page (Inputs.strip_away). A Tabs drawn in a page (a mod's own settings page) fits its
titles to its room, its padding and then its letters smaller, before it cuts one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
l4mf-1: modtool's menu test ("closed, the menu reads nothing a frame") failed on the declarations' read started at
the menu's start; the read is the menu's first opening's again, and costs that opening 1.2 ms now (3.0 before), its
answer written off the script's thread. And the stateChanged condition wrapped as cargo fmt wants it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The allowance at the start (the policy's small_vram_textures, the HDR nits
fallback and the rest) and vram_usage's in play now count no device-local
heap for more than RX_VK_TEST_VRAM_MB makes it. Before, the test switch
lowered the VRAM but not the allowance, so a 24 GB card at 4096 still read
21 GB allowed and never took the small card's path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
menu_mod_ui is on by default, so F1 (or Settings) opens the TS menu with no
option set. Off brings back the C++ drawing until that drawing is deleted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A setting's "native" object is gone: its fields are the setting's own and any mod's, read by the one reader
(manifest::setting::read): store ("options": kept in longshot_options.ini under its id, which may hold a -;
"run": for the run alone; in place of scope), place (its row in the Insert menu), presetExempt, shownIf (one of
the mod's own settings, or <mod id>:<id>), hints (a line an option) and defaultText. A built-in Rust mod's
settings are made SettingDecls from the same SettingSpecs (settings::decl::decl_of); a script mod's are declared
into the settings service at its start and leave at its stop, so they are kept where their store says and their
rows with a place join the menu's, told to the mod by settings.changed. A mod whose options key another mod's
setting holds, or (a player's mod) one of the renderer's own rows, does not start (Settings::refused).

What only a system mod may have: a "button", and legacyOption and legacyId until input movies name settings by
key (the clean break removes both).

New: settings.setHints(id, hints | null), a choice's hints in place of its declaration's (the CRT filter's
"bypassed" lines), and the fake game's menuRow(id), optionsLine(key) and setOptionsLine(key, text) (its longshot_options.ini). The schema, the shared vectors, settings.md, system-mods.md
and DESIGN.md say the same; the built-in mods' mod.json files are flattened, their keys unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Both were Rust only because a script mod's settings had no options-file line or Insert-menu place; with one setting
format they are script system mods over the public API alone: each an output effect of longshot/gfx made from its
settings (src/crt.ts, src/correct.ts: the same passes, sizes, formats, inputs, params, order and nits format the Rust
mods gave), the shaders in effects/ unchanged, the settings in mod.json with their keys (crt_filter, crt_lines,
colour_vision), "store": "options" and their places. The CRT filter's "bypassed while the game presents Native HDR"
hints go through settings.setHints. A refused effect after a change is logged and tried again at the next change.

Their tests run on the fake game (Longshot.exe mod test; modtool's TypeScript system mods test runs them): each
filter and raster, each mode, the rows' places, the options lines read and written, the hints, turning off. The
pixels are test_output_fx_parity.py's (the same .spv files). The crates sysmod-crt and sysmod-colour-vision are gone
from the workspace, the registry finds the folders as script system mods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
When a mod stopped (turned off, faulted, its start failed), Services::ui_gone took its UI away, but the test's view
(fake.js's Ui, made of the batches the game applied) kept the last tree: game.ui.hud() still showed what a stopped mod
had drawn. Each stop now hands the view a host op, "gone", which takes the mod's trees and mounts down; it is not one of
the mod's commits (game.ui.commits and lastBatch leave it out).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The banner of the place's name was Rust only for its options-file line and its Insert-menu row. Now a script system mod:
the names' table and rules (src/places.ts, the Rust places.rs case for case, the C's 95-byte key included), when it
shows, fades and goes (src/banner.ts: a new map in play, 3 s whole, 1 s fading; loads and the title screen take it
down, the title screen forgets the map), and a HUD root at the top centre holding a Canvas (src/main.tsx), drawn as the
Rust mod's ops drew it. area_name_banner keeps its key, store and place.

Its tests (Longshot.exe mod test; modtool's TypeScript system mods test runs them) step the banner alone and through
the fake game's maps, check what it draws, its row and its options line. The crate sysmod-area-names is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
game/DESIGN.md says the rule and gives each mod that stays Rust its reason and what would move it: shadows' fit (in
place on worker sites, until the site runtime measures close enough), sprint-walk (a synchronous pad filter and worker
sites), widescreen's per-pane UI (game function calls, wrapped hooks, a per-present tick), voice-language (it answers
an outcome site) and cheats (immediate memory writes in its VM's order, raw HID, cheat files). The others wait for
the hooks work. system-mods.md lists the CRT filter, Colour vision and Area names among the script system mods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The format's reader (table.rs, with its tests), the signatures and the host's list move from the lifter's sites
crate into site-table, which needs only toml: game-sites' build.rs can then read the tables with the lifter's own
reader instead of a second one of its own. It is a game crate, so a player's tree (which carries game/, not builder/)
has it, and the game library's source key (game/crates) holds it on both sides. sites re-exports every name it had,
so its users are unchanged; the made-up tables of the reader's tests are site-table's fixtures (feature fixtures),
for sites' tests too. The lift's EDITS_SOURCES hashes site-table's sources as well, each file by its crate's name,
and key_crates.rs says why it is not in the lifter's own key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Format 3, read by site-table for every owner: the core's game/sites/sites.toml, each built-in mod's
game/mods/<name>/sites.toml and a player's unsafe mod's sites.toml. A row is the site: its definition, what
finds it in any build (signature, signature_offset, guards, offset), and an entry for each supported build,
builds.<id> = { fn = "f_...", ... }, keyed by the build id's first 8 or more hex digits, holding where it is
there and what of the rest differs (an offset, an anchor, a vslot's slot, or the arguments in other registers:
the same names and types, checked). Long entries are a [site.builds.<id>] table of the row. The anchor key in
becomes within (in is no key now). hot = true marks the sites known to be reached many times a frame (the UI's
per-pane sites, anim.loopStep*, actors.update, heap.*, barrier.*): metadata only, to be confirmed by a hit-count
run. game/sites/<build>/locations.toml is gone: every site's entry moved into its owner's row (the mods' into
their own files), and the named locations are [[location]] tables of the core's file with builds entries too.

For each site the builder uses its entry for the build (its signature checked there), else its signature alone
(sites::find_unlocated), else: a built-in mod's required site leaves that mod out with why (logged, never a
stop), an optional site is not placed, and a required core site makes the build unsupported when no core site
names it and stops it when one does. The HOS_SITE_OUTCOME check reads every owner's rows, so a mod left out
does not trip it. A player's mod reads the same rows with the mods' rules on top (its entries hold fn, offset,
signature, signature_offset, guards and args; old format 1 tables are refused saying so), its list rows carry
the build's registers. game-sites' build.rs reads the tables with site-table: the forms, the mods' slots, and
PLACED, each supported build's placed sites by its key (the same left-out rule). The lift's key holds every
owner's file. The supported build's sites, their order and owners (site_owners.txt) are unchanged, so the lifted
output is the same.

New repository tests: a supported build's every site placed by its entry, none left out; a mod uses only the
core's sites and its own (its mod.json and sources); only game/mods/text names its site. tests/sitecheck.py reads
the new rows; the site-event example is converted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A build with no place for one of a built-in mod's required sites leaves the whole mod out (site_table::load);
the loader now holds such a mod back at the start (not available for your game version, naming the sites)
instead of starting it on hooks that never run. It asks game_sites::placed_in_build, which reads the same
tables' placed sites (PLACED) and is None for a build the tables do not name at all: nothing is held back
there, as nothing is placed. A game-free test holds a made-up mod whose second site no table has.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Longshot.exe mod sites port reads a mod's sites.toml (a player's, or a built-in mod's in game/mods/<name>) with
the tables' reader and, for the --to build: says which sites already have an entry; finds each other one by its
own signature, else by another build's entry's (the --from build's first, its offset, signature and guards
carried into the new entry), else with --from by that build's code grown into a longer signature; and lists the
ones it cannot find. --write adds each found one's builds.<id> = { fn = ... } line to its row, before any
subtable of it, with a key no other of the row's starts, and reads the file back first. The search is the lift's
own (sites::modsites::find_one, now public) rather than a copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
docs/dev/reference/hooks.md documents format 3: every key, where it goes (row or entry) and who may use it (the
core and built-in mods, or a player's mod too), the builds entries with an example of per-build arguments, how
each site is found in a build, hot, within, the named locations, and the lift's new messages. unsafe.md and
tools.md say how a player's mod lists builds and ports them; system-mods.md and game/DESIGN.md say a built-in mod
holds its sites with their entries and is held back when a build has none, the text mod as the whole example
(and the api crate's build, not schema-gen, writes a system mod's types into longshot.d.ts); game/README.md,
setup.md and builder.md lose the per-build locations files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The header comment named the per-build locations.toml files, which are gone: it now names the core's sites.toml
[[location]] tables and their builds entries. The comment is the only change to the generated file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
mod sites port's entry search folds its if into the let chain (clippy), and its test's third site has a signature
found nowhere, so the written table is still one the build takes. The named locations' test writes a location with
both fn and data in one entry (two entries of one key are not TOML). test_switch_table.py reads site-table as it
reads the schema crate: its HOS_* names are game/sites.def's macros, not switches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Nothing of the site tables has shipped, so the one format every owner's sites.toml is written in is format 1,
with no history: the reader takes format = 1 alone and says so for any other, its messages name no older form
(a build's entry that is not a table, the key in), and every table in the repository (the core's, the built-in
mods', the example, the tests') and hooks.md and unsafe.md say format = 1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The hooks had one permission, hooks.unsafe, for anything at a site. Power is now rated by what a write can
reach: hooks.observe (low) hears the game's own sites, hooks.change (medium) lets a filter change them, and
hooks.unsafe keeps a mod's own sites and data rules' values. Each tier holds the ones below it
(permission::HOOK_TIERS, in Grants::has), so a mod granted hooks.unsafe is unchanged.

- api.toml: the two permissions appended last, so no permission's number moves; schema-gen's docs regenerated.
- hooks.toml: listen and sites take hooks.observe; setValue stays hooks.unsafe. api::services::hooks checks
  each row's tier at listen (Row::tier).
- The build (build-driver modsites::collect) takes a sites.toml whose rows only name the game's sites from a
  mod holding hooks.observe or above (sites::modsites::table_tier); mod check says the same.
- Acceptance by content hash still applies to every sites.toml, whatever its tier (an open question).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The state a hit reads and the state it sends back, the ground for rules and the site runtime: no mutable
state is shared between a game thread's hit and the mod's script.

- game_sites::snapshot: 128 cells, one a mod that declares a snapshot. The script publishes a whole one with
  one pointer swap; a hit counts itself in, reads, counts itself out; the one replaced is retired with the
  cell's reader count, as a rule's table is.
- game_sites::capture: a buffer a capture, a lane per game thread (one writer, the script the reader, no
  lock), each a last value (under a sequence count), a count or a 16-record ring; overflow counted.
- game_sites::scratch: 16 values a mod keeps between hits on one thread, zeros for a new claim of its cell.
- mod.json's "snapshot" (names and types: f32, i32, u32, bool, or a table of up to 64), read by
  site-table's snapshot::Layout, so the manifest reader, the rules' reader and mod check share it; the
  website's mod.schema.json regenerated.
- longshot/hooks' publish(values) sets the named fields over the last snapshot and swaps it in; the mod's
  start claims its cell, its stop lets it go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A mod's rules change and read a site's arguments and fields at every hit, natively, from the values its
script publishes: the second of the four ways to answer a site, between events and handlers.

- site-table's rules reads rules.toml (format = 1): set, scale, add, min, max, or, and on a place by an
  operand; when (an AND of up to four comparisons); keep (f32 fields scaled from the game's own value);
  capture (up to four places and a bounded UTF-8 or UTF-16 string, as last, count or ring); answer.
  A place is an argument or a field at most two pointers deep; an operand a number or a snapshot value.
- game_sites::program checks each rule against its site's arguments and the mod's snapshot, rates it by
  what it reaches (Tier: observe, change, unsafe), and runs every mod's rules at a site in load order in
  one Program, one link of the site's chain inside the mods' listeners. keep's tables are the engine's, one
  a field of a site, so several mods' factors multiply, and a field no rule keeps gets the game's value back.
- Each site now knows its owner (core or the built-in mod whose sites.toml defines it): a mod uses the
  game's sites and its own, never another mod's.
- longshot/hooks: setRules(text) and captures(name); a mod's folder's rules.toml is put in place before
  its entry runs (the loader and mod test), and a rule past the mod's tier stops its start.
- mod check reads rules.toml with the same checks (rules, rules.permission).
- The inline value templates (table.rs Rule, the edits' site code) are unchanged: the lift is the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Hot is measured, not declared. Every hit of a site's dispatcher and of a mod's own slot is counted in the
hitting thread's own lane (game_sites::lane, shared with the capture buffers): no lock, no contention.
One hit in 16 a thread is timed and counts for the others. A site with only its owner in its slot (the
plain trampoline) counts nothing, so the game's own callbacks cost what they did.

- game_sites::stats: the counters, and Frames, which the hooks step reads once a frame: each site the
  mods' rows and rules use gets its last frame's hits and time. A site over 0.5 ms a frame for 30 frames in
  a row is said once in the log.
- SiteInfo gains hits, timeUs and overBudget. hooks.sites() lists the mod's rows, then the sites its rules
  use.
- longshot/mods' inspect() gives each mod's sites, and the mod inspector's page of a mod lists them
  (0.5.2).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The third way to answer a site: a mod's src/sites.ts, whose handlers run at the hit on the game thread
that reached it, for a decision that needs that hit's data.

- script::sites: one small QuickJS interpreter a mod a game thread, made at the thread's first hit (1 MB
  heap, 128 KB stack, no game API; its code imports only handle and fields from longshot/sites). A
  handler gets the site's arguments as a draft, the mod's snapshot (frozen, made again when it changed)
  and the thread's scratch object. With hooks.unsafe, fields.get reads a guest value and fields.set
  drafts a write.
- Drafts are applied only when the handler returns in budget, every value read back first; a throw or a
  cut-off leaves the hit untouched. The budget is 200 us a hit, asked every 64 steps: Longshot's
  longshot_qjs_poll_every sets QuickJS's step count, which upstream resets to 10,000. Eight misses in a row
  switch the handler off for that site, with a log line.
- What a handler returns is not read, and outcome sites refuse handlers: no answers on worker sites.
- api::script::SiteRuntime and ScriptHost::site_runtime (QuickJsHost makes script::sites::Sites).
  Services::handlers_start puts a mod's handlers in their chains before its entry runs (the loader and mod
  test). The tier is hooks.change at the game's sites and hooks.unsafe at the mod's own. A mod's stop
  takes them off and retires its runtime; each thread frees its interpreter at its next hit.
- Shadows' steady fit is the first measured case: game/mods/shadows/src/sites.ts ports SteadyFit, and
  tests/site_runtime.rs runs it through the site runtime on 300 written hits for parity with the native fit
  (the same boxes and basis rows), plus an ignored timing of both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A mod for the in-game check of rules, the snapshot, captures and per-site stats. mod.json declares a
snapshot and asks for hooks.change. rules.toml scales camera.lens's angle by snapshot.fov and captures
it. The script publishes the factor and logs each second the site's hits and time (hooks.sites()) and the
newest angle captured.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
ModApi::site_handler asked whether the mod was a system mod, and for hooks.unsafe at any site. It now goes
by the tiers every mod's handlers, rules and listeners have: hooks.change at the core's sites, hooks.unsafe
at the mod's own, never another mod's. The site must still be in its manifest. No hook gate asks whether
a mod is a system mod. DESIGN.md says so, and that a native built-in mod cannot start a site runtime: it
has no script host and no shipped folder at run time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The core named mods: oot::layout::sysmods held every built-in mod's registers, fields and addresses, and
oot::sysmods::widescreen and oot::call::sysmods held Widescreen's site logic and its pause-menu calls.
For the mods l4ts doesn't port, these are now the mods' own:

- sprint-walk, shadows and voice-language each get a src/layout.rs, with the tests that check their
  addresses;
- widescreen gets src/layout.rs and src/wide.rs (the site logic, the layouts and panes, and the picture's
  pack and draw calls), and longshot-game reads the picture from sysmod_widescreen::wide;
- the replace site's own function call is the core's generic oot::call::callee.

Field of view, Damage and Skip title screen stay in oot::sysmods until their ports. Byte-identical code;
no behaviour changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
rules.toml beside the text mod says Text speed and Text size as two rules on its own site text.letterStep:
scale the step's time by the published speed, and keep the pane's text scale (two f32 fields through the
control's wrapper) at the game's own value times the published size. tests/parity.rs runs the rules
through game-sites' interpreter and the native letter_step on copies of the same panes, 360 written hits.
It goes through every speed and size, with panes the game writes between hits and a pane not set up. The
step times and pane scales match after every hit, and so do the values given back when the mod stops.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The text system mod was a native crate whose handler stepped the text panes at text.letterStep. It is
now TypeScript. rules.toml, which matched the native handler on written hits in the commit before, does
the work natively at every hit. src/main.ts only publishes the two settings' numbers, speed and size,
into the snapshot mod.json declares. Its settings keep their keys and rows (text_speed and text_size,
store options, legacyId 5 and 10). Its site stays its own (site_owners.txt unchanged: system/text). Turning
it off takes its rules away, and each pane's text scale goes back to the game's.

- game/mods/text: mod.json (runtime js, its snapshot; 2.0.0), src/main.ts, src/text.ts (each choice's
  number), test/text.test.ts (its rows, options lines and numbers).
- The crate sysmod-text goes: its sources, tests (hit_cost's bench too), and its places in the workspace
  and longshot-game. The repository test that nothing outside its folder names its site goes with it.
  game-sites' tests read the mod's rules.toml itself, so the parity's expectations hold the file.
- mod check reads a built-in script mod's sites.toml in the core's format (as it did for the Rust ones).
- DESIGN.md, system-mods.md and hooks.md say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
game/mods/settings (system/settings) drew the same tree as the TS menu on its own settings page. It
goes whole: its crate, its workspace entry, longshot-game's dependency (the native-mods registry is
made from the folders, so its entry goes with the folder), its tests and its parity list
menu_rows.tsv (tests/test_settings_decls.py now writes and checks the TS menu's menu_rows.json
alone). It declared no setting, so no key moves and FROZEN is unchanged. The docs that named it
name the menu system mod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A button has no value, so the menu's set of one changed nothing and its mod never heard it: a
button declared by a native system mod did nothing. A press is now told (setting_changed) each
time, though no value moved. Test: each_press_of_a_button_is_told_to_its_mod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Debug tab's panel was the C++ menu's code: its rows, their presses (game_cheat_action) and the
Teleport and Inventory pages, over game/oot_cheat_items.h. The cheats mod now declares them as its
settings, drawn as any mod's rows: Mark position, Return to mark, Set time (by Time of day), Change
quantity (by Pouch item and Change by), Teleport (by Teleport to), Switch age, and an item choice for each
inventory section (a choice holds 64 at most) with one Amount, the last chosen item's, which follows
the game's count and sets it. Each is kept for the run alone and shown
while the Debug tools are on. A press runs the same action as before (command::run). Turning the
tools on turns the renderer's Autosave row off, as the menu did.

The inventory's items (labels, pouch names, kinds, sections) and the teleport sections are the
mod's data, game/mods/cheats/debug.json; tests check them against oot::travel's lists and the rows'
choices. New keys are run-only, never saved: FROZEN is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Insert menu draws no row of its own now. vk_menu.cpp keeps its frame (the dimmed game, the
banner with the logo and the version, the help box, the prompts), opening and closing, the restart
question's logic (drawn by the menu mod as "@ask"), the text field a hosted TextInput is typed in,
and the routing of the keys, the gamepad and the mouse to the hosted tree (system/menu's page, or
the engine's fallback when the menu mod does not run). Gone with the drawing: the tabs and rows, the
Controls page's grid (its BINDINGs stay declared), the Debug tools' panel with its Teleport and
Inventory pages (the cheats mod's rows now) and game/oot_cheat_items.h (the cheats mod's
debug.json), the Mods tab and its permission prompt (the mods-tab system mod's), the tune bar, the
quick debug overlay and the Debug tools' own dialog. vk_menu.cpp goes from 8230 lines to 4323.

The Menu drawn by mods row (menu_mod_ui, gpu/vk/menu/mod_ui_menu.cpp) goes, and its key leaves
tests/test_menu_ini_keys.py's FROZEN: it was new in #2434 and never shipped. The renderer's
debug_tools.cpp module goes (Debug tools and Damage taken are the cheats and damage mods' game
rows, drawn in place; FROZEN keeps their keys, now game:CHEATS and game:DAMAGE); its Autosave row
is gpu/vk/menu/autosave.cpp. The Compact menu key and Command palette key rows are hidden, their
lines kept, until the mods open the tune strip and the Commands page from play.

MkwVkHost version 63: the Mods tab's seven members (mods_snapshot, mod_edit_id, mod_setting_set,
mod_permission_set, mod_prompt_answer, cheat_info, cheat_set) are mod_keys (each mod's debug page
key and keybind keys, for play) and mods_state (the waiting permission prompt, which opens the menu
for the Mods tab mod to show it, and the mods' changed number for the restart question), and
game_cheat_action goes. longshot-game's mods_page.rs (the C block) and debug_tab.rs go, the tab's
data functions move into mods_host.rs, and cheats.rs keeps only the live input's !cheat and an input
movie's action. renderer_setting_text("menu_language", MKWVK_TEXT_LANG_CODE) gives the menu's
language code, for the mods' translations.

Tests of the deleted drawing go (test_menu_tune, test_mods_menu, test_mod_prompt_keys,
test_menu_mouse_scroll, test_menu_empty_tab, test_damage_debug_menu); test_cheat_items reads the
cheats mod's data, the tour and its test read the cheats mod's rows, and menu_rows.json is the menu
without the panel's rows. Not run in the game yet.

Left for later: longshot-game still names mod-specific code in sysmods.rs (the system mods' start, which
waits on the hooks' step g) and mods_host's link to the cheats mod's tab; both want a generic extension first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A mod's texts in the player's language: its folder's strings/<lang>.json (a language code each,
en.json, pt-BR.json; a JSON object of texts by key, nested objects joined with '.'), looked up with
t(key, vars?) in the menu's language (renderer_setting_text("menu_language", LANG_CODE): the Menu
language row, Auto worked out to the game's), then the language's first part, then English, then
the key itself (said once when the mod's en.json lacks it too). '{name}' is filled from vars.
lang() and langs() say the language now and the ones strings/ has. No permission; the files are
read at a mod's first lookup and again when it starts again.

Longshot.exe mod check checks strings/ as the game reads it (a language code's .json, an object of
texts); a mod test sets the language with game.menu.setLang(code). settings-host's texts are
documented as English, which the menu mod translates. docs/modding/i18n.md; schema-gen outputs.
Tests: lookup and fallback, placeholders, the file and code rules, mod check's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The renderer gives every text in English now (vk_menu_i18n.cpp's tr is the text itself; it keeps the
Menu language row's list and the game's language), and the menu system mod shows each in the menu's
language through longshot/i18n: game/mods/menu/strings/<lang>.json, the 13 languages of
gpu/vk/menu_i18n.h moved as they were (each keyed by its English text), and src/tr.ts, which also
translates a text made from a printf format ("3 of 9" from "%d of %d", src/formats.ts) through the
format's translation, as the C++ lookup did. src/host.ts is settings-host with its texts
translated as they are read; the menu's own words (Tune, Done, Cancel, Swap, Loading) are translated
too, with new entries for the four the tables lacked. What the renderer draws itself, the FPS counter
and the start-up screen, is English now.

tests/test_menu_i18n.py reads the strings files (every language of the row has one, every text is
the menu's, conversions kept); test_menu_i18n_count and test_share_message_i18n, which compiled the
C++ tables, go; test_framegen_by_row reads the strings files. A mod test checks a label and a made
text in French.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
LONGSHOT_SET="<mod id>:<key>=<value>[,...]" sets mods' settings for one run, over the player's,
never written to the options file or a mod's storage: the settings service's run value
(longshot-game run_set.rs, asked after a mod test's own and before a system mod's switch table). A
value is read as the options file writes it; one the setting does not take is logged and the
player's kept, a malformed entry logged and left out. longshot-builder play --set id:key=value
(repeatable, before --) passes it.

It replaces the switches that each set one setting: HOS_OOT_CHEATS (system/cheats:debug_tools=1),
HOS_OOT_PROTECT_HEARTS (system/cheats:heart_protection=1, now with the Debug tools on, as the row),
HOS_SKIP_OPENING (system/skip-title:skip_opening=1) and HOS_DISCORD_APP_ID (system/discord:appId=<id>);
HOS_DISCORD goes too (HOS_SYSTEM_MODS_OFF=discord). Each is a GONE row of switches.def. HOS_ASPECT
stays: it takes any ratio (2.3889), which the Aspect ratio row cannot hold. The cheats mod's own
switch reads and its heart-protection-until-touched rule go; discord's mod.json names no switch, so
the offSwitch/settingSwitches table is empty (its code stays, for a later cleanup). The test runs'
scripts (the pipeline tour, ab.py, the bridge's TEST_RUN_ENV, the parity gates) and their tests use
the new ways; docs: switches, system mods, build, control bridge, the player's guide.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Debug tab's last line, About >, opens a page of the menu mod's own (@about): the third-party
parts Longshot ships, each with its licence and link (game/mods/menu/src/credits.ts, one a folder of
third_party/, Tracy left out as developer builds alone have it), and the mark of the upscaler in use,
NVIDIA DLSS, AMD FSR or Intel XeSS, only while the Upscaler row names it. A mod test checks the
credits and that a vendor's mark shows only with its upscaler; tests/test_menu_credits.py keeps the
list and each licence the same as third_party/*/PROVENANCE.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
What the C++ menu drew itself and the menu system mod could not know, now in the declarations: a
module button's own text (Apply / Applied, Start test / Stop test) comes as its state's text; a row
that takes a restart, changed from what the game started with, has "Takes effect after a restart" as
its hint's last paragraph (the old After restart tag); Sprint's binding row has the old Controls
page's help (how Sprint starts, what ends a toggled sprint). src/tr.ts translates a text of
paragraphs one paragraph at a time.

The menu's translations lose the 909 entries (of 13 languages) whose English the renderer no longer
says: the C++ Controls grid, the Debug tools' pages (the cheats mod's rows now), the Mods tab (the
mods-tab system mod's, not translated yet), the tune bar and the prompts. tests/test_menu_i18n.py
counts a paragraph as a text, and drops the checks of texts that went (the plural forms, the Controls
hint, the text field's editing bar).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The checks that read the C++ menu's drawing and keys read what took their place: a press runs in
settings_decl_tick (the bug report, the weak laptop button, Save my pipeline list, a locked button),
a button's text and a hidden row in menu_decl_state, a step in menu_setting_set's set_row (Vibration,
Vibration strength), the tab names in kTabLabels, the Mods tab's screen effects in the mods-tab
system mod, MkwVkHost's version 63 members (hos_ab), the text field's place in menu_tick. What went
with the drawing goes from them: the Controls grid's navigation and confirmations (test_menu_keys
keeps the A/B mapping, the keyboard and Esc, the options file), the slider drag (stepped sliders),
the mouse's row record (menu_hit), the prompt bar, the tab walks; test_mic_help_meter, which drew the
help box's live meter, goes. test_settings_decls no longer copies the Debug tools' and their pages'
rules (the cheats mod's rows). scripts/tours/route.py zipped the teleport names with the
destinations' texts instead of their maps' ages.

Not run here (no tests on this PC): their source parts were checked against the tree and their
fixtures compiled syntax-only; game/mods/menu/test/menu_rows.json wants test_settings_decls.py --write
once to be sure it is the menu as built.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
No system mod named one since LONGSHOT_SET (any mod's setting for a run) and HOS_SYSTEM_MODS_OFF (a
system mod left out) took the switches' places. The manifest's "system" is "enabled", "required"
and "legacySwitch" again: the schema crate no longer reads the two nor emits SYSTEM_SWITCHES and
system_switch_of, api's SystemEntry and SystemTable::setting_switch lose them, switched_off is
HOS_SYSTEM_MODS_OFF's alone, and the run's settings are a mod test's and LONGSHOT_SET's. The mod
schema (website/public/schemas/mod.schema.json), docs/modding/system-mods.md and
tests/test_switch_table.py follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
scripts/screenshots/menu.cpp, capture_menu.py and check_menu_capture.py compiled gpu/vk/vk_menu.cpp's
drawing to render the settings without a game; that drawing is gone (the menu system mod's rows,
drawn by the mods' UI, need the game). The guide's README says a settings screenshot comes from a
game run with the menu open until a TS capture path exists; the manifest's menu-fixture entries keep
their fingerprints for the next review.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The first step of the runtime/game-module split (#2434 runtime design): what lifted code touches on its hot paths moves
into the lift runtime, which becomes part of the game module, and the choices the IR is written with stop being a
lift's own.

- builder/rt/a64_config.h is committed and fixed (the window's base, the marks' table, the GPU page bitmap, polls).
  llvm's `abi` repeats the values (a test checks them against the header); the whole lift refuses options that
  differ, and writes the header as builder/rt holds it. The dev lift's --no-polls and --no-mark-bitmap go.
- a64_gpu_pages, read by every marked store, is defined in a64_rt.c beside a64_dirty; host/mark_bitmap.c only sets it.
- hos_site_callee, the replace sites' thread-local, is defined in a64_rt.c with its get and set (Windows cannot import
  thread-local data); host/game_call.c no longer defines it.
- A host function more than 2 GB from a64_lookup (a host call, seen from a module apart from the runtime) gets one of
  512 module-local thunks, so the call caches' 32-bit offsets stay inside the module. In one image none is used.

Tests: llvm's ABI-against-header test; the lift refusing a non-ABI lift and writing the fixed header; a64_rt.c's far
thunk and callee get/set compiled and run (A64_TEST_ALL_FAR); test_game_boundary checks the module's data is defined
by the lift runtime alone, with two crossings planted. The IR is unchanged (the llvm writer is untouched and the
defaults are the frozen values).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A new crate, game/crates/ui: the next channel's ops checked whole on the main
thread (ops, shadow), the UI thread's trees (doc), styles resolved into taffy's
Style, parley's text properties and a small visual, cached by (style ids, state
bits) (style), taffy 0.16 layout kept per root and given only what changed
(layout), parley 0.13 text with its editor and a swash glyph atlas of pages with
sub-pixel bins and LRU eviction (text, atlas), Canvas paths through lyon with AA
fringes and the built-in icons (canvas, icons), the draw list, the renderer's
contract (draw), the behaviour widgets and the old UI's controller navigation
ported (widgets, nav, paint), the synchronous Core and the UI thread ticked per
present (core, thread), and the reference CPU renderer (reference). Metrics and
size probes as examples. taffy, parley, swash and lyon_tessellation pinned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
api::services::ui2: each mod's batches checked whole by its game_ui Shadow and
sent to the UI thread through a new host part, Ui2Sink (Hosts.ui2), its images
decoded by the old channel's ImageSet and handed over once ready, its events
from the UI thread to its onEvents at the next frame, its requestFlush once a
frame, and measure() by the real text layout. With no sink (LONGSHOT_UI2 off)
every call is NotAvailableError.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
runtime.js evaluated a second time for the next channel (group ui-next,
native.next): the primitives as host elements, styles() interning definitions
whose keys are taffy's, parley's and the visual's fields, state blocks, theme
tokens passed through, a virtualised List over the host's range events, and
measure(). The element marker is Symbol.for so TSX (always compiled to
longshot/ui/jsx-runtime) makes elements both instances take. The kit is
TypeScript (game/modapi/ui/kit.tsx) the game compiles at its first import. The
old channel's path is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
longshot-game::ui2: the UI thread made at the first use while LONGSHOT_UI2=1,
the main thread's sink over it, and game.h's game_ui2_present (the input handed
over, the newest frame's C view given back), game_ui2_theme and game_ui2_font.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The fake game runs UI2's Core at each frame: real taffy layout and parley text
with the bundled fonts, the player's presses, navigation and typing, and a
picture from the reference renderer (snapshot()).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
gpu/vk/vk_ui2.cpp gathers each present's input for the UI thread
(game_ui2_present, host version 63), takes the frame's changed atlas pages and
fresh images as kept ImGui textures (vk_imgui's user_texture_kept and
user_texture_update: only a page's dirty rect uploads), and draws the list in
the overlays' ImGui frame under the old mods' UI: rounded rects and borders,
shadows as fading rects, glyph quads, images, meshes, scissors. No pipeline of
its own: the SDF drawer of the contract comes at the renderer's swap. The C
twins of the contract are gpu/vk/ui2_draw.h. Off by default (an attempt).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
docs/dev/reference/ui2-draw-list.md (the renderer contract, the reference
renderer its executable spec), docs/modding/ui-next.md and the example mod,
game/DESIGN.md's UI2 sections (styles as taffy, parley and the visual; the
threads and caching; the metrics; the Later plan to port the menu mods and
delete the old path; open questions) and the architecture page's paragraph.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(vk): UI2's headers include no imgui.h, so vk_menu.cpp keeps ImGui's vector operators
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 20s
CI / Workflow lint (actionlint) (pull_request) Successful in 23s
Third-party parts / As their notes say (pull_request) Failing after 25s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 30s
PR description / Title and description (pull_request_target) Successful in 40s
CI / Website build and checks (pull_request) Failing after 40s
CI / What the change needs (pull_request) Successful in 47s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m26s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 5m18s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 5m47s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 58s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
b9ac716574
vk_ui2.h included imgui.h ahead of vk_ui.h's IMGUI_DEFINE_MATH_OPERATORS, and
vk_imgui.h named ImTextureFormat without imgui.h: vk_menu.cpp and every other
includer failed to compile. vk_ui2.h now forward-declares ImDrawList,
user_texture_kept takes its format as an int, and vk_ui2.cpp includes imgui.h
itself.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The second step of the runtime/game-module split (#2434 runtime design; the design's commit 3, done before the link so
the link has something to load): nothing of the runtime names a symbol of the lifted game, so the game can be a module
of its own.

- builder/rt/a64_module.c: the module's one export, ls_game_module(A64_MODULE_ABI), a table (rt/a64.h A64Module) of
  the lookup, an indirect call, the page marks and the GPU page bitmap, the replace sites' callee, the image's boot
  constants and the named locations, with a64_config.h's base and page count. gen/image.c is now one A64Image
  (a64_image) and gen/locations.c's function a64_locations_resolved.
- host/game_module.c reads the table first thing in main: linked in, ls_game_module is called directly (a weak
  reference); with LONGSHOT_GAME_MODULE=<path> the module is loaded from that path (UTF-8, widened on Windows). A
  missing file, no ls_game_module, another table ABI, another lift ABI or an incomplete table ends the start with a
  sentence; --prepare-shaders needs no module. hos_image_base, hos_main_build_id, hos_main_base ... are the host's
  copies, hos_site_callee_get/_set and hos_locations_resolved forward to the table, hos_game_lookup and
  hos_game_icall replace the host's (and game-sites' vslot) a64_lookup and a64_icall.
- The host's C is compiled with -DA64_RUNTIME: rt/a64.h's A64_DIRTY and A64_GPU_PAGES are then the table's pointers
  (rx_backend.c, hos_mem.c, mark_bitmap.c, every A64_MARK); HOS_MARK_BITMAP_ALL is applied at the load.
- a64_rt.c's weak defaults are left out of a game module (A64_GAME_MODULE): there they would bind inside it.
- The preparation driver's stand-ins are 256 bytes, as big as an A64Image.

Tests: tests/test_game_module.py loads fake modules through host/game_module.c (a fitting one, and each refusal); the
lift's tests and synthetic-game's host read the new image.c; the harnesses of test_game_call, test_libc_hooks and
test_collect_wide follow the new names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
test(boundary): plant game headers that exist
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 19s
CI / Workflow lint (actionlint) (pull_request) Successful in 20s
Third-party parts / As their notes say (pull_request) Failing after 21s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 23s
PR description / Title and description (pull_request_target) Successful in 28s
CI / What the change needs (pull_request) Successful in 39s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m31s
CI / Website build and checks (pull_request) Failing after 36s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 1m59s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 4m52s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m28s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 6m38s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 56s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
529d1f32d1
The boundary check's planted crossings named game/oot_sprint.h, which is gone: an include of a file that is not there
resolves to nothing, so the renderer's plant (through -I gpu/vk) was not seen and the check failed on its own. The
plants name game/phases.h, a game header the host may not include.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(third-party): QuickJS's note names longshot_qjs_poll_every, our own second function, and its tree hash
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 19s
CI / Workflow lint (actionlint) (pull_request) Successful in 20s
Third-party parts / As their notes say (pull_request) Successful in 23s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 25s
PR description / Title and description (pull_request_target) Successful in 30s
CI / What the change needs (pull_request) Successful in 42s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 1m12s
CI / Website build and checks (pull_request) Failing after 18s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 2m49s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 5m38s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 41s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 7m28s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m47s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 8m28s
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
65d5181ac7
The site runtime added longshot_qjs_poll_every to longshot_quickjs.c, Longshot's
own file beside upstream's, without updating the part's note, so
check_third_party refused the tree. Upstream's files are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(builder): vk_ui2.cpp compiled with ImGui's include dir, as the renderer's other ImGui files
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 22s
CI / Workflow lint (actionlint) (pull_request) Successful in 25s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 30s
Third-party parts / As their notes say (pull_request) Successful in 30s
PR description / Title and description (pull_request_target) Successful in 36s
CI / Website build and checks (pull_request) Failing after 41s
CI / What the change needs (pull_request) Successful in 53s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m55s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 5m37s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 5m41s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 57s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 4m5s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 7m29s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 12m9s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 9m39s
827bd8b0f8
UI2's drawer (gpu/vk/vk_ui2.cpp) includes imgui.h and imgui's draw list, but the builder's renderer plan gave ImGui's
include dir and defines only to vk_imgui.cpp, vk_menu.cpp, reshade.cpp and vk_modui.cpp: the game build stopped at
'imgui.h' file not found. The list is now a const, IMGUI_USERS, with vk_ui2.cpp in it, and a test reads gpu/vk and
gpu/vk/menu so that every file including ImGui's headers, or a header of gpu/vk that does (vk_ui.h), is in it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
host/game_module.c reads LONGSHOT_GAME_MODULE (the game module's path, which the builder's play will set), and
test_switch_table wants a row in gpu/vk/switches.def for every name the source reads: a player switch, environment
only, sorted after LONGSHOT_DRIVER_ENV_SET; and its line in docs/dev/reference/switches.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(host): hos.h names the game module's types only beside the a64.h that has them
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
CI / Workflow lint (actionlint) (pull_request) Successful in 22s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 26s
Third-party parts / As their notes say (pull_request) Successful in 29s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 34s
PR description / Title and description (pull_request_target) Successful in 36s
CI / What the change needs (pull_request) Successful in 52s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m45s
CI / Website build and checks (pull_request) Failing after 35s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 5m44s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 5m45s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 40s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 3m5s
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
f069170ec0
hos.h declared hos_game_module_check, hos_game_image and hos_game_lookup with rt/a64.h's A64Module, A64Image and A64Fn,
so a harness that gives hos.h a stand-in a64.h (Ctx and A64_PTR alone: test_fs_save_commit's) no longer compiled:
"unknown type name 'A64Module'". The three are declared under A64_MODULE_ABI, which the lift runtime's a64.h defines
with those types; every host file that calls them includes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The TS menu reads every row's state at the start (renderer_setting_state, menu_decl_state). Its hint line is
made as std::string(hint(v, -1)), and most hints give nullptr for a value with no line: libstdc++ throws
std::logic_error ("basic_string: construction from null is not valid") and the renderer stops the game at
start. The check cuts those lines out of menu_decl_state and runs them with the real modules and model over
each row's every value, the restart tag on and off. Fails here: the fix follows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(menu): renderer_setting_state no longer throws for a row whose hint has no line, so the game starts
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 19s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 20s
Third-party parts / As their notes say (pull_request) Successful in 25s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 25s
PR description / Title and description (pull_request_target) Successful in 30s
CI / What the change needs (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
b50bc86b04
menu_decl_state made a row's hint line as std::string(hint(v, -1)); most hints give nullptr for a value with
no line, so libstdc++ threw std::logic_error ("basic_string: construction from null is not valid") when the TS
menu read every row's state at the start, and the renderer stopped the game ("vk: FATAL: std::logic_error came
out of renderer_setting_state"). Came with mwurlplr (the restart tag in the declarations). The hint is now taken
only when there is one; DeclList::keep takes a nullptr text as "" too, for the declarations' other texts.
tests/test_menu_decl_state_hint.py passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
api::manifest::normal is the one JSON shape of a checked manifest (format 1, every default filled in) and of a
setting in the one-setting format, so a tool shows what the game's reader made of mod.json and a launcher never
parses it itself. The loader gains Loader::offline (the start's scan alone, the API features not checked: a tool has
no game), copies() (every copy found, with the reader's ManifestError for one refused) and resolved() (what the start's
resolver was given and decided). resolve::needs says where each of a mod's dependencies stands after a resolve
(loads, wrong-version, missing, off, wont-load), with its test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The control bridge listed the renderer's rows alone, and the menu takes the game side's rows once, at its first use:
a script system mod's settings (crt_filter, colour_vision, area_name_banner), declared when the mod starts, were
"not_found". The bridge now falls back to the game side's settings, every mod's as its settings service lists them
(game.h's game_setting_*): listed once after the menu's rows, and set as the player sets them. control_test covers a
setting only the game side has, and one both have.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
For the launcher (#268), so it drops its copies of the game's rules. Each runs the game's own loader scan offline over
a read-only disk (the mod store laid over the files, the game folder builds/<stamp> of the profile's code mods, the
built-in Rust mods from game/mods and the build's table of script ones) and answers a versioned document (format 1):

- installed: every mod the next start sees, with its normalized manifest or manifest_problem {field, text}, state,
  load order, code hash, trust (accepted, asks, unsafe grants), the Mods tab's warning and its build state, merged with
  the profile entry's source, pin and update;
- resolve: {order, off: [{id, reason, other, text}], needs: {id: [{dep, state, have}]}} from the game's resolver;
- build-state: the code and ExeFS patches the last build put in against what waits for one;
- settings <id>: its declared settings in the one-setting format with their values; --set and --reset write as the Mods
  tab does (the profile's settings.ini line for store options, else the mod's settings store), refused while the game
  plays the profile.

Documented in docs/modding/tools.md (What the game will do), with CLI tests over a fixture profile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The code mods' stamp and the game folder it names (build_driver::play::mods_stamp, game_folder, BUILDS,
DEFAULT_BUILD) move into game_files::code_mods, which play re-exports: the builder's play and modtool's reading of
what the game will do take one rule. api gains system::table() (the build's table of script system mods, the
game's runtime::system_table gone), loader::ArchivePackages (longshot-game's packages.rs gone) and the built-in Rust
mods' mod.json list (system::native_ok, emitted with the table from schema::system_mods::native_folders, the one walk
of game/mods/<name>/ with a Cargo.toml, which longshot-game's registry build takes too). modtool's own build.rs and
native list go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The installed operation (the game's channel, mod serve) answers the same {format: 1, game, mods} document as the
command line, so the game's Mods tab and the launcher read one thing; its service tests read it by id. mod resolve
--on ID --off ID gives the resolution as if those mods were switched so (the profile's list read through an overlay
with those switches, an entry added for a mod it does not name; nothing written), for the launcher's "switch on what
it needs", with its tests. modtool reads the stamp rule, the system table and the packages from their one place.
tools.md says why settings --set refuses while the game runs: the game's own Mods tab edits them live.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A folder or package of mods/ whose name starts with - or _ is off by the player's choice: Loader::skipped lists each
one (its path under the folder, and why) beside the log's line, for the tools' installed. settings::value_text is
exported for them too (a setting's value as the menu shows it). With its loader test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
installed gains list {state: profile | none | not-a-list, path, old_lists (the game folder's mods.json or
longshot_mods.txt, read by nobody)}, skipped [{path, why}], and per mod in_profile and content {romfs_files,
romfs_more, cheats, exefs_patches, modules} for the launcher's kind chips. mod settings gives every setting its text,
read-only: a choice's value is its option's index, and --set takes the index, never the label. tools.md says so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(modtool): mod settings writes a mod's settings store on the disk, and the installed test reads builds/default as built
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 24s
CI / Workflow lint (actionlint) (pull_request) Successful in 25s
PR description / Title and description (pull_request_target) Successful in 30s
Third-party parts / As their notes say (pull_request) Successful in 29s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 30s
CI / Website build and checks (pull_request) Failing after 35s
CI / What the change needs (pull_request) Successful in 55s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m3s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 4m58s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 3m1s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 57s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 7m17s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 7m56s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 13m6s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 9m9s
e40a12fe35
l4mt-1 found both. The tools run on the stand-in host (host-sys's fake), whose whole-file write keeps the bytes in
memory: a settings store written through the game's Storage over OsDisk never reached the disk. FileDisk makes that
write with build_core::fsx::write_atomic. The fixture has builds/default, so with no code mod taken the game folder is
there and built.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The checks of where a version's members are (test_broker_frame, test_gfx_world, test_texture_pack,
test_ui2_renderer) asked that they be the last in MkwVkHost and in host/rx_backend.c's vk_host, so every new
version broke them (64's UI2 needed an exception in each; 65's engine_text broke them again). The rule they
follow now, from vk_api.h's MKWVK_API_VERSION note: vk_host fills MkwVkHost by position, a version's members
go in together after the versions before them (appended last since 54), and the renderer reads one only with
host->version at least its version. So each check names a version's members with the version's before or
after it and asks they be there together in that order (tests/vk_host_members.py in_order), in both lists;
later versions' members may follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
host/hos_main.c calls the game's _init_libc0 through the game module's table since qnvwqxko (im->entry_init_libc0,
not hos_entry_init_libc0), so test_hos_ab's start-order check no longer found its marker (ValueError). It
looks for the call as it is now; the order it checks is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
test(settings): Damage taken is the damage system mod's setting, placed on the Debug tab by its declaration
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 21s
CI / Workflow lint (actionlint) (pull_request) Successful in 22s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 25s
Third-party parts / As their notes say (pull_request) Successful in 26s
PR description / Title and description (pull_request_target) Successful in 32s
CI / Website build and checks (pull_request) Failing after 36s
CI / What the change needs (pull_request) Successful in 45s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 2m3s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 4m24s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 39s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 3m4s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 5m54s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m55s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 12m32s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 13m46s
1d87ae0130
The Damage taken row moved from the renderer's Debug tab into system/damage (TS-format mod.json, place debug
after heart_protection), so the menu built from the renderer's modules no longer has it and
test_damage_taken_is_listed_in_debug_player failed. The check now reads where the row is: the page's Debug line,
the mod's declaration (its tab, after Heart protection, Normal its default), and no renderer row of it on the
Debug or Gameplay tab.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(build): the shader preparation's driver links no game module table
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 23s
CI / Workflow lint (actionlint) (pull_request) Successful in 24s
Third-party parts / As their notes say (pull_request) Successful in 28s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 29s
PR description / Title and description (pull_request_target) Successful in 34s
CI / What the change needs (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
33d469623e
The preparation's driver is the game's executable without the lifted game, its names stand-ins of 256 zero bytes. Since
the module's table moved into the lift runtime (rt/a64_module.c), the driver linked it too: ls_game_module was then
defined, its image a stand-in, and the runtime took that table for a game. in_prepare leaves a64_module.c out, so the
driver is a runtime with no game in it, which --prepare-shaders allows (host/game_module.c). A static build's
preparation was seen to end by signal 11 within a second (l4rb2-1); this is the likely cause, to be confirmed in game.

Tests: the preparation's unit test leaves a64_module.c out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(scripts): release_bench starts each game folder as it is, without packs.runtime_romfs
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 24s
CI / Workflow lint (actionlint) (pull_request) Successful in 25s
Third-party parts / As their notes say (pull_request) Successful in 28s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 30s
PR description / Title and description (pull_request_target) Successful in 35s
CI / Website build and checks (pull_request) Failing after 42s
CI / What the change needs (pull_request) Successful in 51s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 2m59s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 5m4s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 53s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 3m15s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 7m20s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 7m26s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 12m29s
CI / longshot-builder end to end (synthetic game) (pull_request) Successful in 13m52s
11abc744c6
release_bench.py asked scripts/devtools/packs.py for runtime_romfs(), which packs no longer has: every run stopped with
an AttributeError before the game started. A builder's game folder knows its own romfs (its index), as dev.py ab's
runtimes do, so the session is started with no --romfs, the way ab.py starts its runs; packs is no longer imported.

Checked by importing release_bench and its run's modules (longshot_bridge, tours); the runs themselves in l4rb2-2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
What the engine draws itself was English since the menu's tables moved to the menu mod. It has one
strings set of its own now, game/strings/<lang>.json, in the mods' format (keyed by the English, the
same 13 languages and English), built into longshot-game (engine_text.rs, include_str!). The renderer
asks through a new MkwVkHost member, engine_text(lang, english) (MKWVK_API_VERSION 65,
host/rx_backend.c game_engine_text), as i18n::engine: the start-up screen's texts (its counts and
time left through their formats), the FPS counter's labels, the menu frame's prompts and its
"starting" line. The fallback menu reads the same set in Rust (build_in).

The frame's prompts while a text field has the keyboard are the text field's again (Caret,
Character, Add, Remove, Paste, Done, Cancel; the controller's only with a controller), as the C++
menu showed them: a player on a controller sees how to type.

Tests: every language has every text with its conversions, the lookup's fallback (region, English,
the English itself, the C entry point), the fallback menu in French.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The C++ menu drew the microphone test's levels in its help box; that drawing went. The Audio tab has
a Microphone level line after Test microphone, shown while the test runs: a line declaration with a
range (0 to 1000) whose state is its level (after the gain) and the meter's text ("Testing: 12% ->
24%", then what the test hears). The menu system mod draws any line with a range as a meter, its
text and a Progress bar: a generic piece, read through settings-host like every row.

The test stopped at once with the TS menu: it ran only while the C++ menu's tab was Audio, and that
tab no longer moved. menu_on_tab is now the page whose rows the menu mod read in the last half
second (menu_decl_state notes it; the mod reads only the page it shows).

Tests: a mod test of the meter line; test_microphone_test_gain checks the line and the page-read
rule (stale, another page).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
t(key, { name }) left every {name} as it was from a script: a variadic value reaches the service as
the object's JSON text, which vars_of did not read. And a mod keyed by its English words (no en.json)
got its key back unfilled. Both are filled now; a test covers the text form.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The tab's own words (the list's lines, a mod's page, Permissions, Keybinds, Commands, HUD layout, the
permission prompt, Safe start, About, the switch's states and the help) go through longshot/i18n,
keyed by their English, their parts as {name}s; game/mods/mods-tab/strings/<lang>.json has the 13
languages of the menu. What the loader says (a mod's detail, note, state, warning) stays its own. A
mod test checks the tab in French, a filled-in part included.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
msyuxrny dropped Row's cheat field (the Debug tools' index, -1 for every other row). The checks that
read vk_menu.cpp's rows table still looked for it: tests/menu_model_fixture.py's core headings (their
", -1, true}") found none, so the menu as built had no Resolution and upscaling, Screen or Developer
section, and every row anchored there was a diagnostic (test_settings_decls, test_settings_table,
test_menu_sections, test_menu_modules, test_upscaler_rows). Ported, none deleted:
- menu_model_fixture.py: the core headings without the field;
- test_menu_rows_model: its table without it, and a module's page row checked by its setting's
  opens (row_opens, the C++ drawing's, went);
- test_menu_env_overrides: its FSR 4 model row without it;
- test_menu_keys and test_menu_text_field: the stubs the trimmed fixtures no longer use are
  [[maybe_unused]] (clang's -Wunused).

Their fixtures were compiled syntax-only with clang here; the checks were not run on this PC.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The live microphone meter came back as a row of its own (Microphone level, a line the menu mod draws as a bar
while Test microphone runs), so test_settings_table found a menu row with no line in the settings page's table.
The page lists it after Test microphone, which no longer says the levels are in the help box; the meter has no
default, as the actions have none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Mods tab now says its texts through t() (its strings/ in 13 languages), so test_gfx_effects no longer
found <Section title="Screen effects"> or the GPU time's English line. It looks for the section and the line
as they are written now, t("Screen effects") and t("{ms} ms of the GPU a frame.", ...).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
i18n::engine read MkwVkHost.engine_text whenever the pointer was there; a host older than version 65 has no such
member, and the renderer reads a member only with host->version at least its version, as every other one is
read. Older hosts get the English.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The user's decision on observe-only mods. A mod is observe-only when its code is its sites.toml alone and
it asks for hooks.observe and neither hooks.change nor hooks.unsafe (nor exefs). Its sites can then only
name the game's own (the build leaves out a site of its own without hooks.unsafe), and the game lets it
hear only events and their arguments (a filter needs hooks.change; a field or string capture stays
hooks.unsafe). Such a mod is taken with no acceptance by code hash: no warning, nothing written to the
trust file, and no new question when it is updated. Its low-risk permission is shown at install as any
mod's. The warning ("its own code changes the game's code") is left for hooks.change, hooks.unsafe and
ExeFS code.

One rule, mods_stamp::observe_only, asked by both sides: the stamp takes such a mod's sites without an
acceptance and leaves it out of the trust set; game_files::code_mods and build-driver's modsites::collect
take its sites; api::loader's code_status neither asks nor warns (Row::observe_only), and so neither does
the Mods tab; mod installed's trust says observe_only. Docs: unsafe.md, hooks.md, tools.md. Tests in
mods-stamp, build-driver, api's loader and modtool's installed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
test: the version folder's builds/ and builds/default are read where they are now, game_files::code_mods
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 16s
CI / Workflow lint (actionlint) (pull_request) Successful in 18s
Third-party parts / As their notes say (pull_request) Successful in 20s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 26s
CI / Website build and checks (pull_request) Failing after 29s
PR description / Title and description (pull_request_target) Successful in 35s
CI / What the change needs (pull_request) Successful in 45s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 5m16s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 6m11s
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Failing after 7m12s
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Failing after 8m9s
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Successful in 45s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 16m11s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Failing after 18m7s
CI / longshot-builder end to end (synthetic game) (pull_request) Failing after 20m7s
f1646dd6a3
The stamp rule moved into game_files::code_mods (vzkzlltv): BUILDS and DEFAULT_BUILD are defined there and
build_driver::play re-exports them, so test_longshot_exit and test_recomplauncher_json, which read the
constants from play.rs, failed. Both read them from code_mods.rs now, and check that play.rs takes them from
there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A mod can now widen or narrow the gameplay view without overriding the camera: camera.setFovScale(scale),
0.1 to 10, under camera.write. It takes no claim. Every mod's factor multiplies, and the angle drawn is
held to 5 to 140 degrees. Each factor is a live effect in the journal, so a stopped mod's goes. The API
composes the factors on the main thread into one f32 (oot:📷:lens::compose), and the core's engine
callback on camera.lens applies it with one relaxed load. No mod code runs on the game's threads for it.

- oot:📷:lens: the lens logic that was oot::sysmods::fov's (camera zero's gameplay view, events
  through state::event, broken links, s0 written only when it changes), taking a factor instead of a
  percentage. Its layout moves to layout:📷:lens.
- The core's camera.lens callback scales by the API's factor, composed with the Field of view mod's row
  while that native mod still hands it down the chain.
- A parity test runs the new lens at the factor the TypeScript port will give (the row over 100, composed)
  against sysmods::fov::lens on the same written hits: every slider value, 12 angles, with and without an
  event and a broken link (1008 hits). The 21 factors are bit for bit the f32s the native mod computed.
- The fake game's camera draws the scaled angle as the lens does. The feature camera.setFovScale is
  there when camera.lens is placed.
- Schema (camera.toml) and the generated reference, permissions and scripting pages; docs/modding/camera.md
  and docs/dev/reference/camera.md say how it works.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Field of view system mod was a native crate. Its handler on camera.lens handed its row down the chain
to the core's callback. It is now TypeScript: src/main.ts sets longshot/camera's setFovScale to the
setting's value over 100 whenever the setting changes, and the core's lens (oot:📷:lens) applies the
factor at camera.lens, as the parity test in the commit before showed on written hits. The setting keeps
its key, row, range, place and default text (field_of_view, store options, legacyId 51). The mod has no
site of its own and needs only camera.write. Turning it off takes its factor away, and the next camera
update has the game's angle.

- game/mods/fov: mod.json (runtime js, camera.write; 2.0.0), src/main.ts, src/fov.ts (each value's
  factor, 1 outside the slider as the native mod had it), test/fov.test.ts (its row and options line, its
  factors, and the fake game's lens drawing the game's angle times the setting, held to 140 degrees).
- The crate sysmod-fov goes, and so does its place in the workspace and longshot-game. oot::sysmods::fov
  goes too (with_row, row_now, its layout); the core's camera.lens callback is oot:📷:lens::lens.
  The parity test goes with the native lens it compared against.
- tests/test_oot_fov.py checks the new wiring. DESIGN.md, system-mods.md, game/README.md, the camera
  reference and sites.toml's comment say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Damage taken's port needs two things the API lacked. A scale that comes after the other mods' damage rules,
as the native mod's did. And a way for a script to see the Cheats mod's Debug tools, which gate it.

- DamageRule's last (rules.damageTaken / damageDealt add({ ..., last: true })). A last rule takes the hit the
  other rules made (the game's when none matched), and the last rules combine among themselves as the
  others do: scales multiplied and rounded to a quarter heart (halves up), then adds, then min and max.
  oot::rules::apply_hit runs the two passes; LifeRule gains last in its padding (size 80 kept).
- player.lifeWrite, the game's other compare-and-swap of a life (add w12, w11, w10), never saw the mods'
  rules; only the native Damage taken scaled it. The core's engine callback there now applies Link's last
  rules over the hit that write takes off (oot::rules::life_last). It reads the published rules.life table
  with its reader count (game_sites::rules::with_live, the C's enter and leave), then heart protection as
  before. Both sites log the first 32 writes that lower Link's life, so a game run shows which write a hit
  goes through.
- A parity test runs a last rule at each Damage taken scale (0.5, 2, 4) against the native scaled_life on
  the same written hits at both writes: lives to 20 hearts, hits to 25 hearts, alone and after other mods'
  rules (147,258 hits).
- mod.json's reads ("<mod>:<id>", at most 32, only with a runtime) under the new permission settings.read
  (low risk, read only; each needs the other). settings.get("<mod>:<id>") gives the value of a setting reads
  lists, or null while that mod does not run; any other is UnknownNameError. settings.changed tells its
  changes with that id. The prompt's and the Mods page's permission rows carry the names
  (Asked/PermissionRow names, modsHost's names), and mod check prints them. Drawing them in the TS Mods tab is
  the UI2 helper's. The fake game puts the system mods a mod reads in its game, as it does its dependencies:
  systemMod(name).setSetting is what the mod reads.
- The schema (types.toml, api.toml, settings.toml, modsHost.toml), the generated reference, permissions and
  scripting pages, the website's mod.schema.json, and 4 new cases in tests/mod_vectors/manifest.json (the
  Launcher's reader needs reads to pass them). Docs: rules.md, settings.md, manifest.md, actors.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The Damage taken system mod was a native crate. Its handlers scaled Link's life at player.lifeHit and
player.lifeWrite. It is now TypeScript: src/main.ts keeps one last rule of rules.damageTaken with the
choice's scale (Half 0.5, rounding up; Double 2; Quadruple 4; none for Normal). The game applies it after
the other mods' rules at both of Link's life writes, then heart protection, as the parity test in the
commit before showed on written hits. It works while the Cheats mod's Debug tools are on, read through
mod.json's reads (system/cheats:debug_tools, settings.read), as the native mod was gated on
oot::debug::tools_on. Normal otherwise, or while Cheats does not run. The setting keeps its key, row and
place (damage_taken, store options, legacyId 55, shownIf system/cheats:debug_tools). Turning the mod off
takes its rule away.

Clean break: an input movie's Damage knob (the old option 55, oot::debug::movie's Knob::Damage) is
dropped. A movie naming 55 is told no such setting, and the clean-break item (movies set settings by key)
covers it: damage_taken by key.

- game/mods/damage: mod.json (runtime js, state.write + settings.read, reads; 2.0.0), src/main.ts,
  src/damage.ts (each choice's scale, Normal with the tools off), test/damage.test.ts (its row and options
  line, its scales, and Link's hits through its rule in the fake game with the Cheats mod's Debug tools
  off and on).
- The crate sysmod-damage goes, with its place in the workspace and longshot-game. The input movie's
  Damage knob goes from longshot-game's input.rs and oot::debug; its test says 55 is refused now.
- DESIGN.md, system-mods.md and sites.toml's comment say so. oot::sysmods::damage stays for heart
  protection and the parity test until the core's leftovers move out of oot::sysmods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
A launcher asks the builder for a profile's mods and sources before the
player has set up the game. With the builder's flags before `mod`, as
docs/modding/tools.md writes the line, `--profile` first was taken for a
play, which stopped with exit 120 ("Longshot isn't set up yet") for
installed, resolve, source list, emulators and tags.

- main.rs: --profile/--output/--cache before `mod` run the mod tools
  (mod_line), never a play.
- installed/resolve/build-state: `game` is null while the profile's
  profile.json names no game files.
- installed: while no game folder is built, every built-in mod is listed
  from the build's own table (api::system::table, the native registry)
  with the new state `not-built` ("not built yet"), no load order.
- build-state, the one answer that needs a build, fails with `no_game`.
- Tests: modtool's state tests on a profile not set up, and CLI tests
  (tests/mod_no_game.rs) of each command, flags before and after `mod`.
- docs/modding/tools.md: the null `game`, `not-built`, `no_game`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The launcher kept its own copy of the permissions (names, risk, prompt
words), already behind the schema. `mod permissions` lists them from
the API crate's bindings, made from the schema's [[permission]]s at its
build (not api.toml read again): each row's name, risk, the words the
player is told, system-only, off-PC, pattern and the grants that hold
it, in a versioned document (format 1). It is the stable interface, so
tools never chase the schema's folder. Documented in tools.md, tested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
feat(api): the normalized manifest has reads, the other mods' settings a mod reads
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 16s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 30s
CI / Workflow lint (actionlint) (pull_request) Successful in 32s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 42s
Third-party parts / As their notes say (pull_request) Successful in 35s
PR description / Title and description (pull_request_target) Successful in 53s
CI / What the change needs (pull_request) Successful in 1m15s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
5f739998e7
mod installed's manifest is the game's reading of mod.json, so a launcher never parses it itself. It lacked
"reads", which the prompt and the Mods tab name beside settings.read: a launcher could not show which settings a
mod reads. It now sits next to requires and claims; tools.md says so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
- check-json leaves tsconfig.json alone: TypeScript's JSON with comments, which tsgo reads (every TS mod and example has one).
- trailing-whitespace leaves a .tsv's trailing tab (an empty last column: menu_places.tsv's "before") and the CRT
  shaders as their authors wrote them.
- end-of-file: prelude.js, longshot-together.d.ts and save-tally's test end in one newline.
- ruff: unused imports gone (shaders.py, test_game_boundary, test_menu_hit, test_settings_decls, test_switch_table),
  test_menu_ini_keys' repeated grass_distance key, test_native_zstd's unused local, pipeline_tour's loop variable
  that shadowed an import, and the one-line compound statements of test_bug_report_defaults and test_crash_record
  split.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(website): the settings page reads the game's rows from the system mods' mod.json, and the menu as it is now
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 21s
CI / Workflow lint (actionlint) (pull_request) Successful in 29s
PR description / Title and description (pull_request_target) Successful in 55s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 24s
CI / What the change needs (pull_request) Successful in 59s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 42s
Third-party parts / As their notes say (pull_request) Successful in 31s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
57db2f5428
game/menu/rows.c went (the renderer's table hands the menu the game's settings), and the build failed reading it. The
game's rows are now the settings with a place of the system mods' manifests (game/mods/*/mod.json: toggles, sliders,
choices and buttons, their section and after/before anchor). vk_menu.cpp's Row lost its cheat field, so heading is
the 12th field; a module row built at run time (game_rows.cpp's .row(s)) is not read as a designated row. A
coverage mismatch on a tab now names the rows on each side.

The guide's table follows the menu: Area name banner (the Area names mod's row), and the conditions of the rows the
menu shows only sometimes: Microphone level while Test microphone runs, and Compact menu key and Command palette key
not shown for now (their lines kept).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(build): the shader preparation's early driver links the game's Rust
Some checks failed
Website / Website preview, upload (pull_request_target) Has been skipped
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 17s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 30s
CI / Workflow lint (actionlint) (pull_request) Successful in 31s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 53s
PR description / Title and description (pull_request_target) Successful in 1m3s
CI / What the change needs (pull_request) Successful in 1m1s
Third-party parts / As their notes say (pull_request) Successful in 54s
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Failing after 1m50s
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Failing after 2m42s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
e6d788f6dd
A build whose game folder's caches start from nothing (a first build on Linux: build-driver shaders::Early) links
the shader preparation's driver early, beside the compile (build-compile link_prepare). That link left out the game's
Rust (liblongshot_rs.a, linked into the game since #2411), so every Rust function the host calls was one of the
lifted game's stand-ins, 256 zero bytes of data: the driver's first call into it, before its first line of log,
stopped it with SIGSEGV twice, and the build said "The shaders were not prepared now (the game was stopped by signal
11)". The game then prepared them at its first start.

The driver now links the Rust as the game's link has it (rust_link, one function for both links: the carried library
or cargo's build). The stand-ins' log line names the first of them, so a stand-in that is called can be told apart.

Test: build-compile's the_preparation_s_driver_links_the_game_s_rust (the driver's link command carries the library
after the objects and before the system libraries).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The design's commit 2 (#2434 runtime design): a development switch that links the lifted game apart, as game.so
beside the runtime's executable, the build the boundary measurement runs on.

- RX_GAME_MODULE=1 (build-compile's GameLink): the lifted units and the lift's C but a64_fp.c (the game's Rust's exact
  float, which stays in the runtime) go into the module, compiled -fPIC, the C also -fvisibility=hidden
  -DA64_GAME_MODULE; host/nn_libc.c's guest libc hooks go in with them, built against the module's own tables
  (HOS_WRITTEN under A64_GAME_MODULE is an inline mark, not an import of hos_mem.c's). RX_GAME_MODULE=runtime-libc
  leaves the hooks in the runtime: the measurement's control. Windows is refused for now (the exe's import library
  comes later).
- The module is linked -shared with a version script (ls_game_module its one export, local: *), so lld binds the lifted
  code's calls and loads of its own symbols inside it; --gc-sections and hfsort as the one executable. The replace
  sites' thread-local stays general-dynamic there.
- The export list: link.rs reads the module's undefined dynamic symbols that name no version (a small ELF reader:
  .dynsym, its strings, .gnu.version), and the executable is linked with an EXTERN for each and
  --export-dynamic-symbol-list. Then every strong import must be among the executable's exports, or the link fails
  naming the missing ones.
- a64_unimplemented, an import stub's hook, is the runtime's own (host/hos_hostcall.c), as the OS layer's other
  hooks are: a64_rt.c's weak default is left out of a module, which imports it.
- host/game_module.c: with no game linked in and no LONGSHOT_GAME_MODULE, game.so (game.dll) beside the executable,
  so a development game folder (finished_files copies game.so there) and a future export start as they are. The start's
  log names the module loaded.

Tests: build-compile's plan of the three links (which unit goes where, with which flags; Windows refused), the switch's
parse, link_guards' export-list check with the PC's clang and lld (a module's strong, weak and libc imports; an
executable with and without the lists); test_game_module's runtime loads game.so beside it; test_game_module_imports links the module's own C (the lift's
runtime, nn_libc.c, stand-ins of gen/) as game.so is linked and finds each of its imports defined by the runtime's
sources, without a game.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The runtime design's decision Q5 (2026-11-25): Longshot's runtime is built at x86-64-v3 alone, so a CPU without v3's
features (AVX2, FMA, BMI2, MOVBE ...) is told "this CPU is older than Longshot needs: x86-64-v3, about 2013 or newer"
when a build starts, before the lift. It was built at x86-64-v2 or x86-64 before. The game module stays -march=native.

- build-compile's toolchain: CPU_TOO_OLD, cpu_has_v3 (the processor's own answer, std's feature detection) and
  check_cpu, which RX_MARCH passes (a developer's build for another PC). cpu_flags refuses the same way, and the
  /proc/cpuinfo fallback that picked v2 or x86-64 is gone.
- build-driver's build checks it first.
- Docs: the requirements (AVX2 required), common issues, the RX_MARCH row.

Tests: check_cpu with and without v3 and with RX_MARCH.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The runtime design's decision Q4 (2026-11-25), in game/DESIGN.md's Deferred: no Authenticode signing yet; SHA256SUMS
stays the one signature and the builder checks the runtime against it at unpack; the certificate is chosen when signing
is built, its key a sealed release secret; the game module and the DLSS plugin, linked locally, stay unsigned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
What a script needs to skip the title screen as the native Skip title mod did:
- storage.saves.start() (state.read): the most recent progress.sav the file list opens on, and HOS_START_SLOT
  resolved against the saved slots (newest, a slot with its moves from the newest, or a choice left to the list).
  The native mod's slot.rs and its newest-save search, moved into api::save_start with their tests.
- GameState.loading: the game's own load flag, at the title too, where a save's load from the file list begins
  while mode still says title.
The fake game's setState takes loading (the flag alone, as at the title).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The skip's machine is machine.rs ported line for line to src/machine.ts, and its tests are the native ones one for one
(test/machine.test.ts: its parity). The game reaches it through the public API only:
- the game's button waits: a capture rule at its own sites menu.buttonWait and menu.buttonWaitNoDecideAnim, the
  screen's name at [wait+0xe8]&~3:ptr (47 bytes, ring), read with captures() at the next frame (told.rs);
- input.press for A held 200 ms and the file list's moves; gfx.renderer().menuOpen holds the skip;
- game.state(): mode play or movie is the player running, loading the load after the check's A;
- storage.saves.start(): the newest save and HOS_START_SLOT (slot.rs, now api::save_start).
The rules are set only while the skip watches (the row on at the start, or a slot chosen) and cleared once it ends.

Skip opening is rules.skips of the opening's two events, Opening_Introduction and Opening_LoadingKokiriForest, the
same arm, timeline hold and skip answer the core's opening skip gave at the same three sites (each event starts only
its one timeline, Dm_Kokiri_0030 and Dm_Kokiri_0000). That skip, oot::session's set_skip_opening and its layout go:
the sites answer the mods' skips alone. The mod now asks state.write, so its multiplayer is "all".

Breaking: system/skip-title is a script mod (2.0.0); its settings keep their keys and places.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
With Damage taken and Skip title screen TypeScript, what was left in oot::sysmods was shared core code under a mod's
name. Heart protection, the core's engine callbacks at player.lifeHit and player.lifeWrite, is oot::heart_protection
(its layout layout::heart_protection; Link told by oot::session::is_player, the same fields); with no scale left it
keeps the life through a hit and leaves healing as the game had it. event_running, Sprint and walk's, is
oot::state::event_running over state's own event manager read (its named location, the same field). The unused switch
helpers go; the damage rules' parity test keeps the native scale it is measured against.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
- romfs.load(path, { zstd?, dictionary? }): a file whole on a reader thread of Longshot's (lsmod-romfs), its Promise
  settled at a later frame; with zstd, decoded with the game's dictionaries, a frame that names none with the
  dictionary named (bcett.byml.zsdic for a map file). At most 64 MiB, 8 loads of a mod waiting. A mod's layer is read
  and decoded there too (host_sys::romfs::zs_decode_named over host/zs.c's hos_zs_decode_named); the host's index
  through host_sys::romfs::Later, which the stand-in host serves from the bytes it had at the call (its RomFS is the
  test thread's).
- game.flags.placement(id): a placement's Bool64bitKey flag by its 64-bit id, null when the game data has none; where
  each was found kept (64 ids), so a read after the first is one entry.
- player.provideStat("heartContainers", n | null): a mod gives the core a count it cannot read alone. The last given
  wins, the one before comes back when that mod stops; oot::travel's map refresh makes the pieces of heart from it
  (set_heart_containers_taken). The native mod's fn source stays beside it until that mod is ported.
- The fake game: romfs.add and romfs.remove (typed already, never there), game.stats (what the mods gave).
- The reference, the permission table and the guide regenerated; unsafe.md tells load.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
The eight dungeons' map files are read once, the first time Link is in play, with romfs.load (zstd, bcett.byml.zsdic
for a frame that names no dictionary) on Longshot's reader thread; src/byml.ts, the native BYML reader line for line,
finds each Obj_Heart_Container's placement id; their flags are read with game.flags.placement every 2 s and the count
given with player.provideStat("heartContainers"), which oot::travel's map refresh makes the pieces of heart from (its
native fn source goes). The log line is the native one's. Its parity: test/parity.test.ts, the native tests' cases
and fixture (test/map-file.ts is its map_file), answered as the native code answered them; test/heart-containers.test.ts
runs it on the fake game. The crate sysmod-heart-containers goes from the workspace and longshot-game; DESIGN.md and
system-mods.md say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
fix(skip-title): a capture name for each of its two sites, so setRules takes its rules
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 13s
CI / Workflow lint (actionlint) (pull_request) Successful in 33s
PR description / Title and description (pull_request_target) Successful in 49s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 21s
CI / Lint (pre-commit, ShellCheck) (pull_request) Failing after 40s
Third-party parts / As their notes say (pull_request) Successful in 31s
CI / What the change needs (pull_request) Successful in 1m40s
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
038beefa3c
Its rules named one capture "screen" at both menu.buttonWait and menu.buttonWaitNoDecideAnim, and longshot/hooks
refuses a capture name used twice: in the game the mod did not start ("setRules(): rule 2: the capture screen is
named twice"). Each site has its own now (CAPTURES: screen_a, screen_b), read the first site's then the second's
each frame. Tests: each rule's capture name is its own, and with the row on at the start the mod takes its rules and
runs with no fault.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyKi9X9AgqbaPS28uY
Khronos' three headers of OpenXR 1.1.65, unmodified, with their provenance and the Apache-2.0 text. Nothing uses them yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Where the screen stands, which copy of the game's picture is written and shown, what a session state asks for. The check
breaks each rule on purpose and must notice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With headset=1 in the options file the renderer's instance and device take what the OpenXR runtime asks for, a session is
made on the replay's queue and a thread ends a frame each time the runtime asks for one, with the newest picture the GPU has
done on a screen set in the room. The loader is opened by name at run time. Off: one line of the options file read, each
call one test, no library, thread or extension.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The row (restart) on the Graphics tab. With the headset on the window's swapchain is SDR and the log and the HDR row say so
(hdr_sdr_headset), no frame is made, and V-Sync Auto is Off, so the window does not pace the headset's frames.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The loader is looked for in the game folder too on Windows, the runtime's line names the sandbox on Linux alone and no
switch, and another GPU's line names the row. With the row off nothing is allocated. A close while the GPU is busy ends the
thread without a failure line. The pictures' setup is seen with the flag that asks for them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
test: the Headset row in the menu mod's list, the headset's thread in the pass barrier's
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Blocked by required conditions
CI / longshot-builder end to end (synthetic game) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 34s
PR description / Description follows the template (pull_request_target) Successful in 10s
beanstalk/approval can't be tested as asked: see the farm's comment
f971453d3f
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
First-time contributor

Tested in game: Linux Mint (Cinnamon, X11), RTX 4070, NVIDIA 595.99.02, Meta Quest 3 on WiVRn 26.9, sandbox off (HOS_SANDBOX=0: with it on the window does not open on this PC, also on plain #2434). Headset row On, build f971453d on #2434 @ 038beefa (26 Nov): the title screen and the game on a flat screen in the room, fixed in place, recentering properly. On the earlier base (3b5ef5be, 25 Nov) also: sharp, right colours, steady; headset off and on the head, and quit worked.

Tested in game: Linux Mint (Cinnamon, X11), RTX 4070, NVIDIA 595.99.02, Meta Quest 3 on WiVRn 26.9, sandbox off (HOS_SANDBOX=0: with it on the window does not open on this PC, also on plain #2434). Headset row On, build f971453d on #2434 @ 038beefa (26 Nov): the title screen and the game on a flat screen in the room, fixed in place, recentering properly. On the earlier base (3b5ef5be, 25 Nov) also: sharp, right colours, steady; headset off and on the head, and quit worked.
HumanBean changed target branch from main to mod-api 2026-11-26 04:26:19 +00:00
Owner

/beanstalk

/beanstalk
Member

Beanstalk test farm

Commit f66bc32 · approved by nobody yet · dashboard

A member of BigBeans can review this commit and comment @Beanstalk to test it.

<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `f66bc32` · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/2595) A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
feat(host): the sandbox reaches the active OpenXR runtime with the Headset row on
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Title and description (pull_request_target) Successful in 24s
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Successful in 7s
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
CI / Conventional Commit title (pull_request) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
f66bc32ce2
With headset=1 in the settings file (read as gpu/vk/vk_headset.cpp asked
reads it), host/sandbox_linux.c finds the active runtime as the OpenXR
loader does (XR_RUNTIME_JSON alone, else openxr/1 in $XDG_CONFIG_HOME,
$XDG_CONFIG_DIRS and /etc, a link followed to its target) and gives its
manifest (read, a file with a library_path only), its library_path's
folder (read and run, never the home or a system folder itself) and, by
the library's name, its one socket: Monado's monado_comp_ipc, WiVRn's
wivrn/comp_ipc (sbx_openxr_socket), when it is there. With the row off not
a rule changes. Each grant has its "sandbox: allowed ... (Headset)" line
(below ABI 9 the socket its "sandbox: bound back" line); what is not given
says why.

Nothing on Windows yet (docs/dev/reference/sandbox.md says what stands in
the way); SteamVR gets only its manifest and library folder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
First-time contributor

Tested in game, the sandbox rule (the last commit): Linux Mint (Cinnamon, X11), kernel 7.0 (Landlock ABI 8, the private folders on), RTX 4070, NVIDIA 595.99.02, Meta Quest 3 on WiVRn 26.9 (Flatpak), the sandbox ON; the window opened only through a test-only LD_PRELOAD shim for the sandbox's X11 abstract-socket bug (reported separately, not in this PR). Headset row On (26 Nov): the log gives the runtime's manifest and library ("(Headset)" lines) and binds back WiVRn's socket; WiVRn reached, 2064x2162 an eye, session states 1-5; the game shown on the screen in the room in the headset. On this setup the manifest and library are in /var/lib/flatpak, read by the system rules already, so this run proves the socket; a manifest and library in the home folder are proven by the stand-in runs in the description.

Tested in game, the sandbox rule (the last commit): Linux Mint (Cinnamon, X11), kernel 7.0 (Landlock ABI 8, the private folders on), RTX 4070, NVIDIA 595.99.02, Meta Quest 3 on WiVRn 26.9 (Flatpak), the sandbox ON; the window opened only through a test-only LD_PRELOAD shim for the sandbox's X11 abstract-socket bug (reported separately, not in this PR). Headset row On (26 Nov): the log gives the runtime's manifest and library ("(Headset)" lines) and binds back WiVRn's socket; WiVRn reached, 2064x2162 an eye, session states 1-5; the game shown on the screen in the room in the headset. On this setup the manifest and library are in /var/lib/flatpak, read by the system rules already, so this run proves the socket; a manifest and library in the home folder are proven by the stand-in runs in the description.
Owner
@review
HumanBean approved these changes 2026-11-26 17:02:06 +00:00
BeanBot left a comment

Recommendation: Request changes. The headset can destroy runtime-owned images while the GPU is still using them during shutdown. The feature works in the reported WiVRn run, but its shared-queue cost and several supported platforms remain untested.

Adds an off-by-default Headset setting that displays the game on an OpenXR quad, plus Linux sandbox access for supported runtimes. It opens a new way to play, at the cost of extra GPU images and copies, shared-queue contention, and missing window output effects in the headset.

Blocking (3): must change before merging.

  1. L1 gpu/vk/vk_headset.cpp:330: A close-time fence timeout leaves GPU work in flight but still destroys the OpenXR session and its swapchains. (more on the line) Do: Keep the session and its swapchains alive until the submitted fence completes; if shutdown must remain bounded, leave those resources for process exit when completion cannot be established.
  2. L2 gpu/vk/vk_headset.cpp:536: Startup publishes the active flag before assigning the thread, while close can run concurrently and reads the thread object without synchronization. (more on the line) Do: Serialize headset startup and close, publish the thread only after it is constructed, and prevent startup once close has been requested.
  3. L7: It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first). (for the author)

Should fix (1): not blocking, but worth doing before merging.

  • L3 docs/user/advanced.md:53: The player-facing setup omits the documented Windows sandbox limitation and the Linux requirement to quit and start again after enabling the row. (more on the line) Do: State the current Windows sandbox requirement and the Linux quit-and-start requirement alongside the loader instructions.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L4 gpu/vk/vk_headset.cpp:102: The real runtime's queue-lock hold time and its effect on game frame pacing are unknown. (more on the line) Do: Measure interleaved Headset-on and off frame times and queue-lock hold times with real runtimes, including V-Sync On with a covered window. (@fix does its part first: Use a separate suitable queue, or otherwise avoid holding the game's submit lock across runtime calls that can block.)
  • L5 gpu/vk/vk_headset.cpp:232: The new rendering and platform paths have only one real headset and GPU configuration reported. (more on the line) Do: Run the listed Windows, AMD and Steam Deck coverage where applicable, plus the remaining runtime and Linux sandbox cases in Still to test, and report startup, picture, pacing and shutdown.

Decisions for the author (1) (they don't hold the recommendation)

  • L6 gpu/vk/vk_headset_picture.cpp:104: The headset picture bypasses the player's colour-vision correction and CRT output effects. (more on the line) Do: Decide whether to apply the output effects at headset resolution or copy the finished window picture, and implement the chosen behavior. (@fix does its part first: Apply the output effects to the headset image or copy the finished window output.)

@fix can do L1, L2, L3, L4 and L6.

Questions (2) (not confirmed from the code; they don't hold the recommendation)

  • Can the remaining runtime and Tier 1 hardware runs be supplied before merge?
  • Which output-effects behavior should the headset provide?

Checks: Cancelled on this head (no result): Guide screenshots / Guide images and local UI source review (pull_request), CI / Conventional Commit title (pull_request), CI / What the change needs (pull_request), CI / Rust (rustfmt, clippy, cargo test) (pull_request), CI / longshot-builder end to end (synthetic game) (pull_request), CI / Host C for Windows (llvm-mingw, compile only) (pull_request), CI / Lint (pre-commit, ShellCheck) (pull_request), CI / Game-free checks (run_all.py, part 1/4) (pull_request), CI / Game-free checks (run_all.py, part 2/4) (pull_request), CI / Game-free checks (run_all.py, part 3/4) (pull_request).

More: does it help, other systems, switches, what was read

Does it help: Yes for the feature: the author reports the game visible in a Quest 3 through WiVRn. With Headset off, three paired Linux/NVIDIA runs report median frame times of 7.93 ms before and 7.94 ms after, within the reported spread; the single 8.00 ms Headset-on run does not establish its cost.

Other systems: The change touches Vulkan synchronization, frame pacing, image memory and Linux sandbox rules. The reported real-headset run covers NVIDIA on Linux and WiVRn; Windows, AMD, Intel, Steam Deck, Monado, SteamVR, Meta Link, Landlock ABI 9, and V-Sync On with a covered window remain untested. The headset omits the window's output effects.

Switches: No environment switch is added or changed. The new Headset menu setting defaults to Off and takes a restart; LONGSHOT_PREPARE_ONLY remains off by default and now also suppresses headset startup and its sandbox grants.

Reviewed: f66bc32ce2 against 038beefa3c: Read the repository rules, PR template, commit log, changed headset implementation and interfaces, renderer and sandbox diffs, surrounding shutdown and queue code, and the new headset test. Skimmed the remaining test and documentation diffs, recorded runs, provenance and generated OpenXR headers; the large upstream headers were not read in full. docs/review-checklist.md and the sibling Tooling checkout were absent.; nothing run (a code review).

Checked and fine:

  • The menu row is in its own module, has a frozen settings key, and defaults to Off.
  • Every listed commit has an AI-assistance trailer.
  • The reported real-headset and sandbox runs are evidence for WiVRn on the author's Linux/NVIDIA setup.
  • No game-derived file is apparent in the changed-file list.

Testing: Read-only review; no builds, tests or project scripts were run. All reported CI jobs were cancelled without a result.

Overlaps and merge order: No overlapping pull requests could be checked in the closed-network checkout.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The headset can destroy runtime-owned images while the GPU is still using them during shutdown. The feature works in the reported WiVRn run, but its shared-queue cost and several supported platforms remain untested. Adds an off-by-default Headset setting that displays the game on an OpenXR quad, plus Linux sandbox access for supported runtimes. It opens a new way to play, at the cost of extra GPU images and copies, shared-queue contention, and missing window output effects in the headset. **Blocking (3)**: must change before merging. 1. **L1** `gpu/vk/vk_headset.cpp:330`: A close-time fence timeout leaves GPU work in flight but still destroys the OpenXR session and its swapchains. (more on the line) **Do:** Keep the session and its swapchains alive until the submitted fence completes; if shutdown must remain bounded, leave those resources for process exit when completion cannot be established. 2. **L2** `gpu/vk/vk_headset.cpp:536`: Startup publishes the active flag before assigning the thread, while close can run concurrently and reads the thread object without synchronization. (more on the line) **Do:** Serialize headset startup and close, publish the thread only after it is constructed, and prevent startup once close has been requested. 3. **L7**: It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first). *(for the author)* **Should fix (1)**: not blocking, but worth doing before merging. - **L3** `docs/user/advanced.md:53`: The player-facing setup omits the documented Windows sandbox limitation and the Linux requirement to quit and start again after enabling the row. (more on the line) **Do:** State the current Windows sandbox requirement and the Linux quit-and-start requirement alongside the loader instructions. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4** `gpu/vk/vk_headset.cpp:102`: The real runtime's queue-lock hold time and its effect on game frame pacing are unknown. (more on the line) **Do:** Measure interleaved Headset-on and off frame times and queue-lock hold times with real runtimes, including V-Sync On with a covered window. *(`@fix` does its part first: Use a separate suitable queue, or otherwise avoid holding the game's submit lock across runtime calls that can block.)* - **L5** `gpu/vk/vk_headset.cpp:232`: The new rendering and platform paths have only one real headset and GPU configuration reported. (more on the line) **Do:** Run the listed Windows, AMD and Steam Deck coverage where applicable, plus the remaining runtime and Linux sandbox cases in Still to test, and report startup, picture, pacing and shutdown. **Decisions for the author (1)** (they don't hold the recommendation) - **L6** `gpu/vk/vk_headset_picture.cpp:104`: The headset picture bypasses the player's colour-vision correction and CRT output effects. (more on the line) **Do:** Decide whether to apply the output effects at headset resolution or copy the finished window picture, and implement the chosen behavior. *(`@fix` does its part first: Apply the output effects to the headset image or copy the finished window output.)* `@fix` can do L1, L2, L3, L4 and L6. **Questions (2)** (not confirmed from the code; they don't hold the recommendation) - Can the remaining runtime and Tier 1 hardware runs be supplied before merge? - Which output-effects behavior should the headset provide? **Checks:** Cancelled on this head (no result): `Guide screenshots / Guide images and local UI source review (pull_request)`, `CI / Conventional Commit title (pull_request)`, `CI / What the change needs (pull_request)`, `CI / Rust (rustfmt, clippy, cargo test) (pull_request)`, `CI / longshot-builder end to end (synthetic game) (pull_request)`, `CI / Host C for Windows (llvm-mingw, compile only) (pull_request)`, `CI / Lint (pre-commit, ShellCheck) (pull_request)`, `CI / Game-free checks (run_all.py, part 1/4) (pull_request)`, `CI / Game-free checks (run_all.py, part 2/4) (pull_request)`, `CI / Game-free checks (run_all.py, part 3/4) (pull_request)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the feature: the author reports the game visible in a Quest 3 through WiVRn. With Headset off, three paired Linux/NVIDIA runs report median frame times of 7.93 ms before and 7.94 ms after, within the reported spread; the single 8.00 ms Headset-on run does not establish its cost. **Other systems:** The change touches Vulkan synchronization, frame pacing, image memory and Linux sandbox rules. The reported real-headset run covers NVIDIA on Linux and WiVRn; Windows, AMD, Intel, Steam Deck, Monado, SteamVR, Meta Link, Landlock ABI 9, and V-Sync On with a covered window remain untested. The headset omits the window's output effects. **Switches:** No environment switch is added or changed. The new Headset menu setting defaults to Off and takes a restart; LONGSHOT_PREPARE_ONLY remains off by default and now also suppresses headset startup and its sandbox grants. **Reviewed:** f66bc32ce242 against 038beefa3c4e: Read the repository rules, PR template, commit log, changed headset implementation and interfaces, renderer and sandbox diffs, surrounding shutdown and queue code, and the new headset test. Skimmed the remaining test and documentation diffs, recorded runs, provenance and generated OpenXR headers; the large upstream headers were not read in full. docs/review-checklist.md and the sibling Tooling checkout were absent.; nothing run (a code review). **Checked and fine:** - The menu row is in its own module, has a frozen settings key, and defaults to Off. - Every listed commit has an AI-assistance trailer. - The reported real-headset and sandbox runs are evidence for WiVRn on the author's Linux/NVIDIA setup. - No game-derived file is apparent in the changed-file list. **Testing:** Read-only review; no builds, tests or project scripts were run. All reported CI jobs were cancelled without a result. **Overlaps and merge order:** No overlapping pull requests could be checked in the closed-network checkout. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -50,6 +50,18 @@ whether each started, and why not.
runs on Intel Arc and Iris Xe GPUs, and on other GPUs whose Vulkan driver has what XeSS needs. There is no XeSS for
Linux.
## Headset
Member

L3 (should fix): The player-facing setup omits the documented Windows sandbox limitation and the Linux requirement to quit and start again after enabling the row.

When: A Windows player following this page installs the loader and enables Headset but the default sandbox can still prevent the runtime from starting; a Linux player using the menu restart can retain the old sandbox rules.

Do: State the current Windows sandbox requirement and the Linux quit-and-start requirement alongside the loader instructions.

**L3** (should fix): The player-facing setup omits the documented Windows sandbox limitation and the Linux requirement to quit and start again after enabling the row. *When:* A Windows player following this page installs the loader and enables Headset but the default sandbox can still prevent the runtime from starting; a Linux player using the menu restart can retain the old sandbox rules. **Do:** State the current Windows sandbox requirement and the Linux quit-and-start requirement alongside the loader instructions.
@ -0,0 +99,4 @@
return call(args...);
}
/// Whether a call of the headset's thread succeeded; one that did not ends the headset for this run
Member

L4 (should fix): The real runtime's queue-lock hold time and its effect on game frame pacing are unknown.

When: A runtime that blocks inside a held OpenXR call prevents the game's submits from taking the same queue lock; the reported stand-in deliberately holding acquire for 1.5 seconds produced roughly one-second game frames.

Do: Measure interleaved Headset-on and off frame times and queue-lock hold times with real runtimes, including V-Sync On with a covered window.

**L4** (should fix): The real runtime's queue-lock hold time and its effect on game frame pacing are unknown. *When:* A runtime that blocks inside a held OpenXR call prevents the game's submits from taking the same queue lock; the reported stand-in deliberately holding acquire for 1.5 seconds produced roughly one-second game frames. **Do:** Measure interleaved Headset-on and off frame times and queue-lock hold times with real runtimes, including V-Sync On with a covered window.
@ -0,0 +229,4 @@
XrSessionCreateInfo ci{XR_TYPE_SESSION_CREATE_INFO};
ci.next = &gb;
ci.systemId = s.system;
if (const XrResult r = held(xrCreateSession, s.instance, (const XrSessionCreateInfo*)&ci, &s.session); XR_FAILED(r))
Member

L5 (should fix): The new rendering and platform paths have only one real headset and GPU configuration reported.

When: The session, swapchain formats, shared queue and sandbox IPC are exercised on Linux/NVIDIA/WiVRn; the supported Windows and AMD paths and the other named runtimes have no reported run.

Do: Run the listed Windows, AMD and Steam Deck coverage where applicable, plus the remaining runtime and Linux sandbox cases in Still to test, and report startup, picture, pacing and shutdown.

**L5** (should fix): The new rendering and platform paths have only one real headset and GPU configuration reported. *When:* The session, swapchain formats, shared queue and sandbox IPC are exercised on Linux/NVIDIA/WiVRn; the supported Windows and AMD paths and the other named runtimes have no reported run. **Do:** Run the listed Windows, AMD and Steam Deck coverage where applicable, plus the remaining runtime and Linux sandbox cases in Still to test, and report startup, picture, pacing and shutdown.
@ -0,0 +327,4 @@
do r = vkWaitForFences(dev.device, 1, &s.fence, VK_TRUE, 100000000);
while (r == VK_TIMEOUT && !s.closing.load(std::memory_order_relaxed));
if (r == VK_SUCCESS) return true;
s.pool = VK_NULL_HANDLE; // (the GPU may still be at it: not destroyed)
Member

L1 (blocking): A close-time fence timeout leaves GPU work in flight but still destroys the OpenXR session and its swapchains.

When: If the GPU has not finished the copy when closing is set, submit_and_wait abandons the command pool and returns; run then calls let_go, which destroys the session owning the destination image while that copy may still use it. This violates the image's lifetime and can cause a device loss or crash on exit.

Do: Keep the session and its swapchains alive until the submitted fence completes; if shutdown must remain bounded, leave those resources for process exit when completion cannot be established.

**L1** (blocking): A close-time fence timeout leaves GPU work in flight but still destroys the OpenXR session and its swapchains. *When:* If the GPU has not finished the copy when closing is set, submit_and_wait abandons the command pool and returns; run then calls let_go, which destroys the session owning the destination image while that copy may still use it. This violates the image's lifetime and can cause a device loss or crash on exit. **Do:** Keep the session and its swapchains alive until the submitted fence completes; if shutdown must remain bounded, leave those resources for process exit when completion cannot be established.
@ -0,0 +533,4 @@
void start() {
if (!wanted || !make_session()) return;
on_flag.store(true, std::memory_order_relaxed);
Member

L2 (blocking): Startup publishes the active flag before assigning the thread, while close can run concurrently and reads the thread object without synchronization.

When: If the window closes between the flag store and thread assignment, close sees the headset on but a non-joinable thread and returns; startup then starts the headset thread after shutdown has begun. Concurrent assignment and joinable() also race on the thread object.

Do: Serialize headset startup and close, publish the thread only after it is constructed, and prevent startup once close has been requested.

**L2** (blocking): Startup publishes the active flag before assigning the thread, while close can run concurrently and reads the thread object without synchronization. *When:* If the window closes between the flag store and thread assignment, close sees the headset on but a non-joinable thread and returns; startup then starts the headset thread after shutdown has begun. Concurrent assignment and joinable() also race on the thread object. **Do:** Serialize headset startup and close, publish the thread only after it is constructed, and prevent startup once close has been requested.
@ -0,0 +101,4 @@
b.srcOffsets[0] = {(int)from.x, (int)from.y, 0};
b.srcOffsets[1] = {(int)(from.x + from.w), (int)(from.y + from.h), 1};
b.dstOffsets[1] = {(int)sl.w, (int)sl.h, 1};
vkCmdBlitImage(cmd, src.image, VK_IMAGE_LAYOUT_GENERAL, sl.image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &b, VK_FILTER_LINEAR);
Member

L6 (should fix): The headset picture bypasses the player's colour-vision correction and CRT output effects.

When: A player enables colour-vision correction and Headset: the window is corrected, but the image they play through in the headset is not.

Do: Decide whether to apply the output effects at headset resolution or copy the finished window picture, and implement the chosen behavior.

**L6** (should fix): The headset picture bypasses the player's colour-vision correction and CRT output effects. *When:* A player enables colour-vision correction and Headset: the window is corrected, but the image they play through in the headset is not. **Do:** Decide whether to apply the output effects at headset resolution or copy the finished window picture, and implement the chosen behavior.
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Title and description (pull_request_target) Successful in 24s
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Successful in 7s
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
CI / Conventional Commit title (pull_request) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Has been cancelled
CI / longshot-builder end to end (synthetic game) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 4/4) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
This pull request has changes conflicting with the target branch.
  • docs/dev/reference/sandbox.md
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'openxr-engine:SqueezyLemonade-openxr-engine'
git switch 'SqueezyLemonade-openxr-engine'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'mod-api'
git merge --no-ff 'SqueezyLemonade-openxr-engine'
git switch 'SqueezyLemonade-openxr-engine'
git rebase 'mod-api'
git switch 'mod-api'
git merge --ff-only 'SqueezyLemonade-openxr-engine'
git switch 'SqueezyLemonade-openxr-engine'
git rebase 'mod-api'
git switch 'mod-api'
git merge --no-ff 'SqueezyLemonade-openxr-engine'
git switch 'mod-api'
git merge --squash 'SqueezyLemonade-openxr-engine'
git switch 'mod-api'
git merge --ff-only 'SqueezyLemonade-openxr-engine'
git switch 'mod-api'
git merge 'SqueezyLemonade-openxr-engine'
git push origin 'mod-api'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
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/Longshot!2595
No description provided.