清理 Rust 编译 warning(含 AGC 壳)并加门禁(#649) #650

Merged
suzmii merged 61 commits from chore/rust-compile-warnings into master 2026-10-07 22:52:22 +08:00
Member

关联

  • Issue #649(口径更新见该 Issue 正文顶部)
  • 本 PR 是全量清理的唯一 PR;拆分出来的 #651 / #653 / #654 / #655 已关闭,内容全部并入本 PR(分支保留作历史)
  • 范围外债务(退役残留:权限策略存量容错 / 契约与文案一致性 / 契约退役 id 去留)已单开 #659,本 PR 不含。

目标与硬约束

  • AGC 客户端与 server-rs 的 first-party 编译告警在生产可交付口径下清零,并加门禁防止回涨。
  • 不使用 #[allow] 掩盖、不用假引用、不为消警删测试;生成代码只改生成器、不手改生成物。

结果

目标 命令(口径) 结果
AGC 壳(bin / 生产口径) cargo check --locked --features cocos-editor-execute,unity-editor-execute,godot-editor-execute --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml 0 warning / EXIT 0(Windows + 编辑器 feature 口径;CI 侧另有 agc-linux 档检查 Linux 默认 feature 口径——当前首采、待入册基线,见"已知盲区")
AGC 壳(同 feature,--all-targets) 上条加 --all-targets EXIT 0(--all-targets 的 harness 实例告警与门禁口径无关,不再计数)
server-rs workspace cargo check --locked --workspace --all-targets --manifest-path server-rs/Cargo.toml 0 warning(原 1 条已删)
desktop-shell / 三个编辑器 bridge / 4 个 exclude crate 各自 manifest --all-targets 0 / 0 / 0
  • 计量方式:仓库外 CARGO_TARGET_DIR + cargo clean -p 强制重建(避免 cargo 重放缓存诊断给出假数字);bin 口径的 0 warning 由独立 session 复核。
  • 变更规模与提交历史见本 PR 的 Files changed / Commits 页签(origin/master...HEAD)。

Rust 告警门禁(现役机制,2026-10-07 起)

Werror 已撤:本 PR 原先给 AGC 壳与各 Rust crate 加的 deny(warnings) / [lints] 全部移除。
为什么撤:它会把上游新代码的存量告警直接变成编译错误(典型例子:一次同步 master 就多出 14 条,
需要额外改动才能过门),也会让本地开发构建无谓变红。

现在改为基线感知的告警白名单检查(单一实现 scripts/check-rust-warnings.mjs,npm run check:rust-warnings):

  • 本地:.husky/pre-push 对所有分支一视同仁,但按内容触发——本次推送的提交没碰
    *.rs / Cargo.toml / Cargo.lock 就打印一行并 exit 0(推 master 时仍会额外跑一次 repository parity,既有约定未改)。
    Windows 跑 --profile=agc-windows + --profile=server-rs。
  • CI:挂在两个已有缓存的 Rust job 上——ai-game-creator-shell-rust-lane-2 跑 --profile=agc-linux,
    ai-game-creator-shell-rust-crates 跑 --profile=server-rs(两 job 本来就有 cargo fetch + sccache 缓存);
    repository-checks 不受影响(检查已从 npm run lint 链里摘下)。
  • 判定语义:新增告警 → exit 1 并逐条打印 [新增] 路径:行 | lint | 符号;白名单里的条目被消除 → 只打印
    [已消除·可更新基线] 并 exit 0;另有 fresh 完整性断言(本 profile 每个包都必须真被重编)防止
    「热 target 目录漏报」给出假的「新增 0」。
  • 基线(白名单):scripts/warning-baseline.json,键 = 路径 | 符号 | lint(不含行号)。当前:
    agc-windows 14 条(上游存量)、server-rs 0 条、agc-linux 首采(首次 CI 只采集不判失败)。
  • 覆盖分工(互补、不重叠):本地 = agc-windows + server-rs;CI = agc-linux + server-rs。
    CI 绿 ≠ Windows 生产口径也验过(AGC 壳的 Windows 档只能在 Windows 上编)。
  • 局限:git push --no-verify 可绕过;GENARRATIVE_SKIP_RUST_WARNINGS=1 是应急整段跳过(非入册机制);
    白名单只吞「键完全相同」的那条,同文件里新的符号 / 新的 lint 照样会被拦。
  • 本地耗时(热 target 目录):agc-windows ≈ 8s、server-rs ≈ 9s。

上游 14 项(已入白名单;交接见 #673)

master 本轮新代码在 Windows 生产口径下报 14 条 never used / unused import(Linux 也会报,只是原先不会让 CI 变红);12 条根因是 b04aceb57(王德宇,2026-10-07)——它删掉了 project/export.rs、commands/desktop.rs 的调用点。这 14 条已入白名单、不阻断任何人;其中 7 条疑似发布链路半成品(project.bootstrap 链 6 条 + ensure_staging_path_in_dir)已在 #673 请王德宇确认"删还是接线"。本 PR 曾做的两次最小修与 D1 修复都已 revert(按"不代改同事正在开发的实现"的决定),现在它们只作为白名单存在。

明确不做(范围外,已写入 dev 运维文档)

  • AGC --all-targets 下 bin target 的测试实例告警:属测试构建产物;仓库既有约定“不能把测试目标的 dead_code 一律认定为废弃生产代码”;逐条 cfg 收敛会引入 E0425。该批不在告警检查口径内,不再计数。

决策记录(2026-10-06)

  • 认证路线:不支持用户 Codex OAuth 登录态,统一走我们的中转站 → 删除 AuthBridge / OAuth 链(auth_handoff.rs 整模块、AuthBridge 变体、GAME_CREATOR_CODEX_AUTH_BRIDGE_API_BASE_URL、codex_cli 请求路径等),保留平台会话中转 / 显式自定义 Key / provider-proxy 桥 / 共享模型目录捕获 / 隔离运行环境。删除前后做过只读核查:代码域零残留、无持久化或跨端契约耦合(模型目录回执中被删的取值无任何读方,且回执落盘于每回合新建的隔离 HOME)。
  • 危险项逐条判定:
    • PLATFORM_ART_GENERATION_RUNTIME_SCHEMA_VERSION 采用 #[cfg(test)] 重导出:站得住——定义在生产有 5 处真实读取,跨模块使用者只有两处测试夹具;删掉它测试目标报 E0425,写成 pub(crate) 报 E0364,形态被双向钉死。
    • command_exec.rs linux cfg 块的裸名导入:属批次删除 crate 根 glob 造成的自伤式编译失败;本机与"Windows + 编辑器 feature"口径看不见它,但 CI 的 Linux lane 会编到(M1 若当初跑过 CI 即会被 Linux 档抓到),已按 linux cfg 显式导入;静态审计未再发现同类(判为孤例,脚注见"已知盲区")。
    • repository_context.rs 不能整文件删(含 2 条现役用户可见诊断链)→ 抽出路径脱敏原语并入 agent/redaction.rs,原文件删除。
    • 退役未同步的 272 条可整块删:唯一消费者随 839051f53 消失,实现区零写盘、无 DTO 或契约外泄。
  • 名实一致审计:对基准上“修改后仍存在”的文件逐个判“文件名/职责 vs 剩余内容”——99 个吻合;2 处红旗已处理(repository_context.rs → agent/redaction.rs;agent/generation/pass_artifacts.rs → project/memory.rs);4 项改名使名实相符(generation/game_html_validation.rs、agent/provider_request_snapshot.rs、process_session/shutdown.rs、generation/llm_request.rs),均零调用点改动;并新增长期收尾判据——被修剪/退役清理过的文件必须名实相符。
  • 四项命名决策已全部落地(另见上条):agent/generation/llm_request.rs(原 loop_orchestration.rs)、agent/generation/game_html_validation.rs(原 draft_validation.rs)、agent/provider_request_snapshot.rs(原 runtime_models.rs)、process_session/shutdown.rs(原 recovery.rs);配套修掉两处技术文档里指向旧路径与失效行号的引用。
  • 审计明细(101 个文件的逐项判定表)与复现命令不在仓库内,如需我可贴成 PR 评论;结论见上条。

已知盲区(记录在案)

  • 覆盖矩阵(更正):本机只编 Windows + 编辑器 feature,因此看不见非 Windows cfg 块;但 CI 的 Linux lane 会用默认 feature 编译并测试 AGC 壳,所以 Linux/unix cfg 的一部分是被 CI 覆盖的——本次 4 个 CI 红因中 3 个(godot/unity bridge 的 Linux -D dead-code、AGC 壳 Linux 下 54 条 never used(当时的 Werror 口径,现已撤销)、Linux harness 3×E0599 run_turn)正是被它抓到的;两档口径互不覆盖。完整矩阵见 dev 运维文档「Rust 编译告警门禁」。
  • 静态审计(同日):全 crate 463 个非 Windows cfg 属性 / 68 文件 / 355 个最外层块 / 364 个裸 crate 引用;四类危险计数(悬空引用 / not(test) 越用 / windows-only use 被非 Windows 使用点依赖 / 跨平台谓词缺口)全为 0。此前称该问题为"孤例"需加脚注:M1 若当初跑过 CI,会被 Linux 档抓到(command_exec.rs 由 main.rs 无 cfg 引入,落在 Linux lane 的编译面内)。
  • 门禁口径(2026-10-07 更正):AGC 壳原来的 #![cfg_attr(all(not(test), windows), deny(warnings))] 已随 Werror 撤离一并撤销;现役机制是基线感知的白名单检查——agc-linux 档由 CI 的 lane-2 检查(当前为首采,打印清单、不判失败,待入册基线),Windows 生产档仅由本地 pre-push 覆盖。Linux 默认 feature 口径的存量告警不再是编译错误,将以 agc-linux 基线入册。

验证命令

cd W:/workspace/Genarrative/.worktrees/chore/rust-compile-warnings
export CARGO_TARGET_DIR=W:/workspace/agc-target-merge      # 必须在仓库外
F="--locked --features cocos-editor-execute,unity-editor-execute,godot-editor-execute --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml"
cargo check $F                                            # 期望 0 warning / EXIT 0
cargo check $F --all-targets                              # 期望 EXIT 0
cargo check --locked --workspace --all-targets --manifest-path server-rs/Cargo.toml   # 期望 0 warning
cargo test  $F --test runtime_prompt_bundle_build         # 6 passed
cargo test  $F --test prompt_source_boundaries            # 17 passed
cargo test  $F --bin genarrative-ai-game-creator-shell -- thread_manager --test-threads=1   # 72 passed
cargo test  $F --bin genarrative-ai-game-creator-shell -- redaction --test-threads=1        # 4 passed
cargo fmt   --all --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml -- --check
npm run check:encoding && git diff --check

(新工作树首次编译前先 npm run agc:bundled-resources:prepare,否则 build.rs 会因缺随包资源 panic。客户端本地验证:npm run agc;需要真实后端时另开 npm run agc:backend。)

## 关联 - Issue #649(口径更新见该 Issue 正文顶部) - 本 PR 是全量清理的**唯一 PR**;拆分出来的 #651 / #653 / #654 / #655 已关闭,内容全部并入本 PR(分支保留作历史) - 范围外债务(退役残留:权限策略存量容错 / 契约与文案一致性 / 契约退役 id 去留)已单开 **#659**,本 PR 不含。 ## 目标与硬约束 - AGC 客户端与 server-rs 的 **first-party 编译告警在生产可交付口径下清零**,并加门禁防止回涨。 - 不使用 `#[allow]` 掩盖、不用假引用、不为消警删测试;生成代码只改生成器、不手改生成物。 ## 结果 | 目标 | 命令(口径) | 结果 | |---|---|---| | AGC 壳(bin / 生产口径) | `cargo check --locked --features cocos-editor-execute,unity-editor-execute,godot-editor-execute --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml` | **0 warning / EXIT 0**(Windows + 编辑器 feature 口径;CI 侧另有 `agc-linux` 档检查 Linux 默认 feature 口径——当前**首采**、待入册基线,见"已知盲区") | | AGC 壳(同 feature,`--all-targets`) | 上条加 `--all-targets` | EXIT 0(`--all-targets` 的 harness 实例告警与门禁口径无关,不再计数) | | server-rs workspace | `cargo check --locked --workspace --all-targets --manifest-path server-rs/Cargo.toml` | **0 warning**(原 1 条已删) | | desktop-shell / 三个编辑器 bridge / 4 个 exclude crate | 各自 manifest `--all-targets` | 0 / 0 / 0 | - 计量方式:仓库外 `CARGO_TARGET_DIR` + `cargo clean -p` 强制重建(避免 cargo 重放缓存诊断给出假数字);bin 口径的 0 warning 由独立 session 复核。 - 变更规模与提交历史见本 PR 的 Files changed / Commits 页签(`origin/master...HEAD`)。 ## Rust 告警门禁(现役机制,2026-10-07 起) **Werror 已撤**:本 PR 原先给 AGC 壳与各 Rust crate 加的 `deny(warnings)` / `[lints]` 全部移除。 为什么撤:它会把**上游新代码的存量告警直接变成编译错误**(典型例子:一次同步 master 就多出 14 条, 需要额外改动才能过门),也会让本地开发构建无谓变红。 现在改为**基线感知的告警白名单检查**(单一实现 `scripts/check-rust-warnings.mjs`,`npm run check:rust-warnings`): - **本地**:`.husky/pre-push` 对**所有分支一视同仁**,但**按内容触发**——本次推送的提交没碰 `*.rs` / `Cargo.toml` / `Cargo.lock` 就打印一行并 exit 0(推 master 时仍会额外跑一次 repository parity,既有约定未改)。 Windows 跑 `--profile=agc-windows` + `--profile=server-rs`。 - **CI**:挂在两个**已有缓存**的 Rust job 上——`ai-game-creator-shell-rust-lane-2` 跑 `--profile=agc-linux`, `ai-game-creator-shell-rust-crates` 跑 `--profile=server-rs`(两 job 本来就有 `cargo fetch` + sccache 缓存); `repository-checks` 不受影响(检查已从 `npm run lint` 链里摘下)。 - **判定语义**:新增告警 → exit 1 并逐条打印 `[新增] 路径:行 | lint | 符号`;白名单里的条目被消除 → 只打印 `[已消除·可更新基线]` 并 exit 0;另有 **fresh 完整性断言**(本 profile 每个包都必须真被重编)防止 「热 target 目录漏报」给出假的「新增 0」。 - **基线(白名单)**:`scripts/warning-baseline.json`,键 = `路径 | 符号 | lint`(不含行号)。当前: `agc-windows` **14 条**(上游存量)、`server-rs` **0 条**、`agc-linux` **首采**(首次 CI 只采集不判失败)。 - **覆盖分工(互补、不重叠)**:本地 = `agc-windows` + `server-rs`;CI = `agc-linux` + `server-rs`。 **CI 绿 ≠ Windows 生产口径也验过**(AGC 壳的 Windows 档只能在 Windows 上编)。 - **局限**:`git push --no-verify` 可绕过;`GENARRATIVE_SKIP_RUST_WARNINGS=1` 是应急整段跳过(非入册机制); 白名单只吞「键完全相同」的那条,同文件里新的符号 / 新的 lint 照样会被拦。 - **本地耗时**(热 target 目录):`agc-windows` ≈ 8s、`server-rs` ≈ 9s。 ## 上游 14 项(已入白名单;交接见 #673) master 本轮新代码在 **Windows 生产口径**下报 14 条 `never used` / `unused import`(Linux 也会报,只是原先不会让 CI 变红);**12 条根因是 `b04aceb57`(王德宇,2026-10-07)**——它删掉了 `project/export.rs`、`commands/desktop.rs` 的调用点。这 14 条**已入白名单、不阻断任何人**;其中 **7 条疑似发布链路半成品**(`project.bootstrap` 链 6 条 + `ensure_staging_path_in_dir`)已在 **#673** 请王德宇确认"删还是接线"。本 PR 曾做的两次最小修与 D1 修复**都已 revert**(按"不代改同事正在开发的实现"的决定),现在它们**只作为白名单存在**。 ## 明确不做(范围外,已写入 dev 运维文档) - AGC `--all-targets` 下 bin target 的**测试实例**告警:属测试构建产物;仓库既有约定“不能把测试目标的 dead_code 一律认定为废弃生产代码”;逐条 `cfg` 收敛会引入 `E0425`。该批不在告警检查口径内,不再计数。 ## 决策记录(2026-10-06) - **认证路线**:不支持用户 Codex OAuth 登录态,统一走我们的中转站 → 删除 AuthBridge / OAuth 链(`auth_handoff.rs` 整模块、`AuthBridge` 变体、`GAME_CREATOR_CODEX_AUTH_BRIDGE_API_BASE_URL`、`codex_cli` 请求路径等),保留平台会话中转 / 显式自定义 Key / provider-proxy 桥 / 共享模型目录捕获 / 隔离运行环境。删除前后做过只读核查:代码域零残留、无持久化或跨端契约耦合(模型目录回执中被删的取值无任何读方,且回执落盘于每回合新建的隔离 HOME)。 - **危险项逐条判定**: - `PLATFORM_ART_GENERATION_RUNTIME_SCHEMA_VERSION` 采用 `#[cfg(test)]` 重导出:站得住——定义在生产有 5 处真实读取,跨模块使用者只有两处测试夹具;删掉它测试目标报 `E0425`,写成 `pub(crate)` 报 `E0364`,形态被双向钉死。 - `command_exec.rs` linux cfg 块的裸名导入:属批次删除 crate 根 glob 造成的**自伤式编译失败**;本机与"Windows + 编辑器 feature"口径看不见它,但 **CI 的 Linux lane 会编到**(M1 若当初跑过 CI 即会被 Linux 档抓到),已按 linux cfg 显式导入;静态审计未再发现同类(判为**孤例**,脚注见"已知盲区")。 - `repository_context.rs` **不能整文件删**(含 2 条现役用户可见诊断链)→ 抽出路径脱敏原语并入 `agent/redaction.rs`,原文件删除。 - 退役未同步的 272 条可整块删:唯一消费者随 `839051f53` 消失,实现区零写盘、无 DTO 或契约外泄。 - **名实一致审计**:对基准上“修改后仍存在”的文件逐个判“文件名/职责 vs 剩余内容”——99 个吻合;2 处红旗已处理(`repository_context.rs` → `agent/redaction.rs`;`agent/generation/pass_artifacts.rs` → `project/memory.rs`);4 项改名使名实相符(`generation/game_html_validation.rs`、`agent/provider_request_snapshot.rs`、`process_session/shutdown.rs`、`generation/llm_request.rs`),均零调用点改动;并新增长期收尾判据——**被修剪/退役清理过的文件必须名实相符**。 - 四项命名决策**已全部落地**(另见上条):`agent/generation/llm_request.rs`(原 `loop_orchestration.rs`)、`agent/generation/game_html_validation.rs`(原 `draft_validation.rs`)、`agent/provider_request_snapshot.rs`(原 `runtime_models.rs`)、`process_session/shutdown.rs`(原 `recovery.rs`);配套修掉两处技术文档里指向旧路径与失效行号的引用。 - 审计明细(101 个文件的逐项判定表)与复现命令不在仓库内,如需我可贴成 PR 评论;结论见上条。 ## 已知盲区(记录在案) - **覆盖矩阵(更正)**:本机只编 Windows + 编辑器 feature,因此看不见非 Windows cfg 块;但 **CI 的 Linux lane 会用默认 feature 编译并测试 AGC 壳**,所以 Linux/unix cfg 的一部分**是被 CI 覆盖的**——本次 4 个 CI 红因中 3 个(godot/unity bridge 的 Linux `-D dead-code`、AGC 壳 Linux 下 54 条 `never used`(**当时的 Werror 口径**,现已撤销)、Linux harness 3×`E0599 run_turn`)正是被它抓到的;两档口径**互不覆盖**。完整矩阵见 dev 运维文档「Rust 编译告警门禁」。 - **静态审计(同日)**:全 crate 463 个非 Windows cfg 属性 / 68 文件 / 355 个最外层块 / 364 个裸 crate 引用;四类危险计数(悬空引用 / `not(test)` 越用 / windows-only `use` 被非 Windows 使用点依赖 / 跨平台谓词缺口)全为 0。此前称该问题为"孤例"需加脚注:**M1 若当初跑过 CI,会被 Linux 档抓到**(`command_exec.rs` 由 `main.rs` 无 cfg 引入,落在 Linux lane 的编译面内)。 - **门禁口径(2026-10-07 更正)**:AGC 壳原来的 `#![cfg_attr(all(not(test), windows), deny(warnings))]` **已随 Werror 撤离一并撤销**;现役机制是**基线感知的白名单检查**——`agc-linux` 档由 CI 的 `lane-2` 检查(当前为**首采**,打印清单、不判失败,待入册基线),Windows 生产档仅由**本地 pre-push** 覆盖。Linux 默认 feature 口径的存量告警**不再是编译错误**,将以 `agc-linux` 基线入册。 ## 验证命令 ```bash cd W:/workspace/Genarrative/.worktrees/chore/rust-compile-warnings export CARGO_TARGET_DIR=W:/workspace/agc-target-merge # 必须在仓库外 F="--locked --features cocos-editor-execute,unity-editor-execute,godot-editor-execute --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml" cargo check $F # 期望 0 warning / EXIT 0 cargo check $F --all-targets # 期望 EXIT 0 cargo check --locked --workspace --all-targets --manifest-path server-rs/Cargo.toml # 期望 0 warning cargo test $F --test runtime_prompt_bundle_build # 6 passed cargo test $F --test prompt_source_boundaries # 17 passed cargo test $F --bin genarrative-ai-game-creator-shell -- thread_manager --test-threads=1 # 72 passed cargo test $F --bin genarrative-ai-game-creator-shell -- redaction --test-threads=1 # 4 passed cargo fmt --all --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml -- --check npm run check:encoding && git diff --check ``` (新工作树首次编译前先 `npm run agc:bundled-resources:prepare`,否则 `build.rs` 会因缺随包资源 panic。客户端本地验证:`npm run agc`;需要真实后端时另开 `npm run agc:backend`。)
suzmii changed title from WIP: 清理 Rust 编译 warning 并加门禁(#649) to WIP: 清理 Rust 编译 warning(含 AGC 壳)并加门禁(#649) 2026-10-06 16:08:41 +08:00
suzmii added 1 commit 2026-10-06 16:33:15 +08:00
修复 api-server 未使用常量并给已清零的 Rust 包加 warning 门禁
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend 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
c1ad1a19f8
删除 api-server src/llm/mod.rs 中零引用的测试常量 TEST_AGC_MODEL_DEFAULT_ID,全仓仅定义处命中,无调用方与专属用例。

server-rs workspace 根新增 [workspace.lints.rust] warnings = "deny",27 个成员 crate 各自新增 [lints] workspace = true。

4 个被 exclude 的独立 crate(agent-runtime-core、agent-runtime-orchestration、editor-adapter-api、platform-agent)各自新增 [lints.rust] warnings = "deny"。

apps/desktop-shell/src-tauri 与 unity/godot/cocos 三个编辑器 bridge 各自新增 [lints.rust] warnings = "deny";未触碰 apps/ai-game-creator-shell/src-tauri 及其 vendor。

验证:server-rs --workspace --all-targets、desktop-shell、三个 bridge、4 个 exclude crate 全部 rc=0 且输出 0 条 warning;api-server llm:: 定向用例 30 passed / 0 failed。

门禁自证:api-server 与 editor-adapter-api 各插入未使用变量后 cargo check 均失败并报 -D warnings(-D unused-variables implied by -D warnings),撤销后同一命令转绿 rc=0。
suzmii added 1 commit 2026-10-06 16:37:16 +08:00
文档收口:写入 Rust 编译告警门禁口径与 AGC 检查命令
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 3m54s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 3m50s
Project CI / AI game creator shell Rust crates (pull_request) Failing after 4m56s
Project CI / Frontend tests (pull_request) Successful in 2m44s
Project CI / Repository checks (pull_request) Failing after 2m35s
Project CI / Native shell tests (pull_request) Failing after 5m29s
Project CI / Backend tests (pull_request) Successful in 10m36s
Project CI / AI game creator shell web tests (pull_request) Successful in 4m2s
e0ea9d2c7f
- dev 运维文档新增「Rust 编译告警门禁」整段:口径、落法(workspace lints + 成员继承 + 独立 crate 自持)、依据(--deny=warnings、不改 RUSTFLAGS、CI 缓存不受影响)、覆盖范围、检查命令与实测基线(server-rs workspace 1 → 0、AGC 壳 613 条批次清理中、desktop-shell/三 bridge/4 个 exclude crate 均 0)。
- dev 运维文档在编译警告清理段尾补门禁口径:能直接修的一律修掉、与口径冲突优先改口径、不能修的登记关闭条件。
- dev 运维文档 AuthBridge 条目改为已决策:2026-10-06 不支持用户 Codex OAuth 登录态、统一走中转站,按决策表第一行删除链路,warning 随之归零。
- dev 运维文档 ts-rs 条目补「待上游」关闭条件;Vite chunk 条目补门禁范围与关闭条件。
- dev 运维文档 cfg(not(test)) 拆分边界补「拆分不作为消警手段」;allow 表述收紧为登记后最窄范围使用。
- dev 运维文档 AGC 检查命令(bin 与 --tests)补编辑器 feature,基线句由「复核通过」改为当次快照。
- shared-memory/development-workflow 验证路由补 Rust warning 门禁与「拆分不作为消警手段」。
- shared-memory/pitfalls 顶部新增条目:AGC 壳新工作树缺 gitignored 随包/源码侧产物时 build.rs 报「未声明文件」的真实成因与最小处理。
- AGC 主方案 OAuth 契约冲突节改为已决策(决策内容、日期、执行动作、保留项、关闭条件),SDK 串行工具节的 OAuth 状态同步。
Author
Member

Rust 编译告警清理:告警清单与处置结果(按危险等级从低到高)

口径:AGC 壳 apps/ai-game-creator-shell/src-tauri,feature = cocos-editor-execute,unity-editor-execute,godot-editor-execute;server-rs 为 workspace --all-targets。

定级口径:低 = 噪声/一致性(会淹没有效告警);中 = 退役未同步或测试构建失败;高 = 真实构建 bug 或安全面/口径冲突。

总账:AGC 壳 613 条 → 已修 589 条;余下 24 条跨分支耦合已于同日全部落地(bin 口径 = 0)。--all-targets 下另有 339 条 test 实例告警判定不修(当时测得 358,合并后终值 339)。server-rs 1 条 → 0。

# 位置 / 范围 条数 是什么问题(本质) 危险等级 处置与状态
1 AGC 壳 unused_imports / unused_variables / dropping_copy_types 三族(main.rs、runner/*、ui_editor/* 等) 24 改名与退役后遗留的无用导入/变量/多余 clone() 低 ✅ 已修
2 build_support/* 生成物 17 build.rs 生成的 Rust 里 emit 了无人使用的常量/字段;手改生成物会被下次构建覆盖 低 ✅ 已修(改生成器,生成物 17 → 0)
3 src/runner/tests.rs 头部残行 use crate::{unix_timestamp, ProcessSessionRecord}; 1 整块删除后遗留的 import,两个名字在文件内 0 使用(回加即 E0432) 低 ✅ 已修
4 src/agent/generation.rs 删除 PLATFORM_ART_GENERATION_RUNTIME_SCHEMA_VERSION 重导出 1(牵出 agent/direct_runtime/mod.rs:6840/8071 两处 cfg(test) 用例) 只删生产符号、漏了测试态使用 → 测试构建 E0425 中(测试构建失败,CI test shard 会红) ✅ 已修(以 #[cfg(test)] 重导出保留测试态)
5 src/repository_context.rs / src/git_inspect.rs / src/patchset.rs 272 839051f53 退役漏删的实现(本地仓库检查、git 读取、patchset 生成)仍编进产物 中(退役未同步;残留能力面误导后续引用) ✅ 已修(repository_context.rs 3134 → 141 行、后两文件整删;其现役路径脱敏原语随后并入 agent/redaction.rs,原文件删除)
6 src/process_session* / src/project/* / src/runner/* 退役实现 128 → 3 同一批退役漏删的会话/项目/运行器死代码 中 ✅ 已修(余 3 条随第 10 项的耦合批落地)
7 src/debug.rs、src/debug/debug_drafts.rs 整模块 101 → 21 调试入口随退役 runtime 失活,仍编入生产产物 中 ✅ 已修(4 条用例重定向到现役入口)
8 src/command_exec.rs:1598/1708/1709/1714(#[cfg(target_os = "linux")] 块) 1(隐藏缺陷) 批次删掉 crate 根 use command_sandbox::*; 后,Linux 目标下这 4 个裸名引用会 E0425;Windows 两个口径全绿,跨平台构建失败被掩盖 高(真实构建 bug) ✅ 已修(按 linux cfg 显式导入,导入集 = 使用集);并经静态审计确认是孤例(全 crate 463 个非 Windows cfg 属性 / 68 文件 / 355 个最外层块,四类危险计数全 0);此前称"孤例"需加脚注:M1 若当初跑过 CI 会被 Linux 档抓到(CI 的 Linux lane 用默认 feature 编译并测试 AGC 壳)
9 Codex OAuth / AuthBridge 链:AuthBridge 变体、GAME_CREATOR_CODEX_AUTH_BRIDGE_API_BASE_URL、auth_handoff.rs 整模块、codex_cli(601 行)、runtime_models、thread_manager 等 7 文件 + 1 模块 + 用例 与已决策口径「不支持用户 Codex OAuth 登录态,统一走我们的中转站」冲突的残留实现,其中含读取用户本机 Codex CLI 登录态的路径 高(安全面 + 决策冲突) ✅ 已修(整链删除,文档同步为已决策口径;保留中转站路由、共享模型目录、隔离运行环境)
10 AGC bin 口径跨分支耦合批(甲 = 直删 16 / 乙 = cfg(test) 3 / 丙 = 根因项 2 / 丁 = 改生成器 2 / 戊 = 摘空转参数 2) 24 多 lane 合并后才失去消费者的退役 DTO / 常量 / 函数;含"生成器只发射消费方真读的字段"与"摘掉从未构造的 brief 传参" 低–中 ✅ 已全部落地(98cecdfc5 → 92ac35270,bin 24 → 0),门禁随其后启用
11 AGC 壳门禁(控制手段,非告警) — 需要防止告警回涨;AGC 因 GUI 主入口在测试构建中被排除,不能在其 Cargo.toml 开 [lints](harness 实例会被一并 deny、CI 必红) — ✅ 已落地:src/main.rs 顶部 #![cfg_attr(all(not(test), windows), deny(warnings))](CI 的 Linux 默认 feature 档有 54 条 never used,不纳入门禁);其余 crate 用 [lints.rust] warnings = "deny"。自证:插探针 → EXIT 101(#[deny(dead_code)] implied by #[deny(warnings)]),撤销 → 0
12 AGC --all-targets 的 test 实例告警 358(终值 339) 同一个 bin target 被编第二次,harness 中 #[cfg(not(test))] fn main() 被排除,generate_handler! / desktop::run() 链不可达而判死 低(测试构建产物,不是废弃生产代码) ⛔ 判定不修(逐条 cfg 会引入 E0425);已写入 dev 运维文档与 Issue #649 口径
13 退役未同步债务(契约 / 文案 / 存量数据) — 清告警时暴露的隐性债务:存量 .agent/policy.json 若含已不在契约清单内的 id,会让该项目权限门动作全被拒(机制已确证);退役能力仍写在契约与提示词文本里 中(其中权限策略一项是真实失败路径,是否触发需对真实项目采样) 📌 已单开 Issue #659(本 PR 不含)。口径更正:两侧契约 67/67 对称且 toHaveLength(67) 仍在,故此前提到的"17 个孤儿契约 id"不成立;capabilities 共 41 条,准确表述是"其中 13 条已退役未兑现、前端 0 消费"

附:server-rs 唯一 1 条(crates/api-server/src/llm/mod.rs:326 死常量 TEST_AGC_MODEL_DEFAULT_ID)已删。

验证方式(本地)

cargo check --locked --features cocos-editor-execute,unity-editor-execute,godot-editor-execute \
  --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml            # EXIT 0
cargo check --locked --all-targets --features cocos-editor-execute,unity-editor-execute,godot-editor-execute \
  --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml            # EXIT 0
cargo check --workspace --all-targets --manifest-path server-rs/Cargo.toml   # EXIT 0,0 warning
# Rust 编译告警清理:告警清单与处置结果(按危险等级从低到高) **口径**:AGC 壳 `apps/ai-game-creator-shell/src-tauri`,feature = `cocos-editor-execute,unity-editor-execute,godot-editor-execute`;server-rs 为 workspace `--all-targets`。 **定级口径**:低 = 噪声/一致性(会淹没有效告警);中 = 退役未同步或测试构建失败;高 = 真实构建 bug 或安全面/口径冲突。 **总账**:AGC 壳 613 条 → 已修 589 条;余下 24 条跨分支耦合**已于同日全部落地**(bin 口径 = 0)。`--all-targets` 下另有 339 条 test 实例告警判定不修(当时测得 358,合并后终值 339)。server-rs 1 条 → **0**。 | # | 位置 / 范围 | 条数 | 是什么问题(本质) | 危险等级 | 处置与状态 | |---|---|---|---|---|---| | 1 | AGC 壳 `unused_imports` / `unused_variables` / `dropping_copy_types` 三族(`main.rs`、`runner/*`、`ui_editor/*` 等) | 24 | 改名与退役后遗留的无用导入/变量/多余 `clone()` | 低 | ✅ 已修 | | 2 | `build_support/*` 生成物 | 17 | `build.rs` 生成的 Rust 里 emit 了无人使用的常量/字段;手改生成物会被下次构建覆盖 | 低 | ✅ 已修(改生成器,生成物 17 → 0) | | 3 | `src/runner/tests.rs` 头部残行 `use crate::{unix_timestamp, ProcessSessionRecord};` | 1 | 整块删除后遗留的 import,两个名字在文件内 0 使用(回加即 `E0432`) | 低 | ✅ 已修 | | 4 | `src/agent/generation.rs` 删除 `PLATFORM_ART_GENERATION_RUNTIME_SCHEMA_VERSION` 重导出 | 1(牵出 `agent/direct_runtime/mod.rs:6840/8071` 两处 cfg(test) 用例) | 只删生产符号、漏了测试态使用 → **测试构建 `E0425`** | 中(测试构建失败,CI test shard 会红) | ✅ 已修(以 `#[cfg(test)]` 重导出保留测试态) | | 5 | `src/repository_context.rs` / `src/git_inspect.rs` / `src/patchset.rs` | 272 | `839051f53` 退役漏删的实现(本地仓库检查、git 读取、patchset 生成)仍编进产物 | 中(退役未同步;残留能力面误导后续引用) | ✅ 已修(`repository_context.rs` 3134 → 141 行、后两文件整删;其现役路径脱敏原语随后并入 `agent/redaction.rs`,原文件删除) | | 6 | `src/process_session*` / `src/project/*` / `src/runner/*` 退役实现 | 128 → 3 | 同一批退役漏删的会话/项目/运行器死代码 | 中 | ✅ 已修(余 3 条随第 10 项的耦合批落地) | | 7 | `src/debug.rs`、`src/debug/debug_drafts.rs` 整模块 | 101 → 21 | 调试入口随退役 runtime 失活,仍编入生产产物 | 中 | ✅ 已修(4 条用例重定向到现役入口) | | 8 | `src/command_exec.rs:1598/1708/1709/1714`(`#[cfg(target_os = "linux")]` 块) | 1(隐藏缺陷) | 批次删掉 crate 根 `use command_sandbox::*;` 后,Linux 目标下这 4 个裸名引用会 **`E0425`**;Windows 两个口径全绿,**跨平台构建失败被掩盖** | **高(真实构建 bug)** | ✅ 已修(按 linux cfg 显式导入,导入集 = 使用集);并经静态审计确认**是孤例**(全 crate 463 个非 Windows cfg 属性 / 68 文件 / 355 个最外层块,四类危险计数全 0);此前称"孤例"需加脚注:**M1 若当初跑过 CI 会被 Linux 档抓到**(CI 的 Linux lane 用默认 feature 编译并测试 AGC 壳) | | 9 | Codex OAuth / AuthBridge 链:`AuthBridge` 变体、`GAME_CREATOR_CODEX_AUTH_BRIDGE_API_BASE_URL`、`auth_handoff.rs` 整模块、`codex_cli`(601 行)、`runtime_models`、`thread_manager` 等 | 7 文件 + 1 模块 + 用例 | 与已决策口径「**不支持用户 Codex OAuth 登录态,统一走我们的中转站**」冲突的残留实现,其中含**读取用户本机 Codex CLI 登录态**的路径 | **高(安全面 + 决策冲突)** | ✅ 已修(整链删除,文档同步为已决策口径;保留中转站路由、共享模型目录、隔离运行环境) | | 10 | AGC bin 口径跨分支耦合批(甲 = 直删 16 / 乙 = `cfg(test)` 3 / 丙 = 根因项 2 / 丁 = 改生成器 2 / 戊 = 摘空转参数 2) | 24 | 多 lane 合并后才失去消费者的退役 DTO / 常量 / 函数;含"生成器只发射消费方真读的字段"与"摘掉从未构造的 brief 传参" | 低–中 | ✅ 已全部落地(`98cecdfc5` → `92ac35270`,bin 24 → 0),门禁随其后启用 | | 11 | AGC 壳门禁(控制手段,非告警) | — | 需要防止告警回涨;AGC 因 GUI 主入口在测试构建中被排除,不能在其 `Cargo.toml` 开 `[lints]`(harness 实例会被一并 deny、CI 必红) | — | ✅ 已落地:`src/main.rs` 顶部 `#![cfg_attr(all(not(test), windows), deny(warnings))]`(CI 的 Linux 默认 feature 档有 54 条 `never used`,不纳入门禁);其余 crate 用 `[lints.rust] warnings = "deny"`。自证:插探针 → EXIT 101(`#[deny(dead_code)] implied by #[deny(warnings)]`),撤销 → 0 | | 12 | AGC `--all-targets` 的 test 实例告警 | 358(终值 339) | 同一个 bin target 被编第二次,harness 中 `#[cfg(not(test))] fn main()` 被排除,`generate_handler!` / `desktop::run()` 链不可达而判死 | 低(测试构建产物,不是废弃生产代码) | ⛔ **判定不修**(逐条 `cfg` 会引入 `E0425`);已写入 dev 运维文档与 Issue #649 口径 | | 13 | 退役未同步债务(契约 / 文案 / 存量数据) | — | 清告警时暴露的隐性债务:存量 `.agent/policy.json` 若含已不在契约清单内的 id,会让该项目权限门动作**全被拒**(机制已确证);退役能力仍写在契约与提示词文本里 | 中(其中权限策略一项是真实失败路径,是否触发需对真实项目采样) | 📌 **已单开 Issue #659**(本 PR 不含)。口径更正:两侧契约 **67/67 对称**且 `toHaveLength(67)` 仍在,故此前提到的"17 个孤儿契约 id"**不成立**;capabilities 共 **41 条**,准确表述是"其中 **13 条已退役未兑现**、前端 0 消费" | 附:server-rs 唯一 1 条(`crates/api-server/src/llm/mod.rs:326` 死常量 `TEST_AGC_MODEL_DEFAULT_ID`)已删。 ## 验证方式(本地) ```bash cargo check --locked --features cocos-editor-execute,unity-editor-execute,godot-editor-execute \ --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml # EXIT 0 cargo check --locked --all-targets --features cocos-editor-execute,unity-editor-execute,godot-editor-execute \ --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml # EXIT 0 cargo check --workspace --all-targets --manifest-path server-rs/Cargo.toml # EXIT 0,0 warning ```
suzmii added 13 commits 2026-10-06 17:30:08 +08:00
清理 AGC 热点三模块不可达实现(272 条 warning)
Project CI / AI game creator shell Rust crates (pull_request) Successful in 6m5s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 7m2s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 8m0s
Project CI / Backend tests (pull_request) Successful in 8m58s
Project CI / Frontend tests (pull_request) Successful in 3m11s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m47s
Project CI / Repository checks (pull_request) Successful in 6m38s
Project CI / Native shell tests (pull_request) Successful in 8m34s
6d5436541c
根因:退役提交 839051f5「退役AGC独立Agent Runtime与CLI执行面」删除 agent/runtime_tools 等调用面时漏删这三个模块,此后三者均无现役调用方(bin 与 --all-targets 两种口径下 dead_code 计数相同,且文件内无 cfg(feature/cfg(windows) 分支)。

- 删除 src/git_inspect.rs 全部实现(88 条 dead_code):文件内部互相调用不构成活根;同时删除 main.rs 的 `mod git_inspect;`、`use git_inspect::*;` 与文件内 #[cfg(test)] 模块 23 例。失去的行为覆盖:受控本地提交事务、Windows index 替换语义、Git 控制文件硬链接/重解析点拒绝、fingerprint 稳定性;当前文件级补丁与提交路径为 agent/direct_patch.rs,不含多文件提交事务语义。
- 删除 src/patchset.rs 全部实现(65 条 dead_code):多文件原子 patchset 应用已被 agent/direct_patch.rs 取代,无任何调用方;同时删除 main.rs 的 `mod patchset;`、`use patchset::*;` 与 mod tests 9 例。失去的行为覆盖:patchset 输入解析与七字段严格校验、预检/应用/回滚事务、路径冲突与敏感路径拒绝、正文大小预算。
- 收敛 src/repository_context.rs(119 条 → 0):仅保留现役脱敏链 redact_absolute_path_tokens 及私有 helper starts_absolute_path / starts_forward_slash_unc_path / starts_file_uri / is_path_boundary / consume_path_token(经 main.rs glob 供 agent/redaction.rs:88 与 agent/generation/canvas_generation.rs:1080 使用);删除仓库启动上下文扫描与渲染的其余 113 条实现、全部常量与 20 例测试,保留仍覆盖保留函数的 2 例路径脱敏测试。失去的行为覆盖:仓库扫描/清单与 Skill 摘要/文档预算/Git 状态采集与渲染/fingerprint。
- 删除 tests/prompt_source_boundaries.rs 中 src/repository_context.rs 的源码边界用例:其断言对象 render_repository_startup_context_for_prompt 已随实现删除。

口径:cargo check --features cocos-editor-execute,unity-editor-execute,godot-editor-execute
chore(agc): 清掉 agent 生成链退役实现的 dead_code 与未用导入
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 4m1s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 2m15s
Project CI / AI game creator shell Rust crates (pull_request) Failing after 4m45s
Project CI / Frontend tests (pull_request) Successful in 3m51s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m46s
Project CI / Repository checks (pull_request) Failing after 3m53s
Project CI / Backend tests (pull_request) Successful in 9m2s
Project CI / Native shell tests (pull_request) Successful in 11m6s
22540a874a
- 删除已退役的多 pass 生成链实现:generation/pass_artifacts.rs(保留仍被
  project/memory.rs 使用的 agent_role_memory_relative_path*)、
  generation/draft_writer.rs(整文件)、generation/draft_validation.rs 与
  generation/trace.rs 中已无任何 cfg 引用的实现与其专属测试。
- generation.rs 按新边界收敛 re-export;draft_validation.rs 不再需要 use super::*。
- redaction.rs / task_lock.rs 删除无调用方的 helper;task_lock 的 Mutex/OnceLock
  只在 unix 分支使用,按 cfg 收敛导入。
- direct_events.rs 删除只服务已删实现的测试 helper。
- agent.rs 删除未使用的 BTreeSet/Seek/Atomic* 导入(sha2 仍被子模块经 use super::*
  使用,保留)。
- build_support/codex_bundle.rs:CLI_VERSION 只在发行构建与单测使用,按 cfg 收敛。

无新增 allow,无假引用;AGC 壳 bin 口径(cocos/unity/godot-editor-execute)编译通过。
清理 AGC 客户端退役运行时遗留的编译告警(session record / 内容 diff / ledger 写入层)
Project CI / AI game creator shell Rust crates (pull_request) Successful in 5m57s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 7m16s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 8m0s
Project CI / Frontend tests (pull_request) Successful in 3m31s
Project CI / Backend tests (pull_request) Successful in 7m31s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m21s
Project CI / Native shell tests (pull_request) Successful in 8m27s
Project CI / Repository checks (pull_request) Successful in 6m58s
4e8662e87c
- process_session:删除退役的 record 模型与 io/persistence/lifecycle 模块及 30 例专属测试,保留 WindowsProcessJob、process_session_bridge 与 Runner 退出用的会话收尾入口。
- project/checkpoint:删除退役的本地项目内容 diff 实现与 3 例专属测试;3 例链接/敏感路径安全用例剥离 diff 断言后保留。
- project/agent_db:ledger 写入/校验层已无生产调用方、仅安全断言使用,27 项按 cfg(test) 收敛保留 68 例覆盖,4 项真死删除。
- project/*:真死条目删除,测试独占条目 cfg(test),仅生产入口条目按调用方条件 cfg(not(test));project.rs 丢弃失效 re-export/导入。
- runner/tests.rs:删除已无引用的 crate 导入块。
chore(agc): 清理退役 Runtime 残留,改生成器停发无消费者的 prompt section
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend 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
fcd8607204
- main.rs:删除已退役 Runtime/Goal/Task/Event 序列化视图、无人引用的输出 token 与
  runtime 限额常量、AgentRuntimeState 等 DTO 及其专属夹具
- 删除只服务退役 Runtime 的调试草稿模块(src/debug.rs、src/debug/debug_drafts.rs)
- image_inspect:删除退役的 image.inspect 入口(load_agent_runtime_inspection_images
  及其路径解析/校验/摘要链);资源预览路径与共享读取器行为不变,专属测试改打资源预览入口
- 仅测试使用 → cfg(test):command_output 分页 API、resource_preview_scheduler
  uncancelled、ui_editor initialize_ui_design_state_at、assets 凭据失败判定、
  game_distribution_publish OwnerGameEntry.localProjectId、command_exec as_str
- 仅 Linux 使用 → cfg(target_os = "linux"):command_sandbox CommandSandboxMetadata /
  command_sandbox_platform_metadata,并删掉 non-linux legacy 分支
- 删无用导入/形参(runner re-export、command_sandbox glob、TcpListener 改 cfg(test)、
  LlmMessageContentPart、config 提权修复未用的 path 形参)
- build.rs 生成器:不再产出 runtime_prompt_bundle_section 与 RUNTIME_PROMPT_* 常量,
  只生成仍被引用的 Agent 目录;同步更新 tests/runtime_prompt_bundle_build 期望

实测:bin 口径(--features cocos/unity/godot-editor-execute)本人领地残留 21 条,
全部是 lane C 死函数仍按类型引用的耦合项;runtime_prompt_bundle_build(17) 与
prompt_source_boundaries(6) 共 23 例全绿。
chore(agc): 把无测试消费者的 Tauri 命令接入收敛到生产边界
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 2m56s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 3m17s
Project CI / AI game creator shell Rust crates (pull_request) Failing after 4m49s
Project CI / Repository checks (pull_request) Failing after 1m15s
Project CI / Frontend tests (pull_request) Successful in 3m29s
Project CI / Native shell tests (pull_request) Failing after 7m22s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m12s
Project CI / Backend tests (pull_request) Successful in 9m26s
6621bbad97
run_limited_local_command / read_local_game_memory / read_local_agent_memory /
write_local_agent_memory / write_local_game_memory / read_local_project_file 这 6 条
#[tauri::command] 没有任何测试直接调用(--all-targets 实测均报 never used),按仓库
既定口径给包装加 #[cfg(not(test))]。注册表在 src/desktop.rs 的
invoke_handler(generate_handler![...]),而 main.rs 已是 #[cfg(not(test))] mod desktop;,
测试构建不编译该表,因此无需改动注册表。

这样被调用方在测试构建里不再被无条件引用,lane B 可继续收敛:
project/memory.rs 的 read_local_game_memory_at / read_local_agent_memory_at /
write_local_agent_memory_at / write_local_game_memory_at / memory_file_path,
project/filesystem.rs 的 is_agent_trace_read_path,
project/verification.rs 的 run_limited_local_command_at。

实测:bin 与 --all-targets 两口径 cargo check 均 EXIT=0。
认证路线决策(2026-10-06):不支持用户自有 Codex 的 OAuth 登录态,模型流量统一走中转站。

- 删除 AuthBridge 凭据变体、OAuth 专属 auth.json 读取分支、OAuth 轮换链、
  model_catalog/auth_handoff.rs 整文件,以及 G11 余下只服务该链的符号
  (APP_SERVER_PROTOCOL/protocol_identity、AUTH_MAX_BYTES、ToolHost、
  acquire、request_/stream_agent_codex_app_server)。
- 保留并逐条验证中转站路由(平台会话代理 / 显式自定义 Key)、共享模型目录捕获、
  隔离运行环境;存疑即留。
- G8 余下:prompt_context 14 项、canvas_generation 12 项、
  external_generation_state 6 项、loop_orchestration 6 项;generation.rs re-export 同步收敛。
- G12:codex_cli 退役 CLI 请求路径(601 行)与其 7 个专属用例。
- runtime_models 收敛为仍在服役的 provider 请求快照。
- thread_manager 仅测试使用的访问器按 cfg(test) 收敛;仅生产入口使用的按
  cfg(not(test)) 收敛;direct_events 事件接收端 import 同口径收敛。

bin 口径 0 warning;--all-targets 口径余 5 条(lib target 编译把 config/commands/
project 等模块排除在外导致的假阳性,见报告)。无新增 allow、无假引用。
1. 非 Windows 目标会 E0425:main.rs 去掉 `use command_sandbox::*;` 后,
   command_exec.rs 在 `#[cfg(target_os = "linux")]` 块里裸名使用的
   prepare_command_sandbox_launch / stage_command_sandbox_launch /
   CommandSandboxLaunch / command_sandbox_platform_metadata 失去来源
   (command_exec.rs 靠 `use super::*` 继承 main.rs 的 glob)。改为在
   command_exec.rs 顶部显式 `#[cfg(target_os = "linux")] use crate::command_sandbox::{...}`,
   Windows 口径下不引入新的 unused import。已核对这是全部裸名使用点:
   trampoline/process_session_bridge 均为全限定或自带 import。

2. src/runner/tests.rs 的 `use crate::{unix_timestamp, ProcessSessionRecord};`
   两个名字在文件内各只在 import 行出现一次,整行删除(warning 已消失);
   lane B 已删 ProcessSessionRecord 本体,保留该名字合并后会 E0432。

实测:bin 与 --all-targets 两口径 cargo check 均 EXIT=0;领地 bin 21(不变)、
--all-targets 346→345。Linux 目标本机无法编译验证(缺少 GTK sysroot,
glib-sys/gobject-sys/gio-sys 的 pkg-config 交叉编译失败,与本改动无关),
第 1 项按"显式 import 覆盖全部 4 个裸名"构造性验证。
- 并入本地分支 chore/agc-warnings-agent @ 86478e8a5(两批共 30 文件):第一批收敛 generation 链退役实现与重导出、task_lock/redaction/direct_events/agent.rs 未用导入、codex_bundle CLI_VERSION 按 profile 收敛;第二批删除 OAuth/AuthBridge 链路(codex_cli.rs / codex_app_server / model_catalog / canvas_generation / prompt_context 等)与 agent 子系统余下 dead_code。
- 并入本地分支 chore/agc-warnings-session @ 4e8662e87(18 文件):process_session 退役模块删除、project/* 与 runner/tests.rs 未用项收敛。
- 并入本地分支 chore/agc-compile-warnings @ 6d5436541(5 文件):删除 git_inspect.rs / patchset.rs 全文件、repository_context.rs 收敛到 141 行只保留脱敏链、main.rs 撤 4 行、tests/prompt_source_boundaries.rs 撤 1 条 case。
- 并入本地分支 chore/agc-warnings-misc @ 3a97ce6b1(22 文件,含两批):commands.rs/config.rs 命令接入收敛、debug.rs 删除、command_exec/command_sandbox/runner 等未用项清理、runtime_prompt_bundle 生成器停发无消费者 prompt section;末端两处必修项:command_exec.rs 补 #[cfg(target_os = "linux")] use crate::command_sandbox::{…}(M1)、runner/tests.rs 删残留 import(M2)。
- `game_distribution_publish.rs`:`OwnerGameEntry` 的 doc 注释与 `localProjectId` 字段
  已按「仅测试读取」收敛成 `cfg(test)` 的现状对齐(生产按本地 manifest 的 `projectId` 匹配,
  只有 `parse_owner_game_entry` 的解析用例读它)。
- `build_support/runtime_prompt_bundle.rs`:`provider_fragment_entries` 第二个元素
  (`RUNTIME_PROMPT_PROVIDER_*_SECTION` 常量名)随退役 Runtime 的常量生成逻辑停发后已无消费者
  (三处调用点都忽略它),收敛为 `(manifest 路径键, section 键)` 二元组,行为不变。
- rustfmt:HEAD 上 `cargo fmt --all --check` 不通过(M1 的 `command_sandbox` 导入换行、
  `image_inspect.rs` 两处调用/断言换行),会让 husky `check:rustfmt` 失败;一并修正,无语义变化。

实测(`CARGO_TARGET_DIR=W:/tmp/agc-target-laneD`,features cocos/unity/godot-editor-execute):
- `cargo check`(bin)EXIT=0,领地 21 条(全为耦合项,未变);
- `cargo check --all-targets` EXIT=0,领地 harness 增量 336→335(-1 来自 M2 的 unused import);
- `cargo test --test runtime_prompt_bundle_build --test prompt_source_boundaries`:
  17 passed + 6 passed,0 failed(改了生成器,按 dev 运维文档必跑);
- `cargo fmt --all --check` 通过。
合并 lane D2 后续:prompt bundle 生成器标签收敛与 rustfmt 修正
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend 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
a667355164
- 并入本地分支 chore/agc-warnings-misc @ 09f7a310c(4 文件):build_support/runtime_prompt_bundle.rs 的 provider_fragment_entries 收敛、game_distribution_publish.rs 注释对齐退役事实、image_inspect.rs 与 command_exec.rs 的 rustfmt 修正。
- 与后续丁组(改 render_role_array/render_group_value 的 emit)改同一文件的不同函数,语义互不重叠。
suzmii added 8 commits 2026-10-06 17:44:28 +08:00
合并 lane C 后 cargo fmt --all --check 在 5 个文件上不干净(agent.rs、agent/codex_cli.rs、agent/direct_events.rs、agent/generation.rs、agent/codex_app_server/model_catalog/real_tests.rs):仅 reorder/wrap,无行为改动。

原因:这些文件是 lane C 的内容,其分支上未过 rustfmt;仓库 pre-commit 的 rustfmt 门禁按 AGC workspace 整体检查,不修会挡住后续各组提交。

处理:cargo fmt --all --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml 后 --check 干净(rc=0)。
main.rs:删 `use platform_agent::{build_game_creation_seed_task_graph, plan_game_creation_agent_pass, route_game_creation_repair_issues};` 与 shared-contracts 列表中已无消费者的 `GAME_CREATION_AGENT_RUN_SCHEMA_VERSION`。

main.rs:删退役 DTO/结构 `GenerateLocalGameDraftResult`、`AgentPassArtifactPaths`、`AgentPassAgenda`、`LlmGameDraft`、`LlmAgentHandoff`、`GameCreatorAgentLoopResult`(后三者互引,一并删除后无级联孤儿)。

main.rs:删退役常量 `GAME_CREATOR_AGENT_LOOP_MAX_PASSES`、`GAME_CREATOR_CONVERSATION_CONTEXT_MAX_MESSAGES`。

platform_session.rs:删 `platform_session_is_available`。

project/agent_db.rs:删 `append_jsonl_line`(其内部 `append_jsonl_line_unlocked` 仍有其他使用者)。

project/conversation.rs:删 `append_markdown_entry`。

project/manifest.rs:删 `record_draft_task_progress`。

config.rs:删 `build_game_creator_llm_client_without_redirects_from_llm_config`。

验证:bin 口径 warning 24 → 9,EXIT=0,无 error 行;每个符号删前均以 Git 全树引用矩阵确认(见 local://rust-warning-coupling-report-20261006.md §3a)。
main.rs:`AGENT_RUNTIME_AUTONOMOUS_SOURCE_FIELD_MAX_CHARS`、`AGENT_RUNTIME_AUTONOMOUS_SOURCE_TOTAL_MAX_CHARS` 加 `#[cfg(test)]`(使用点全在 cfg(test):project/agent_db.rs 的测试区与 project/agent_db/security_tests.rs;security_tests.rs 68 例零改动)。

assets.rs:`external_editor_api_credentials_override_is_active` 加 `#[cfg(test)]`(使用点全在本文件 2785-2819 的测试)。

只做 cfg 收敛,不删实现、不新增 allow、不加假引用。

验证:bin 口径 warning 9 → 6,EXIT=0。
main.rs:删 `const AGENT_RUNTIME_RUN_PROFILE_STANDARD: &str = "standard";` 与 `fn default_agent_runtime_run_profile()`——后者唯一引用前者,两者在任一 lane 树上都还各有 1 处引用,属真跨分支耦合(合并后 0 引用)。

已全仓搜索确认无 `#[serde(default = "default_agent_runtime_run_profile")]` 之类字符串引用。

验证:bin 口径 warning 6 → 4,EXIT=0。
build_support/runtime_prompt_bundle.rs:render_role_array 不再 emit `id`/`tool_id`,改为 `AgentRoleDefinition {{ role, task_id, brief_path_name }}`;render_group_value 不再 emit `role`/`brief_path_name`,改为 `AgentGroupDefinition {{ id, label, roles }}`。

src/main.rs:AgentRoleDefinition 删 `id`/`tool_id`(保留 `role`/`task_id`/`brief_path_name`——`agent/generation/pass_artifacts.rs:9` 仍在读 `brief_path_name`);AgentGroupDefinition 删 `role`/`brief_path_name`(保留 `id`/`label`/`roles`)。

tests/runtime_prompt_bundle_build.rs:fixture 自带的两个 struct 声明同步为新形状(358 与 882-891 的断言不受影响)。

prompts/runtime/manifest.json 与 build_support 的 catalog 字段一律未动;生成物只经生成器改(OUT_DIR/agent_runtime_prompt_bundle.rs 已被 include! 进 crate)。

验证:bin 口径 warning 4 → 2,EXIT=0;生成物新形状实例:`AgentRoleDefinition { role: "Director", task_id: "design-director", brief_path_name: "director.md" }`、`AgentGroupDefinition { id: "supervisor", label: "项目总控", roles: &PROJECT_SUPERVISOR_AGENT_ROLES }`。
src/main.rs:删除 `AgentRoleBrief` 与 `AgentGroupBrief` 两个从未被构造的结构(全仓 0 处 `AgentRoleBrief {` / `AgentGroupBrief {`)。

canvas_generation.rs:摘掉 9 个函数形参(8 个 `briefs: &[AgentGroupBrief]` + 1 个 `_briefs: &[AgentGroupBrief]`:generate_platform_art_asset_at / admit_platform_art_generation_at / generate_admitted_platform_art_asset_at / generate_platform_art_asset_with_options_at / generate_platform_art_asset_with_runtime_options_at / generate_art_package_asset_with_runtime_options_at / generate_platform_art_asset_with_runtime_options_and_retention_at / request_platform_art_asset_with_runtime_options_at)。

删除 31 个调用点的对应实参(10 处 `briefs`/`_briefs` 透传、21 处字面量 `&[]`),涉及 canvas_generation.rs、agent/direct_runtime/mod.rs、agent/direct_tool_bridge.rs、asset_generation_tasks/runtime.rs、commands.rs、commands/desktop.rs。

定性:这些值可证永远为空且无读取者,函数可见性均 crate 内私有、无 `#[tauri::command]`、不涉持久化与公开契约;行为不变。

验证:bin 口径 warning 2 → **0**,EXIT=0;`cargo fmt --all --check` 干净。
src/main.rs 顶部加 `#![cfg_attr(not(test), deny(warnings))]`,并留注释说明为何不用 `[lints]` 表:`--all-targets` 会把同一个 bin target 再编一次,harness 实例里 `#[cfg(not(test))] fn main()` 被排除、`generate_handler!`/`desktop::run()` 链不可达,产生一批属测试构建产物的假死告警(当前 339 条),若用 `[lints] warnings = deny` 会被 deny 而 CI 必红。

AGC 的 Cargo.toml 不加 `[lints]`(保持现状);server-rs workspace、4 个 exclude crate、desktop-shell 与三个 bridge 的 `[lints]` 写法不变。

门禁自证(生产可见处插入未使用变量):bin 口径失败并报 `error: unused variable: gate_selfcheck_unused_probe` + `= note: #[deny(unused_variables)] implied by #[deny(warnings)]`(RC=101);撤销后同命令转绿(RC=0,无 warning)。

带门禁的 `--all-targets` 仍 EXIT=0(test 实例 339 条不受影响)。
docs(agc): 写清 AGC 壳生产口径门禁与 harness 告警边界,并把 OAuth/AuthBridge 段改为已删除叙述
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend 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
09cc0a55c6
dev 运维文档「Rust 编译告警门禁」:补 AGC 壳为何用 `#![cfg_attr(not(test), deny(warnings))]` 而非 `[lints]` 表(同 crate 无 lib 目标、`--all-targets` 会把同一个 bin target 再编一次)。

同节补 `--all-targets` 下 harness 实例告警的来源(`#[cfg(not(test))] fn main()` 被排除 → `generate_handler!`/`desktop::run()` 链不可达,2026-10-06 实测 339 条)与边界:不作为废弃生产代码处理、不在门禁覆盖内、`--all-targets` 无法归零;不做超出事实的承诺。

同节测量命令拆成生产口径(不带 `--all-targets`)与测试口径(带),并写明两条都必须带编辑器 feature,否则 `build.rs` 随包资源校验 panic。

同节覆盖范围与实测基线表更新:AGC 壳 bin 613 → 0(已启用生产口径门禁)、AGC 壳 `--all-targets` 1214 事件 / 1034 唯一 → 339。

技术方案文档 OAuth 契约冲突节:把「仍存在的实现与承诺」改为「当时存在的实现与承诺(已随 2026-10-06 决策删除)」,生产入口一条改为历史事实并注明相关符号已删除;保留 485ed50b2 提交号、PR #439 与章节锚点作为历史证据出处。

同段 :84/:96/:98/:104/:258 的决策与门禁叙述只做事实一致性核对,未改动措辞。

检查:`npm run check:encoding` rc=0、`git diff --check` rc=0、`npm run check:rustfmt`(4 个 workspace)rc=0。
suzmii added 2 commits 2026-10-06 18:01:40 +08:00
dev 运维文档「Rust 编译告警门禁」段末尾追加四条事实说明:

①盲区:本机与 CI 只编 Windows,`#[cfg(target_os = "linux"/"macos")]`、`#[cfg(unix)]` 等非 Windows 块内的名字解析不会被编译器检查,`--all-targets` 的 test harness 实例告警又不按废弃代码处理,因此“删了 glob/再导出、只有非 Windows 块还在用”在 Windows 口径下不可见(实例:command_exec.rs 的 linux cfg 块在批次一删掉 crate 根 `use command_sandbox::*;` 后四个裸名只在 Linux 目标下 E0425)。

②覆盖面与结论:全 crate 463 个非 Windows cfg 属性 / 68 文件 / 355 个最外层块;块内 364 个裸 crate 引用、98 个符号;提供方自带 cfg 的仅 6 行且全部消解;四类危险计数(悬空 / not(test) 越用 / windows-only use 被非 Windows 使用点依赖 / 跨平台谓词缺口)全为 0 → 本例是孤例,无待修项。

③兜底条件(若成立才做):若将来出现 Linux / macOS 交付面,CI 应增加对应目标的 `cargo check --all-targets` 作业;当前不新增作业。

④门禁现状:AGC 壳用 `#![cfg_attr(not(test), deny(warnings))]`(src/main.rs),其余 crate 用 `[lints.rust] warnings = "deny"`。

检查:`npm run check:encoding` rc=0(5408 文件)、`git diff --check` rc=0。

注:本次不 push,等用户一并确认后再推。
refactor(agc): 把路径脱敏原语并入 agent/redaction.rs,删除名实不符的空壳模块
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend 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
8cd6d45d1c
src/repository_context.rs 整文件删除:该文件在 lane A 收敛后只剩脱敏链,文件名承诺的“仓库启动上下文”已不存在(名实不符)。

redact_absolute_path_tokens + 5 个私有 helper(starts_absolute_path / starts_forward_slash_unc_path / starts_file_uri / is_path_boundary / consume_path_token)+ #[cfg(test)] mod tests(2 例)逐字搬入 src/agent/redaction.rs(该模块自述职责即“诊断文本的长度收口与脱敏”),可见性保持 pub(crate),实现未改一字。

main.rs 删除 mod repository_context; 与 use repository_context::*;。

agent/generation/canvas_generation.rs 改为显式 use crate::agent::redaction::redact_absolute_path_tokens;(不再依赖 crate 根 glob);agent/redaction.rs 内部调用点不受影响。

验证:AGC 壳 bin 口径 0 warning / EXIT=0;--all-targets EXIT=0(test harness 实例 339 条不变);测试 runtime_prompt_bundle_build 17、prompt_source_boundaries 6、thread_manager 72、manifest_invalidation 1、agent_db 65、redaction 4(含搬移过来的 2 例)全 passed;cargo fmt --all --check、npm run check:encoding、git diff --check 全绿;零新增 #[allow]。
suzmii added 2 commits 2026-10-06 18:05:17 +08:00
src/agent/generation/pass_artifacts.rs 整文件删除:该文件名承诺“多 pass 产物写入”,退役清理后只剩两个“角色记忆路径”工具函数,与文件名无关。

两个函数(agent_role_memory_relative_path / agent_role_memory_relative_path_for_task)逐字移入 src/project/memory.rs(其唯一消费者 project/memory.rs:38/71 所在模块,记忆路径构造属该模块域),实现未改一字。

src/agent/generation.rs 删除 mod pass_artifacts; 与 pub(crate) use pass_artifacts::agent_role_memory_relative_path_for_task;(原跨模块再导出不再需要)。

调用点不变:project/memory.rs 的两处调用现在解析到同模块定义。

验证:AGC 壳 bin 口径 0 warning / EXIT=0;--all-targets EXIT=0(test 实例 339 条不变);定向用例 invalid_toolbar_arguments_are_rejected_before_any_generation(唯一触达这些记忆函数的用例)1 passed;cargo fmt --all --check、npm run check:encoding、git diff --check 全绿;零新增 #[allow]。
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
b7a7860154
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。
suzmii added 1 commit 2026-10-06 18:13:45 +08:00
refactor(agc): 三个名不副实的模块按内容改名,只动文件与 mod/再导出(各 2 行 plumbing)
Project CI / Backend tests (pull_request) Failing after 20s
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (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 / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
8b7cd8de5a
agent/generation/draft_validation.rs → agent/generation/game_html_validation.rs(剩 9 个公开项全是游戏 HTML/JS 校验原语,草案链已退役);同步 agent/generation.rs:4 的 mod 声明与 :35 的再导出前缀;文件顶部新增 //! 模块文档。

agent/runtime_models.rs → agent/provider_request_snapshot.rs(只剩 1 个 DTO AgentRuntimeProviderRequestSnapshot);同步 agent.rs:36 的 mod 声明与 :80 的 pub(in crate::agent) use 前缀;顶部新增 //! 模块文档。

process_session/recovery.rs → process_session/shutdown.rs(只剩 shutdown_all_process_sessions 与 shutdown_all_process_sessions_and_wait);同步 process_session.rs:8 的 mod 声明与 :11 的再导出前缀;顶部新增 //! 模块文档。

实现、可见性、cfg 一律未改:三个文件的函数体逐字节不变,无新增/删除 #[allow];无新增导入。

调用点改动数 = 0(证据):git status 仅 3 个 R(重命名)+ 3 个 M(plumbing:agent/generation.rs、agent.rs、process_session.rs),无任何调用点文件被改;shutdown_all_process_sessions 的两处调用点 runner/dispatch.rs:543 与 runner/server/desktop.rs:164 用的是项名 crate::shutdown_all_process_sessions*,模块改名不影响。

第四项 loop_orchestration.rs → llm_request.rs 未做:按约定规则,改名会碰到 mod/再导出之外的引用(3 处文档),已停下单独报告等裁决。

验证:bin 口径 0 warning / EXIT=0;--all-targets EXIT=0(test 实例 339 条不变);测试 runtime_prompt_bundle_build 17、prompt_source_boundaries 6、thread_manager 72、manifest_invalidation 1、agent_db 65、redaction 4 全 passed;cargo fmt --all --check、npm run check:encoding(5406 文件)、git diff --check 全 rc=0。
suzmii added 2 commits 2026-10-06 18:18:39 +08:00
agent/generation/loop_orchestration.rs → agent/generation/llm_request.rs:剩 5 个符号全是 LLM 文本请求与其额度/进度错误面(request_game_creator_llm_text、GAME_CREATOR_MUD_POINTS_INSUFFICIENT_ERROR_KIND、消息构造、判定、公开摘要),多 pass 循环编排已随 Agent Runtime 退役。

同步 agent/generation.rs:6 的 mod 声明(mod loop_orchestration; → mod llm_request;)与 :52 的 pub(crate) use 前缀(loop_orchestration::{ → llm_request::{)。

文件顶部新增 //! 模块文档:LLM 文本请求与额度/进度错误面,并注明循环编排已退役。

实现、可见性、cfg 一律未改;调用点改动 0:git status 仅 1 个 R + 1 个 M(plumbing),无任何调用点文件被改(调用方使用再导出的项名)。

验证:bin 口径 0 warning / EXIT=0;--all-targets EXIT=0(test 实例 339 条不变);测试 runtime_prompt_bundle_build 17、prompt_source_boundaries 6、thread_manager 72、manifest_invalidation 1、agent_db 65、redaction 4 全 passed;cargo fmt --all --check、npm run check:encoding(5406 文件)、git diff --check 全 rc=0;零新增 #[allow]。
docs(agc): 同步 loop_orchestration 改名后的 3 处文档引用(路径 + 事实时态/失效行号)
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend 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
c3704072ac
docs/technical/【技术评估】Responses API与Agents SDK迁移评估-2026-09-07.md:29:路径改为 generation/llm_request.rs,并把“仍保留一条文件驱动的确定性生成链”改为过去时(该链已随 Agent Runtime 退役删除,模块现只保留 LLM 文本请求与额度/进度错误面);其后的链路列表保持原样。

同文件:81:表格行内的 `loop_orchestration.rs` 改为 `generation/llm_request.rs`,表格结构未动。

docs/technical/【技术说明】AGC接第三方Provider的兼容性缺陷-2026-08-19.md:91:markdown 链接目标改为 llm_request.rs,并移除已失效的 `:536` 行号引用(该行号在 68 行的现行文件上不存在),链接文字标注原名以便追溯。

只改这 3 处;未新增承诺、未写时间表、未动其它文档内容。

检查:npm run check:encoding rc=0(5406 文件)、git diff --check rc=0。
suzmii added 1 commit 2026-10-06 18:19:47 +08:00
refactor(agc): 补齐 llm_request 改名的 plumbing 与模块文档
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (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
d2b2cad045
上一条提交(0a735ec0d)因 git add 命令里带了已不存在的旧路径而返回 128,只带上了文件重命名;本提交补齐同一改名所需的另外两处:

src/agent/generation.rs:6 mod loop_orchestration; → mod llm_request;,:52 pub(crate) use loop_orchestration::{ → llm_request::{。

src/agent/generation/llm_request.rs 顶部新增 //! 模块文档(LLM 文本请求与额度/进度错误面,注明循环编排已退役)。

两者与已提交的重命名构成完整改名;0a735ec0d 单独不可编译,本分支最终 tip 不受影响。

验证(在本 tip 上复测):bin 口径 0 warning / EXIT=0;--all-targets EXIT=0(test 实例 339 条);测试 runtime_prompt_bundle_build 17、prompt_source_boundaries 6、thread_manager 72、manifest_invalidation 1、agent_db 65、redaction 4 全 passed;cargo fmt --all --check、npm run check:encoding、git diff --check 全 rc=0;零新增 #[allow]。
suzmii added 1 commit 2026-10-06 18:40:38 +08:00
fix(agc): 修 Linux 目标下被新警告门禁判死的两个插件 crate(CI 红因)
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 2m36s
Project CI / Backend tests (pull_request) Failing after 54s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 4m10s
Project CI / Repository checks (pull_request) Failing after 22s
Project CI / AI game creator shell Rust crates (pull_request) Failing after 4m58s
Project CI / Frontend tests (pull_request) Successful in 3m59s
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
2965023337
根因(CI run 3572 的 job 日志):godot-editor-bridge 的 src/files.rs:346 `pub fn verified_module_path` 在 Linux 库构建里无调用方(唯一库内调用点在 platform.rs 的 #[cfg(windows)] 分支),被切片一新增的 [lints.rust] warnings = "deny" 判为 `-D dead-code` 错误;5 个 job(Rust lane 1/2、lane 2/2、Rust crates、Native shell tests、Repository checks)全部死在这一条上。

修法(godot):给 `verified_module_path` 加 `#[cfg(any(windows, test))]` 并补 3 行文档说明——Windows 库路径才是它的活调用方,跨平台单测 official_loader_copy_requires_exact_parent_and_trusted_bytes 继续在 Linux 覆盖该逻辑;不新增 allow、不删测试、不改实现。

修法(unity):tests/protocol.rs 里 Windows-only 用例(shared_service_executes_serially_and_retains_uncertain_state_across_instances)专用的 2 条 import(editor_adapter_api::EditorAdapter、unity_editor_bridge::{configure_helper_candidates, disconnect_unity_editor, execute_unity_editor_code_for_project, UnityEditorAdapter})与 `fn project()` helper 补上与该用例一致的 `#[cfg(all(windows, target_arch = "x86_64"))]`;Linux 侧仍保留 helper_timeout_eof_oversized_frame_and_blocked_write_are_bounded 用例。

验证(本地复现 CI 的 Linux 口径:cargo check --target x86_64-unknown-linux-gnu --all-targets + 门禁):godot bridge RC=0、unity bridge RC=0、cocos bridge RC=0;3 个 exclude crate(agent-runtime-core / agent-runtime-orchestration / editor-adapter-api)RC=0;platform-agent 仅因本机缺 x86_64-linux-gnu-gcc 交叉编译器而失败(环境性,CI 原生 Linux 构建)。

验证(Windows 口径不变):unity bridge --all-targets RC=0、godot bridge --all-targets RC=0;godot 单测 30 passed(含受影响用例)、unity 单测 12 passed + 集成 3 passed,全 0 failed。

验证(仓库检查):npm run check:rustfmt(4 个 workspace)rc=0、npm run check:encoding rc=0(5406 文件)、git diff --check rc=0;零新增 #[allow]。
suzmii added 2 commits 2026-10-06 19:07:10 +08:00
- 合入最新 base(2 个提交,15 文件),满足 CI 守卫步骤要求的 "pull request head 必须包含最新 base commit"。
- 自动合并无冲突;重叠文件(claude_code_cli.rs / codex_app_server/mod.rs / direct_runtime/mod.rs / config.rs / pitfalls.md / 技术方案文档)均为两侧改动互补。
fix(agc): AGC 壳生产门禁按交付平台收窄到 Windows,修 Linux CI 红因
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 4m39s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 3m50s
Project CI / AI game creator shell Rust crates (pull_request) Failing after 5m4s
Project CI / Frontend tests (pull_request) Successful in 2m36s
Project CI / Repository checks (pull_request) Failing after 3m34s
Project CI / Backend tests (pull_request) Successful in 9m4s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m54s
Project CI / Native shell tests (pull_request) Has been cancelled
3673f6f92b
背景(CI run 3603 证据):lane 1/2 在 Linux 上报 `error: could not compile genarrative-ai-game-creator-shell (bin) due to 54 previous errors`,逐条是 `never used`(acl_repair_gate 的 AclRepairGateResult/AclRepairPolicy/ACL_REPAIR_POLICY/LeaderGuard、Windows 策略路径 normalize_windows_policy_path、编辑器 RPC managed_editor_rpc/execute_unity_editor_code/execute_godot_editor_code、process_session_bridge 的 verdict 枚举与桥服务、configure_windows_background_tokio_command 等)。这些项在 Windows 上都被真实调用(本地 Windows bin 口径 0 warning 可证),在 Linux 上因大量 Windows 专用实现被整块编掉而变成未用项。

修法:main.rs 顶部由 `#![cfg_attr(not(test), deny(warnings))]` 改为 `#![cfg_attr(all(not(test), windows), deny(warnings))]`,并把注释写清两个条件(not(test) = 隔离 test harness 实例假死;windows = 交付面是 WebView2/Windows,Linux 构建存在的未用项是“编译剔除”产物)。

CI 无外部 RUSTFLAGS/-D warnings 注入(已全仓核对 .gitea/scripts/package.json),因此 Linux 构建只会把它们当普通 warning,不会红。

同步更新 dev 运维文档「Rust 编译告警门禁」的 AGC 特例条目:记录 cfg(windows) 的来历与 54 条实测数字,并保留 not(test) 的原有说明。

验证(Windows,门禁仍生效):bin 口径 0 warning / EXIT=0;--all-targets EXIT=0(test harness 实例 336 条,全部属测试构建产物);cargo fmt --all --check、npm run check:encoding(5406 文件)、git diff --check 全 rc=0;零新增 #[allow]。

同批还包含:合并 origin/master(merge commit 2a3d1b3d6),满足 CI 守卫步骤 “pull request head 必须包含最新 base commit”(此前 Backend tests 因此 exit=1)。
suzmii added 1 commit 2026-10-06 19:45:51 +08:00
fix(agc): 让 run_turn 在 unix 测试构建可见,修 Linux harness 的 E0599(CI 红因)
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 6m24s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 5m3s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m3s
Project CI / Frontend tests (pull_request) Failing after 1m38s
Project CI / Backend tests (pull_request) Successful in 9m35s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m41s
Project CI / Native shell tests (pull_request) Successful in 10m26s
Project CI / Repository checks (pull_request) Successful in 7m50s
8789b398a2
根因(CI run 3609 的 21864/21865/21866 日志):`cargo test --bin genarrative-ai-game-creator-shell --no-run` 在 Linux 上 `could not compile ... (bin ... test) due to 3 previous errors`,逐条是 `error[E0599]: no method named run_turn found for struct CodexAppServerConnection`(src/agent/codex_app_server/mod.rs:8284/8337/8423)。

来历:lane C 的 86478e8a5(清 dead_code 那批)给 `CodexAppServerConnection::run_turn` 与 `RunFailure::into_llm_error` 加了 `#[cfg(not(test))]` 来消除测试构建里的未用告警;但这三个调用点所在用例是 `#[cfg(unix)]`(用 chmod/权限位与假 app-server 脚本),在 Linux 的测试构建里存在并需要该方法,在 Windows 测试构建里整段不存在,所以本地/Windows 口径看不到。

修法:两个方法由 `#[cfg(not(test))]` 改为 `#[cfg(any(not(test), unix))]`(生产全平台可用 + unix 测试构建可用;Windows 测试构建仍排除,保持既有 zero-warning 口径),并加注释写清为何不能再收窄。不新增 allow、不删测试、不改实现。

验证(本地 Windows):bin 口径 0 warning / EXIT=0;--all-targets EXIT=0(test harness 实例 336 条不变);定向用例 `cargo test --bin ... -- agent::codex_app_server` 118 passed / 0 failed;cargo fmt --all --check、npm run check:encoding(5406 文件)、git diff --check 全 rc=0。

说明:AGC 壳的 Linux test 构建无法在本机复现(tauri/webkit 依赖需要 Linux 系统库,pkg-config 交叉不可用),该口径以下一轮 CI 为准;修复本身只涉及“方法缺失”这一类错误(编译器在同一次编译里报了全部 3 条,已全部覆盖)。
suzmii added 1 commit 2026-10-06 20:30:35 +08:00
docs(agc): 按 CI 实测修正「非 Windows cfg 块不被检查」的错误表述,并写入 AGC 壳编译矩阵
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend 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 / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
8d7ac9c8ce
纠错:原文写「本机与 CI 都只编译 Windows…非 Windows 块内的名字解析永远不会被编译器检查到」是错的——CI 的 Linux lane 确实在编译 AGC 壳并跑测试(本次四个红因里三个就是被 Linux 档抓到的)。

改为按矩阵的准确说法:本机(Windows + 编辑器 feature)不编译非 Windows 块;CI 的 lane 1/2、lane 2/2(Linux 原生 target、默认 feature、bin 测试 harness + `--test runtime_prompt_bundle_build --test prompt_source_boundaries`)与 Rust crates / Repository checks 的 `check:generated-bindings`(`cargo test --locked … export_bindings`)会编译并运行 unix / linux cfg 代码;`cfg(windows)` 块在 CI 从不编译;编辑器 feature 只在 Native shell tests 的 release 档(`tauri build --features 默认编辑器 features --release`)编译且不跑测试;两侧口径互不覆盖。

给「孤例」结论加脚注,并记录 M1(`command_exec.rs:9-13` 的 linux cfg 裸名)判定:`mod command_exec;`(`src/main.rs:92`)无 cfg 且落在 lane 的编译面内 → 若当初跑过 CI,Linux 档会抓到。

补写两条事实:AGC 壳门禁 predicate 为 `#![cfg_attr(all(not(test), windows), deny(warnings))]`;Linux 档在默认 feature 下对壳报出的 54 条 `never used`(Windows 专用实现被整块剔除的产物)不纳入门禁,CI 也不注入 RUSTFLAGS/-D warnings。同时修正旧「门禁现状」行里过时的 predicate。

新增「CI 对 AGC 壳的编译矩阵」表(8 个 job:命令原文 / target / feature / 是否 --all-targets|--test)与证据出处(workflow 行号、run 3612 job 日志、check-native-shells.mjs / check-generated-bindings.mjs / build-release.mjs 行号)。

自检:本提交只改这一个文档文件(1 file changed, +26/-4);`npm run check:encoding` rc=0、`git diff --check` rc=0。
suzmii added 1 commit 2026-10-06 20:32:08 +08:00
docs(agc): 修正矩阵里「release 档注入编辑器 feature」的说法(该组合只对 Windows target 注入)
Project CI / AI game creator shell Rust crates (pull_request) Successful in 6m6s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m54s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m47s
Project CI / Backend tests (pull_request) Successful in 9m12s
Project CI / Frontend tests (pull_request) Successful in 3m37s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m2s
Project CI / Repository checks (pull_request) Successful in 5m20s
Project CI / Native shell tests (pull_request) Successful in 7m8s
abafb50ef9
行级核实 `apps/ai-game-creator-shell/scripts/cargo-features.mjs:47-51`:`defaultEditorFeatures(target)` 只在 target 为 win32/windows 时返回 `cocos-editor-execute,unity-editor-execute,godot-editor-execute`,否则返回空列表 → CI 的 Linux runner 上 release gate 的 `tauri build` 不带编辑器 feature。

因此改写矩阵的 Native shell tests 行与检查面结论:编辑器 feature 代码在 CI 从不编译(只由本机 Windows + 编辑器 feature 口径覆盖);Linux 上被编到的是 godot/unity/cocos 三个 bridge(由 release gate 的插件随包 staging 与 Rust crates job 的 `agc:plugins:native-test` 编译)——本次 bridge 的 Linux `-D dead-code` 红因就在那里暴露。

同步修正「兜底条件」:现状是 Linux 档只覆盖默认 feature 的 bin 测试 harness 与插件 bridge 编译,`cfg(windows)` 块与编辑器 feature 代码两边都不覆盖。

本提交仍只改这一个文档文件;`npm run check:encoding` rc=0、`git diff --check` rc=0。
suzmii added 2 commits 2026-10-07 11:05:24 +08:00
合入 master 自 256e6fe34 起的 **159** 个提交(含小红书小工具导出、导出产物面板、发布会话网关等;master 改动 133 文件,本分支 119 文件,重叠 9 个)。

唯一冲突:`apps/ai-game-creator-shell/src-tauri/src/git_inspect.rs` 为 modify/delete(本分支删除、master 修改)→ 按裁决**保留删除**(git rm)。依据:该模块在 master 上仍只有 `mod` + glob 引入、零调用方;master 对该文件的修改只是把 3 处调用从 `should_skip_project_snapshot_path` 换成另一个判断函数 `should_skip_project_derived_path`(该函数在 `project/filesystem.rs` 有定义、共 10 处使用,与旧函数并存,并非全局改名)。

守卫 1:`git_inspect` 在 AGC src 内 **0 命中**;main.rs 未被 master 带回 `mod`/`use` 行;unmerged=0。

守卫 2:四个旧名文件(loop_orchestration/draft_validation/runtime_models/process_session::recovery)在合并树内**均不存在**,四个新名文件均在预期路径;无任何 `??` 条目。

守卫 3:本分支删/改过的 22 个符号全树扫描仅命中 15 处——全部是既有工具 id 残留(prompts 与两侧契约里的 `project.patchset`),无一处来自 master 新代码;master 新前端字符串调用的 3 个 Tauri 命令(append_local_permission_log / save_local_project_asset_file / reveal_local_project_asset_file)均有定义且仍注册。

本提交未附任何额外修改(只包含 master 侧改动 + 冲突解决);①/② 的修复另开提交。
fix(agc): 清理导出模块在 Windows 生产门禁下的 2 处 dead 项(合并 master 后暴露)
Project CI / AI game creator shell Rust crates (pull_request) Successful in 5m7s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m47s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 6m55s
Project CI / Backend tests (pull_request) Successful in 8m46s
Project CI / Frontend tests (pull_request) Successful in 3m39s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m7s
Project CI / Repository checks (pull_request) Successful in 7m14s
Project CI / Native shell tests (pull_request) Successful in 8m41s
aeebbee282
`src/export/mod.rs`:`pub(crate) use registry::{…}` 里 `Loaded` 在任何档都无人使用(只在 registry.rs 内部用),`content_hash` 只被 `xhs_minitool/registry.rs` 的测试调用 → 收敛为 `use registry::{load_or_create, save, RegistryError};` + `#[cfg(test)] use registry::content_hash;`(未新增 allow)。

`src/export/draft/xhs_minitool/script.rs`:`NpmScript.package_json_relative` 在所有非测试构建中只写不读(`missing_error()` 自行用 `package_json_relative(cwd)` 重算),仅两处测试断言读它;非 serde 字段、不属线协议 → 删除字段与初始化,并把两条断言改为经同一生产函数断言(`assert_eq!(package_json_relative(script.cwd_relative), …)`),断言强度不变、未删用例。

验证:Windows 生产口径(三编辑器 feature)由 2 error 回到 **0 warning / EXIT 0**;`cargo fmt --all --check` rc=0。

背景:这两处属 master 新增的导出模块,是本分支 Windows 门禁 `all(not(test), windows)` 把它们从 warning 升格为 error;Linux/CI 档不受影响。
suzmii marked the pull request as ready for review 2026-10-07 11:06:08 +08:00
k88936 was assigned by suzmii 2026-10-07 11:06:16 +08:00
k88936 was unassigned by suzmii 2026-10-07 11:06:29 +08:00
suzmii requested review from k88936 2026-10-07 11:06:33 +08:00
suzmii added 3 commits 2026-10-07 14:01:21 +08:00
origin/master = 441be8d62(落后 143 提交);合并前本分支 HEAD = aeebbee28。
冲突 11 处,按「master 侧是否活跃」分三桶处理。

M 桶(master 改过该文件 → 取 master 版本,不把我们的删除加回去):
- agent/codex_app_server/mod.rs(master +348/-108)
- agent/codex_app_server/model_catalog.rs(master +38/-18:CatalogSource::Authenticated / source_for_credential / verify_authenticated_source)
- agent/codex_app_server/model_catalog/auth_handoff.rs(modify/delete → 保留 master 版,OAuth 轮换交接)
- agent/codex_cli.rs(master +190/-44)
- agent/codex_app_server/model_catalog/real_tests.rs:我们把该文件裁到 59 行以适配自建的 capture 签名;master 的 model_catalog.rs 恢复 4 参 capture 后取回 master 的 244 行用例,否则 --all-targets 报 2 处 E0061。

D 桶(master 未动过、我们删除的死码 → 保留删除):
- 合并前已删:patchset.rs、git_inspect.rs、repository_context.rs、generation/pass_artifacts.rs、agent/runtime_models.rs、debug.rs(+debug/debug_drafts.rs) 等。
- process_session/{io,lifecycle,persistence,recovery}.rs 与 process_session/tests/owner_fixture_cleanup.rs → 裁决为「保留删除」:master 在这 4 个文件里只改「死码的错误正文」;实测整棵子树在 AGC 生产构建里 69 条 dead_code、且只被 tests.rs 引用;生产只用到 recovery.rs 的 2 个 shutdown 函数,而那 2 个我们已搬进 process_session/shutdown.rs。

G 桶(双方都改、我们那侧非语义 → 以 master 语义为准,手工合并):
- agent.rs:取 master 的 claude_code_failure_to_turn_error(改名,codex_app_server/mod.rs:5323 依赖该再导出);保留我们的模块集合(provider_request_snapshot,去掉 runtime_models 与 dispatch 的再导出)。
- thread_manager/dispatch.rs:master 的 host_dropped_with_detail(panic 详情)+ 我们的 cfg(not(test))/cfg(test) 收口(测试态不读兜底结果,避免 harness 未用变量告警)。
- generation/llm_request.rs:取 master 的 AgentProgressEmitter(其唯一消费方 maybe_generate_platform_art_asset_step 已在我们那侧删除,随之成为残留,交由后续提交处理)。
- process_session/model.rs:master 的 8 处错误正文(WindowsProcessJob 的 last_os_error)**全部落在我们未裁的区间**,逐 hunk 叠加到我们的 382 行版本(结果 406 行;last_os_error 出现次数与 master 版一致,均为 13)。
- process_session/shutdown.rs:把 master 在 recovery.rs 里给 shutdown 广播加的诊断搬进我们的实现(`process_session.shutdown.send_failed processId=… detail=…`;收敛后的 LiveProcessSession 不再有 process_id 字段,进程身份取注册表 key)。
- docs/project-memory/shared-memory/pitfalls.md:两侧各新增一节,两节都保留。
用户决定(本 PR 内落地):把 codex 这块 provider 相关逻辑收敛到一个模块内,给该模块打上允许
dead code,而不是删除——上游 master 正在活跃编辑这些文件,删除会与其在飞工作反复冲突。
本次只影响 AGC 壳;server-rs、其它目录、其它 lint 与 CI 都不受影响。

逐行说明:
1. 新增 agent/codex_provider/mod.rs
   - 顶部 `#![allow(dead_code)]`:唯一落点,覆盖本模块及其子模块(实测可压过 AGC 壳的
     `#![cfg_attr(all(not(test), windows), deny(warnings))]`,但压不住 `unused_imports`)。
   - `#[path = "../codex_app_server/mod.rs"] pub(crate) mod app_server;`
     `#[path = "../codex_cli.rs"]          pub(crate) mod cli;`
     用 `#[path]` 就地挂载,不搬动文件——与上游活跃编辑区的冲突面只剩本文件与 agent.rs。
   - `pub(crate) use cli as codex_cli;`:子树内部既有的 `super::codex_cli::…` 相对路径照旧可用。
2. agent.rs
   - `mod codex_app_server;` + `mod codex_cli;` → `mod codex_provider;`
     `+ pub(crate) use codex_provider::{app_server as codex_app_server, cli as codex_cli};`
     对外路径(`crate::agent::codex_cli::…`、`super::codex_app_server::…`)不变,既有调用点零改动。
3. agent/codex_app_server/mod.rs:`resolve_direct_codex_project_authority` 由 `pub(super)` 放宽为
   `pub(in crate::agent)`——挂载多了一层后,保持它在挂载前对 agent 子树的有效可见性。
4. agent/codex_app_server/direct_project_identity.rs:`use super::super::*;` → `use crate::agent::*;`
   (同因,绝对路径与挂载前语义一致)。
5. agent/generation/llm_request.rs:删除 `AgentProgressEmitter` / `emit_agent_progress` 并同步模块文档。
   理由:其唯一消费方 `maybe_generate_platform_art_asset_step` 已随退役批次删除(我们那侧),
   master 对它的改动只是给死函数加日志;且 `allow(dead_code)` 压不住其它 lint,残留必须真删。
6. agent/thread_manager/turn_completion.rs:`host_dropped()` 加 `#[cfg(test)]`。理由:master 的生产
   Drop 已改用 `host_dropped_with_detail`,该兼容构造只剩用例引用,生产口径下是死码。
7. browser/process.rs:删除 `BrowserLaunchFailure::setup`。理由:master 把它改名成
   `setup_with_detail` 后遗留的未用构造(全仓无调用点)。
8. command_exec.rs:`project_command_actual_target` 收窄为 `#[cfg(target_os = "linux")]`。理由:
   master 新增该函数,但其调用点全在 Linux 编译面(沙箱启动路径与该平台用例),Windows 生产构建无消费方。

结果(Windows msvc / rustc 1.98.1,编辑器 feature):
- 生产口径 `cargo check`:0 warning / EXIT 0;
- `cargo check --all-targets`:EXIT 0(352 条告警全部落在这一个 bin 的 test harness 实例,属既有口径,
  与本提交无关);
- `npm run check:rustfmt`、`npm run check:encoding`、`git diff --check` 均通过。
docs: 登记 codex_provider 的 #[allow(dead_code)] 限定例外
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend 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
ef56bc0174
仓库原有口径明文禁止新增 `#[allow(dead_code)]`(开发运维文档「Rust 编译告警门禁」、
development-workflow「验证路由」)。本次按用户决策登记**限定例外**,两处同步,避免文档与代码自相矛盾。

- 作用域:AGC 壳 `agent/codex_provider`(`app_server` = `agent/codex_app_server/**`,含凭据、模型目录与
  OAuth 交接;`cli` = `agent/codex_cli.rs`,含 CLI 请求路径)。其它 crate、其它目录、其它 lint 与 CI 不受影响。
- 理由:该子树在 AGC 交付口径下休眠(生产恒走平台会话 / DirectProject 路由,原生 app-server 与内置 CLI
  请求入口在 Windows 生产构建里没有调用方),而上游 master 正在活跃编辑这些文件,删除会与其在飞工作反复冲突。
- 失效边界:该子树内今后新增的 `dead_code` 不再被任何机器检查发现;`unused_imports` / `unused_variables`
  等其它 lint 仍必须真修(已实测:allow(dead_code) 压不住未使用的 `use`)。
- 退出条件:该子树被重新启用(恢复个人 Codex OAuth 登录态或原生 app-server 路径)或确定整体退役删除时,
  必须一并移除该 `#![allow(dead_code)]` 并删除登记条。
- 同时修订原「不得模块级 `#![allow]`」一句,指向唯一登记例外。
suzmii added 1 commit 2026-10-07 15:52:22 +08:00
docs: 补充 PR #650 合并 master 后的实测基线复核
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend 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
1612ee9446
同机同 feature、先 `cargo clean -p genarrative-ai-game-creator-shell` 再取数:
- server-rs workspace(--all-targets):0
- AGC 壳 bin 生产口径:0
- AGC 壳同 feature + --all-targets:bin test harness 实例 351 warning 事件(全部落在 master 侧
  既有文件,agent/codex_provider 子树内 0 条),仍属文档「边界」所述的 harness 产物。

原表记的是 2026-10-06 的 339,这里不覆盖历史快照,只补一条带日期的复核。
suzmii added 2 commits 2026-10-07 17:00:17 +08:00
origin/master = e6933762d(落后 106 提交);合并前本分支 HEAD = 1612ee944。
冲突只有 5 处,codex 区域 0 冲突。

M 桶(master 改过的文件 → 取 master 版本,不把我们的删除加回去):
- agent/codex_app_server/**(mod.rs、model_catalog.rs、model_catalog/auth_handoff.rs、real_tests.rs)、
  agent/codex_cli.rs、agent/codex_provider_proxy.rs、build_support/codex_bundle.rs 均与新 master 逐字节相同。
  其中 real_tests.rs / codex_bundle.rs / direct_project_identity.rs 一并取 master 版本,清掉了本分支先前
  在这几个文件里留下的多余 diff(口径:codex 区域一行不删不改)。
- 唯一保留的 codex 侧差异是 codex_app_server/mod.rs 的 1 行:resolve_direct_codex_project_authority
  的 `pub(super)` → `pub(in crate::agent)`。挂载到 codex_provider 后 `pub(super)` 对兄弟模块
  direct_tools_mcp.rs 不可见(E0603),这是收敛必需的适配,不是清理残留。

D 桶(master 未动过、我们删的死码 → 保留删除):patchset.rs、git_inspect.rs、
process_session/{io,lifecycle,persistence,recovery}.rs、generation/pass_artifacts.rs、
agent/runtime_models.rs、debug.rs(+debug/debug_drafts.rs)、process_session/tests/owner_fixture_cleanup.rs 等。
⚠ 复核发现 D 清单里 3 个文件本轮被 master 改过(`git log a8ae81720..origin/master -- <path>` 非 0),逐条判定:
  - repository_context.rs(ad0877219:should_ignore_directory 的 "exports" → ".export"):该函数所在的
    仓库扫描实现已在更早的退役批次(6d5436541)判为不可达并删除,全仓已无该符号 → 改动无处生效,保留删除。
  - generation/pass_artifacts.rs(b04aceb57:黑板字符串去掉「发布包装:exports/README.md」):内容已并入
    project/memory.rs(fbea59251),全仓已无该字符串 → 无需承接,保留删除。
  - generation/draft_writer.rs(b04aceb57 −16:删掉 exports/README.md 写入):属 legacy draft 生成链,
    已在 22540a874 整体退役;全仓 grep 0 引用,恢复只会留下未挂载的孤立文件 → 保留删除。

G 桶(双方都改、我们那侧不改变行为 → 以 master 语义为准):
- agent/generation/trace.rs:唯一冲突块里 master 只把 "exports/README.md" 从产物清单里删掉,而该函数
  (append_local_artifact_write_step)已由我们在退役批次里整段删除 → 保留我们的删除。
- useGameDistributionPublishForm.ts:master 本轮删除该文件(b04aceb57),我们侧只有上一轮同步带来的错误
  正文改动 → 取 master 语义(删除)。

其余文件由 git 自动合并。本提交不含新写的功能改动:收敛形态与残留清理见后续提交。
chore(agc): 清掉本轮 master 新代码带来的 14 处生产口径告警(最小修,无 #[allow])
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend 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
1a86675f4c
背景:本 PR 的 AGC 壳 warning 门禁只覆盖「Windows 生产口径」,master 侧没有该门禁;本轮同步进来的代码
(陶泥儿导出/发布链路退役、bootstrap 退役)留下 14 处 never used / unused import。已逐条与上一轮合并点
`d5e26a68f` 比对确认:**不是我们删除造成的连带**,全部是 master 本轮自己新引入的。

逐条(文件:行 → 处理):
1. game_package_upload.rs:19 unused import `GAME_PACKAGE_UPLOAD_PROGRESS_EVENT` → 从再导出列表移除。
2. game_package_upload/runtime.rs:11 `GAME_PACKAGE_UPLOAD_PROGRESS_EVENT` 常量 → 删除;生产调用点已被
   b04aceb57(exports 全退役)删除。
3. game_package_upload.rs:73 `ensure_staging_path_in_dir` → `#[cfg(test)]`;生产调用点同样被 b04aceb57 删除,
   当前只剩本文件的用例调用。
4. command_exec.rs:645 `resolve_project_bootstrap_spec_at` → 删除。
5. command_exec.rs:2500 `run_project_bootstrap_command_at` → 删除;唯一调用方 project/export.rs 已被 master 删除。
6. project/bootstrap.rs → 整文件删除(唯一入口 run_project_bootstrap_at 失去唯一调用方),并移除 project.rs 的
   `mod bootstrap;` 与 `pub(crate) use bootstrap::*;`。
7. project/verification.rs:662 `run_project_verification_with_commit_at` → 删除;两个调用方(project/export.rs、
   xhs_minitool/build.rs)均已由 master 改动删除;下游文档里对它的 intra-doc 链接改为不带链接的描述。
8. export/draft/taonier/mod.rs:25 再导出 `TaonierArtifactPackage` → 移除;结构体本身仍被 read_artifact_package 使用。
9. export/draft/taonier/registry.rs:88 `read_form` → 删除;全仓无调用方。
10. export/draft/taonier/script.rs:22 `NpmScript.package_json_relative` 字段 → `#[cfg(test)]`(只有用例读取;
    未删除任何用例或断言)。

不使用 `#[allow]`,不删除业务校验与用例,不引入假引用。AGC 壳生产口径恢复 0 warning / EXIT 0。
suzmii added 1 commit 2026-10-07 17:12:05 +08:00
fix(agc): 修 Linux-only 悬空引用 D1,并补同类静态排查(非 Windows cfg 块)
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m16s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 5m9s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 5m7s
Project CI / Frontend tests (pull_request) Successful in 3m34s
Project CI / Backend tests (pull_request) Successful in 8m30s
Project CI / AI game creator shell web tests (pull_request) Failing after 2m58s
Project CI / Repository checks (pull_request) Successful in 6m47s
Project CI / Native shell tests (pull_request) Successful in 9m33s
694b545062
D1(由 1a86675f4 引入):该提交删掉了 master 定义的 `resolve_project_bootstrap_spec_at`
(原 command_exec.rs:645 + 生产包装 :2500),但同文件 `#[cfg(test)] mod tests` 里
`#[cfg(target_os = "linux")] #[test] fn npm_command_targets_node_plus_npm_cli_on_linux`
仍在调用它(command_exec.rs:2641)⇒ Linux 测试目标必然 E0425;Windows 生产口径看不见(cfg 盲区)。

修法(取"按真实使用面收窄"这一支):按 master 原文恢复该函数,并加
`#[cfg(all(target_os = "linux", test))]`:
- 比同文件先例 `project_command_actual_target` 的 `#[cfg(target_os = "linux")]` 更窄——那个函数
  Linux 生产仍在调用(沙箱启动路径),这个的唯一生产调用方 project/export.rs 已被 master 删除,
  只剩本文件用例调用,故按实际使用面写成 all(target_os="linux", test),避免在 Linux 生产里留下一枚死函数。
- 引用侧有效 cfg = `#[cfg(test)] mod tests` + `#[cfg(target_os = "linux")]` 用例 = all(test, target_os=linux),
  与定义侧一致 ⇒ 「引用 1 处 / 定义 1 处(同 cfg)」。
- 函数体与 master 逐字相同;未删用例、未删断言、未用 #[allow]。

同类排查(1a86675f4 里删掉/收窄的每一项符号 × 引用 × 定义 × cfg):
1. GAME_PACKAGE_UPLOAD_PROGRESS_EVENT(常量及其再导出)→ 删除;tip 引用 0 ⇒ 无悬空。
2. run_project_bootstrap_command_at → 删除;引用 0 ⇒ 无悬空。
3. project/bootstrap.rs 整模块(BOOTSTRAP_PACKAGE_MAX_BYTES / ProjectBootstrapResult /
   read_bootstrap_file / run_project_bootstrap_at)+ project.rs 的 `mod bootstrap;` 与
   `pub(crate) use bootstrap::*;` → 删除;`bootstrap::` 与 `run_project_bootstrap_at` 引用均为 0 ⇒ 无悬空。
4. run_project_verification_with_commit_at → 删除;引用 0 ⇒ 无悬空(下游
   resolve_project_verification_spec_with_cwd_at 另有 taonier/build.rs:82 与 xhs_minitool/build.rs:46 调用,未受影响)。
5. TaonierArtifactPackage 再导出 → 移除;3 处引用全在 build.rs(定义/返回类型/构造)⇒ 无悬空。
6. read_form → 删除;引用 0 ⇒ 无悬空。
7. ensure_staging_path_in_dir → 收窄为 `#[cfg(test)]`;引用 3 处 = 定义 + 同文件 `#[cfg(test)] mod tests`
   两处 ⇒ 兼容(test ⊆ test)。
8. NpmScript.package_json_relative 字段 → 收窄为 `#[cfg(test)]`;读取处两处用例断言(cfg(test))+ 构造处
   亦已 cfg(test) ⇒ 兼容;同名自由函数仍属生产并被 script.rs:76 使用。
9. resolve_project_bootstrap_spec_at → 本次按 D1 处理(见上),引用/定义各 1 处且 cfg 一致。

静态复查(方法自定):对 AGC 壳全部 321 个 .rs 建「定义名 → cfg 链」与「use 绑定名」表,按 `#[cfg]`
属性 + 花括号深度重建每行的有效 cfg 链,筛出非 Windows 块(target_os=linux/macos/…、unix、
not(windows))共 7315 行,再统计三类危险计数:
- ① 悬空(master 有定义、tip 无定义的名字在非 Windows 块仍有引用):3 名 9 处命中,逐条核对全为假阳
  (`"git"`/`"running"` 是字符串字面量;`process_identity` 是模块路径的另一符号)⇒ **0**。
- ② windows-only 定义被非 Windows 块引用:3 名 23 处,全为假阳(`is_empty` 是 std 方法调用;
  `platform_art_windows_directory_open_policy`、`resume_suspended_tokio` 位于嵌套的
  `#[cfg(windows)] { … }` 块内,是启发式未下钻)⇒ **0**。
- ③ not(test) 越用:3 名 4 处,全为假阳(`main`/`startup` 是字符串;`set_external_agent_runner_config_dir`
  的 cfg 是 `any(not(test), unix)`,unix 测试构建中存在,且命中行是该定义行本身)⇒ **0**。
说明:`cargo check --target x86_64-unknown-linux-gnu` 在本机跑不通(GTK/webkit 的 -sys 与 ring 需要 Linux
工具链,pkg-config 无法交叉配置),故 Linux 侧证据以静态法给出;master 侧的非 Windows 改动由 master 自己的
Linux CI 兜底。

验证(Windows + 编辑器 feature;取数前 `cargo clean -p genarrative-ai-game-creator-shell`):
AGC bin EXIT 0 / 0 warning(18 条 serde 宏提示非 lint);AGC `--all-targets` EXIT 0(harness 实例 382 条);
`npm run check:rustfmt` / `npm run check:encoding`(5549 文件)/ `git diff --check` 全 EXIT 0;
六组测试 6 / 17 / 74 / 1 / 65 / 4,全部 0 failed。
suzmii added 1 commit 2026-10-07 18:39:43 +08:00
fix(agc): 修 process_tree 夹具的硬编码测试路径(Linux lane 2/2 红,收敛引入)
Project CI / Backend tests (pull_request) Failing after 20s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 6m31s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m25s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m54s
Project CI / Repository checks (pull_request) Failing after 30s
Project CI / Frontend tests (pull_request) Successful in 3m34s
Project CI / AI game creator shell web tests (pull_request) Failing after 3m20s
Project CI / Native shell tests (pull_request) Successful in 9m8s
ad33d42bc7
CI run 3708(head 694b54506)8 个 job:6 成功 / 2 失败。本提交修其中**我们引入**的那一条。

失败 1(我们引入 → 已修):AI game creator shell Rust lane 2/2 → shard 3/4 有 1 例失败
- 用例:agent::codex_provider::app_server::process_tree::tests::shutdown_stops_the_owned_background_writer_and_preserves_proof_scope
- 原始报错:`called Result::unwrap() on an Err value: Elapsed(())`;shard 内重跑该用例仍失败(非偶发)。
- 根因:process_tree.rs 的夹具用 `--exact` 复跑本测试二进制,路径是**硬编码**的
  `const FIXTURE = "agent::codex_app_server::process_tree::tests::owned_tree_process_fixture"`
  (process_tree.rs:307-308,master 原文;该文件本体与 master 逐字节相同)。codex provider 收敛把本模块
  挂到 `agent::codex_provider::app_server::` 下后,`--exact` 匹配 0 个用例 → 子进程不写 marker、
  不打印 TREE_READY → 父进程 `tokio::time::timeout(5s, …).unwrap()` 超时 → Elapsed(())。
- 修法(最小):该字符串同步为新模块路径,并补 2 行说明这个耦合。不改夹具逻辑、不删/不放宽用例、不用 #[allow]。
- 本地验证(Windows + 编辑器 feature):`cargo test -- process_tree::tests` → 3 passed / 0 failed;
  其中 `shutdown_proves_entire_owned_job_exit_and_keeps_sibling_running` 修复前 FAILED(同 Elapsed(()))、
  修复后 ok。cfg(unix) 的那条本机不编译,但走同一夹具常量,机制一致。
- 同类排查:全 crate 共 11 处「硬编码测试路径」字面量,逐条核对后**只有这一处**因本分支的模块搬迁失效
  (`direct_tools_mcp` / `builtin_plugins` / `command_exec` / `command_sandbox_trampoline` /
  `environment_check::web_creation::ownership` / `windows` 的路径本分支未改名,仍与真实模块一致)。

失败 2(上游自带 → 未修,只给证据):AI game creator shell web tests → `directThreadChat.test.ts`
- 失败用例 `DirectProject 聊天 reducer > 系统条目与未识别的 item 类型不进聊天视图`:
  `AssertionError: expected [ { itemId: 'sys-1', …(5) } ] to have a length of +0 but got 1`
- 证据:① 本分支与 origin/master 在 `apps/ai-game-creator-shell/{src,tests}` 与 `packages/**` diff 为空
  (零前端改动);② master 自己的 run 3715(head 9cd290362)同一 job 同一用例同一断言同样失败
  ⇒ master 自带红色,与本分支无关;不擅自改、不合别人的分支。

验证(取数前 cargo clean -p genarrative-ai-game-creator-shell):bin EXIT 0 / 0 warning;
--all-targets EXIT 0(harness 实例 382);check:rustfmt / check:encoding(5549 文件)/ git diff --check 全 EXIT 0;
六组测试 6 / 17 / 74 / 1 / 65 / 4 全部 0 failed;另 process_tree::tests 3 passed。
suzmii added 9 commits 2026-10-07 20:25:52 +08:00
按决策:不再用编译器把告警变成错误(`deny(warnings)`/`-D warnings`),改为「本地 pre-push + CI 的
基线感知 warning check」(见下一个提交)。本提交只做撤销,不引入新机制。

- revert 9fbab1a92:删掉 `apps/ai-game-creator-shell/src-tauri/src/main.rs` 顶部的
  `#![cfg_attr(all(not(test), windows), deny(warnings))]` 及其 9 行说明注释(含 3673f6f92 之后的收窄版本)。
- revert c1ad1a19f:删掉 `server-rs/Cargo.toml` 的 `[workspace.lints.rust] warnings = "deny"`、
  27 个成员 crate 的 `[lints] workspace = true`、4 个被 exclude 的独立 crate 与
  `apps/desktop-shell/src-tauri`、三个编辑器 bridge 各自的 `[lints.rust] warnings = "deny"`。
  **保留**该提交里与门禁无关的清理:`server-rs/crates/api-server/src/llm/mod.rs` 中零引用的
  `TEST_AGC_MODEL_DEFAULT_ID`(revert 会把它恢复出来,这里重新删掉,避免新增一条告警)。
- revert 296502333:撤回两处「为让 deny 下的 Linux CI 变绿」而做的 cfg 收窄
  (godot `verified_module_path` 的 `#[cfg(any(windows, test))]`、unity `tests/protocol.rs` 的
  Windows-only import/helper 的 `#[cfg(all(windows, target_arch = "x86_64"))]`)——它们只服务于 Werror,
  撤销后这些文件回到 master 状态,多出来的 Linux 侧告警由基线覆盖。

验证(Windows,取数前 `cargo clean -p genarrative-ai-game-creator-shell`):
- AGC 壳生产口径 bin:EXIT 0 / **14 条告警**(就是上游 `b04aceb57` 等引入的那批,已入册基线);
- `server-rs --workspace --all-targets`:EXIT 0 / 0 告警;
- tip 上 `git grep -n 'deny(warnings)'` 仅剩文档里的历史说明。
按决策「不要替上游作者修」:这两处改动的唯一目的是让自己的 `deny(warnings)` 不把上游新代码的存量
告警判死,撤销 Werror 后不再需要,且它们动了 master 的文件,故整体撤回。

- revert 1a86675f4:把 master 本轮新代码带来的 14 处告警(`b04aceb57` 等的 exports/bootstrap 退役
  留下的无消费者实现)恢复原样——`project/bootstrap.rs`(113 行)、`project.rs` 的 `mod bootstrap;`
  与 glob 再导出、`project/verification.rs` 的薄包装、`command_exec.rs` 的两个 bootstrap 函数、
  `game_package_upload{,/runtime}.rs`、`export/draft/taonier/{mod,registry,script}.rs` 全部回到 master 状态。
- revert 694b54506:撤掉上面那批里 `resolve_project_bootstrap_spec_at` 的
  `#[cfg(all(target_os = "linux", test))]` 收窄;两个 revert 相抵后该函数就是 **master 原文**,
  `command_exec.rs` 里 Linux 用例仍能编译(此时它只是 Windows 侧的一条告警,不是错误)。

注:CI 修复提交 `ad33d42bc`(process_tree 夹具的硬编码测试路径)**保留**——那是收敛重命名造成的
真实故障(Linux 测试会失败),与 Werror 无关。

这 14 条告警已逐条入册 `scripts/warning-baseline.json` 的 `agc-windows` / `agc-linux` profile,
归属与风险分级见 `local://commit-1a86675f4-inventory.md`。
目的:不再用 Werror,改为「推送前 + CI」的显式检查,并且只拦**基线之外的新增**告警,
这样上游新代码的存量不会挡住任何人,本地开发构建也不会因为告警变红。

单一真源(本地与 CI 调同一份实现):
- 新增 `scripts/check-rust-warnings.mjs` + `npm run check:rust-warnings`:
  用 `cargo check --message-format=json` 收集告警,键 = `路径|符号|lint`(**不含行号**,抗上游行号漂移),
  与 `scripts/warning-baseline.json` 比对:新增 → 退出码 1 并逐条打印;存量减少 → 只提示可更新;
  更新用 `--profile=<name> --update-baseline`。
- 新增 `scripts/pre-push-rust-warnings.mjs`:读 pre-push 的 ref 行,**只在本次推送触碰
  `*.rs`/`Cargo.toml`/`Cargo.lock`** 时才跑(无关推送不受影响);Windows 跑 `agc-windows`+`server-rs`,
  Linux/macOS 只跑 `server-rs`。
- `.husky/pre-push`:把 ref 行落一份临时文件供两段检查共用,然后调用上面的脚本(原有的
  `check:pre-push-master` 保持不变)。
- `.gitea/workflows/project-ci.yml`:新增 `rust-warning-check` job(`runs-on: genarrative-ci`,Linux),
  跑 `--profile=server-rs --profile=agc-linux`,复用 Rust lane 的隔离编译缓存,只 `cargo check` 不 build。
- `scripts/warning-baseline.json`:`agc-windows` 14 条(上游 `b04aceb57` 等引入,逐条见
  `local://commit-1a86675f4-inventory.md`);`agc-linux` 433 条(从 CI lane 日志抽取去重,**刻意取超集**,
  含测试实例产物,首轮 CI 的多余项只显示为「存量减少」不判失败);`server-rs` 0 条。
- 文档:dev 运维「Rust 编译告警门禁」改写为现役口径(目的/命令/基线更新/覆盖分工与缺口/局限),
  旧 Werror 段落标注为历史;development-workflow 的门禁句同步改写。

覆盖分工:CI 覆盖 `server-rs` + AGC 壳 **Linux** 档;AGC 壳 **Windows 生产口径**(GTK/ring 无法在
Linux 交叉编译)**只由本地 pre-push 覆盖**。局限:`--no-verify` 可绕过;本机 target 目录污染要先
`cargo clean -p`;CI 不跑 clippy;基线只保证「不新增」。
接法:挂进 npm run lint(CI 的 Repository checks 与推 master 时的 pre-push 共用那条命令),不新增 job/hook;此前自造的 pre-push 触发接线(.husky/pre-push 改动、scripts/pre-push-rust-warnings.mjs、额外 CI job)已撤。
确定性:profile 专属 target 目录 + 对本 profile first-party 包逐个 cargo clean -p <包名> + 取数后 fresh 完整性断言(每个包必须出现 compiler-artifact 且 fresh=false,否则 exit 1 报测量不完整);只收 first-party 路径前缀下的告警。
修掉两个口径 bug:包集把 AGC 壳下的 vendor/ 路径依赖误算成自己(改精确目录判定);normalizeId 只取 id 的 # 片段导致server-rs 27 个同版本成员碰撞(断言永远为假)。
否决“整体清空 target 目录”:实测 AGC 壳清空后需重建 tauri/webkit 全链依赖 15-25 分钟。
实测:A 干净 agc-windows 1/1·14/14 exit 0、server-rs 27/27·0/0 exit 0;B 播种 unused import → agc-windows 15 条/新增 1、server-rs 1 条/新增 1,均 exit 1 并逐条打印;C 撤销 → 均 exit 0;负向测试(GENARRATIVE_WARNCHECK_SKIP_CLEAN 漏清一个成员)→ 26/27 + 测量不完整 → exit 1。
基线:agc-windows 14 条 / server-rs 0 条 / agc-linux 首采(首次 CI 只采集不判失败,需一次 --update-baseline)。
文档:dev 运维「Rust 编译告警门禁」同步接法、首采、开关、否决清空的原因与局限。
默认 target 目录改为 cargo metadata 报的 target_directory(开发者本来就在用的、依赖已热),保留 GENARRATIVE_WARNCHECK_TARGET_DIR 覆盖供 CI 使用;fresh 完整性断言仍是安全网(本 profile 的包没被重编就 exit 1 报测量不完整,不会静默给出新增 0)。热目录实测:agc-windows 7.9s、server-rs 9.0s。文档补一句:CI 挂在 repository-checks(有工具链与依赖、不会红,但无 cargo 预热缓存,估 25-40 分钟),接线方案待定。
本地:.husky/pre-push 无条件调用 node scripts/check-rust-warnings.mjs --only-if-changed(脚本按 refs 判断本次推送是否触碰 *.rs/Cargo.toml/Cargo.lock,不碰则打印一行并 exit 0);推 master 才做 repository parity 的既有约定保持原样。package.json:把 check:rust-warnings 从 lint 链里摘掉(避免 master 推送跑两次、也不拖慢 repository-checks),脚本保留供手工与 CI 使用。CI:ai-game-creator-shell-rust-lane-2 加一步 --profile=agc-linux,ai-game-creator-shell-rust-crates 加一步 --profile=server-rs(两 job 已有 cargo fetch + sccache 缓存);repository-checks 不动。文档同步接法、失败模式与应急放行(GENARRATIVE_SKIP_RUST_WARNINGS=1)。
.husky/pre-push:refs 先落临时文件→告警检查用 --refs-file 读→exec < 还原 stdin→最后一行仍是 npm run check:pre-push-master -- "$@"(git-hooks.test.mjs 断言逐字不变,故 check:git-hooks 仍绿)。文档:基线 = 告警白名单(显式入册/可审计/可回收)、与 #[allow] 的区别(白名单只吞键相同的那一条)、审计入口 git log -p scripts/warning-baseline.json、SKIP=1 是整段跳过而非入册机制;并修正“feature 分支不跑”的过时表述。
collectOnly(尚无基线条目的 profile,如首次 CI 的 agc-linux)以前只打印条数,导致首轮日志里拿不到可入册的键;现在逐条打印 `[首采] 路径:行 | lint | 符号` 并在末尾给条数 + 入册命令,同时在 --json 的 report[name].collected 里带上完整条目;非首采路径的打印与退出码语义不变。
fix(scripts): 补上首采模式逐条打印(上一次编辑未覆盖到)
Project CI / Backend tests (pull_request) Failing after 37s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m44s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 7m46s
Project CI / Repository checks (pull_request) Failing after 28s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 8m14s
Project CI / Native shell tests (pull_request) Successful in 11m10s
Project CI / Frontend tests (pull_request) Successful in 4m3s
Project CI / AI game creator shell web tests (pull_request) Failing after 4m15s
a5138d2eca
prettier 把 for 循环重排成无花括号形式,导致上一次插入点没匹配上:现在真正逐条打印 [首采] 路径:行 | lint | 符号 + 条数与入册命令;--json 的 report[name].collected 已带上完整条目。实测:临时移除 agc-windows 基线条目 → 首采打印 14 行、exit 0;还原后 14/14 exit 0。
suzmii added 1 commit 2026-10-07 20:40:44 +08:00
chore(scripts): 入册 agc-linux 告警基线(CI 首采,69 条)
Project CI / Backend tests (pull_request) Failing after 39s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m15s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 7m9s
Project CI / Frontend tests (pull_request) Successful in 3m56s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 7m54s
Project CI / Repository checks (pull_request) Failing after 23s
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
32dab26426
来源:run 3729 的 ai-game-creator-shell-rust-lane-2 里新增步骤 “Run AGC shell Rust warning check (Linux)” 的首采输出(该步骤首采模式逐条打印清单、不判失败)。键=路径|符号|lint(不含行号),共入册 69 条;自本条起 agc-linux 档从“首采”转为“只拦新增”。
suzmii added 1 commit 2026-10-07 21:09:41 +08:00
Merge origin/master (b1c89fbba) into chore/rust-compile-warnings:按「让路 master + 最小集恢复」收口跨文件契约冲突
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend 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
888ea76cb2
解冲突口径(本次同步 master 16 个提交):

- `agent/generation/canvas_generation.rs`、`command_exec.rs` 两个冲突文件不再整文件取一边,改为按
  hunk 三分法:master 的功能 hunk 全量移植;我们的清理只在 master 调用方不依赖时才保留。
  未恢复整块模块 / 整文件,未新增任何 `#[allow]` / `#[expect]`。
- 成对回退我们的「摘掉 brief 传参空转」清理:master #628 等新代码仍按带 briefs 的契约调用生成链,
  故 cg 的 8 处签名与 6 个调用方(direct_runtime / direct_tool_bridge / commands / commands/desktop /
  asset_generation_tasks)回到 master 形状,并按最小集恢复 `main.rs` 的 `AgentRoleBrief` /
  `AgentGroupBrief`(未恢复其它已删模块)。
- master #628 已收敛切片用途判定:客户端不再暴露/发送 `sliceCount`,本次跟 master 走(
  `PlatformArtAssetGenerationOptions` 不再有该字段),只保留结果侧 256 上限门。
- command_exec 的 `project_command_actual_target` 采用 master 的 `Vec<OsString>` 字节精确契约,
  同时保留我们「调用点全在 Linux 编译面」的 `#[cfg(target_os = "linux")]` 收窄(与 master 调用方不冲突)。
- 脚本缺陷修复:`scripts/check-rust-warnings.mjs` 编译失败不再可能假通过(cargo 退出码非 0 一律 exit 1,
  并把 stderr 尾部提到前面打印;去掉 `warnings.length === 0` 条件)。
- 取 master 版本带来的回流告警 2 条(`main.rs` 两个 brief 结构体的字段未被读)已登记进
  `scripts/warning-baseline.json`(agc-windows 16 条 / agc-linux 71 条,server-rs 0 条);
  按既定口径「不修上游告警」,只做记账。
suzmii added 1 commit 2026-10-07 21:23:57 +08:00
Merge origin/master (0576f0a3c) into chore/rust-compile-warnings:第二轮同步(游戏共创/作品 Fork 等 186 提交)
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend 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 / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
aa36e691a7
冲突分桶:预检 `git merge-tree --write-tree HEAD origin/master` 返回 0 冲突 ⇒ M/D/G 三桶本轮无需人工分桶,
全部走自动合并;本轮未触碰 codex 区域(`agent/codex_app_server` / `agent/codex_provider` 的挂载与
HEAD 逐字一致),未改 `.gitea/` workflow,未改 `scripts/check-rust-warnings.mjs` 与其判定语义。

同步后收口两处 master 侧遗留:

1. `game_fork.rs` 的两处用例断言调用 `project_has_runnable_prototype`,而该函数随 master 的
   `b04aceb57`(AGC 陶泥儿打包链路落地与 exports 全退役)删掉 `project/export.rs` 一起消失
   ——**master 自己的树就没有定义**(`git grep project_has_runnable_prototype origin/master`
   只有 2 处调用 + 文档,没有定义),所以 master 的 bin 测试 harness 会 E0425。
   本分支同步时就地按最小集恢复该谓词(与 `32714298b` 提升为 `pub(crate)` 的那份逐字同义),
   且只服务本文件用例 ⇒ 按本仓「仅测试使用的项收窄到 `#[cfg(test)]`」的既定口径放进 `game_fork.rs`
   的测试模块,不新增 `#[allow]`、不恢复 `project/export.rs` 整块模块、生产口径零影响。

2. 取 master 版本带来的回流告警登记进 `scripts/warning-baseline.json`:
   `game_distribution_publish.rs | snapshot | unused_variables`(匿名公开读函数
   `get_public_platform_json` 的 `snapshot` 形参在该文件里没被用,随 master 的
   `dab99e82a`「Fork 真实阶段事件 + 公开作品详情读取」进来;master 侧同样报)。
   基线现为:agc-windows **17** / server-rs **0** / agc-linux **72**(本地只能验前两档)。
suzmii added 1 commit 2026-10-07 21:41:05 +08:00
Merge branch 'master' into chore/rust-compile-warnings
Project CI / AI game creator shell Rust crates (pull_request) Successful in 7m16s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m37s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 7m43s
Project CI / Backend tests (pull_request) Successful in 9m11s
Project CI / Native shell tests (pull_request) Failing after 2m53s
Project CI / AI game creator shell web tests (pull_request) Failing after 55s
Project CI / Frontend tests (pull_request) Successful in 2m40s
Project CI / Repository checks (pull_request) Failing after 3m30s
d3676f3a5f
suzmii added 1 commit 2026-10-07 22:24:35 +08:00
Merge branch 'master' into chore/rust-compile-warnings
Project CI / AI game creator shell Rust crates (pull_request) Successful in 6m54s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m13s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 7m45s
Project CI / Backend tests (pull_request) Successful in 8m46s
Project CI / Native shell tests (pull_request) Failing after 2m11s
Project CI / AI game creator shell web tests (pull_request) Failing after 1m15s
Project CI / Frontend tests (pull_request) Successful in 3m50s
Project CI / Repository checks (pull_request) Successful in 6m0s
411ba98054
suzmii merged commit 218027487d into master 2026-10-07 22:52:22 +08:00
suzmii deleted branch chore/rust-compile-warnings 2026-10-07 22:52:23 +08:00
Sign in to join this conversation.