docs(agc): 给 Rust 告警门禁补“修剪后名实相符”的收尾判据
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 2m2s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 2m32s
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 2m2s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 2m32s
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
dev 运维文档「Rust 编译告警门禁」新增一条收尾判据:文件名与模块文档承诺的职责必须与删完剩下的内容一致;只剩单个通用工具函数的文件要并回同族模块或改名,不允许留下“名字是业务模块、内容却只剩一个与之无关的工具函数”的空壳。 该条同时点明本次两个实例的处理方式:repository_context.rs 内容并入 agent/redaction.rs、agent/generation/pass_artifacts.rs 内容并入 project/memory.rs,两个原文件均已删除。 检查:npm run check:encoding rc=0、git diff --check rc=0。
This commit is contained in:
@@ -375,6 +375,7 @@ npm run check
|
||||
- AGC 壳的门禁落法(特例,不使用 `[lints]` 表):在 `apps/ai-game-creator-shell/src-tauri/src/main.rs` 顶部写 `#![cfg_attr(not(test), deny(warnings))]`;AGC 壳的 `Cargo.toml` 不加 `[lints]`。原因是该 crate 没有 lib 目标,`cargo check --all-targets` 会把同一个 bin target 以 test harness 再编一次;harness 实例里 `#[cfg(not(test))] fn main()` 被排除,`generate_handler!` 注册的 Tauri 命令与 `desktop::run()` 链整体不可达,于是产生一批**属于测试构建产物**的假死告警(2026-10-06 实测 339 条)。若改用 `[lints.rust] warnings = "deny"`,这批 harness 告警会被 deny 而 CI 必红;若逐条用 `cfg` 收敛它们,又会因为 handler 注册仍在编译而报 `E0425`。因此 AGC 壳门禁限定 `cfg(not(test))`,CI 的 `cargo check --features …`(不带 `--all-targets`)与发布构建自动成为门禁。
|
||||
- 边界:harness 实例的那批告警**不作为废弃生产代码处理**,也**不在门禁覆盖内**;它们与生产口径的 0 warning 是两个不同目标。可选方向是把 handler 列表抽到 cfg 无关位置以批量消除命令可达链的假死,但“同一个 bin 被编两次”这一事实不变,`--all-targets` 无法归零。
|
||||
- AGC 壳的测量命令必须带编辑器 feature(`cocos-editor-execute,unity-editor-execute,godot-editor-execute`),否则 `build.rs` 的随包资源校验会 panic;生产口径不带 `--all-targets`,测试口径另加 `--all-targets`(见下方命令块)。
|
||||
- 收尾判据(对修剪 / 退役清理过的文件):文件名与模块文档承诺的职责必须与删完剩下的内容一致;只剩单个通用工具函数的文件要并回同族模块或改名,不允许留下“名字是业务模块、内容却只剩一个与之无关的工具函数”的空壳(本次 `repository_context.rs` 与 `agent/generation/pass_artifacts.rs` 即按此判据处理:内容分别并入 `agent/redaction.rs` 与 `project/memory.rs`,原文件删除)。
|
||||
- 实测基线(2026-10-06,Windows msvc / rustc 1.98.1,全新 target 目录;AGC 壳行同时给出清理前基线与清理后实测值):
|
||||
|
||||
| 目标 | warning |
|
||||
|
||||
Reference in New Issue
Block a user