Implement capability-separated Lua UI interaction packages
Replace prototype-specific routing with a production package/runtime foundation built fresh from develop. Preserve both prototypes and their uncommitted changes in engines-client-lua; actual implementation worktree /home/mathias/Projects/worktrees/engines-lua-ui-interactions, branch feature/lua-ui-interactions, baseline origin/develop c93ba9ced. User approves flexibility over perfect automation prevention. Architecture: ordinary presentation Lua plus optional isolated interaction Lua declared by manifest; native role adapters grant actions and input authority, never package self-assertion. Reuse native Lua bridge, collection identity/validation and established window/input abstractions. Do not copy ConsolePort code, prototype-specific hard-coded views/source names, opt-in environment switches or controller device fixes into the foundation blindly. User now explicitly requests finishing the implementation and migrating all windows, beyond the initial Inventory/Perks increment. Scope includes every command-bearing Lua role, presentation-only role accounting, reusable native keyboard/controller ingress, layout/state bridges, native action/menu/hotbar paths and player configuration restrictions. Do not mark complete after a partial rollout. Initial migration targets Inventory and Perks for known issue 305; protect final native commands/subjects/gesture lifetimes while freeing layout, browsing and navigation. Add reusable live action membership/reconciliation and explicit layout metadata crossing, no full taint system. Retain presentation-only package compatibility and default provider/fallback behavior. Physical controller ingress must use normal session lifecycle/input architecture if included, not prototype hooks. Trace and address macro/hotbar restrictions as part of the full migration; preserve native command validation and player input provenance. User subsequently authorized committing, pushing and opening a WIP PR via /open-pr; no game launch requested. Acceptance: manifest can declare multiple interaction scripts, separate runtime has only granted interaction capabilities, presentation cannot invoke gameplay actions, physical gesture budget/cancellation cannot be replayed or chained, stale references invalidate rather than retarget, representative migrations work during combat/resizing and package failure/fallback/disposal are coherent. Relevant focused builds/tests and native rendering pass, limitations explicit. Avoid broad speculative framework work and deep/long reviews; user will validate gameplay. First production increment implemented, uncommitted, in the clean worktree above. LuaUiPackage supports ordered InteractionScript declarations separately from presentation scripts, with the same filename/count/resource validation and external catalog content checks. LuaUiComponent creates an optional isolated LuaInteractionRuntime only for native opt-in roles; required module factories load independently into both VMs. Unsupported hosts reject interaction manifests through existing failure/fallback behavior. Interaction initialization registers an input callback. Native registered commands are the only granted action sources; adapters explicitly update live subject membership. Surviving selections persist, departed subjects clear selection and invalidate held native activations. Input callback arguments are action, captured reference and button. One attempt per native activation is consumed even when unavailable; execution waits for successful return and revalidates membership/availability. Presentation APIs and ordinary callbacks cannot invoke these commands. Faulted handlers discard queued commands and block subsequent direct-dispatch fallback. Native chrome/menu lifecycle remains native. UI diagnostics aggregate both runtimes' calls/time/memory. Inventory containers and Perks opt into the new runtime in their normal bundled packages, with no prototype files, environment flags or device hooks. Perks supplies training/removal subjects before projection. Inventory supplies server-close references and bank-credit-transfer membership; native item input/dragging and text submission retain existing validation/lifetimes. Interaction-enabled packages avoid blanket combat layout lockdown, so resize/local navigation and enabled-state updates work; presentation-only external providers retain their old protection path. README in UI/Packages documents actual contracts and limitations. Verified: warning-as-error client build passes with existing NU1903 exemption and prepared Lua/font/audio package overrides. 83 targeted tests pass, no skips with PRK_GUIROOT set. Coverage includes real dual-runtime multi-file isolation, physical activation and live-subject invalidation, failed-handler suppression/no fallback, legacy security, provider/catalog/library compatibility, bank credits, native inventory/loot gestures, explicit Inventory/Backpack combat resizing and Perks combat tabs/line selection/training/removal/resize. Budget check was shown failing with consumption removed and passing restored. A new resize test initially confused template ID with identity; corrected to compare the actual native source item rather than inventing an expected value. Native Vulkan Perks/other-window capture inspected at PRK.Client/PRK.Client.Tests/TestResults/lua-missions-perks-tradeskills.png; existing native rendering checks pass. API generator self-test and both interaction-script syntax checks pass; git diff whitespace clean. Source-linked UI AOT test project builds, but Native AOT publishing/execution and complete suites were NOT run. Logs /tmp/lua-ui-interactions-build.log, /tmp/lua-ui-interactions-red.log, /tmp/lua-ui-interactions-final.log, /tmp/lua-ui-interactions-aot-build.log. No game launch, broad review, commits or PR. Full requested migration implemented in the clean worktree; committed as 671ca6668 (feature: Add Lua-owned UI interactions and navigation) and pushed to origin/feature/lua-ui-interactions. All 20 bundled command-bearing packages now declare interaction scripts and reuse core.interaction: Actions, ControlCenter, Friends, GridNode, Hotbar, Inventory, Market, MissionRewardPicker, MissionTerminal, NanoPrograms, Ncu, NpcChat, Perks, Pets, Skills, Team, TeamInvite, TeamSearch, Trade, Tradeskills. Other packages retain presentation-only/native responsibilities rather than gaining unnecessary gameplay capabilities. Native windows, dialogs and annotated context menus are discovered by a non-owning LuaWindowInteractionScope; adapters preserve original native callbacks and UI trees, so the same Lua navigation works outside Lua-authored windows as well. Generated native projections now mark Binding-derived references with their opaque kind in LuaArguments; generated native command registration includes the matching kind. Runtime membership is reconciled by native entrypoint before presentation receives each snapshot. Lua ui.bind cannot grant subjects. Explicit native controls (Market forms, Friends add, container close/credits) use native grants/typed annotations where needed. NCU/Pets use keyed reconciliation for surviving subjects; generic grid/table reuse remains unchanged to preserve lifecycle/performance. Ordinary menu commands and native hotbar key paths pass through interaction dispatch. Exact native shortcut capture is retained ahead of shared-key group execution and observers. Hotbar row/slot/macro model changes synchronously invalidate held input via events, not icon/availability heuristics. Normal input-phase GuiInteractionInput is owned by GuiInputManager, with live endpoint lifecycle, topmost-window routing, physical key-repeat suppression, button-driven gamepad selection, left/right stick and trigger-axis observations, cancellation and a shared press/release budget. FrameWiring pumps devices from the normal engine input context. Ctrl+F6 toggles keyboard UI navigation; controller Back toggles it. Ctrl+Tab was rejected by the full-suite collision check because it is reserved for friendly-target cycling; the existing game binding remains intact. Arrows/D-pad/left stick navigate actual widget geometry in Lua; Enter/A primary activation, X secondary, B existing escape/blur policy, bumpers cycle/page scroll views, and left/right adjusts native sliders respecting steps. Focus has a separate painted flag and does not alter gameplay selection. Native UI activation cannot recursively create another interaction budget; active mouse gestures and stale binding revisions block controller activation. Focus also moves carried UI cursor presentation without synthesizing world input. Native text submission retains physical/native validation. Interaction callbacks on_control/on_layout/on_cancel, owned target/kind/geometry queries, UI focus/activate/scroll/adjust, and bounded one-way publish/on_interaction/value state bridge are implemented. Layout/axis/ordinary observers have no execution authority. Macro creation, orientation, removal, uploads and quick binding no longer have a blanket combat gate; explicit user locks and layout/input validity remain. The controller supplemental mapping and upstream license are packaged under UI/Input, not a prototype directory. Existing prototypes remain untouched. README and API declarations describe actual contracts, migration coverage and flexibility/no-taint tradeoffs. Final verification: warning-as-error client/test builds pass with the existing NU1903 exemption and prepared native Lua/font/audio overrides. Complete client suite: 4,818 total, 4,666 passed, 152 explicit environment-dependent skips, zero failures (about 9.5 seconds). GUI renderer suite: 300/300 passed. Source-linked UI acceptance project builds and its DLL passes the complete managed-invocation acceptance runner across all roles; runner labels say Native AOT, but this was NOT a published native-AOT executable. Five new control tests pass for native/modal lifecycle, step-quantized slider commits, repeat/pointer exclusion, nonrecursive budgets/state isolation, held release revocation, and native typed-grant add/remove vs Lua binding configuration. Existing shared-hotkey, pointer capture, native bank/item, provider fallback and allocation checks pass. API generator self-test, all 70 Lua syntax checks, package XML parsing and diff whitespace checks pass. Built output contains mapping plus license. Native Vulkan focus/modal specimen captures rendered and inspected at .dev-data/interaction-controls; earlier role rendering captures/checks also pass. Logs: /tmp/lua-ui-complete-client-tests.log, /tmp/lua-ui-renderer-tests.log, /tmp/lua-ui-controls-tests.log, /tmp/lua-ui-final-controls.log, /tmp/lua-ui-all-aot-build.log, /tmp/lua-ui-managed-acceptance.log. No deep feature review or game launch. Windows/macOS and published Native AOT remain unverified. WIP/draft PR #3028: https://git.project-rk.com/prk/engines/pulls/3028 — head feature/lua-ui-interactions, base develop. Prototype worktree remains untouched. Production worktree is clean. The remote base advanced by three commits after the implementation baseline; branch history was not rewritten or merged merely for PR administration. Only README clarification and nonsemantic license whitespace cleanup changed during PR preparation; prior implementation validation remains applicable. Current outstanding validation is the user's live gameplay/hardware-controller retest of this finished implementation, including issue-305 flows, native menus/dialogs, device/focus changes and hotbar configuration. Do not treat the earlier prototype validation as validation of the new session input path, or claim every reading/visual family was independently reviewed.
Checklist
5 of 5 complete- Implement manifest-declared optional interaction runtime with explicit native role grants, controlled data crossing, input authority and lifecycle/failure handling.
- Migrate Inventory and Perks onto reusable interaction ownership and live action identities without blanket combat layout/navigation blocks.
- Verify authority, identity reconciliation, cancellation, compatibility/fallback and representative native rendering; document production contracts and remaining scope.
- Migrate every command-bearing Lua window using generated native subject grants; account for presentation-only windows and all direct native action/menu paths.
- Complete session-owned keyboard/gamepad routing, layout and interaction-state bridges, cancellation, and player-owned macro/hotbar configuration.
- Area
- Project Rubi-Ka
- Project
- engines
- Kind
- Feature
- Task ID
tsk_u4h4xhc9p3- Updated