Fix secure icon grid binding failure on combat lockdown
Investigate player report: entered ToTW, fired drains, UI package died. Screenshot: Core/ui.lua:279 secure action must match widget semantic binding; stack Core/icon_grid.lua:127 bind, :179 show, :185 on_lockdown, Core/security.lua:54. Work in isolated worktree /home/mathias/Projects/worktrees/engines-secure-icon-grid, branch fix/secure-icon-grid-lockdown from origin/develop 7072523ff; leave existing checkout changes untouched. Trace semantic binding lifecycle and combat transition, reproduce with real UI components before fixing, preserve secure dispatch invariants. Acceptance: regression reproduced red, robust lifecycle fix verified green, relevant client/Lua validation passes. Verified diagnosis: Lua grid cached binding=0 on empty cells while native combat collections populated them. Unlock compaction moved an effect but skipped clearing its former slot because cached binding already equalled 0, leaving a duplicate native binding. Next combat reconciliation retained the duplicate and cleared the visible slot; next unlock skipped restoring that slot due stale cached nonzero binding, then ui.action raised the exact screenshot exception/stack. Deterministic regression drives real ScriptedNcuWindow, snapshots, Lua/native collection and pointer input through two combat cycles; reproduced screenshot stack before fix. Fix removes semantic binding from presentation cache and compares desired references with ui.binding before out-of-combat writes, including empty-cell clearing. Native security checks and combat mutation gates unchanged. Verified: client suite 4409 passed/187 environment-dependent skipped/0 failed; GraphicsEngine 721 passed/1 skipped/0 failed; run-client-lua-tests.sh native Release and ASan/UBSan 8/8 each, generator self-tests, bridge NativeAOT and production UI NativeAOT pass. Mutation omitting empty-binding clears fails the regression; mutation removed and full client suite rerun green. Docker validation rewrote ignored restore assets to container paths; normal local restore resolved follow-up build failure. git diff --check clean. Only Core/icon_grid.lua and ScriptedNcuWindowTests.cs changed; committed as 3b7a322ce (fix: Reconcile native icon grid bindings after combat) and pushed to origin/fix/secure-icon-grid-lockdown. Live report circumstances remain uncertain; exact reported stack reproduced offline, not live ToTW gameplay. PR #2937: https://git.project-rk.com/prk/engines/pulls/2937 (fix/secure-icon-grid-lockdown → develop).
Checklist
2 of 2 complete- Reproduce reported binding failure and trace affected lifecycle paths.
- Fix lifecycle cause without weakening protected action identity and verify regression plus relevant suites.
- Area
- Project Rubi-Ka
- Project
- engines
- Kind
- Bug
- Task ID
tsk_6tq6ncm783- Updated