TR2 bounded Action observer preparation — 2026-11-08
Implemented the optional observer in tools/tr2-action-observer.cjs and integrated it into the normal selected TR2 helper. Preparation is complete; no original game, Chrome session, allocation or replay ran. Nothing here proves an original poll, firing, targeting, aiming or backend success. The next fresh original needs separate authorization.
Evidence: scratch/runs/20261108-tr2-action-observer-1652/ (R). Historical generation: scratch/runs/20261108-tr2-dog-encounter-1610/runtime-pins.json, unchanged at 614 providers / 29 helpers. R's explicit normal runtime_helper_closure.relocate transition produces 615 providers / 29 physical helpers, with each old/new helper row in runtime-pins.json:selectedGeneration.helperRepin and the new observer module as the sole additional provider. prepare.py is the small reproducible transition recipe, not authorization to launch. No source archive or media copy was made. Exact Git SHAs, relevant binary diff, small owned-file patches and existing media path/hash references are retained in R.
The selected CPU remains build/wine-assembly.wasm, SHA-256 d8facd0658b7f158c6e60bef2de0936471f438f8bf41e9240fd75635f1d319dc. The original CPU/owning WebGL2 authority and all 585 non-helper historical provider rows remain unchanged. This deliberately does not refresh historical helpers to unrelated current kernel/clock work. The exact existing test/binaries/candidates/tomb-raider-2-demo/game/TOMB2.EXE remains 0811efa84bfab8c458b9e29976088152db4c14601a99ca4910c75a2d009233aa.
The selected browser-run.cjs accepts actionObserver:true on one ordinary reviewed key:Control command, holdMs <= 2000. Existing current-pixel review, native admission, CPU-module identity and owning Worker target/endpoint checks run first. It then installs the serialized observer into that Worker's normal instance facade and calls the unchanged native bound.hold. No debugger breakpoint, tracing flag, guest setter, guest function invocation, translator call, binding change, input-policy change, clock change or backend change is used. The observer's direct reads use the frozen direct-window ABI, avoiding guest_to_wasm's possible materialization side effects.
The adapter follows the existing optional ordinary run(1) observation pattern. It preserves the total block count and remaining normal run budget when it removes itself. It checks the preferred image, Worker slot 0 / guest thread 1, endpoint, immutable loaded instruction windows and call-stack relationships. Internal WAT reentry and other threads are explicitly outside its coverage. Absence of a witnessed boundary never establishes absence of guest execution.
At actual ordinary run boundaries it records:
0x447206and retry0x447236: EAX HRESULT,0x51b078[0x1d/0x9d], slot-8 configured/default binding and conflict dword. The wrapper's saved EDI, caller0x44d2bb, and buffer argument0x51b078must match; the saved stack ties the poll to this input update.- The owning Worker's actual
GuestRpc.views(memory,slot).pub, using exportedSLOT.KEYS,KEYS_VALIDandGEN, for VK 17/162/163. Unpublished or generation-changing reads stop unqualified. These reads are not an atomic history and do not prove which event snapshot an open RPC input event used. - Slot-8 return
0x44d3c6, its EAX result and pre-Action EBX; then the pinned mandatory successor of the conditional OR at0x44d3cd. A taken JE reaches0x44d3d4; fallthrough executes OR/store/push9/CALL and reaches0x44d180with caller0x44d3dband argument 9. Stack and EBX postconditions must match.orExecuted, actual EBX bit0x40, binding/conflict and the associated poll index are retained. Action set remains explicitly weapon/aim unqualified.
The relocated page sampler now includes physical VK 17/162/163 alongside arrows. The observer records Worker wall timestamps and monotonic observation timestamps; normal hold receipts retain native attempt/release times. Final correlation requires a physical VK17 down sample wholly inside the hold and a paired poll/Action record inside its native interval. Wrong publication, failed HRESULT, zero Ctrl bytes, Action clear and Action set remain separate raw observations. A changing publication or event snapshot can require further causal work; this tool does not diagnose a fabricated Control defect.
Limits are fixed at installation: default 4096 observed boundaries, at most 32 records, and at most 2500 ms including installation/removal allowance around the <=2000 ms hold. Time is checked at every observed boundary and by a prearmed Worker timer. Overflow, boundary exhaustion, expiry, bad read/code/stack, owner replacement, guest trap or an incomplete Action pair fail closed. A successful explicit removal restores the exact original instance. The retained one-use status handle cannot rearm the observer. finally removes it after the hold; a no-poll/out-of-interval result is saved and terminates the normal driver without retry. A Worker stalled in a host operation cannot execute its timer until it returns, but the independent native release still runs; observation cannot extend the hold. The existing runtime's external lifecycle bound remains required for a future original.
Focused checks passed:
node tools/tr2-action-observer.test.cjs: 25 checks. The actual serialized production observer, static exact-game instruction windows, fixture CPU states and actual RPC layout distinguish poll failure, retry, zero Ctrl, binding/Action clear, Action set and no-poll. Overflow, expiry, removal, unpublished bitmap, foreign owner, bad caller/code and incomplete pairing remain unqualified. Actual orchestration uses the unchanged native hold executor, including physical-interval and missing-physical negative cases. A stalled sample resolves only after independent keyUp. A manually authored three-byte INC/JMP loop runs on the exact productiond8facd06CPU to verify adapter budget continuation, aggregate block counts and automatic removal; no PE is loaded or executed. These are cheap fixture checks, not original/backend acceptance.- Unchanged
tools/tr2-action-path.test.cjsboth directly and with--rpc: production DOM → renderer → host → Worker bitmap/RPC → compiled production GetDeviceState passes all nine checks, including both Ctrl DIKs and release. Existing historical test authority is unchanged. - Normal physical helper resolver validates all 29 selected helpers and all dependencies; the actual selected driver's
DRIVER_PREFLIGHT=1preloader resolves all 615 providers and exits before starting Chromium. The production static-server resolver serves all nine existing HTTP pins with exact hash/size matches. The historical manifest is rehashed unchanged. Seehelper-resolver.json,driver-preloader.log,http-resolver.json,generation-tests.log. flock /tmp/wine-build.lock bash tools/build.sh: PASS, samed8facd06CPU bytes.
Next: a separately authorized fresh original using this explicit selected generation, normal custody/deadline startup, unchanged actual CPU/owning WebGL2 qualification, reviewed drawn pistols/dog ahead, then exactly one observed <=2000 ms Control hold. Preserve current reviewed aim/pose/flash/hit pictures over the interval; stop on an unqualified result. No hold extension, automatic retry, binding alteration or inferred firing success. Full27, parity, audio and FPS remain open.
No box was created, resumed, stopped or deleted. Box ID/state/expiry/stop receipt: N/A. No external messages, deployment, subworkers or heavy-runtime lock. The local board watcher is retired at release.