恢复合并时丢掉的 AGC 壳依赖 codex-patch-parser 与 chrono
Project CI / AI game creator shell Rust crates (pull_request) Successful in 3m7s
Project CI / Backend tests (pull_request) Failing after 12s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 3m58s
Project CI / Native shell tests (pull_request) Failing after 2m50s
Project CI / Repository checks (pull_request) Failing after 12s
Project CI / Frontend tests (pull_request) Successful in 3m27s
Project CI / AI game creator shell web tests (pull_request) Failing after 1m34s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 9m23s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 9m24s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 3m7s
Project CI / Backend tests (pull_request) Failing after 12s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 3m58s
Project CI / Native shell tests (pull_request) Failing after 2m50s
Project CI / Repository checks (pull_request) Failing after 12s
Project CI / Frontend tests (pull_request) Successful in 3m27s
Project CI / AI game creator shell web tests (pull_request) Failing after 1m34s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 9m23s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 9m24s
- apps/ai-game-creator-shell/src-tauri/Cargo.toml:[dependencies] 补回 master 侧新增的 `codex-patch-parser = { path = "vendor/codex-patch-parser" }` 与 `chrono = { version = "0.4", default-features = false, features = ["std"] }`(冲突解决时随同段落的 ts-rs 一起被丢掉,导致 src/agent/direct_patch.rs 与 src/agent/direct_codex_audit.rs 报 8 条 E0433 / E0432)
- apps/ai-game-creator-shell/src-tauri/Cargo.lock:按清单恢复 genarrative-ai-game-creator-shell 条目里的 chrono 与 codex-patch-parser 依赖
- docs/project-memory/shared-memory/pitfalls.md:新增 2026-09-22 条,记录「合并后 CI 报 cannot find module or crate 先查对方新增的依赖行」的判据与踩坑点
- docs/project-memory/shared-memory/decision-log.md:在 2026-09-22 合并条目补记这次丢依赖与验证
验证:cargo metadata --locked(AGC workspace)、cargo test --locked --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml --no-run(bin + 4 个集成测试目标全部编译)、cargo check --locked --workspace --manifest-path server-rs/Cargo.toml、npm run check:native-shells:agc-rust-crates、npm run check:encoding、npm run check:doc-index、git diff --check
This commit is contained in:
+2
@@ -1798,7 +1798,9 @@ dependencies = [
|
||||
"axum",
|
||||
"base64 0.22.1",
|
||||
"chromiumoxide",
|
||||
"chrono",
|
||||
"cocos-editor-bridge",
|
||||
"codex-patch-parser",
|
||||
"editor-adapter-api",
|
||||
"futures",
|
||||
"getrandom 0.3.4",
|
||||
|
||||
@@ -27,6 +27,8 @@ shared-contracts = { path = "../../../server-rs/crates/shared-contracts", defaul
|
||||
tauri-build = { version = "2.6.2", features = [] }
|
||||
|
||||
[dependencies]
|
||||
codex-patch-parser = { path = "vendor/codex-patch-parser" }
|
||||
chrono = { version = "0.4", default-features = false, features = ["std"] }
|
||||
# 与 server-rs 同一口径:已发布的 ts-rs 12.0.1 解析不了 enum 级 `serde(deny_unknown_fields)`
|
||||
# (见 agent/direct_codex_user_item/model.rs),上游修复 #491 未发版,故固定到该 commit;
|
||||
# 等 crates.io 发布 > 12.0.1 后改回 registry 版本。不要改用 `no-serde-warnings` 关告警。
|
||||
|
||||
@@ -9355,3 +9355,4 @@ CI 上 `background_agent_runtime_recovers_stale_running_before_pending_task` 在
|
||||
- 代价与取舍:ts-rs 重新进入 AGC 构建脚本与 `spacetime-module`(wasm32-unknown-unknown)依赖图,即 `a5ee45aa4` 省下的编译开销不再保留。已实测该依赖图可编译:`cargo check -p spacetime-module --target wasm32-unknown-unknown` 通过(`ts-rs` / `ts-rs-macros` 在 wasm32 上可编译)。
|
||||
- 影响面:`server-rs/Cargo.toml`、`server-rs/crates/shared-contracts/Cargo.toml`、`server-rs/crates/shared-contracts/src/game_creation_app/asset_kind.rs`、`apps/ai-game-creator-shell/src-tauri/Cargo.toml`;以及本文件、`pitfalls.md`、`docs/technical/【技术方案】AI游戏创作智能体App实施计划-2026-06-24.md`、`docs/project-memory/todos/【待办】AGC资源kind枚举化扫描清单-2026-09-15.md`、`docs/project-memory/plans/【实施计划】AGC资源kindRust枚举与ts-rs绑定-2026-09-15.md` 里的生成命令(去掉 `--features ts-bindings`)。
|
||||
- 验证方式:`cargo metadata --locked`(server-rs 与 AGC 两个 workspace)、`cargo test -p shared-contracts`(119 + 5 + 5 + 2 + 2 全绿、无告警)、`npm run contracts:model3d:generate` 后 `packages/shared` 零 diff、`cargo check -p spacetime-module --target wasm32-unknown-unknown`、`npm run check:encoding`、`npm run check:rustfmt`、`npm run check:spacetime-schema`、`git diff --check`。
|
||||
- 合并结果还丢过依赖:`apps/ai-game-creator-shell/src-tauri/Cargo.toml` 里 master 新增的 `codex-patch-parser` 与 `chrono` 在解决同段落 `ts-rs` 冲突时被一并丢掉(vendor crate 仍是 workspace member,光看 members 不显眼),CI 编译 AGC Rust 分片时报 8 条 `cannot find module or crate codex_patch_parser`。已按 manifest 恢复这两行并同步 lock;排障口径记在 `pitfalls.md` 2026-09-22 条。
|
||||
|
||||
@@ -5986,3 +5986,10 @@ Cocos Creator 根目录由 `package.json.creator.version` 与普通 `assets/`
|
||||
- **原因**:校验器对每个 `input_text` 单独执行 `trim().is_empty()` 并立即拒绝,混淆了结构化片段合法性和整条消息是否有实际内容。
|
||||
- **处理(现行口径)**:`input_text` 允许空字符串、空格和换行,校验过程保持全部片段的原文、分段与顺序,不做合并或删除;遍历完整条消息后,只在既没有非空白文字、也没有任意非文本 part(素材引用 / 运行画面引用 / Skill 引用 / 附件引用)时返回“聊天内容不能为空”。各类引用仍逐个执行原有校验,消息带正文也不能绕过非法引用。
|
||||
- **关联**:`apps/ai-game-creator-shell/src-tauri/src/agent/direct_codex_user_item/validation.rs`、`docs/【功能说明】AGC聊天素材引用-2026-09-08.md`。
|
||||
|
||||
## 2026-09-22 合并 master 后 CI 报 `cannot find module or crate`:先查 `Cargo.toml` 是否丢了对方新增的依赖行
|
||||
|
||||
- **现象**:合并 `origin/master` 到 `feat/tribo3d-integeration` 后,CI 的 AGC Rust 分片报 8 条 `error[E0433]` / `error[E0432]`,全部集中在 `cannot find module or crate codex_patch_parser`,落点是 `apps/ai-game-creator-shell/src-tauri/src/agent/direct_patch.rs` 与 `direct_codex_audit.rs`。
|
||||
- **成因**:冲突解决只处理了同一个 `[dependencies]` 段落里的 `ts-rs`(本分支改成 git 固定 commit、master 仍是 registry `12.0.1`),把 master 在同段落新增的 `codex-patch-parser = { path = "vendor/codex-patch-parser" }` 与 `chrono = { version = "0.4", … }` 一并丢掉;vendor crate 仍是 workspace member,所以看起来"依赖还在",但 `[dependencies]` 里已经没有它。
|
||||
- **处理(现行口径)**:合并两个 Rust workspace 的 `Cargo.toml` 后不能只看 `cargo metadata --locked`——它只验证 lock 与 manifest 自洽,不看代码用了什么。必须各做一次真实编译:`cargo check --locked --workspace --manifest-path server-rs/Cargo.toml` 与 `cargo test --locked --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml --no-run`。CI 报 crate 找不到时,先 `git diff <merge>^2 <merge> -- <Cargo.toml>` 核对对方新增的依赖行,不要先怀疑 crate 名字或 vendor 路径。
|
||||
- **易错点**:`--locked` 通过不等于依赖齐全;任何 cargo 命令都会按当前 manifest 重新对齐 lock,缺失的依赖条目会被顺手从 lock 里剪掉,于是"缺依赖"看起来像"本来就不该有"。
|
||||
|
||||
Reference in New Issue
Block a user