给真机 DirectProject 夹具加一键入口
Project CI / AI game creator shell Rust crates (push) Successful in 1m30s
Project CI / AI game creator shell Rust smoke (push) Successful in 2m1s
Project CI / Backend tests (push) Successful in 4m21s
Project CI / Frontend tests (push) Successful in 2m23s
Project CI / Native shell tests (push) Successful in 6m43s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 9m17s
Project CI / AI game creator shell Rust lane 1/2 (push) Successful in 9m48s
Project CI / AI game creator shell web tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled

- 新增 scripts/run-agc-direct-execution-fixture.mjs:默认用 src-tauri/target/debug 的 AGC 二进制跑全部 11 个用例,支持 -- --cases 子集与 -- --agc-exe 覆盖;二进制缺失时给出构建提示并以退出码 2 结束
- package.json 注册 npm run check:agc-direct-execution-fixture
- 复验:全量 11/11 passed(completed/passes/mcp/mcp-write/native/native-resources/patch/deadline/native-session/restart/running);-- --cases restart 透传也通过
- DirectProject 里程碑记录该可复跑入口与 11/11 结果
This commit is contained in:
kdletters
2026-09-29 00:11:11 +08:00
parent d39931a01a
commit 25898969fb
3 changed files with 73 additions and 0 deletions
@@ -95,3 +95,4 @@ AGC 项目开发对话的显示与恢复只依赖两项输入:**项目对话
- 宿主确实对外发布「这一轮正在跑」:快照 `phase=working`、`active` 里恰好一条 `kind=execute` 的在途许可、`executorStopped=false` —— 这正是界面重进时判断「有运行中回合可恢复/可终止」读的事实;
- 收尾后账本落 `completed`、`active` 清空、`executorStopped=true`;宿主侧落的条目(中间文本 → 工具卡片 → 工具回执)顺序不变。
- 顺带记实:CLI / 无前端宿主的历史里**既没有用户消息、也没有最终助手回复**(两者都由前端 `append_direct_project_conversation_message` 写),CLI 只有宿主侧条目与回执文本;夹具断言据此只校验宿主侧条目。
- **可复跑入口(2026-09-29)**:新增 `npm run check:agc-direct-execution-fixture`(`scripts/run-agc-direct-execution-fixture.mjs`)——默认用工作区 `src-tauri/target/debug` 里的 AGC 二进制跑**全部 11 个用例**(`completed / passes / mcp / mcp-write / native / native-resources / patch / deadline / native-session / restart / running`),也支持 `-- --cases <子集>` 与 `-- --agc-exe <path>` 透传。本轮实跑:**11/11 passed**(修复前这些用例要么根本到不了 Provider,要么统一卡在账本阶段)。这样这条真机证路不再需要手打长命令,后续改 DirectProject/执行许可链路可以直接拿它当判据。
+1
View File
@@ -79,6 +79,7 @@
"check:game-distribution-upload-resume": "node scripts/check-game-distribution-upload-resume.mjs",
"check:agc-project-snapshot-admin-http": "node scripts/check-agc-project-snapshot-admin-http.mjs",
"check:agc-update-channel-manifests": "node scripts/check-agc-update-channel-manifests.mjs",
"check:agc-direct-execution-fixture": "node scripts/run-agc-direct-execution-fixture.mjs",
"check:game-distribution-sandbox-e2e": "node scripts/check-game-distribution-sandbox-e2e.mjs",
"check:external-v1-scene-generation-smoke": "node scripts/check-external-v1-scene-generation-smoke.mjs",
"check:game-distribution-web-e2e": "node scripts/check-game-distribution-web-e2e.mjs",
@@ -0,0 +1,71 @@
// 真机 DirectProject 执行夹具的一键入口:真 AGC CLI → 真 app-server → loopback Responses
// fixtures,不需要账号、不花付费 Provider。
//
// 与 `apps/ai-game-creator-shell/scripts/direct-execution-production-fixture.mjs` 的区别:
// 那个夹具必须显式传 `--agc-exe`;这里默认用工作区里已构建的 debug 二进制,省掉每次手打路径。
//
// 用法:
// npm run check:agc-direct-execution-fixture # 默认跑全部用例
// npm run check:agc-direct-execution-fixture -- --cases restart # 透传夹具参数
// npm run check:agc-direct-execution-fixture -- --agc-exe <path> # 指定其它二进制
//
// 前置:先构建 debug 二进制(`cargo build --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml`)。
import { spawnSync } from 'node:child_process';
import { existsSync } from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const repoRoot = path.resolve(
path.dirname(fileURLToPath(import.meta.url)),
'..',
);
const fixture = path.join(
repoRoot,
'apps/ai-game-creator-shell/scripts/direct-execution-production-fixture.mjs',
);
const defaultExecutable = path.join(
repoRoot,
'apps/ai-game-creator-shell/src-tauri/target/debug',
process.platform === 'win32'
? 'genarrative-ai-game-creator-shell.exe'
: 'genarrative-ai-game-creator-shell',
);
const defaultCases = [
'completed',
'passes',
'mcp',
'mcp-write',
'native',
'native-resources',
'patch',
'deadline',
'native-session',
'restart',
'running',
].join(',');
const forwarded = process.argv.slice(2);
const hasExecutable = forwarded.some(
(value) => value === '--agc-exe' || value.startsWith('--agc-exe='),
);
const hasCases = forwarded.some(
(value) => value === '--cases' || value.startsWith('--cases='),
);
if (!hasExecutable && !existsSync(defaultExecutable)) {
console.error(
`未找到 debug 二进制:${defaultExecutable}\n` +
'请先执行 `cargo build --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml`,' +
'或用 `-- --agc-exe <path>` 指定一个已构建的 AGC 二进制。',
);
process.exit(2);
}
const args = [fixture, ...forwarded];
if (!hasExecutable) args.push('--agc-exe', defaultExecutable);
if (!hasCases) args.push('--cases', defaultCases);
const result = spawnSync(process.execPath, args, {
cwd: repoRoot,
stdio: 'inherit',
});
process.exit(result.status ?? 1);