From 3193182665330b3532dbef7e8b1150874cd3c932 Mon Sep 17 00:00:00 2001 From: Linghong Date: Thu, 1 Oct 2026 11:42:48 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20AGC=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E5=B9=B6=E4=BF=9D=E7=95=99=20CI=20=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E8=AF=8A=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除 Claude 流式结果测试中已失效的回合参数 分片运行器使用 Cargo 渲染诊断并保留 JSON 产物发现 新增编译失败诊断回归测试并更新排障文档 --- .../scripts/run-rust-shell-test-shards.mjs | 3 ++- .../scripts/run-rust-shell-test-shards.test.mjs | 12 ++++++++++++ .../src-tauri/src/agent/claude_code_cli.rs | 1 - docs/project-memory/shared-memory/pitfalls.md | 6 ++++++ .../【开发运维】本地开发验证与生产运维-2026-05-15.md | 2 ++ 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/apps/ai-game-creator-shell/scripts/run-rust-shell-test-shards.mjs b/apps/ai-game-creator-shell/scripts/run-rust-shell-test-shards.mjs index 2698de093..fc4cedefe 100644 --- a/apps/ai-game-creator-shell/scripts/run-rust-shell-test-shards.mjs +++ b/apps/ai-game-creator-shell/scripts/run-rust-shell-test-shards.mjs @@ -156,7 +156,8 @@ function resolveTestExecutable() { kind: options.targetKind, name: options.binName, }); - cargoArguments.push('--no-run', '--message-format=json'); + // 保留 stdout 的 artifact JSON,并由 Cargo 将编译诊断输出到继承的 stderr。 + cargoArguments.push('--no-run', '--message-format=json-render-diagnostics'); console.log(`[rust-shards] cargo ${cargoArguments.join(' ')}`); const child = spawn('cargo', cargoArguments, { diff --git a/apps/ai-game-creator-shell/scripts/run-rust-shell-test-shards.test.mjs b/apps/ai-game-creator-shell/scripts/run-rust-shell-test-shards.test.mjs index cf86a6a60..1e30cf53a 100644 --- a/apps/ai-game-creator-shell/scripts/run-rust-shell-test-shards.test.mjs +++ b/apps/ai-game-creator-shell/scripts/run-rust-shell-test-shards.test.mjs @@ -62,6 +62,18 @@ fn failing_case() { assert.match(result.output, /1 passed; 1 failed/); }); +test('compile failure retains the diagnostic code, source location and cause', (t) => { + const result = runFixture( + t, + '#[test]\nfn compile_failure() { let _: u32 = "not a number"; }\n', + ); + assert.equal(result.status, 1, result.output); + assert.match(result.output, /error\[E0308\]/); + assert.match(result.output, /src[\\/]lib\.rs:2:/); + assert.match(result.output, /mismatched types/); + assert.match(result.output, /expected `u32`, found `&str`/); +}); + test('successful shard keeps its compact summary', (t) => { const result = runFixture(t, '#[test]\nfn passing_case() {}\n'); assert.equal(result.status, 0, result.output); diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/claude_code_cli.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/claude_code_cli.rs index 641ace7bb..8adffce7d 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/claude_code_cli.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/claude_code_cli.rs @@ -898,7 +898,6 @@ mod tests { let error = parse_direct_stream_result( br#"{"type":"result","is_error":true,"result":"Authentication failed"} "#, - "turn-1", None, ) .expect_err("failed terminal must be rejected"); diff --git a/docs/project-memory/shared-memory/pitfalls.md b/docs/project-memory/shared-memory/pitfalls.md index 817cf6a64..b1a5b185e 100644 --- a/docs/project-memory/shared-memory/pitfalls.md +++ b/docs/project-memory/shared-memory/pitfalls.md @@ -2,6 +2,12 @@ 这里只记录对当前开发仍有用的症状、根因、排查方法和风险边界。同一事实保留一个当前口径;退役对象的专属过程与单轮测试结果由 Git 历史追溯。遇到旧路径或版本时,以现行代码和专题文档为准。 +## 2026-10-01 Rust 分片编译失败只剩汇总错误 + +- **原因**:`--message-format=json` 把编译诊断写到 stdout;只读取 `compiler-artifact` 的运行器会丢弃 `compiler-message`,CI 只能看到「due to 1 previous error」。 +- **处理**:使用 `json-render-diagnostics` 保留 JSON artifact,同时让 Cargo 将诊断渲染到 stderr;运行器继承 stderr。既有分片 fixture 同时覆盖编译失败详情、测试 panic 和成功摘要,见开发运维文档的 Rust lane 口径。 +- **排查边界**:函数签名变更与另一分支新增测试可能在无文本冲突的合并后产生参数不匹配;合并后必须检查测试目标,不能只验证普通二进制。 + ## 2026-10-01 线上 Nginx 手工维护漂移:`/profile` 刷新 404、发行包请求体仍限 64m - **现象**:登录后刷新 `https://www.genarrative.world/profile` 直接 404,返回 Nginx 默认 404 页(162 字节);应用内点击进入正常。`curl` 复现:`/`、`/project`、`/creation`、`/components`、`/design-system`、`/games*`、`/editor/canvas` 全部 200 且正文与 `/` 同一份 SPA 外壳,只有 `/profile`(含 `/PROFILE`、`/profile/`)404。 diff --git a/docs/【开发运维】本地开发验证与生产运维-2026-05-15.md b/docs/【开发运维】本地开发验证与生产运维-2026-05-15.md index 4f73e66ef..d3272305e 100644 --- a/docs/【开发运维】本地开发验证与生产运维-2026-05-15.md +++ b/docs/【开发运维】本地开发验证与生产运维-2026-05-15.md @@ -359,6 +359,8 @@ npm run check ### Gitea Actions PR 门禁 +AGC 分片运行器编译测试二进制时使用 `--message-format=json-render-diagnostics`:stdout 的 JSON artifact 用于定位可执行文件,编译错误与 warning 由 Cargo 渲染到继承的 stderr,CI 必须保留错误编号、源码位置与具体原因。回归验证运行 `node --test apps/ai-game-creator-shell/scripts/run-rust-shell-test-shards.test.mjs`。函数签名变更合并后,还要编译 `cfg(test)` 调用方;普通 `cargo check` 不能替代测试目标检查。 + Linux process-session 的 owner SIGKILL 用例必须在启动 owner 后立即建立测试清理 guard:正常退出或断言 panic 时终止、回收 owner,并在有界时间内清理其独立临时项目目录中的残留进程。原有「owner 退出后子进程自行消失」断言在兜底清理之前执行,不能由 guard 代替生产生命周期验证。清理覆盖 panic 路径及临时项目间隔离,且不得因清理失败再次 panic。 仓库级 Gitea Actions 工作流固定为 `.gitea/workflows/project-ci.yml`,在向 `master` 推送、创建或更新 PR,以及手工触发时运行。工作流拆成九个必须通过的 job。job 声明顺序就是 runner 领取顺序,因此把两条 AGC 壳 Rust lane 排在最前:并发槽位不足时它们必须最先开始,AGC 侧的关键路径才由自己而不是由排队决定。