Batch 40 · R2d session profiles and reversible binding drafts¶
2026-10-26, dev-0.9.0-bootloader, starting HEAD d72e3e73. Implementation committed separately as 889a73f6; documentation/evidence follows separately. Two existing input sources amended, two C# files/two metadata files added. No push or player build.
Change and ownership¶
PlayerInputSession.ApplyProfile changes overrides on the existing collection only while Blocked, with validated definition/slot/device-family and post-SDK ownership checks. No new InputUser, player identity, device pairing or collection replaces the existing owner. InputBindingDraft owns one edit: validated preview, selected-profile defaults, cancel restoring the actual starting session state, or Accept returning an immutable in-memory document. See the application contract and profile wrapper for API/data rules.
Invalid candidate edits retain the prior draft/session. Reset restores effective authored paths while retaining unknown fields on override records and other profiles/settings. Cancel restores actual overrides/layout/profile marker, even if the supplied document initially differed from the session. Accept does not save or admit commands. Session edits/context changes cannot bypass the draft owner; a new run cannot prepare while an edit owns the session. Device loss/reassignment, cancellation/run release or disposal cancel the draft. Held buttons require release/new press across handoffs; held movement remains available on resume.
Application checks ownership again after SDK resolution; a controlled mid-application device loss verifies restoring the prior actual collection. Reentrant SDK callbacks cannot change context/edit ownership while applying. If restoring itself throws, the error is explicit/aggregated and the map is disabled; arbitrary SDK-failure recovery is not certified. No normal config loader/writer, actor, menu, scene, authored input definition or package is migrated. The old typed writer still drops inputBindings, keeping production persistence gated. Interactive capture/prompts/UI remain future work.
Executed evidence¶
Required Unity 6000.2.8f1, Input System 1.17.0, direct batchmode/nographics execution without immediate -quit. Each retained runner handles domain-reload resumption, watchdog, cleanup, scene restoration and exit.
- Initial
TinyChaos.EditorTools.BindingDraftChecks.RunBatch40exited1 at compile time: helper Application shadowed UnityEngine.Application. Renamed it ProfileApplication. No behavioral checks from that attempt are counted. - Same entry: 9/9 new Play Mode groups, process exit0.
- Unchanged
TinyChaos.EditorTools.InputSessionChecks.RunBatch38: 8/8 prior Play Mode groups, process exit0. Template/clone identity, four-device isolation, layouts, context handoffs, reconnect, SDK override shape, readiness/retry/reload and cleanup remain passing.
| New group | Actual final result |
|---|---|
| E01 | PASS: remapped keyboard movement/Dash and P2 pad Dash work in four simulated slots; IDs/users/collections retained, other profiles isolated, apply leaves input disabled. |
| E02 | PASS: Gameplay/Reward edits, wrong slot/family/definition and null data rejected; explicit arrow profile retains movement and one-shot Dash. |
| E03 | PASS: valid preview stays blocked; conflicting edit leaves candidate and preview unchanged; cancel restores exact prior overrides/profile marker/user and original button behavior; stale acceptance rejected. |
| E04 | PASS: three reset/accept cycles restore selected authored Dash, retain unknown root/override fields and P2 pad override, leave commands blocked and close stale drafts. |
| E05 | PASS: held apply/cancel buttons do not replay, movement resumes, real release/press re-arms remapped Dash and reward confirmation, with no carried edge. |
| E06 | PASS: disable/re-enable and explicit reassignment cancel drafts and restore baseline; stale accept rejected, existing user retained and original button works on the reassigned pad after neutral input. |
| E07 | PASS: a scoped SDK BoundControlsChanged observer disables the owned device after an override reaches the collection. Application fails, rolls back exact overrides/marker/collection, rejects context reentry and emits no commands during mutation. Observer/device state restored. |
| E08 | PASS: accepted remap persists through three shared-host runs and actual scene reload; stopped edits cancel/restore baseline, identity/user retained, ended runs cannot reopen commands. |
| E09 | PASS: second editor, direct layout/refresh/apply and Gameplay admission rejected during an edit; worker-thread reset rejected; run preparation fails without stealing the edit; disposal closes the draft and detaches only its action collection. |
Checks use SDK-created keyboard/gamepads with scoped cloned focus settings. They do not certify physical controllers, production UI/rebinding capture, full gameplay, Linux player/Windows IL2CPP or file persistence. Batch-39's original Edit Mode suite was not rerun: its Read/WithBinding paths are unchanged, and the added defaults/application adapter is exercised here. Existing-category CS8785 generator and CS0252 StabilizationChecks warnings remain; no compiler error or unexpected runtime exception occurs in the two passing runs.
Private diagnostics: /tmp/tinychaos-batch40-editor.log (excluded compile attempt), /tmp/tinychaos-batch40-editor-final.log (9/9), /tmp/tinychaos-batch40-session-regression.log (8/8), with redirected stdout. No raw logs, preference values or normal config contents are committed. Retained checks reproduce the cases; temporary paths are not portable test archives.
Preservation and exact implementation scope¶
Pre-run capture /tmp/tinychaos-batch40-preserve-09fe9fa99e/ contains 2,863 project file bytes/hashes, 8,172 Unity/profile hashes and recoverable preference bytes. Only PlayerInputSession/InputBindingProfiles intentionally differ among those project files; the other 2,861 match. Of the previous 46 unique implementation paths, 44 are unchanged and two receive the explicit amendments below. Original 608 gameplay-source pins retain 606 matches plus only batch 37's two documented package exceptions. The authored action asset/29 IDs, old scenes/prefabs/build lists/settings and existing metadata are unchanged.
Unity inserted only com.unity.toolchain.linux-x86_64 in manifest/lock; JSON comparison verified that addition and exact captured package bytes were restored, retaining Input System 1.17.0. Normal game prefs changed only four automatic Unity player/connection-session keys, and shared prefs changed three Editor/session keys. Generated copies were archived and captured preference bytes restored after key-level attribution. Normal game profile coverage is one prefs file; no new profile/save/config appeared. Five external package/licensing/metrics bookkeeping files changed and remain, so the whole Unity profile tree is not claimed unchanged.
Only two new metadata files had empty-field trailing whitespace trimmed, preserving unique GUIDs. The unresolved audio and metadata deletions and untracked Addressables Linux metadata remain untouched/outside commits. Inventory now covers 248 scripts: two edited rows updated, 244 earlier rows byte-preserved, two new rows appended. Gates append nine groups (85 total), retaining earlier 76 rows and all 27 open workstream follow-ups. The 22-row legacy input consumer map is unchanged; ARCH-01 stays active.
| Path | Change | SHA-256 |
|---|---|---|
| Assets/Script/Game/GameSystem/Input/PlayerInputSession.cs | modified | 2b2e2b70fc3a3837b3fe31f4a6d529179ebe3f02e825018c46e887aa8ca2d6f5 |
| Assets/Script/Game/GameSystem/Input/InputBindingProfiles.cs | modified | 93faeb95632671f550d77236c2733b7cf7e63727dbd79d3470328efa7ff3182d |
| Assets/Script/Game/GameSystem/Input/InputBindingDraft.cs | added | 111bad59541b3789c5650db2e89f0e219e5b322cec364dfc4e79c41a6991e792 |
| Assets/Script/Game/GameSystem/Input/InputBindingDraft.cs.meta | added | b396893e272392db48747bbcfeff7946fab90b49cb3aabc7635cf1dde9da407d |
| Assets/Script/External/Editor/BindingDraftChecks.cs | added | e462a883ddc58f120696fb6902c9e583918707cc55b1214f5082a7a46ca43600 |
| Assets/Script/External/Editor/BindingDraftChecks.cs.meta | added | 5a21338a3cb512dd9bf97fd9e529e6c08b6b26f61c0bdd9e5acfcaf2f05507ec |
Final static review passes: 766 local documentation links resolve; all 53 issue IDs route once; 248 inventory paths match project scripts, with 244 old rows unchanged and two amended; all earlier 76 gate rows are preserved. Implementation commit contains exactly the six reviewed paths and matching tested source hashes, with no documentation or unrelated files. Whitespace checks pass.
Next and checkpoint boundaries¶
Next is device-owned interactive capture using this draft API: reject opening/held Submit/Back presses, filter to the assigned device and selected binding family, validate before preview, and cancel cleanly on retry/loss/reassignment/teardown. Production settings/setup/recovery views and a safe whole-config writer follow their owners; normal persistence remains gated until unknown/input data and disposable write-failure cases pass. Legacy-feel/physical comparisons precede actors/UI migration. No new Reroll shortcut or unrelated feature. GAME-01 and Tutorial remain deferred.
The six implementation paths form one commit, including code checks; all evidence/contracts/status/inventory changes form a separate documentation commit. No push. Overall gameplay completion and R2/F1 acceptance remain unfinished.