GFramework/ai-plan/public/runtime-generator-boundary/todos/runtime-generator-boundary-tracking.md
gewuyou 7288114e33 fix(game): 剥离运行时模块对生成器依赖
- 修复 GFramework.Game 对 SourceGenerators.Abstractions 的项目引用并移除未使用的枚举生成 attribute

- 新增 runtime-generator 边界校验脚本并接入 CI 与发布打包校验

- 更新 AGENTS、贡献文档与 ai-plan 跟踪,明确运行时模块禁止依赖生成器能力
2026-05-05 12:39:10 +08:00

1.7 KiB

Runtime / Generator Boundary Tracking

Goal

Keep runtime, abstractions, and meta-package modules free from source-generator project references, source-generator attributes, and leaked NuGet dependencies.

Current Recovery Point

  • Recovery point: RGB-RP-001
  • Phase: remove GFramework.Game generator coupling and add repository guardrails
  • Focus:
    • delete GFramework.Game's dependency on GFramework.Core.SourceGenerators.Abstractions
    • remove unused [GenerateEnumExtensions] usage from GFramework.Game
    • add static and packed-package validation so runtime packages cannot regress

Active Risks

  • A runtime package can still compile locally if it references a non-packable generator helper project, so regressions are easy to miss without an explicit guard.
  • A leaked package dependency may only surface when a consumer restores from NuGet, not during normal repository builds.

Completed In This Stage

  • Confirmed GFramework.Game was the direct runtime offender and GeWuYou.GFramework.Game leaked GFramework.Core.SourceGenerators.Abstractions into its nuspec dependency graph.
  • Confirmed the two [GenerateEnumExtensions] usages inside GFramework.Game do not need generated output and can be removed outright.

Validation Target

  • python3 scripts/validate-runtime-generator-boundaries.py
  • dotnet build GFramework.Game/GFramework.Game.csproj -c Release
  • dotnet build GFramework.Godot/GFramework.Godot.csproj -c Release
  • dotnet pack GFramework.sln -c Release -p:PackageVersion=<local>

Run the new boundary validator plus minimal Release build and pack validation, then inspect GeWuYou.GFramework.Game and transitive runtime packages to confirm no SourceGenerators dependency remains.