Consolidate Lua icon-grid reconciliation and cell lifecycle before Inventory migration
USER-AUTHORIZED CLEANUP: Shared-grid worktree was clean at publisheda8737dfc0 with0 ahead/behind upstream; PR2806 was already merged. Archived85 selected validation/evidence/source files and HEAD/branch manifests under /home/mathias/Projects/worktrees/lua-window-worker-archives/inventory-grid-20261022T161756Z/shared-grid/. Closed Herdr workspace w17/agent lua-shared-grid and removed engines-client-lua-shared-grid without force. Local branch refs and global Pi transcript retained. No remaining Lua task worktrees; current coordinator/original checkout and unrelated worktrees/agents preserved. Historical source/evidence paths below were retired; use archive/published history for continuation. User approved a dedicated shared-grid session as the next step after merged/CI-passed shared Window/Table migrations. Worktree /home/mathias/Projects/worktrees/engines-client-lua-shared-grid; branch refactor/client-lua-shared-grid; base merged origin/develop6626be885 (#2805). Original checkout, unrelated worktrees and other Herdr projects remain untouched. User subsequently explicitly requested opening the PR, authorizing commit/push/PR creation. Committed as a8737dfc0 (refactor: Share Lua icon-grid cell lifecycle across windows), pushed with upstream origin/refactor/client-lua-shared-grid and opened ready PR2806 https://git.project-rk.com/prk/engines/pulls/2806 against develop. User subsequently merged PR2806; verified hasMerged=true at2026-10-22T10:22:18Z. Worktree remains at published feature head a8737dfc0; new implementation should branch from updated develop, not this old feature history. No rebase/force-push or merge was performed by the assistant. No Inventory migration or extra agents. Audit Actions/action_button.lua+main, Ncu/cells.lua+main, NanoPrograms/main and Core/icon_grid.lua plus schemas/XML/input/backend tests. Core.icon_grid currently supplies geometry, not shared widget reconciliation/cell lifetime; extract actual repeated behavior rather than assuming three identical implementations. Build one reusable owned grid/cell component using/extending the existing Core abstractions. Native GuiView/XML/layout/input stays reused; Core.Table remains the only shared list/sort engine. Distinguish grid geometry, row/cell lifecycle and domain presentation cleanly without overbuilding a generic framework. Scope: shared grid creation/reconciliation/padding/reuse/retirement, native semantic bindings, callback registration/cleanup, icon assignment/clearing and empty-cell behavior; reuse generic ordering where needed. Packages own canonical data/order policies, formatters/tooltips/badges/hostile overlays/opacity/enabled state, resource meaning, geometry parameters/chrome and actual validated activation/cancellation callbacks. Preserve square Actions/Nano grids and rectangular NCU cells, existing snapping/scrollbar/capacity/window sizing and current preferences. Do not force NCU into square-cell rules or move native game facts/clock/session/casting/removal rules into Core. Shared engine must not branch on window/game types or expose domain commands. Preserve native captured user activation and right-release provenance, single-use/button-specific permissions, CanInteract/session checks, stale token invalidation, package isolation and borrowed-resource lifetime. Empty slots clear binding/content/tooltip/icons as appropriate and cannot authorize commands; retired views lose callbacks. Avoid unnecessary writes/rebinding/reallocation on unchanged entries/snapshots and maintain current generous widget/text/Lua budgets. Remove superseded per-window grid reconciliation engines rather than leaving parallel implementations; retain only truly domain-specific configuration/formatting. Validation: observed-red meaningful native-input/cleanup/multi-instance regressions plus existing Actions/NCU/Nano/shared-table/window/resize/preferences/inspection/shortcut tests; preserve the500-nano/node-budget case, square/rectangular size behavior, silent Nano casts/ordinary button sounds and shared list ordering. Run full client/graphics and generator/native/shared AOT acceptance as practical. No separate per-window AOT gates; full-client publish only when relevant/prerequisites available, with actual limitations recorded rather than fake packages/suppressions or unexecuted claims. CI passed for merged base per user, not a claim about new branch CI. Native installed-art/live Windows/macOS checks remain explicit. Implemented locally: Core.icon_grid owns Grid.cells creation/padding/positional reuse, cached bindings/presentation writes, activation registration and retirement. Deleted Actions/action_button.lua and Ncu/cells.lua; replaced Nano's inline lifecycle. Square/rectangular geometry, domain formatting/callbacks, native authorization/resource ownership and Core.Table ordering remain in their existing owners. Core/package docs updated; Inventory untouched. Verified in this worktree using the existing Docker SDK runners (host has no dotnet): ./run-client-tests.sh -p:TreatWarningsAsErrors=true -p:WarningsNotAsErrors=NU1903: 4,026 passed, 180 environment-dependent skips, zero failures. Graphics project via prk-client-tests:10.0 with the same warning flags: 713 passed, one skipped, zero failures. ./run-client-lua-tests.sh: native release and sanitizer CTest 8/8 each, generator self-tests, scripting AOT and shared UI/Actions AOT acceptance all passed. Lua syntax checks and git diff --check passed. No new per-window AOT projects or suppressions. Regressions use real GuiInputManager mouse/right-release events, button-specific single-use commands, reconciliation during captured activation, cross-package command refusal, inactive/hidden views, empty slots, independent grids, padding/growth/shrink/reorder/replacement/clear/disposal, stale delegates, borrowed icon lifetime, unchanged-field allocation/icon writes and the existing geometry/preferences/sound/inspection/shortcut suites. The 500-nano case now also traverses list → grid → list, preserving order and real casting. Negative controls failed when binding or native destruction was removed and when cached writes were disabled (384,000 managed bytes versus zero over 1,000 unchanged updates); all controls restored and final suites rerun green. Limitations: installed-art/live game acceptance and Windows/macOS execution were not performed. Full-client AOT publish was not attempted: .dev-data/native-audio/linux-x64/package is absent; publishing requires the real OpenAL Soft library, license/notice bundle and openal-soft-1.25.2 source archive. No fake packages, changed quotas or bypasses. All intended source/docs/tests are now committed and published as a8737dfc0/PR2806 with explicit permission; prior local validation logs were inspected during publication, not misrepresented as freshly rerun tests. No extra agents. New-branch CI is unexecuted; no claim that full-client AOT or live/platform acceptance has newly run. Update concise Core docs, private task/checklist and final handoff. Read project instructions and reuse existing modules/helpers first. Work local until user authorizes publication. No source/comments/docs/commits/branches/PRs containing private task metadata. Dedicated Herdr agent will be lua-shared-grid; startup prompt in ignored .dev-data/start.prompt.txt.
Checklist
3 of 3 complete- Audit existing grid/cell implementations, identify common lifecycle versus domain policy and verify baseline behavior.
- Implement one reusable Core grid/cell component, migrate all three grids and remove superseded reconciliation/handler engines.
- Verify native input/bindings/provenance, reuse/padding/cleanup, multi-instance isolation, geometry/preferences and unchanged-data allocations; update docs and report real validation.
- Area
- Project Rubi-Ka
- Project
- engines
- Kind
- Chore
- Task ID
tsk_j4at76rjh7- Updated