Group Lua contracts by domain with ownership guidance
User clarified that the prior one-type-per-file split was too aggressive: contracts should be grouped by domain (Actions, future Stats/Inventory), not by individual record/delegate. This explicitly supersedes the earlier structural enforcement. Worktree: /home/mathias/Projects/worktrees/engines-client-lua-actions; branch feature/client-lua-actions. User requested pushing the correction. Committed as 2fd1657ea (refactor: Group Lua contracts into cohesive domain files) and pushed to origin/feature/client-lua-actions, updating draft PR2797. Worktree clean. Original checkout untouched. Implemented correction: ten separate declaration files consolidated into four cohesive files under UI/Scripting/Contracts/: Ui.cs (widget handles/callback), Shared.cs (genuinely cross-domain Binding/Icon handles), Game/Actions.cs (action reference and projected payload), Components/Actions.cs (four private builtin entrypoints). Existing semantic namespaces preserved, so consumers and generated projection/entry names remain unchanged. Future Game/Stats.cs and Game/Inventory.cs are examples only, not speculative stubs. Recursive source/AOT discovery remains intact without manual file registration. Removed generator one-contract-per-file and CLR-filename enforcement entirely; no replacement artificial file-count rules. Agent instructions in Contracts/CLAUDE.md and LuaApi/README.md now encourage related domain declarations together, retaining domain ownership, data-only/native validation boundaries and actual multi-owner admission to Shared. Exports stay with real host implementations, not a central registry. A domain should split only when responsibilities/navigation justify it, never merely because it contains multiple types. Validation after correction: grouped-contract API equivalence regression observed red against previous guard, then green after removal. Generator self-tests pass, including deterministic output and unchanged semantic diagnostics. ./run-client-lua-tests.sh passes native Release7/7, ASan/UBSan7/7, both Linux x64 Native AOT executables including real UI list/grid/sort/activation and zero-allocation unchanged updates. Broader UI regression run:96 passed,1 install-dependent skip. Generated Lua bindings and every Markdown API page byte-identical to pre-reorganization baseline at .dev-data/contract-layout/baseline. git diff --check clean. No new Windows/macOS or remote CI claim; known unrelated full-suite baseline failure remains outside this scope. Evidence: /tmp/prk-domain-contracts-{red,aot,ui}.log; generated docs still in client bin/publish docs/lua-api. Correction committed and pushed with explicit user permission. Do not mark draft PR ready or merge automatically.
Checklist
3 of 3 complete- Split declarations into focused ownership-based files/namespaces and wire automatic recursive discovery for the client and AOT tests.
- Group related contracts per domain; remove one-type-per-file restrictions and document ownership-based placement.
- Verify Lua/API docs and payload compatibility, generator negative cases, UI regressions and Native AOT publication.
- Area
- Project Rubi-Ka
- Project
- engines
- Kind
- Chore
- Task ID
tsk_zad3zcmtna- Updated