Migrate the player NCU window to the shared XML/Lua window component
Implementation-ready under the user/coordinator's clarified batch scope. Native/Lua functional acceptance, regressions and mutation checks are satisfied. Separate per-window Native AOT smoke is not a hard gate; combined full-client AOT publish is deferred to coordinated local integration. No NCU-specific AOT execution is claimed. Windows, live-game and installed-asset rendering limitations remain. No source/harness/suppression changes, repeated tests or Git operations were performed for this scope acknowledgment. Parallel window migration, based on merged develop adde9d039997805fcd0090e4c75f63a8d8589449. Worktree /home/mathias/Projects/worktrees/engines-client-lua-ncu; branch feature/client-lua-ncu. Siblings own Stats and Nano Programs. Own the local player's full NCU window, not target/team/pet NCU views. Initial audit found the following shared blockers; they are now resolved by the integrated bc39fd9b9 shared-capabilities merge. No shared API gap remains. LuaWidgetHost exposes ui.on_click(LuaWidgetReference, LuaCallback) only through GuiView.Clicked; no right-button native pointer subscription or button-specific authorization exists. Need ui.on_pointer_release(view, button, callback) (or equivalent) and ConsumeActivation(binding, button), with native pressed==released proof, captured pre-callback binding, one use, callback-only lifetime, no init/snapshot/menu permission, and cleanup on handler replacement/view destruction/package disposal. Generator Contract.cs restricts RequiresActivation to one ActionRef; need typed NanoEffectRef support for bool game.ncu.cancel(NanoEffectRef), preserving authorization before dispatch. References must invalidate on current-character changes, effect removal/replacement and disposal. Existing ui.bind(view, BindingRef)/BindingOf(view) can support adapter-owned nano inspection mapping without a new shared inspection service. Missing dynamic overlay/text-color exports also block current hostile/type frames and hostile list text; request bounded ui.overlay(view, bundledGraphicName) and ui.text_color(view, color) (or equivalent). Shared Core Window and scoped preference APIs suffice for frame/persistence. Core icon_grid currently assumes square cells and Actions-specific overhead (cell+spacing for both axes, +16 width/+40 height); NCU needs rectangular 46x30 cells, +23 width/+45 height, 12 scrollbar width and 30-cell cap. Rectangular geometry is now implemented in package-local Ncu/main.lua with core.window; no Core expansion or native sizing relay is needed. Verified independent local work: PlayerNcuCommands now owns cancellation packet construction and rechecks InPlay, current canonical character identity, active nano membership and all three removal restrictions immediately before sending. CharacterInterface edits only touch BuildNcu; target/team/pet presentation stays native and unchanged. Permanent and zero-remaining effects remain governed by canonical membership, not guessed expiry. Four new regressions cover native commands and real GuiInputManager pointer input, including left-button/mismatched-release refusal, stale effects, character changes, flags and disposed presenter. Initial extraction produced 2 failing membership tests; a control removing membership/flags made all 4 regressions fail; restored checks pass. Final Linux container command: ./run-client-tests.sh --filter 'FullyQualifiedName~Ncu|FullyQualifiedName~Window|FullyQualifiedName~LuaActionsListTests' -p:TreatWarningsAsErrors=true -p:WarningsNotAsErrors=NU1903 --logger 'trx;LogFileName=ncu-targeted.trx'. Result: 390 passed, 19 skipped, 0 failed. Skips require GUI/install assets (15) or disposable native display (4). Logs and TRX are ignored under .dev-data. git diff --check passes. No AOT publish, Windows verification or shared harness edits. Shared capabilities integrated by user-authorized own-branch git merge --ff-only bc39fd9b94499626b1b49941ea4bb6e3448c04d8. Private binary HEAD diff and nonignored untracked C# source copies saved under ignored .dev-data/pre-shared-bc39fd9b9; all preparation verified byte-for-byte after fast-forward. Integrated targeted baseline: 61 passed, 3 asset skips with warnings as errors. Shared APIs now cover the prior blockers; rectangular geometry will be package-local Lua with core.window. Resuming native effect references and Lua player-NCU migration; Refresh must run even when hidden/unchanged. Existing independent extraction stays intact. Migration is implemented locally and managed validation passes. ScriptedNcuWindow/PlayerNcuSource and grouped Game/Ncu.cs/Components/Ncu.cs contracts supply canonical facts, native sampled countdown values and Binding-derived NanoEffectRef handles. Every native nano revision/character change renews references. PlayerNcuCommands also rechecks expected canonical revision, session, character, active membership and removal flags at cancellation. Lua Ncu owns shared Window, rectangular grid, all 11 sortable/resizable list columns, type frames/hostile colors, tooltips, countdown formatting, usage title and existing scalar/array preferences. Scoped array delegates are wired in BuildNcu. Refresh is called every CharacterInterface.Update, including hidden/unchanged state. Native target/team/pet presentation remains; unused parallel player code was removed from NcuPresenter. Preparation tests were ported to the real scripted path, not discarded. Final verification: full ./run-client-tests.sh -p:TreatWarningsAsErrors=true -p:WarningsNotAsErrors=NU1903 --logger 'trx;LogFileName=ncu-full-final.trx' reports 4012 passed,180 skipped,0 failed. Targeted NCU/window/Actions/shared-capability suite reports401 passed,19 skipped. New ScriptedNcuWindowTests covers11 cases; PlayerNcuCommandsTests retains3 cases. Real pointer tests cover matching release, wrong button, current/stale/replaced/removed effects, character/session/permission changes, all removal flags and teardown. Adversarial Lua asserts init/apply/menu/left/visibility callbacks cannot cancel, old/unrelated tokens cannot borrow permission, rebinding cannot replace captured permission, and right activation is single-use. Grid/list both allocate0 managed bytes for1000 unchanged-display Apply calls. Native-zero-remaining effects persist until canonical removal; no Lua wall clock. Negative controls removing activation policy/allocation gating/width saving/rectangular geometry/timer delivery/revision check each fail corresponding tests; restored implementation passes. Skia synthetic-icon render inspected; non-name table text was corrected to native white after a failing regression. Stock test image has fontconfig but no system fonts: isolated render omitted text. Control rerun of the same compiled render test with /usr/share/fonts mounted read-only passes and produces readable names/all columns/hostile red text; image inspected. No shared image/harness/source edits. Optional installed-game chrome render remains skipped. Generator --self-test passes. Fast managed common UI harness with -p:PublishAot=false -- --shared-capabilities passes (dynamic code=True), proving no source-link/generator regression, NOT NCU AOT coverage. Static review_feature covered23 changed diffs and found no actionable issues; static only. git diff --check passes. Logs/TRX under ignored .dev-data; render at PRK.Client/PRK.Client.Tests/bin/Debug/net10.0/TestResults/lua-ncu-list.png. Deferred validation, not an implementation blocker: the coordinator will arrange a combined full-client Native AOT publish after local integration. Separate per-window smoke projects are not required for this batch; shared runtime/bindings already passed AOT. The dependency/scenario handoff below remains optional guidance for later coverage, not a request to expand the common harness. Current source-linked shared harness includes ScriptedActionsWindow but not NCU windows; PlayerNcuSource is intentionally under Windows (not shared Scripting wildcard), avoiding an unowned harness dependency break. No AOT harness/runner or shared source edits, no full publish from this session. Windows/live-game/installed-asset rendering are unverified; unavailable install/native display/audio fixtures account for full-suite skips. Implementation readiness is assessed against the clarified native/Lua functional scope; combined-publish and platform limitations remain explicitly deferred. Own-branch HEAD is now local b54c7291008f41190247d48c841719cf3b727612, integrated with the explicitly authorized git merge --ff-only; parent verified bc39fd9b9. Before update, saved binary HEAD diff plus all18 nonignored untracked source files (.cs/.lua/.xml only) under ignored .dev-data/pre-sizing-b54c7291. Tracked diff and every source hash verified byte-for-byte after update. No generated trees copied, no stash/reset/clean/forced checkout, no peer edits, no remote commands. Read updated Core guide: resizable defaults true; NCU keeps its existing resizable rectangular grid/list policy unchanged. Post-update targeted regression command: ./run-client-tests.sh --filter 'FullyQualifiedName~Ncu|FullyQualifiedName~Window|FullyQualifiedName~LuaActionsListTests|FullyQualifiedName~LuaSharedCapabilitiesTests' -p:TreatWarningsAsErrors=true -p:WarningsNotAsErrors=NU1903 --logger 'trx;LogFileName=ncu-sizing-integrated.trx'. Result403 passed,19 skipped,0 failed; includes new shared content-sized regressions. git diff --check clean. Log .dev-data/ncu-sizing-integrated.log. No migration commit/push/PR and no remote access. Exact NCU common-harness dependency handoff (paths under PRK.Client/PRK.Client unless specified): UI/Windows/ScriptedNcuWindow.cs, PlayerNcuSource.cs, PlayerNcuCommands.cs; UI/Scripting/Contracts/Game/Ncu.cs and Components/Ncu.cs; UI/Windows/NanoDisplay.cs; UI/NanoPresentationProvider.cs declares NanoPresentation; Character/Stats/LocalPlayerStatState.cs declares ActiveNanoSnapshot and LocalPlayerNanoSnapshot; Character/Stats/LocalPlayerStatSnapshot.cs declares LocalPlayerStatSnapshot. Snapshot support declarations are Character/Stats/IStatReader.cs, StatValue.cs and PlayerStatCalculator.cs (ClientStatSource/PlayerStatResult). Common types come from PRK.Common/AOEmu.Common/Entities/NanoFlags.cs, AOEmu.Common/Identity.cs, AOEmu.Common/Messaging/N3Messages/CharacterActionMessage.cs and PRK.Common.Enums/CharacterActionType.cs, StatIds, NanoSchool through their actual projects. Existing shared UI/Scripting/Core runtime, SkiaSharp and generated LuaApiEntries/LuaApiProjection/dispatch are required. Include all UI/Packages/Ncu assets and Core. IMPORTANT: the active snapshots are co-located with LocalPlayerStatState (pulling calculator/inventory/network dependencies), NanoPresentation is co-located with its RDB provider (pulling RDBLib2/NanoTargetRules/common stat logic), and stat result records are co-located with PlayerStatCalculator. This is the exact direct declaration map, NOT a validated minimal source-link closure. Do not duplicate/shadow DTO definitions or blindly add a full-client project reference alongside existing source-linked duplicate UI types. If later source-linked coverage is chosen, its compilation boundaries remain coordinator-owned; no separate smoke or common harness expansion is required for this batch, and no central source moves/harness edits were made here. Meaningful NCU Native AOT smoke scenarios to port from ScriptedNcuWindowTests using real GuiInputManager.OnMouseDown/OnMouseUp: (1) Apply canonical player stats plus friendly/hostile/permanent/hidden/team effects; assert generated projection populates correct grid bindings and all11 list columns, native timer updates and existing scoped scalar/array preferences. (2) Right down/up on the same bound slot or row child sends exactly one RemoveFriendlyNano packet with current character/nano; left click, release over another view, revoked CanInteract/session, hostile/NotRemovable/NoRemoveNoNCUFriendly all send none. (3) After rendering, change the live command snapshot without applying UI: removal, character change or same nano re-added at a newer revision must refuse the stale UI reference. Apply a new revision and ensure new binding works. (4) Use an adversarial package wrapper as in SnapshotMenuLeftAndVisibilityCallbacksCannotCancelAndRightActivationIsCapturedSingleUse: snapshot/menu/left/visibility observers cannot cancel; rebinding cannot authorize another effect; captured right permission is single-use. (5) Switch grid/list and dispose/fault the real component; retired slot/row PointerReleased handlers and borrowed bitmaps are cleared, NanoAt returns null, old pointer input produces no command, borrowed native bitmap remains usable, and failure frame retains safe close handling. Existing FailedLuaApplyReleasesPointerHandlersAndLeavesBorrowedIconsOwnedNatively covers fault teardown. A combined full-client Native AOT publish after local integration remains coordinator-owned deferred validation, not a separate-window implementation gate. NCU-specific AOT execution has not occurred and is not claimed. Outcome: player NCU uses shared Core Lua Window with Lua-owned grid/list composition, ordering/sorting, countdown display, title, tooltips and preferences, backed by canonical native active-nano data and validated cancellation. Preserve permanent/expired effects, identity/revision changes, hostile/friendly/other-source distinctions, availability and existing columns/inspection behavior. Right-click cancellation must retain pressed==released provenance, current-character identity, active membership, removability restrictions and current native command validation. No background/init/snapshot/menu-triggered gameplay commands. Inspect UI/Windows/NcuPresenter.cs, NcuWindowSizing.cs, NcuStrip.cs, TargetNcuWindow.cs, UI/Layouts/Ncu.xml/NcuSlot.xml, CharacterInterface.BuildNcu and local update/inspection paths, NcuPresenterTests/NcuResizeTests/NcuStripTests/TargetNcu*Tests. NcuPresenter.ForTarget and other native consumers remain supported; do not delete a shared presenter merely to eliminate the player path. Remove the parallel native player-NCU presentation, not unrelated target views. Contracts belong in grouped Contracts/Game/Ncu.cs and Components/Ncu.cs if needed. Restrict CharacterInterface edits to own NCU hunks. Shared Core/runtime/widget-host/activation policy/generator/graphics/input/window manager/preference store/CI/AOT harness are centrally coordinated, not independently edited. Audit shared API needs first, especially button-specific native user activation/right-click, semantic binding/inspection and non-ActionRef command authorization. Do not misuse ActionRef/game.actions.execute for nanos or bypass the protected/native-validated command boundary. Report precise signatures, provenance/lifetime and behavior requirements; proceed with independent domain work but stop/block where a shared prerequisite prevents correctness. Do not replace correct domain behavior with a simplified proof. Acceptance: real player NCU migrates to Lua while all native target/team/pet views remain intact; counts/timers/grid/list/preferences and validated right-click cancellation preserve behavior; regression tests cover current identity, removed/stale effects, hostile/nonremovable refusal, real pointer provenance, disposal and unchanged-data allocation gating. Canonical snapshots/timing remain native; no Lua wall-clock reconstruction of game facts. Relevant targeted tests required; coordinate common AOT coverage. Do not mark done with unmet prerequisites. No commit/push/PR/rebase/merge permission; hand off local changes/results/limitations. Private tracking data never enters repository/team content.
Checklist
3 of 3 complete- Audit player NCU behavior, shared target consumers and required pointer/activation capabilities; report shared prerequisites.
- Migrate player NCU presentation/frame/preferences to Lua with native active-effect facts and validated cancellation, preserving target/team/pet views.
- Verify native/Lua timers, identity/removal restrictions, real right-click provenance, grid/list/preferences and cleanup; record deferred combined full-client AOT and Windows/live/installed-asset limitations under the clarified batch scope.
- Area
- Project Rubi-Ka
- Project
- engines
- Kind
- Feature
- Task ID
tsk_5vbhg5k793- Updated