Skip to content

fix(game): 剥离运行时模块对生成器依赖#324

Merged
GeWuYou merged 2 commits into
mainfrom
fix/runtime-generator-boundary
May 5, 2026
Merged

fix(game): 剥离运行时模块对生成器依赖#324
GeWuYou merged 2 commits into
mainfrom
fix/runtime-generator-boundary

Conversation

@GeWuYou
Copy link
Copy Markdown
Owner

@GeWuYou GeWuYou commented May 5, 2026

  • 修复 GFramework.Game 对 SourceGenerators.Abstractions 的项目引用并移除未使用的枚举生成 attribute

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

  • 更新 AGENTS、贡献文档与 ai-plan 跟踪,明确运行时模块禁止依赖生成器能力

Summary by CodeRabbit

发布说明

  • 文档更新

    • 增加了代码贡献规范,明确运行时模块与源代码生成器的边界要求。
  • 测试

    • 添加了运行时/生成器边界的自动化验证步骤至持续集成流程。
  • 重构

    • 移除运行时项目中的源代码生成器相关依赖与属性,确保代码结构清晰。

- 修复 GFramework.Game 对 SourceGenerators.Abstractions 的项目引用并移除未使用的枚举生成 attribute

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

- 更新 AGENTS、贡献文档与 ai-plan 跟踪,明确运行时模块禁止依赖生成器能力
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

Warning

Rate limit exceeded

@GeWuYou has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 33 minutes and 29 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5e0ddc37-61b2-488f-bd4c-595a4567e750

📥 Commits

Reviewing files that changed from the base of the PR and between 7288114 and d9ceb83.

📒 Files selected for processing (4)
  • ai-plan/public/runtime-generator-boundary/todos/runtime-generator-boundary-tracking.md
  • ai-plan/public/runtime-generator-boundary/traces/runtime-generator-boundary-trace.md
  • scripts/test_validate_runtime_generator_boundaries.py
  • scripts/validate-runtime-generator-boundaries.py
📝 Walkthrough

背景概述

该PR建立并强制执行运行时/源代码生成器的边界约束。通过引入验证脚本、更新CI/CD工作流、清理现有代码中的生成器依赖、定义编码规则和文档,确保框架运行时模块不会意外地依赖于源代码生成器相关的项目或属性。

行动概览

该PR通过新增验证脚本和CI步骤、清理现有代码中的生成器属性使用、制定编码规则和跟踪文档,建立并强制执行框架运行时模块与源代码生成器之间的边界隔离。

变更详情

运行时/生成器边界隔离

层级 / 文件 摘要
规则与约束定义
AGENTS.md, docs/zh-CN/contributing.md
新增编码规则要求框架运行时/抽象层/顶层元包不得引用 *.SourceGenerators* 项目或包,不得使用 GenerateEnumExtensions 等生成器属性。
验证工具实现
scripts/validate-runtime-generator-boundaries.py
添加286行Python脚本,扫描项目文件中的禁用引用(ProjectReference/PackageReference)、源文件中的禁用属性模式,以及已打包NuGet依赖中的生成器引用,返回聚合的违规列表。
运行时代码清理
GFramework.Game/Config/YamlConfigSchemaPropertyType.cs, GFramework.Game/Config/YamlConfigStringFormatKind.cs, GFramework.Game/GFramework.Game.csproj
移除两个枚举上的 [GenerateEnumExtensions] 属性及其导入,移除项目文件中指向源生成器抽象项目的 ProjectReference
CI/CD集成
.github/workflows/ci.yml, .github/workflows/publish.yml
在代码质量检查和包发布步骤中分别添加验证命令,确保在编译前和打包后都执行边界验证。
计划与跟踪
ai-plan/public/README.md, ai-plan/public/runtime-generator-boundary/todos/runtime-generator-boundary-tracking.md, ai-plan/public/runtime-generator-boundary/traces/runtime-generator-boundary-trace.md
创建主题索引、追踪文档和实施进度记录,记录恢复点、已完成的补救措施、验证命令清单和后续步骤。

评估代码审查工作量

🎯 3 (中等) | ⏱️ ~30 分钟

可能相关的PR

  • GeWuYou/GFramework#247:两个PR都修改了CI/发布工作流文件并涉及源生成器相关的验证和打包逻辑。
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Pull request title clearly summarizes the main change: removing the runtime module's dependency on code generators. The Chinese title is concise and accurately reflects the primary objective of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/runtime-generator-boundary

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2274 2274 0 0 0 0 1ms

Test Results

passed 2274 passed

Details

tests 2274 tests
clock 36.4s
tool nunit
build CI - Build & Test arrow-right build-and-test link #1056
pull-request fix(game): 剥离运行时模块对生成器依赖 link #324

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2274 0 0 3.7s

build-and-test: Run #1056

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
2274 2274 0 0 0 0 0 36.4s

🎉 All tests passed!

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
CreateStream_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 1 3.7s 3.7s
Does_Not_Report_When_FieldInjectedModel_Is_Registered 1 2.1s 2.1s
Generates_Scene_Behavior_Boilerplate 1 1.8s 1.8s
CleanupDuringAcquire_Should_NotCauseRaceCondition 1 1.1s 1.1s
Append_ShouldNotBlock 1 1.0s 1.0s
Context_Caching_Should_Improve_Performance 1 784ms 784ms
PendingCount_ShouldReflectQueuedEntries 1 501ms 501ms
Cleanup_Should_NotRemoveActiveLocks 1 404ms 404ms
Cleanup_Should_RemoveUnusedLocks 1 401ms 401ms
Generates_Precise_Assembly_Type_Lookups_For_Inaccessible_External_Generic_Definitions_With_Visible_Type_Arguments 1 301ms 301ms

🎉 No failed tests in this run. | 🍂 No flaky tests in this run.

Github Test Reporter by CTRF 💚

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 5, 2026

Greptile Summary

  • Removes GFramework.Game's project reference to GFramework.Core.SourceGenerators.Abstractions and strips the two unused [GenerateEnumExtensions] attributes from its internal enums, eliminating the leaked NuGet dependency that blocked external consumers.
  • Introduces scripts/validate-runtime-generator-boundaries.py with corrected lookbehind-based regex (addressing the previous false-negative for standalone attributes), comment-line filtering, and both source-level and packed-.nupkg validation modes.
  • Wires the validator into CI (ci.yml) and the publish workflow (publish.yml --package-dir); the companion regression test file is not yet run in CI.

Confidence Score: 5/5

Safe to merge; the core boundary fix is correct and the validator logic is sound.

Only P2 findings: a no-op re.MULTILINE flag and the regression test suite not being wired into CI. No logic errors or correctness issues were found in the validator, the csproj change, or the workflow integration.

scripts/validate-runtime-generator-boundaries.py (re.MULTILINE) and .github/workflows/ci.yml (missing test invocation) are the only files worth a follow-up.

Important Files Changed

Filename Overview
scripts/validate-runtime-generator-boundaries.py New boundary-validation script; regex correctly handles standalone, parameterised, non-leading, and fully-qualified attribute forms after the lookbehind fix; minor issue: re.MULTILINE flag is a no-op here
scripts/test_validate_runtime_generator_boundaries.py New regression test suite for the validator; covers all identified edge cases but is not wired into CI
.github/workflows/ci.yml Adds boundary-validator step to CI; regression test file for the validator itself is not included in the run command
.github/workflows/publish.yml Adds packed-package boundary check with --package-dir; path resolution logic is correct
GFramework.Game/GFramework.Game.csproj Removes the forbidden ProjectReference to GFramework.Core.SourceGenerators.Abstractions; core fix of this PR

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[CI / Publish trigger] --> B[validate-runtime-generator-boundaries.py]
    B --> C{--package-dir supplied?}
    C -- No --> D[validate_project_references]
    C -- No --> E[validate_source_attributes]
    C -- Yes --> D
    C -- Yes --> E
    C -- Yes --> F[validate_packed_dependencies]
    D --> G{Violations?}
    E --> G
    F --> G
    G -- Yes --> H[Print violations / exit 1]
    G -- No --> I[Passed / exit 0]

    subgraph validate_source_attributes
        E1[rglob *.cs in runtime projects] --> E2[compile_attribute_patterns lookbehind regex per forbidden attr]
        E2 --> E3[finditer matches]
        E3 --> E4{is_comment_attribute_match?}
        E4 -- Yes --> E5[skip]
        E4 -- No --> E6[record Violation]
    end
Loading
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
scripts/validate-runtime-generator-boundaries.py:149-153
**`re.MULTILINE` has no effect on this pattern**

`re.MULTILINE` only changes the meaning of `^` and `$` anchors — it does not make `.` match newlines (that would be `re.DOTALL`). Since the compiled regex contains no `^` or `$`, the flag is silently a no-op. Multi-line matching already works here because `[^\]]*` in a character-class naturally matches `\n` without any extra flag. The flag is misleading for anyone trying to reason about multi-line behavior.

```suggestion
            patterns[attribute_name] = re.compile(
                rf"\[[^\]]*(?:(?<=\[)|(?<=[\s,(]))(?:global::)?(?:[A-Za-z_][A-Za-z0-9_]*\.)*{escaped_attribute_name}(?:Attribute)?(?=\s*(?:\(|,|\]))[^\]]*\]",
            )
```

### Issue 2 of 2
.github/workflows/ci.yml:38-39
**Regression tests for the validator are not run in CI**

`scripts/test_validate_runtime_generator_boundaries.py` exercises the edge-case regex paths (standalone, parameterised, non-leading, fully-qualified, and comment-skip behaviour) but is never invoked by CI. A future refactor of `compile_attribute_patterns` or `is_comment_attribute_match` could silently reintroduce a false-negative without any CI signal.

```suggestion
      - name: Validate runtime-generator boundaries
        run: |
          python3 scripts/validate-runtime-generator-boundaries.py
          python3 scripts/test_validate_runtime_generator_boundaries.py
```

Reviews (2): Last reviewed commit: "fix(runtime-generator-boundary): 修复边界校验回..." | Re-trigger Greptile

Comment thread scripts/validate-runtime-generator-boundaries.py
Comment thread scripts/validate-runtime-generator-boundaries.py
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Warnings Elapsed time
⚠️ CSHARP dotnet-format yes 1 no 5.56s
✅ REPOSITORY gitleaks yes no no 8.41s
✅ REPOSITORY trufflehog yes no no 6.41s

Detailed Issues

⚠️ CSHARP / dotnet-format - 1 error
Welcome to .NET 9.0!
---------------------
SDK Version: 9.0.114

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate, run 'dotnet dev-certs https --trust'
Learn about HTTPS: https://aka.ms/dotnet-https

----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Unhandled exception: System.Exception: Restore operation failed.
   at Microsoft.CodeAnalysis.Tools.CodeFormatter.OpenMSBuildWorkspaceAsync(String solutionOrProjectPath, WorkspaceType workspaceType, Boolean noRestore, Boolean requiresSemantics, String binaryLogPath, Boolean logWorkspaceWarnings, ILogger logger, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Tools.CodeFormatter.FormatWorkspaceAsync(FormatOptions formatOptions, ILogger logger, CancellationToken cancellationToken, String binaryLogPath)
   at Microsoft.CodeAnalysis.Tools.FormatCommandCommon.FormatAsync(FormatOptions formatOptions, ILogger`1 logger, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Tools.Commands.RootFormatCommand.FormatCommandDefaultHandler.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
   at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/zh-CN/contributing.md`:
- Around line 219-229: The "代码生成器边界" section is misplaced between the "### 命名规范"
header and its body; move the entire "### 代码生成器边界" block (the paragraph starting
with "- 框架内部的运行时模块..." through the end of that block) so it appears after the
naming content that begins with "遵循 C# 标准命名约定:" and its examples, but before the
existing "### 代码风格" header; locate the headers "### 命名规范", "### 代码生成器边界", and
"### 代码风格" and cut/paste the generator-boundary section accordingly to restore
correct document structure.

In `@scripts/validate-runtime-generator-boundaries.py`:
- Around line 31-45: Update FORBIDDEN_ATTRIBUTE_NAMES to annotate ambiguous
entries and reduce false positives: add inline comments next to "Log" and
"Priority" indicating they refer to GFramework source-generator attributes
(e.g., from GFramework.Core.SourceGenerators) and, if the validator uses a regex
or name-matching elsewhere, tighten matching logic to require the GFramework
namespace/prefix (or full attribute type name) for these two entries so generic
uses of [Log] or [Priority] in other libraries won't trigger the rule; locate
the tuple FORBIDDEN_ATTRIBUTE_NAMES and the validation match logic in the same
file (references: FORBIDDEN_ATTRIBUTE_NAMES and any function that tests
attribute names) and apply the comments + stricter matching there.
- Around line 145-184: The regex built in compile_attribute_patterns()
incorrectly requires the attribute name to be preceded by ^ or one of [\s,(],
causing standalone attributes like [GenerateEnumExtensions] to be missed; update
the pattern generation in compile_attribute_patterns() to (1) escape
attribute_name with re.escape when interpolating, and (2) use a simpler
body-matching expression that allows the attribute identifier to occur at the
start of the attribute body or after separators — e.g. match inside the brackets
for
(?:^|[\s,])(?:global::)?(?:[A-Za-z_][A-Za-z0-9_]*\.)*<escaped_name>(?:Attribute)?
— keeping re.MULTILINE, and replace the current complex lookaround-based pattern
with this corrected version so validate_source_attributes() finds standalone and
parameterized attributes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c5a2bf2f-b1a6-473d-9493-58e3b1b695b3

📥 Commits

Reviewing files that changed from the base of the PR and between c69942d and 7288114.

📒 Files selected for processing (11)
  • .github/workflows/ci.yml
  • .github/workflows/publish.yml
  • AGENTS.md
  • GFramework.Game/Config/YamlConfigSchemaPropertyType.cs
  • GFramework.Game/Config/YamlConfigStringFormatKind.cs
  • GFramework.Game/GFramework.Game.csproj
  • ai-plan/public/README.md
  • ai-plan/public/runtime-generator-boundary/todos/runtime-generator-boundary-tracking.md
  • ai-plan/public/runtime-generator-boundary/traces/runtime-generator-boundary-trace.md
  • docs/zh-CN/contributing.md
  • scripts/validate-runtime-generator-boundaries.py
💤 Files with no reviewable changes (3)
  • GFramework.Game/Config/YamlConfigStringFormatKind.cs
  • GFramework.Game/GFramework.Game.csproj
  • GFramework.Game/Config/YamlConfigSchemaPropertyType.cs
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (C#)
  • GitHub Check: Code Quality & Security
🧰 Additional context used
📓 Path-based instructions (12)
ai-plan/public/**/{todos,traces}/**

📄 CodeRabbit inference engine (AGENTS.md)

Tracking updates MUST reflect completed work, newly discovered issues, validation results, and next recommended recovery point

Active tracking and trace files are recovery entrypoints, not append-only changelogs; they MUST stay concise enough for boot to locate the current recovery point quickly

When a task spans multiple commits or is likely to exceed a single agent context window, update both recovery document and trace at each meaningful milestone before pausing

If subagents are used on a complex task, the main agent MUST capture the delegated scope and any accepted findings in the active recovery document or trace before continuing

Files:

  • ai-plan/public/runtime-generator-boundary/traces/runtime-generator-boundary-trace.md
  • ai-plan/public/runtime-generator-boundary/todos/runtime-generator-boundary-tracking.md
ai-plan/public/**/traces/**

📄 CodeRabbit inference engine (AGENTS.md)

Contributors MUST maintain a matching execution trace under ai-plan/public/<topic>/traces/ for complex work recording current date, key decisions, validation milestones, and immediate next step

Files:

  • ai-plan/public/runtime-generator-boundary/traces/runtime-generator-boundary-trace.md
!(*.snap|*.bin|*.lock|obj/**|bin/**)

📄 CodeRabbit inference engine (AGENTS.md)

Do not add project license headers to generated snapshots, binary assets, lock files, and generated build output

Files:

  • ai-plan/public/runtime-generator-boundary/traces/runtime-generator-boundary-trace.md
  • ai-plan/public/runtime-generator-boundary/todos/runtime-generator-boundary-tracking.md
  • AGENTS.md
  • ai-plan/public/README.md
  • .github/workflows/ci.yml
  • .github/workflows/publish.yml
  • docs/zh-CN/contributing.md
  • scripts/validate-runtime-generator-boundaries.py
ai-plan/public/**/todos/**

📄 CodeRabbit inference engine (AGENTS.md)

When working from a tracked implementation plan, contributors MUST update the corresponding tracking document under ai-plan/public/<topic>/todos/

Recovery documents MUST record the current phase, active recovery point identifier, known risks, and next recommended resume step

Files:

  • ai-plan/public/runtime-generator-boundary/todos/runtime-generator-boundary-tracking.md
**/README.md

📄 CodeRabbit inference engine (AGENTS.md)

Use canonical filename README.md for module documentation, not ReadMe.md or other variants

A module README MUST describe the module's purpose, relationship to adjacent packages, major subdirectories, minimum adoption path, and corresponding docs/zh-CN/ entry points

Files:

  • ai-plan/public/README.md
**/{README.md,docs/**}

📄 CodeRabbit inference engine (AGENTS.md)

Update the relevant README.md or docs/ page when behavior, setup steps, architecture guidance, or user-facing examples change

Public documentation MUST stay reader-facing and not surface raw filenames or paths as navigation text

Public documentation MUST avoid rhetorical, self-referential, or AI-sounding headings and prompts

Public documentation MUST present limitations, suitability, and migration boundaries as adoption guidance, not as internal governance or roadmap

Keep code samples, package names, and command examples in documentation aligned with the current repository state

Prefer documenting behavior and design intent in documentation, not only API surface

When a public page references XML docs or API coverage, convert that evidence into reader-facing guidance instead of exposing audit counts

When examples are rewritten, preserve only the parts that remain true and delete or replace speculative examples

Files:

  • ai-plan/public/README.md
  • docs/zh-CN/contributing.md
ai-plan/public/README.md

📄 CodeRabbit inference engine (AGENTS.md)

ai-plan/public/README.md MUST list only active topics; do not add ai-plan/public/archive/** content to the default boot index

When a worktree-to-topic mapping changes or when a topic becomes active/inactive, contributors MUST update ai-plan/public/README.md in the same change

When a topic is fully complete, move the entire topic directory under ai-plan/public/archive/<topic>/ and remove it from ai-plan/public/README.md

Files:

  • ai-plan/public/README.md
docs/**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

Documentation should be organized with Chinese content in docs/zh-CN/ and structured to include getting started, module-specific capabilities (Core, Game, Godot, ECS), source generator usage, tutorials, best practices, and troubleshooting

Files:

  • docs/zh-CN/contributing.md
docs/zh-CN/**

📄 CodeRabbit inference engine (AGENTS.md)

When a feature is added, removed, renamed, or substantially refactored, contributors MUST update or create corresponding user-facing integration documentation in docs/zh-CN/

For integration-oriented features, documentation MUST cover project directory layout, file conventions, required wiring, minimal working example, and migration notes

Files:

  • docs/zh-CN/contributing.md
docs/**

📄 CodeRabbit inference engine (AGENTS.md)

If a docs category appears in VitePress navigation or sidebar, it MUST have a real landing page or be removed from navigation

Files:

  • docs/zh-CN/contributing.md
**/*.{cs,csproj,xml,yaml,yml,json,py,sh}

📄 CodeRabbit inference engine (AGENTS.md)

Repository-maintained source and configuration files supported by scripts/license-header.py MUST include an Apache-2.0 file header

Files:

  • scripts/validate-runtime-generator-boundaries.py
**/*.{sh,py}

📄 CodeRabbit inference engine (AGENTS.md)

For files with shebang lines, keep the shebang as the first line and place the license header immediately after it

Files:

  • scripts/validate-runtime-generator-boundaries.py
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Read `@.ai/environment/tools.ai.yaml` before choosing runtimes or CLI tools
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: In WSL against Windows-backed worktrees, prefer Linux `git` with explicit `--git-dir` and `--work-tree` bindings over `git.exe`
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Every completed task MUST pass at least one build validation before it is considered done
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Establish warning baseline from non-incremental repository-root build by running `dotnet clean` followed by `dotnet build`
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Commit messages MUST use Conventional Commits format: `<type>(<scope>): <summary>` with summary in simplified Chinese
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Commit body MUST use unordered list items starting with verbs such as `新增`、`修复`、`优化`、`更新`、`补充`、`重构`
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Use `feat` for user-facing or consumer-facing capability additions; use `fix` for behavior corrections, `perf` for observable performance improvements, `refactor` for non-feature code restructuring
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Use `BREAKING CHANGE` in commit footer or `!` after type/scope when the change should raise the next released version's `major` segment
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Documentation-only changes MUST NOT use `feat`; prefer `docs(<module-or-area>)` for documentation work
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Keep technical terms in English when they are established project terms such as `API`、`Model`、`System`
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Do not add project license headers to excluded or third-party areas such as `.agents/**`, `ai-libs/**`, `third-party-licenses/**`, generated snapshots, binary assets, lock files, and generated build output
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Keep abstractions projects free of implementation details and engine-specific dependencies
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Preserve existing module boundaries and do not introduce new cross-module dependencies without clear architectural need
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Framework runtime, abstractions, and meta-package projects MUST NOT reference `*.SourceGenerators*` projects or packages, and MUST NOT use source-generator attributes
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Every non-trivial feature, bug fix, or behavior change MUST include tests or an explicit justification for why a test is not practical
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Public API changes must be covered by unit or integration tests
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Minimize new package dependencies and add them only when necessary with narrow scope
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Every user-facing package or module directory with a `*.csproj` intended for direct consumption MUST have a sibling `README.md`
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: The main documentation site lives under `docs/` with Chinese content under `docs/zh-CN/`
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Prefer invoking `$gframework-boot` when the user uses short startup prompts such as `boot`, `continue`, `next step`, or Chinese equivalents
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: The boot skill MUST read `AGENTS.md`, `.ai/environment/tools.ai.yaml`, `ai-plan/public/README.md` and relevant active-topic `ai-plan/` artifacts before substantive execution
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Use subagents only when the task is complex, context is likely to grow too large, or work can be split into independent parallel subtasks
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: The main agent MUST identify the critical path first before delegating work to subagents
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Use `explorer` subagents for read-only discovery, comparison, tracing, and narrow codebase questions
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Use `worker` subagents only for bounded implementation tasks with explicit file or module ownership boundary
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Every subagent delegation MUST specify concrete objective, expected output format, files or subsystem ownership, and constraints
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Subagents are not allowed to revert or overwrite unrelated changes; they must adapt to concurrent work
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Prefer lightweight models such as `gpt-5.1-codex-mini` for narrow exploration, indexing, and comparison tasks
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Prefer stronger models such as `gpt-5.4` for cross-module design work, non-trivial refactors, and tasks requiring higher confidence reasoning
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: The main agent remains responsible for reviewing and integrating subagent output; unreviewed subagent conclusions do not count as final results
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: If a task changes multiple projects or shared abstractions, prefer solution-level or affected-project `dotnet build ... -c Release`
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: When a task adds a feature or modifies code, run a Release build for every directly affected module/project instead of relying on unrelated project slices
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Warnings reported by affected-module builds are part of task scope; contributors MUST resolve touched module's build warnings in the same change
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: If required build passes and there are task-related staged or unstaged changes, contributors MUST create a Git commit automatically unless the user explicitly says not to
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: When composing a multi-line commit body from shell commands, use multiple `-m` flags or ANSI-C `$'...'` quoting for real line breaks, not Bash `$"..."` quoting
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: If a new task starts while the current branch is `main`, first try to update local `main` from remote, then create and switch to a dedicated branch
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: The branch naming rule for a new task branch is `<type>/<topic-or-scope>` where `<type>` matches the intended Conventional Commit category
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: If CI reports a license-header failure, either fix it locally with `python3 scripts/license-header.py --fix` or use the manual `License Header Fix` GitHub Actions workflow
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Before committing changes that add or modify supported source/configuration files, run `python3 scripts/license-header.py --check` and resolve any missing or misplaced headers
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Treat `ai-libs/` as a read-only third-party source reference area; do not modify it unless the user explicitly asks to sync or update
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Contributors MUST keep committed `ai-plan/public/**` content safe to publish in Git history
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Never write secrets, tokens, credentials, private keys, machine usernames, home-directory paths, hostnames, IP addresses, or proprietary URLs into `ai-plan/**` files
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Never record absolute file-system paths in `ai-plan/**`; use repository-relative paths, branch names, PR numbers, or stable document identifiers
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Use `ai-plan/public/**` only for durable, handoff-safe task state; put temporary notes and worktree-specific data under `ai-plan/private/`
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: Completing code changes without updating the active tracking document is considered incomplete work
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: For any multi-step refactor, migration, or cross-module task, contributors MUST create or adopt a dedicated recovery document under `ai-plan/public/<topic>/todos/` before making substantive code changes
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: When a stage inside an active topic is fully complete, move the finished artifacts into that topic's `archive/` directory instead of leaving completed steps in the default boot path
Learnt from: CR
Repo: GeWuYou/GFramework

Timestamp: 2026-05-05T04:42:42.450Z
Learning: When completed and validated stages begin to accumulate, contributors MUST archive their detailed history out of active todos/ and traces/ entry files
🔇 Additional comments (6)
AGENTS.md (1)

215-217: LGTM!

新增规则与验证脚本和 CI 强制检查保持一致,措辞准确。

ai-plan/public/runtime-generator-boundary/todos/runtime-generator-boundary-tracking.md (1)

1-41: LGTM!

追踪文档完整覆盖了恢复点、风险、已完成工作与验证目标,符合 ai-plan/public/**/todos/** 规范。

.github/workflows/ci.yml (1)

38-39: LGTM!

新增步骤位置合理(紧接 license-header 检查之后),验证脚本仅依赖 Python XML 解析,无需 .NET 环境,与 code-quality job 现有配置兼容。

.github/workflows/publish.yml (1)

121-122: LGTM!

步骤顺序正确(打包 → 模块名称校验 → 边界校验),--package-dir ./packages 相对路径处理逻辑已在脚本中正确处理。

ai-plan/public/runtime-generator-boundary/traces/runtime-generator-boundary-trace.md (1)

1-22: LGTM!

追踪日志结构符合 ai-plan/public/**/traces/** 规范,触发原因、决策依据、预期实现与下一步均有记录。

ai-plan/public/README.md (1)

45-48: LGTM!

新增主题条目格式与现有条目一致,分支到主题的映射在同一变更中完成更新,符合 ai-plan/public/README.md 规范。

Also applies to: 75-77

Comment thread docs/zh-CN/contributing.md
Comment thread scripts/validate-runtime-generator-boundaries.py
Comment thread scripts/validate-runtime-generator-boundaries.py
- 修复 runtime-generator 边界校验对独立与带参数 attribute 的漏报问题,并过滤注释示例误报

- 新增 Python 回归测试覆盖独立、限定名、多 attribute 与文档示例场景

- 更新贡献文档与 ai-plan 记录,移除面向用户文档中的内部治理段落并补充验证结果
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2274 2274 0 0 0 0 36.6s    ↑218ms

Test Results

passed 2274 passed

Details

tests 2274 tests
clock 36.6s ↑218ms
tool nunit
build CI - Build & Test arrow-right build-and-test link #1057
pull-request fix(game): 剥离运行时模块对生成器依赖 link #324

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2274 0 0 4.2s

build-and-test: Run #1057

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
2274 2274 0 0 0 0 0 36.6s

🎉 All tests passed!

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
CreateStream_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 2 3.9s 4.2s
Does_Not_Report_When_FieldInjectedModel_Is_Registered 2 2.1s 2.1s
Generates_Scene_Behavior_Boilerplate 2 1.9s 1.9s
CleanupDuringAcquire_Should_NotCauseRaceCondition 2 1.1s 1.1s
Append_ShouldNotBlock 2 1.0s 1.0s
Context_Caching_Should_Improve_Performance 2 784ms 785ms
PendingCount_ShouldReflectQueuedEntries 2 501ms 501ms
Cleanup_Should_NotRemoveActiveLocks 2 404ms 405ms
Cleanup_Should_RemoveUnusedLocks 2 401ms 401ms
Generates_Precise_Assembly_Type_Lookups_For_Inaccessible_External_Generic_Definitions_With_Visible_Type_Arguments 2 312ms 324ms

± Comparison with run #1056 at 04b582b | 🎉 No failed tests detected across all runs. | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 2 runs.

Github Test Reporter by CTRF 💚

@GeWuYou GeWuYou merged commit a8c6c11 into main May 5, 2026
7 checks passed
@GeWuYou GeWuYou deleted the fix/runtime-generator-boundary branch May 5, 2026 05:14
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