Skip to content

Enforce recursive Client API type boundaries - #46

Merged
AriusII merged 1 commit into
mainfrom
fix/cli-011-recursive-type-boundaries
Sep 21, 2026
Merged

AriusII merged 1 commit into
mainfrom
fix/cli-011-recursive-type-boundaries

Conversation

@AriusII

@AriusII AriusII commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #27

Summary

  • replace shallow Lua mapper validation with a bounded, deterministic Roslyn type-closure walk
  • reject raw Lua/SDK lifetime types through arrays, generic arguments and definitions, tuples, DTO members, delegates, generic constraints, pointers, function pointers, by-reference members, and interop/Lua-class types
  • preserve only the explicitly approved SDK value-type boundary for generated Client results; SDK mapper sources remain permitted only when they do not expose raw ownership or interop state
  • make the aggregate public-signature contract test recursive over the equivalent CLR shapes, while retaining the documented legacy RuntimeCapabilities exception
  • compile and emit generated output, then compile a separate consumer against that emitted API rather than relying on generated-source text alone

Validation

  • dotnet build CheatEngine.Client.slnx -c Release --no-restore -warnaserror — passed, 0 warnings / 0 errors
  • all seven Microsoft Testing Platform test executables — passed, 540 tests
  • dotnet publish tests/CheatEngine.Client.AotProbe/CheatEngine.Client.AotProbe.csproj -c Release -r win-x64 --no-restore -warnaserror — passed

Boundaries and risks

The walker has explicit depth (32) and node (256) limits, deterministic symbol/member ordering, and runs only at generation/test time. It does not introduce runtime reflection, service discovery, or dynamic loading in shipped Client code. No live Cheat Engine claim is made: this issue enforces source/API boundaries only.

Summary by CodeRabbit

  • Bug Fixes
    • Strengthened validation for Lua mapper inputs and results, including nested types, generics, tuples, delegates, pointers, and function pointers.
    • Prevented unsupported, unsafe, or restricted SDK and runtime types from crossing public client boundaries.
    • Added validation for inherited members, constraints, and complex type graphs to catch boundary violations consistently.
    • Improved diagnostics to identify the specific type or boundary issue causing a mapping to be rejected.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c42ac0e4-4429-42a5-873c-50598ac9202d

📥 Commits

Reviewing files that changed from the base of the PR and between 83949f3 and 3ea602d.

📒 Files selected for processing (6)
  • source-generators/CheatEngine.Client.SourceGenerators.Lua/AnalyzerReleases.Unshipped.md
  • source-generators/CheatEngine.Client.SourceGenerators.Lua/CheatEngineLuaGenerator.cs
  • tests/CheatEngine.Client.SourceGenerators.Lua.Tests/CheatEngineLuaGeneratorTests.cs
  • tests/CheatEngine.Client.SourceGenerators.Lua.Tests/Infrastructure/GeneratorRun.cs
  • tests/CheatEngine.Client.Tests/CheatEngine.Client.Tests.csproj
  • tests/CheatEngine.Client.Tests/PublicClientSignatureBoundaryTests.cs
 _________________
< Shell we dance? >
 -----------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@AriusII
AriusII force-pushed the fix/cli-011-recursive-type-boundaries branch from 3ea602d to 6a502e4 Compare September 21, 2026 17:21
@AriusII
AriusII merged commit 070802d into main Sep 21, 2026
4 checks passed
@AriusII
AriusII deleted the fix/cli-011-recursive-type-boundaries branch September 21, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant