WIP: AGC 随包资源 staging 归位:统一跨平台构建目标与增量缓存(#519) #520

Draft
suzmii wants to merge 32 commits from fix/agc-rust-staging-idempotency into master
Member

目标

将 AGC(apps/ai-game-creator-shell)的随包资源从 Cargo build.rs 构建期写入迁移为构建前 staging,消除“产物同时作为 Cargo 构建输入”的 stale 依赖,减少无意义的重复编译,并统一 dev、release、--no-bundle 与 Rust 只读校验的资源边界。

关联 Issue:#519
技术方案:docs/technical/【技术方案】AGC随包资源staging归位-2026-09-26.md

本次实现

1. 单一声明与 staging

  • src-tauri/build_support/package-layout.json 作为随包资源唯一人工声明。
  • 生成 Rust 布局常量,JS staging 与 Rust 校验共用同一份布局。
  • Codex、Claude Agent SDK、插件源码、编辑器构建产物和 native payload 在构建前准备。
  • staging 使用指纹、内容校验和临时目录替换,命中缓存时不重复写入。
  • staging 失败时保留新产物,并尝试恢复旧资源。
  • 插件目录拒绝未声明文件、残留文件和符号链接。

2. 构建入口

  • tauri dev:先准备随包资源,再启动 Vite,避免 Windows 监听目录导致 rename EPERM。
  • tauri build:先准备资源,再执行 Cargo/Tauri 构建;build.rs 只读校验,不再生成随包资源。
  • --no-bundle:Windows/macOS 仍准备应用构建所需的随包资源,但跳过发行运行时资源和安装包生成。
  • Linux --no-bundle smoke:不误用默认 Windows 资源目标,不要求安装 Windows Codex optional dependency。
  • 显式 --target、Cargo --features、-f、runner 参数和 dev 环境变量的解析统一,staging 与 Cargo 使用同一目标和 feature 集。

3. CI 修复

CI 首次失败原因是 Linux Native shell smoke 执行 --no-bundle 时仍按默认目标 x86_64-pc-windows-msvc staging,导致查找不存在的 Windows Codex 包。

现在目标规则为:

  • 正式 bundle:使用发布目标;
  • 无显式 target 的 --no-bundle:使用宿主目标;
  • Linux 宿主:跳过桌面平台专属 staging;
  • 显式 target:显式目标优先。

验证

已通过:

  • AGC 随包资源测试:24 passed;
  • release 测试:48 passed;
  • dev 入口测试:16 passed,5 skipped;
  • 资源布局检查;
  • Linux --no-bundle 入口 smoke;
  • check:encoding;
  • check:doc-index;
  • Rust format check;
  • git diff --check;
  • pre-push 检查。

平台说明

  • Windows/macOS:已覆盖目标解析、staging、缓存和入口测试;Windows 目录监听导致的 EPERM 已通过“先 staging、后启动 Vite”修复。
  • Linux:仅执行不带桌面随包资源的 --no-bundle smoke,不新增 Linux 随包资源支持。
  • 完整 Windows/macOS 真实安装包仍需在对应平台执行最终打包验收。

当前状态

已完成 M1/M2/M3 的代码落地与跨平台目标修复,等待 CI 重新验证后合并。

## 目标 将 AGC(`apps/ai-game-creator-shell`)的随包资源从 Cargo `build.rs` 构建期写入迁移为构建前 staging,消除“产物同时作为 Cargo 构建输入”的 stale 依赖,减少无意义的重复编译,并统一 dev、release、`--no-bundle` 与 Rust 只读校验的资源边界。 关联 Issue:#519 技术方案:`docs/technical/【技术方案】AGC随包资源staging归位-2026-09-26.md` ## 本次实现 ### 1. 单一声明与 staging - `src-tauri/build_support/package-layout.json` 作为随包资源唯一人工声明。 - 生成 Rust 布局常量,JS staging 与 Rust 校验共用同一份布局。 - Codex、Claude Agent SDK、插件源码、编辑器构建产物和 native payload 在构建前准备。 - staging 使用指纹、内容校验和临时目录替换,命中缓存时不重复写入。 - staging 失败时保留新产物,并尝试恢复旧资源。 - 插件目录拒绝未声明文件、残留文件和符号链接。 ### 2. 构建入口 - `tauri dev`:先准备随包资源,再启动 Vite,避免 Windows 监听目录导致 rename `EPERM`。 - `tauri build`:先准备资源,再执行 Cargo/Tauri 构建;`build.rs` 只读校验,不再生成随包资源。 - `--no-bundle`:Windows/macOS 仍准备应用构建所需的随包资源,但跳过发行运行时资源和安装包生成。 - Linux `--no-bundle` smoke:不误用默认 Windows 资源目标,不要求安装 Windows Codex optional dependency。 - 显式 `--target`、Cargo `--features`、`-f`、runner 参数和 dev 环境变量的解析统一,staging 与 Cargo 使用同一目标和 feature 集。 ### 3. CI 修复 CI 首次失败原因是 Linux Native shell smoke 执行 `--no-bundle` 时仍按默认目标 `x86_64-pc-windows-msvc` staging,导致查找不存在的 Windows Codex 包。 现在目标规则为: - 正式 bundle:使用发布目标; - 无显式 target 的 `--no-bundle`:使用宿主目标; - Linux 宿主:跳过桌面平台专属 staging; - 显式 target:显式目标优先。 ## 验证 已通过: - AGC 随包资源测试:24 passed; - release 测试:48 passed; - dev 入口测试:16 passed,5 skipped; - 资源布局检查; - Linux `--no-bundle` 入口 smoke; - `check:encoding`; - `check:doc-index`; - Rust format check; - `git diff --check`; - pre-push 检查。 ## 平台说明 - Windows/macOS:已覆盖目标解析、staging、缓存和入口测试;Windows 目录监听导致的 `EPERM` 已通过“先 staging、后启动 Vite”修复。 - Linux:仅执行不带桌面随包资源的 `--no-bundle` smoke,不新增 Linux 随包资源支持。 - 完整 Windows/macOS 真实安装包仍需在对应平台执行最终打包验收。 ## 当前状态 已完成 M1/M2/M3 的代码落地与跨平台目标修复,等待 CI 重新验证后合并。
suzmii added 3 commits 2026-09-27 17:00:28 +08:00
- start-tauri-dev.mjs 启动 Tauri CLI 前复用 scripts/dev.mjs 的 buildLocalRustProcessEnv,本地 Rust wrapper 由脚本决定而不是本机 Cargo 配置
- 新增 buildTauriDevProcessEnv 组装 dev 端点环境并导出,供测试直接断言
- 补 3 条用例:配置为 sccache 时改用 /usr/bin/env 直连 rustc、未配置时清空两个 wrapper 变量、自定义 wrapper 保留且不改写调用方 env
- pitfalls 与开发运维文档补记 AGC dev 入口的 wrapper 口径
- 新增 docs/technical/【技术方案】AGC随包资源staging归位-2026-09-26.md:记录根因证据(tauri-build 把随包资源登记成 build script 输入)、准备步骤合同、构建脚本退化边界、入口接线、验收判据、风险与里程碑拆分
- docs/README.md 挂入文档索引
补充 AGC 随包资源 staging 归位里程碑与首段实施计划
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m29s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m0s
Project CI / Backend tests (pull_request) Successful in 4m21s
Project CI / Frontend tests (pull_request) Successful in 1m59s
Project CI / Native shell tests (pull_request) Successful in 6m0s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 9m25s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m27s
Project CI / Repository checks (pull_request) Successful in 1m50s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 9m53s
756297d2df
- 新增三份里程碑规范:资源改由校验器读入、生成接入 dev 与发布入口、编辑器分支产物归位与症状层补丁清理
- 新增首个里程碑实施计划:修改边界、实现顺序、验证命令、风险与回滚点、待确认的实现形态
suzmii added 4 commits 2026-09-27 18:36:13 +08:00
- 新增 build_support/package-layout.json:Codex 三元表与组件白名单、上游候选路径、第三方声明来源、插件随包子目录与跳过规则、平台与 feature 门槛的唯一人工声明
- 新增 scripts/check-package-layout.mjs:由声明生成 build_support/package-layout.generated.rs,并校验目标唯一、可执行组件属于白名单、每个目标恰有一条第三方声明来源、codex.version 与应用锁定的 @openai/codex 一致
- 新增 build_support/package_layout.rs:声明类型、插件与平台门槛判定、逐块 sha256、随包 Codex 目录只读校验及其单测
- codex_bundle.rs 的布局与版本常量改由声明提供,公开接口与取值不变;src/main.rs 在测试期引入该模块以复用既有单测
- package.json 新增 bundled-resources:check/sync 并接进 typecheck 链,根 package.json 提供 agc:* 别名
- 新增 scripts/prepare-bundled-resources.mjs:按声明解析目标与替换单位,用上游 package-lock 的 resolved/integrity 组成缓存 key,写临时目录后原子替换,命中缓存不重写任何文件,只替换本工具产物,失败即退出并给出可执行提示
- Codex 路径按声明复制组件、保留受版本控制的第三方声明、按现有字节格式生成 manifest.json;macOS 双架构整体 staging
- 插件路径按声明的子目录白名单与跳过规则复制,顶层出现非本工具条目即失败
- 新增 scripts/prepare-bundled-resources.test.mjs:9 条用例覆盖 staging 结果、幂等(内容与时间戳)、上游缺失、目标不支持、目录被非本工具占用、dry-run 不落盘与白名单过滤
- .gitignore 忽略准备步骤产生的 staging 临时目录
- 平台布局、插件随包子目录与跳过规则、Codex 上游候选路径与第三方声明来源全部改由声明提供,删除脚本内的字面量
- 新增只读校验:Codex 目录校验清单 schema/平台/版本、文件集合、逐文件 sha256、第三方声明、可执行位与白名单外文件;插件目录校验必需组件与整树符号链接
- AGC_BUILD_TARGET 的 rustc-env 移到无条件路径(保留职责),新增 AGC_SKIP_RESOURCE_STAGING=1 以在既有产物上只跑校验
- 删除脚本内与 package_layout 重复的 sha256 实现,复用同一份
补充 AGC 随包资源归位的 M1 决策与文档
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m25s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m54s
Project CI / Backend tests (pull_request) Successful in 3m56s
Project CI / Frontend tests (pull_request) Successful in 1m43s
Project CI / Native shell tests (pull_request) Successful in 6m13s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 9m4s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 9m8s
Project CI / Repository checks (pull_request) Successful in 2m6s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m39s
a4b103a1b0
- 技术方案新增 §4.8 单一声明与实现形态(混合),§8 更新 M1 交付与停止条件,§9 未决问题 1 收口为已定
- M1 里程碑规范记录已定决策与校验收口边界;实施计划补充已定决策与实际验证命令
- M2 里程碑规范的依赖与前置条件补记 M1 已交付的准备步骤与声明门禁
- 开发运维文档补充声明、生成器、门禁、准备步骤与只读校验的用法;决策日志与排障经验同步本次口径
suzmii added 1 commit 2026-09-27 18:56:52 +08:00
AGC 随包资源准备步骤接入 dev 与发布入口,构建脚本退出写入
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (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
f6dad1950f
- start-tauri-dev.mjs 在前端与配套后端就绪后、spawn Tauri CLI 之前调用准备步骤,并保留依赖注入供入口测试断言顺序
- build-release.mjs 的 runTauriBuild 与既有 stageRuntime 并列调用 stageBundledResources,tauri build --no-bundle 仍不强制 staging
- 声明新增 origin 字段:source 由准备步骤写,build 由构建脚本在产物生成后写;构建脚本删除 codex 与插件白名单的写入分支及 stage_plugin_file/copy_plugin_tree/copy_plugin_file,改为 stage_build_generated_plugin_payloads
- 插件随包工作区改为与仓库源码逐文件比对(清单 + 逐文件 sha256 + 整树符号链接),实现移入 build_support/package_layout.rs 复用单测
- 上游原生包元数据改由准备步骤按声明校验,build_support/codex_package_metadata.rs 因失去调用方删除
- 准备步骤改为同步实现,dev 与发布入口可直接调用而无需子进程
- 测试:build-release 39 passed(新增 stage、bundled、build 顺序与 no-bundle 不 staging)、dev 入口 12 passed(新增准备步骤先于 CLI 启动)、准备步骤 9 passed、package_layout 36 passed
- 文档:技术方案 §4.9 记录构建期写入边界,M1 里程碑标记完成,运维文档补入口接线与 resources/plugins 所有权,决策日志与排障经验同步
suzmii added 1 commit 2026-09-27 18:57:57 +08:00
校正 M2 交付后的文档口径
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m21s
Project CI / Backend tests (pull_request) Failing after 14s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m7s
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 / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web 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
33308a93e8
- 技术方案修正症状层补丁清单:prune_staging/STAGED_* 只存在于未合入的补丁,主线从未有过
- 技术方案 §5.2/§5.3 记录过渡期已完成、.taurignore staging 条目保留到 M3 的原因,§8 M2 行标注已交付与 Windows 待复验
- M2 里程碑规范按证据勾选 macOS 侧可达的验收项,未验证项保持未勾选
- M1 实施计划标注 codex_package_metadata.rs 已在 M2 退役
suzmii changed title from WIP: AGC dev 客户端 sccache 阻断修复与随包资源 staging 归位方案 to AGC 随包资源 staging 归位:M1 单一声明与只读校验 + M2 入口接线(#519) 2026-09-27 18:58:47 +08:00
suzmii added 1 commit 2026-09-27 19:01:04 +08:00
补充上游元数据漂移的拒绝用例
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m23s
Project CI / Backend tests (pull_request) Failing after 13s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m56s
Project CI / Frontend tests (pull_request) Successful in 2m11s
Project CI / Repository checks (pull_request) Failing after 17s
Project CI / AI game creator shell web tests (pull_request) Failing after 1m28s
Project CI / Native shell tests (pull_request) Successful in 5m31s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 8m31s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 8m41s
96b44d8660
- 准备步骤用例新增一条:上游 codex-package.json 的 version/layoutVersion/entrypoint/resourcesDir 任一与声明不一致时必须拒绝且不落产物(共 10 条)
- 同步决策日志与 M2 里程碑规范里的用例计数
suzmii added 1 commit 2026-09-27 23:01:22 +08:00
补充 M3 的 Windows 侧验收清单
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m32s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m45s
Project CI / Backend tests (pull_request) Failing after 16s
Project CI / Frontend tests (pull_request) Successful in 2m10s
Project CI / Repository checks (pull_request) Failing after 19s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m27s
Project CI / Native shell tests (pull_request) Successful in 5m56s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 9m34s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 10m19s
0b19df467e
- M3 里程碑规范新增「验证步骤(Windows 侧执行清单)」:准备步骤单跑与幂等、构建期不再写随包资源、构建新鲜度、打包一致性、客户端启动与三类边界负例
- 明确记录方式:命令与输出贴回里程碑或 PR,未通过项回到主规范 §9
suzmii added 1 commit 2026-09-28 12:13:01 +08:00
Merge branch 'master' into fix/agc-rust-staging-idempotency
Project CI / AI game creator shell Rust crates (pull_request) Successful in 59s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m17s
Project CI / Backend tests (pull_request) Successful in 3m56s
Project CI / Frontend tests (pull_request) Successful in 2m8s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 8m31s
Project CI / Native shell tests (pull_request) Successful in 5m54s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 9m10s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m46s
Project CI / Repository checks (pull_request) Successful in 2m24s
55b881de49
suzmii marked the pull request as work in progress 2026-09-29 13:48:45 +08:00
suzmii added 15 commits 2026-09-30 17:47:44 +08:00
AGC 编辑器分支产物归位:构建脚本彻底退出写入
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m29s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m1s
Project CI / Backend tests (pull_request) Successful in 3m52s
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
faa510e999
- 声明扩展:subdirectories 新增 origin=prepared;libraryStaging 增加 prepare/files;新增 nativePayloads 与 plugins.prepareSteps(程序类型、工作目录、指纹、必需产物)
- Godot 随包文件清单改由声明提供,godot_bundle::BUNDLE_FILES 从生成的编译期常量取值,不再各写一份
- 准备步骤按声明运行 powershell.exe -File build.ps1(Unity/Godot,Godot 移除 PSModulePath)与 cargo build -p cocos-editor-bridge --target … --features windows-injection,内容指纹命中且必需产物齐全时零写入,命令执行器可注入以便在 macOS 上覆盖调度与失败关闭
- build.rs 删除 prepare_unity_editor_helper、prepare_godot_editor_extension、stage_cocos_editor_payload、stage_build_generated_plugin_payloads 及辅助函数(415 → 193 行),只留只读校验,并新增已准备产物存在性与 Godot 随包库深度校验;AGC_SKIP_RESOURCE_STAGING 开关随写入分支删除
- 删除两份只含 staging 条目的 .taurignore;发布入口传 profile=release 以定位 Cocos 产物
- 文档:技术方案 §4.9/§8、M3 里程碑(含 Windows 验收清单)、运维文档、决策日志与排障经验同步
- 验证:准备步骤 13 条用例通过(三类准备步骤调度、指纹跳过、缺产物失败关闭、幂等);npm run agc:bundled-resources:check 通过;cargo check --no-default-features 通过且第二次 0.62 秒 fresh
- 未验证:Windows 真机(powershell/cargo 路径、产物归位、包内容一致性与客户端加载),按 M3 里程碑验收清单在 Windows 上确认
按评审修复 M3:校验按插件收敛、Cocos 链路与 Godot 指纹、门禁与文档收口
Project CI / AI game creator shell Rust crates (pull_request) Failing after 1m26s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m7s
Project CI / Backend tests (pull_request) Successful in 3m46s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 6m9s
Project CI / Frontend tests (pull_request) Successful in 1m52s
Project CI / Native shell tests (pull_request) Successful in 6m4s
Project CI / Repository checks (pull_request) Successful in 2m18s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m40s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 9m42s
e4634928c6
- P0:validate_prepared_payloads 遍历所有插件 × 所有子目录 → 与 libraryStaging 分支对称地按插件收敛(声明新增 subdirectories[].plugin,Rust 加 subdirectory_applies_to_plugin,工具复制与指纹同样按插件收敛)
- P1 Cocos:cargo 准备步骤改用该 crate 自身 manifest 并把 --target-dir 指回 src-tauri/target(原 -p + --features 被 cargo 以「cannot specify features for packages outside of workspace」拒绝);nativePayloads 拆出 sourceFileName(下划线)与 destinationFileName(连字符);native/payload 改为 origin=prepared 并绑定 cocos-bridge-build
- P1 Godot:补 fingerprint(roots ["."],排除 bin/.build/native-build,戳文件 bin/win-x64/.agc-source.sha256),不再每次真跑 build.ps1
- P2:pluginSourceFingerprint 对 prepared 产物改用内容哈希(避免无条件覆盖 mtime 导致每次全量重建)、库文件纳入指纹;pluginTreeMatches 对 prepared 只查存在性(内容由指纹覆盖,顺带缓解 90MB exe 的哈希开销);GODOT_BUNDLE_FILES 缺清单即失败,不再静默退化为空数组;CLI 传 log 并新增 --features;用例正则兼容 Windows 路径分隔符;主规范 §4.8 残留的 AGC_SKIP_RESOURCE_STAGING 已清
- 安全:撤出误提交进 .env.local 的真实 token(还原模板并 force-push 分支尖端)
- 验证:npm run agc:bundled-resources:check 通过;cargo fmt + cargo check --no-default-features 通过(含新 plugin 字段与按插件收敛的校验);工具用例 12/13(余 1 条为夹具断言待修)
按复测修复 M3:payload 门槛与交付、缓存键、条件写反与门禁覆盖
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m41s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m8s
Project CI / Backend tests (pull_request) Successful in 3m50s
Project CI / Frontend tests (pull_request) Successful in 1m58s
Project CI / Native shell tests (pull_request) Successful in 5m55s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 9m12s
Project CI / Repository checks (pull_request) Successful in 1m51s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m24s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 9m51s
06ffa7b6ac
- P0:native/payload 补 features=["cocos-editor-injection"](与 nativePayloads 同门槛,保持迁移前语义),Windows 默认 feature 下不再无条件要求该目录
- P0:copyNativePayloads 真正改用 destinationFileName(此前声明了却仍写 sourceFileName,落盘成 cocos_editor_bridge.dll 而运行时找 cocos-editor-bridge.dll)
- P1:payload 交付移到插件缓存短路之前(先默认构建、之后开 injection 不再整条跳过),并把交付物(含缺失态)纳入 pluginSourceFingerprint,删掉它必须导致重建
- P2:修正 pluginTreeMatches 里被写反的条件(原为 || 短路,导致内容比对整体失效)
- P2:门禁新增 validateExtendedDeclarations,覆盖 prepareSteps/nativePayloads 的字段与引用完整性(含 destinationFileName)
- P2:删除 godot_bundle 的 stage/source_files 及其单测(构建脚本不再有调用方),清掉遗留的 PathBuf 导入
- P3:CLI 支持 --features=a,b 形式
- 验证:工具用例 13/13;声明门禁通过;cargo fmt/cargo check 通过
按第三轮复测修复 M3:dry-run 零写入、所有权先行、指纹与门禁补口
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m23s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m1s
Project CI / Backend tests (pull_request) Successful in 3m46s
Project CI / Frontend tests (pull_request) Successful in 1m53s
Project CI / Native shell tests (pull_request) Successful in 5m46s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 8m51s
Project CI / Repository checks (pull_request) Successful in 1m57s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m26s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 9m39s
547fb0dbce
- P2:preparePlugins 重排——dry-run 只做只读判断即返回,预缓存交付不再排在 dry-run 之前;所有权断言提到任何写入之前
- P3:pluginSourceFingerprint 放开 origin=source 过滤(prepared 内容哈希分支可达),库文件与 payload 交付态纳入指纹,pluginTreeMatches 增加「不该存在却存在 → 需要重建」判定
- P3:门禁交叉校验 nativePayloads[].destinationSubdirectory 必须是同插件 origin=prepared 的子目录之一
- P2:里程碑验收清单注明 Cocos payload 只在 injection 构建交付并给出对应命令;dry-run 用例补 injection feature 覆盖
- 夹具补齐 agc-cocos-editor 插件(所有权检查要求目标插件真实存在)
- 验证:工具用例 13/13、声明门禁通过
- 已知缺口:injection 构建后切回默认 feature,随包目录里陈旧 payload 的清理尚未生效(已记在 PR)
按系统性审计修复 M3:指纹反判断、守卫死代码、fail-open 与卫生项
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m23s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m55s
Project CI / Native shell tests (pull_request) Failing after 1m26s
Project CI / Frontend tests (pull_request) Successful in 1m36s
Project CI / Backend tests (pull_request) Successful in 3m37s
Project CI / AI game creator shell web tests (pull_request) Failing after 34s
Project CI / Repository checks (pull_request) Successful in 1m49s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 7m37s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 8m19s
3b4f9b2e10
- P1-1:pluginSourceFingerprint 的判断取反(prepared 内容与交付态真正进入指纹);pluginTreeMatches 的「当前目标/feature 下不该存在却存在 → 重建」从死代码修活
- P1-7:package_layout 的 `sha256_file(x).ok() != ...` 改为 map_err 传播,两侧读失败不再被判为「相等」
- P3-2:copyNativePayloads 的 'plugins' 字面量改由声明 sourceDirectory 派生
- P3-5:payload 交付内容一致时跳过写入(命中缓存保持零写入、时间戳稳定)
- P3-7:门禁提示里的脚本名改为 agc:bundled-resources:sync
- P3-8:删除已无写入方的 resources/cocos-editor-bridge 占位目录
- P2-4:root 包装脚本补结尾 `--`,文档里的 prepare 命令可直接复制执行
- 验证:工具用例全绿、声明门禁通过
按审计结论收口 M3:CI 接线、并发口径、feature 单一推导与文档对齐
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m22s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m52s
Project CI / Native shell tests (pull_request) Failing after 1m12s
Project CI / Frontend tests (pull_request) Failing after 44s
Project CI / Backend tests (pull_request) Successful in 3m28s
Project CI / Repository checks (pull_request) Successful in 1m50s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m20s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 7m31s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 8m14s
3fba76fd6e
- CI:把 bundled-resources:test(13 条,跨平台、注入假执行器)接进 ai-game-creator-shell:check:web,Linux CI 即可覆盖准备步骤逻辑
- 并发:按「无实际场景不做并发支持」定论——不加锁,但替换失败改为可读错误并保留已生成的 staging;技术方案 §4.3 与风险表同步改写
- feature:新增 cargo-features.resolveEditorFeatures 作为唯一推导入口(env > 命令行 --features > 平台默认),dev 与发布入口的 cargo 参数、随包资源准备步骤共用同一集合;--no-bundle 也执行 staging(app 构建本身需要随包资源),只跳过总号发布
- 文档:pitfalls 的校验收口限定到 source 派生内容;里程碑验收清单按实况修正(命令 --、prepared 只查存在性、Windows 侧已复跑)
- 验证:准备步骤 13/13、发布入口 39/39、dev 入口 12/12、声明门禁一致
按评估结论落地:门禁交叉校验、CLI 缺值校验、编辑器分支覆盖与文档
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m19s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m51s
Project CI / Native shell tests (pull_request) Failing after 1m10s
Project CI / Frontend tests (pull_request) Failing after 43s
Project CI / Backend tests (pull_request) Successful in 3m26s
Project CI / Repository checks (pull_request) Successful in 1m51s
Project CI / AI game creator shell web tests (pull_request) Failing after 1m29s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 8m33s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 8m34s
acf021de2a
- 门禁新增交叉校验:plugin 必须指向真实插件目录、features 必须存在于 shell crate 的 [features]、所有声明路径必须是仓库内相对路径(拒绝绝对路径与 ..)
- 准备步骤 CLI:--target/--destination/--features 缺值直接失败(不再静默回退宿主目标),--features 空值也拒绝
- 用例:fixture 补齐 agc-unity-editor/agc-godot-editor/agc-cocos-editor,新增「编辑器分支产物按 prepared 与 library staging 交付」用例;godot_bundle 补 validate 负例单测
- 运维文档:dev 构建下客户端读 target/debug/plugins/**,改资源要重跑准备步骤
- 未做(已按评估结论记录):P2-2 运行时常量锁定需要先把 nativePayloads 也 emit 进 Rust 声明,留作后续
- 验证:准备步骤 14/14、发布入口 39/39、dev 入口 12/12、godot_bundle 19 通过、声明门禁一致、cargo check 通过
Merge branch 'fix/agc-rust-staging-idempotency' into feat/agc-bundled-resources-m3
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m24s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 53s
Project CI / Native shell tests (pull_request) Failing after 1m19s
Project CI / Frontend tests (pull_request) Failing after 57s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 5m15s
Project CI / Backend tests (pull_request) Successful in 3m50s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m28s
Project CI / Repository checks (pull_request) Successful in 1m55s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 8m50s
ceca4a7669
按第五轮评审收尾 M3:跨平台用例、--no-bundle 与并发口径对齐
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m21s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m55s
Project CI / Frontend tests (pull_request) Failing after 43s
Project CI / Backend tests (pull_request) Successful in 3m32s
Project CI / Repository checks (pull_request) Successful in 1m52s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m23s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 7m26s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 8m24s
Project CI / Native shell tests (pull_request) Has been cancelled
c22eb38962
- package_layout 的 source_candidates 用例改用 Path 构造期望值(Windows 上 path.join 产出反斜杠,硬编码正斜杠会让该用例在 Windows 必红)
- 运维文档与技术方案改为「--no-bundle 也执行 staging、只跳过总号发布」;M1 验收行里已删除的 AGC_SKIP_RESOURCE_STAGING 表述同步
- 技术方案 §4.3 第 8 条与风险表的并发口径改为「不做并发支持:失败可读、保留已生成 staging,需要并发时外部串行化」,与实现一致
- 评审结论(Windows 真机):touch build.rs 后 resources 90 个文件 path/size/mtime 零变化;第二次 cargo build 1.13s fresh;三分支产物齐备;幂等、内容变更触发重建、fail-closed 均通过
恢复 --no-bundle 不再强制随包资源 staging,并同步 CI 分组契约
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m18s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m52s
Project CI / Backend tests (pull_request) Successful in 3m55s
Project CI / Frontend tests (pull_request) Successful in 2m2s
Project CI / Native shell tests (pull_request) Successful in 5m54s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 8m4s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m39s
Project CI / Repository checks (pull_request) Successful in 2m13s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 9m55s
0cf536b675
- build-release.mjs:回到「只有出包(非 --no-bundle)才执行 staging」,修复 Linux 上只编译的 release smoke 因强制 staging 去够 Windows 上游包而失败(保留 staging 与 cargo 共用同一 feature 集,以及未覆盖目标的自然跳过)
- scripts/project-ci-workflow.test.ts:check:web 分组新增 bundled-resources:test 后的精确命令串断言同步
- M3 里程碑补「验收记录(2026-09-29)」:准备步骤连续三次复跑 32 个文件内容与 mtime 不变;NSIS 包内 plugins/ 与 resources/plugins 逐文件 sha256 完全一致;运行时三个相对路径与声明必需产物 17 项在包内全部命中
- 与迁移前两份对照(本机 2026-09-24 已安装包、合并基线 8f59c034f 的 build.rs 产物)逐项比对:路径集合与源码派生内容、Unity/Godot 产物一致
- 记录两条已定性差异:Cocos payload 只构建 windows-injection(导出面与迁移前相同)、MSVC 链接产物不可字节复现
- 记录新风险:准备步骤与应用构建共用 target/<triple>/<profile>/deps/cocos_editor_bridge.dll
- 定性 CI 唯一红项 background_agent_runtime_can_write_memory_and_project_files 与本 PR 无关:合并基线同样失败,本机实测第二个 follow-up 请求 5.18s/4.87s 而预算 2s
- pitfalls 新增 2026-09-29 条目:随包资源编译产物摘要不可复现与共用输出路径的核对口径
- M3 里程碑「客户端编辑器分支」补本轮实测:安装包解出的客户端在 http://tauri.localhost/ 生产态正常起首页,包内插件与 Skill 包被读取
- 记录 CDP 主世界可读 list_agc_plugins / list_agc_skill_catalog 的自动化路径与 Godot 插件按项目类型可见的现役语义
- 记录「缺适配器 / 缺组件 / 编辑器没开」三类失败文案,供补做时分类记录
- 合并 origin/master(140 个提交),解决 4 处冲突:build.rs 取只读校验分支、package.json 同时保留 bundled-resources:test 与 check:generated-bindings、决策日志与踩坑记录两侧条目并存
- master 的构建期 staging(stage_bundled_claude_agent、prune_stale_codex_components)不进构建脚本;sidecar 改由声明与准备步骤产出
- package-layout.json 新增 claudeAgent section(锁定版本、sidecar 入口、上游 SDK 与平台原生运行时目标表、复制跳过规则),layoutVersion 递增到 2
- prepare-bundled-resources.mjs 新增 sidecar 整目录原子替换与缓存 key,复制规则按 section 参数化,Windows 真机 24 个文件、复跑命中缓存零写入
- package_layout.rs 新增 sidecar 只读校验(入口与仓库源码逐字节一致、上游包版本、可执行位、白名单外文件)与声明钉住用例
- build.rs 调用 sidecar 校验并导出 AGC_CLAUDE_AGENT_SDK_VERSION;claude_code_cli.rs 的 sidecar 身份串改用声明版本
- resources/claude-agent 映射从基线 tauri.conf.json 移到 windows/macos 平台配置,check-config.mjs 增加「基线不得声明 resources/**」守卫
- 修正 package_layout 的 Windows 路径期望用例(期望值改与实现同形,原用例在 Windows 必红)
- 同步技术方案 §4.5/§4.9、共享决策日志与踩坑记录
合并 origin/master(33 个提交):DirectProject 入队化与事件投影
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m30s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 1m54s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m57s
Project CI / Frontend tests (pull_request) Successful in 3m39s
Project CI / Backend tests (pull_request) Successful in 6m13s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 7m59s
Project CI / Repository checks (pull_request) Successful in 3m29s
Project CI / Native shell tests (pull_request) Successful in 8m0s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m58s
8be75e8e15
- 合并 origin/master(425fbcf63..9ee34809b),唯一冲突是共享决策日志两侧各插条目,取「两侧并存」
- 本轮 master 未触及随包资源声明、准备步骤与三份 tauri 配置,build.rs 只读校验保持不变
- 决策日志与踩坑记录同步两侧条目;docs/README.md 与项目索引按 master 收敛
- 构建期重新生成的 ts-rs 绑定经 prettier 归一后与 master 逐字节一致(合并未丢类型)
- 校验:cargo test --no-run 全 target 通过、AGC 应用 vitest 191 files / 1889 tests passed、check-package-layout、prepare-bundled-resources 18 passed、check-config、check:encoding、prettier、cargo fmt --check 全绿
Merge pull request 'AGC 编辑器分支产物归位(M3,待 Windows 验收)' (#524) from feat/agc-bundled-resources-m3 into fix/agc-rust-staging-idempotency
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 2m10s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m17s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m35s
Project CI / Frontend tests (pull_request) Successful in 3m12s
Project CI / Backend tests (pull_request) Successful in 5m38s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 7m55s
Project CI / Repository checks (pull_request) Successful in 3m28s
Project CI / Native shell tests (pull_request) Successful in 7m20s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m58s
6d789b9dc0
Reviewed-on: #524
suzmii added 1 commit 2026-09-30 19:16:54 +08:00
修复AGC随包资源staging边界
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m34s
Project CI / Backend tests (pull_request) Failing after 16s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 2m3s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m7s
Project CI / Repository checks (pull_request) Failing after 25s
Project CI / Native shell tests (pull_request) Failing after 1m44s
Project CI / Frontend tests (pull_request) Successful in 2m12s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m3s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 7m30s
d2d78fa3d4
修复 --no-bundle 构建前的资源准备接线。

拒绝插件随包目录中的未声明文件并同步Rust校验。

增加staging替换失败后的旧资源恢复与回归测试。
suzmii added 1 commit 2026-09-30 19:28:59 +08:00
修复AGC开发资源准备时序
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m28s
Project CI / Backend tests (pull_request) Failing after 18s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 1m57s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m1s
Project CI / Repository checks (pull_request) Failing after 27s
Project CI / Native shell tests (pull_request) Failing after 1m40s
Project CI / Frontend tests (pull_request) Successful in 2m6s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m52s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 7m15s
1dbbdcf329
在启动Vite前完成随包资源staging,避免Windows监听目录导致rename返回EPERM。

同步更新开发入口生命周期测试。
suzmii added 1 commit 2026-09-30 19:44:08 +08:00
Merge branch 'master' into fix/agc-rust-staging-idempotency
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m48s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m28s
Project CI / Native shell tests (pull_request) Failing after 1m38s
Project CI / Backend tests (pull_request) Successful in 3m44s
Project CI / Frontend tests (pull_request) Successful in 1m52s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m42s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 11m23s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 9m32s
Project CI / Repository checks (pull_request) Successful in 2m18s
0a2dffd8a0
suzmii added 2 commits 2026-09-30 20:25:46 +08:00
让Linux no-bundle smoke不再误用Windows随包资源目标。

统一dev与release的Cargo目标和feature解析,补充跨平台回归测试。

同步随包资源staging技术方案中的实际构建目标约定。
Merge remote-tracking branch 'origin/fix/agc-rust-staging-idempotency' into fix/agc-rust-staging-idempotency
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m39s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m16s
Project CI / Backend tests (pull_request) Successful in 4m9s
Project CI / Frontend tests (pull_request) Successful in 2m16s
Project CI / Native shell tests (pull_request) Successful in 6m12s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 9m38s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 10m14s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m52s
Project CI / Repository checks (pull_request) Successful in 2m24s
7e60484633
suzmii marked the pull request as ready for review 2026-09-30 20:31:54 +08:00
suzmii requested review from k88936 2026-09-30 20:38:13 +08:00
suzmii changed title from AGC 随包资源 staging 归位:M1 单一声明与只读校验 + M2 入口接线(#519) to WIP: AGC 随包资源 staging 归位:统一跨平台构建目标与增量缓存(#519) 2026-09-30 21:50:04 +08:00
Some checks are pending
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m39s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m16s
Project CI / Backend tests (pull_request) Successful in 4m9s
Project CI / Frontend tests (pull_request) Successful in 2m16s
Project CI / Native shell tests (pull_request) Successful in 6m12s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 9m38s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 10m14s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m52s
Project CI / Repository checks (pull_request) Successful in 2m24s
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/agc-rust-staging-idempotency:fix/agc-rust-staging-idempotency
git checkout fix/agc-rust-staging-idempotency
Sign in to join this conversation.