test: verify real model multi-file repair and preserve the delivered sample

This commit is contained in:
Agent Workbench Dev
2026-10-29 15:31:38 +08:00
parent 04c93eafec
commit 3781591f97
16 changed files with 386 additions and 5 deletions
+1
View File
@@ -2,6 +2,7 @@
/dist-client/
/dist-server/
/dist/
/examples/delivery-report/dist/
/artifacts/
/.data/
/.local/
+5 -1
View File
@@ -14,7 +14,7 @@
| 源码ZIP独立安装、构建和回归 | 离线安装、6份构建文件逐字节匹配、68/68通过 | [m1-source-package-validation.json](m1-source-package-validation.json) |
| 两个ZIP的CRC、路径、清单与散列 | 全部通过 | [m1-archives-validation.json](m1-archives-validation.json) |
| 正式原进程升级 | 1.1.0、同PID/内存连接、3项目/9会话及历史hash保留 | [m1-upgrade-live-validation.json](m1-upgrade-live-validation.json) |
| 真实模型四模块交付 | 正在实际执行 | 后续记录 |
| 真实模型四模块交付 | 13项失败→四模块修复→14/14及构建通过,同Task/2Run/1次审查/81秒 | [m1-live-delivery-validation.json](m1-live-delivery-validation.json) |
26组界面流程的页面异常/请求失败均为0,覆盖桌面和390px。已目视核对任务、差异和手机日志弹窗:标题、hash、正文、关闭/分页及固定任务输入区均可用,无遮挡或横向溢出。新增继续按钮使用明确的可访问名称。
@@ -22,6 +22,10 @@
1.1.0实现Node/npm工程切片;三类工程完整M2验收、任务依赖图、外部引擎、REA执行和桌面/手机配对仍在后续阶段。真实模型样本的审查次数与用量单独报告。
真实模型gpt-6.1-sol完成normalize/summary/render/cli四模块,仅修改允许的源文件。封存14项测试、fixtures、构建脚本和package保留;9个保护输入hash以及已有owner修改和未跟踪文件核对通过。验收器核对并应用一次四文件提案,通过「继续检查与交付」进入原Task的第2轮;最终实际测试14/14和构建通过,构建CLI结果一致。仅四个源文件进入本地交付commit `b17492ca0fb9d6ea562290f3857b1c4c06bf6bf2`。
该样本的Git提交由验收器完成,尚不属于1.1.0界面内的Git能力;后续M2将其内置。验收器的脚本确认、提案审查/应用和Git提交均属于已记录的介入,不能把此结果称为完全无人参与交付。可运行成果见[Delivery Report示例](../examples/delivery-report/README.md)。
以下保留1.0.0基线验收。
验收日期:2026-10-29(Asia/Shanghai)。环境:Windows x64,Node.js 24.22.1,npm 11.19.1,Microsoft Edge 156.0.4314.42。自动化验证使用独立项目和数据目录,正式用户会话验证单独记录。
File diff suppressed because one or more lines are too long
+22
View File
@@ -0,0 +1,22 @@
# Delivery Report:已验证的四模块交付样本
本例由工作台内用户配置的gpt-6.1-sol完成。封存初始输入见[工程基准](../../benchmarks/node-delivery-v1/README.md):先取得13项真实测试失败,再产生四模块提案,审查应用后继续同一个Task,实际测试14/14通过并完成构建。验收文件与原工程的既有改动保留。
```powershell
npm test
npm run build
node dist/cli.mjs fixtures/tasks.json
node dist/cli.mjs fixtures/tasks.json --json
```
没有第三方依赖。Node24下默认输出:
```text
交付进度:2/4(50%)
待办 0 · 进行中 1 · 已完成 2 · 阻塞 1
剩余预计:50 分钟
```
CLI接受JSON任务数组;无效参数、JSON、数据或文件返回退出码2与中文错误。normalize/summary/render/cli分别负责输入校验、统计、中文渲染和命令行入口。14项测试覆盖输入边界、数据独立性、统计、输出、CLI参数与错误退出;build核对语法并生成dist。
这是一个受控Node样本,不能代表所有真实项目的完成率。实现来自实际配置模型;验收器负责限定脚本确认、提案审查与应用,最后保存源文件Git提交。详细结果见[真实模型验收](../../docs/m1-live-delivery-validation.json)。
@@ -0,0 +1 @@
{ "unfinished":
@@ -0,0 +1,6 @@
[
{ "id": " docs ", "title": " 编写交付文档 ", "status": "done", "minutes": 30 },
{ "id": "api", "title": "接口回归", "status": "doing", "minutes": 40 },
{ "id": "release", "title": "准备发行包", "status": "blocked", "minutes": 10 },
{ "id": "review", "title": "代码审查", "status": "done", "minutes": 20 }
]
+7
View File
@@ -0,0 +1,7 @@
{
"name": "delivery-report-lab",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": { "test": "node --test test/*.test.mjs", "build": "node scripts/build.mjs" }
}
@@ -0,0 +1,11 @@
import fs from 'node:fs';
import { spawnSync } from 'node:child_process';
const modules = ['normalize.mjs', 'summary.mjs', 'render.mjs', 'cli.mjs'];
for (const name of modules) {
const check = spawnSync(process.execPath, ['--check', 'src/' + name], { encoding: 'utf8', windowsHide: true });
if (check.status !== 0) { process.stderr.write(check.stderr); process.exit(1); }
}
fs.mkdirSync('dist', { recursive: true });
for (const name of modules) fs.copyFileSync('src/' + name, 'dist/' + name);
fs.writeFileSync('dist/package.json', '{"type":"module"}\n');
console.log('四个模块语法检查及可运行构建完成。');
+22
View File
@@ -0,0 +1,22 @@
import fs from 'node:fs';
import { normalizeTasks } from './normalize.mjs';
import { summarize } from './summary.mjs';
import { renderText } from './render.mjs';
try {
const args = process.argv.slice(2);
if (args.length < 1 || args.length > 2 || !args[0] || args[0].startsWith('-') ||
(args.length === 2 && args[1] !== '--json')) {
throw new TypeError('用法:node src/cli.mjs <JSON文件> [--json]');
}
const source = fs.readFileSync(args[0], 'utf8');
const tasks = normalizeTasks(JSON.parse(source));
const summary = summarize(tasks);
const output = args[1] === '--json' ? JSON.stringify(summary) : renderText(summary);
process.stdout.write(output + '\n');
process.exitCode = 0;
} catch (error) {
process.stderr.write(`输入错误:${error.message}\n`);
process.exitCode = 2;
}
@@ -0,0 +1,32 @@
const statuses = new Set(['todo', 'doing', 'done', 'blocked']);
export function normalizeTasks(input) {
if (!Array.isArray(input)) throw new TypeError('任务必须是数组');
if (input.length > 10000) throw new RangeError('任务数量不能超过10000项');
const ids = new Set();
const tasks = [];
for (const task of input) {
if (task === null || typeof task !== 'object' || Array.isArray(task)) {
throw new TypeError('每项任务必须是对象');
}
if (typeof task.id !== 'string' || typeof task.title !== 'string') {
throw new TypeError('任务id和title必须是字符串');
}
const id = task.id.trim();
const title = task.title.trim();
if (!id || !title) throw new TypeError('任务id和title不能为空');
if (ids.has(id)) throw new TypeError(`任务id重复:${id}`);
const { status, minutes } = task;
if (!statuses.has(status)) {
throw new TypeError('任务status必须是todo、doing、done或blocked');
}
if (!Number.isSafeInteger(minutes) || minutes < 0 || minutes > 1000000) {
throw new RangeError('任务minutes必须是0到1000000之间的安全整数');
}
ids.add(id);
tasks.push({ id, title, status, minutes });
}
return tasks;
}
+8
View File
@@ -0,0 +1,8 @@
export function renderText(summary) {
const { total, counts, completedPercent, remainingMinutes } = summary;
return [
`交付进度:${counts.done}/${total}(${completedPercent}%)`,
`待办 ${counts.todo} · 进行中 ${counts.doing} · 已完成 ${counts.done} · 阻塞 ${counts.blocked}`,
`剩余预计:${remainingMinutes} 分钟`,
].join('\n');
}
+16
View File
@@ -0,0 +1,16 @@
export function summarize(tasks) {
const counts = { todo: 0, doing: 0, done: 0, blocked: 0 };
let remainingMinutes = 0;
for (const task of tasks) {
counts[task.status] += 1;
if (task.status !== 'done') remainingMinutes += task.minutes;
}
const total = tasks.length;
return {
total,
counts,
completedPercent: total === 0 ? 0 : Math.round(counts.done / total * 100),
remainingMinutes,
};
}
@@ -0,0 +1,26 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import { spawnSync } from 'node:child_process';
import { normalizeTasks } from '../src/normalize.mjs';
import { summarize } from '../src/summary.mjs';
import { renderText } from '../src/render.mjs';
const input = () => JSON.parse(fs.readFileSync('fixtures/tasks.json', 'utf8'));
const record = overrides => ({ id: 'one', title: '任务', status: 'todo', minutes: 5, ...overrides });
const expected = { total: 4, counts: { todo: 0, doing: 1, done: 2, blocked: 1 }, completedPercent: 50, remainingMinutes: 50 };
const invoke = (...args) => spawnSync(process.execPath, ['src/cli.mjs', ...args], { encoding: 'utf8', windowsHide: true });
test('normalize trims identifiers and titles into independent records', () => { const original = input(), before = structuredClone(original), result = normalizeTasks(original); assert.equal(result[0].id, 'docs'); assert.equal(result[0].title, '编写交付文档'); assert.notEqual(result, original); assert.notEqual(result[1], original[1]); assert.deepEqual(original, before); });
test('normalize rejects blank and duplicate normalized identifiers', () => { assert.throws(() => normalizeTasks([record({ id: ' ' })])); assert.throws(() => normalizeTasks([record({ title: ' ' })])); assert.throws(() => normalizeTasks([record(), record({ id: ' one ' })])); });
test('normalize validates record shape and bounded collection size', () => { assert.throws(() => normalizeTasks({})); assert.throws(() => normalizeTasks([null])); assert.throws(() => normalizeTasks(Array.from({ length: 10001 }, (_, i) => record({ id: String(i) })))); });
test('normalize supports all four states and rejects unknown states', () => { for (const status of ['todo', 'doing', 'done', 'blocked']) assert.equal(normalizeTasks([record({ status })])[0].status, status); assert.throws(() => normalizeTasks([record({ status: 'completed' })])); });
test('normalize rejects noninteger and out-of-range estimates', () => { for (const minutes of ['5', null, -1, 0.5, NaN, Infinity, 1000001]) assert.throws(() => normalizeTasks([record({ minutes })])); assert.equal(normalizeTasks([record({ minutes: 0 })])[0].minutes, 0); assert.equal(normalizeTasks([record({ minutes: 1000000 })])[0].minutes, 1000000); });
test('normalize emits only the declared four-field contract', () => assert.deepEqual(normalizeTasks([record({ unrelated: true })])[0], record()));
test('summary reports complete state counts and excludes completed work from remaining time', () => assert.deepEqual(summarize(normalizeTasks(input())), expected));
test('summary rounds progress instead of truncating percentages', () => assert.equal(summarize([record({ status: 'done' }), record({ id: 'two', status: 'done' }), record({ id: 'three' })]).completedPercent, 67));
test('summary handles an empty plan with every state present', () => assert.deepEqual(summarize([]), { total: 0, counts: { todo: 0, doing: 0, done: 0, blocked: 0 }, completedPercent: 0, remainingMinutes: 0 }));
test('text rendering keeps the required three readable Chinese lines', () => assert.equal(renderText(expected), '交付进度:2/4(50%)\n待办 0 · 进行中 1 · 已完成 2 · 阻塞 1\n剩余预计:50 分钟'));
test('CLI JSON output matches the summary contract and has a trailing newline', () => { const result = invoke('fixtures/tasks.json', '--json'); assert.equal(result.status, 0); assert.equal(result.stderr, ''); assert.deepEqual(JSON.parse(result.stdout), expected); assert.ok(result.stdout.endsWith('\n')); });
test('CLI text output is readable and matches the shared rendering', () => { const result = invoke('fixtures/tasks.json'); assert.equal(result.status, 0); assert.equal(result.stdout, renderText(expected) + '\n'); assert.equal(result.stderr, ''); });
test('CLI missing arguments and unknown options return exit 2 without output', () => { for (const args of [[], ['fixtures/tasks.json', '--unknown'], ['fixtures/tasks.json', '--json', '--json']]) { const result = invoke(...args); assert.equal(result.status, 2); assert.equal(result.stdout, ''); assert.match(result.stderr, /^输入错误:/); } });
test('CLI invalid JSON and missing files preserve the failure exit code', () => { for (const file of ['fixtures/invalid.json', 'fixtures/not-found.json']) { const result = invoke(file); assert.equal(result.status, 2); assert.equal(result.stdout, ''); assert.match(result.stderr, /^输入错误:/); } });
+5
View File
@@ -111,3 +111,8 @@ Claude Code 报告已验证工具输入校验、权限决定、队列并发屏
- README首个更新补丁因把完整长行截成前半句而未匹配,未写文件;改为完整行后应用成功。
- 新任务UI前6组通过,最后一组定位“继续检查与交付”超时。真实DOM与Task/Run核对确认按钮已显示,accessible name包含辅助说明,导致精确名称不匹配。为操作补充明确aria-label后重新构建并复验,保留界面截图与失败记录。
- 最终68/68行为与10/9/7组界面全部通过,证据已复制到docs/m1-*.json。持续浏览器补充观察的组合cell超时并重置kernel,功能验收仍以已完成的独立脚本和截图为准;后续浏览器操作拆成短cell。
- 1.1.0便携/源码ZIP初次验证通过,源码独立构建6份文件完全一致、68项回归通过;真实原进程升级0.7秒成功,历史消息/工具/提案hash、状态、revision和连接保留。
- 真实gpt-6.1-sol四模块样本通过:81秒、11次请求、143721个已报告tokens、1Task/2Run/1次审查,13失败→14通过,build与dist CLI正确。服务未提供价格配置,未换算金额;模型效果与固定行为测试分别记录。
- M2 Git交付需新增sourceFingerprint:当前检查fingerprint包含HEAD/status,提交仅改变Git元数据也会导致旧指纹不同。源文件一致性与提交前Git准入基线需分开验证;提交只包含当前Task已应用的路径,已有暂存/工作区修改应保持。
- Git提交副作用要持久job身份、未知结果核对和不重放;新core kind在原进程热升级时也要补齐Map,不能因ensureStorage已初始化直接跳过。
- 新示例dist是构建产物,按具体路径加入ignore。首次补丁误用不存在的starter-project/node_modules行未写文件,已按实际/dist/锚点修正。
+2
View File
@@ -91,3 +91,5 @@
- 源码ZIP独立解压,离线安装、完整构建与68/68测试通过;6份客户端/服务端构建文件与本仓库逐字节相同。
- 4318已成功升级至1.1.0,仍是原PID23080,gpt-6.1-sol内存连接、3个项目、9个原会话及消息/工具/提案hash和revision保留;调试端口已关闭。
- 真实模型四模块交付验证已启动,只操作独立合成工程,不使用原用户项目作为实验输入。界面新版本链接已提交给当前Codex面板。
- 真实模型验收81秒完成:1Task/2Run/1次四文件审查,14项测试由1通过/13失败变为14通过;build和dist CLI结果一致,9个保护输入与原owner改动保留。交付源文件commit b17492ca,详细结果与可运行样本已保存。
- 继续M2首个内置Git交付切片:1.1.0的提交由验收器执行,产品需要Task绑定的审查计划/commit job/报告及未知结果核对。工作台原连接保持,开发仍在源码/独立QA进行。
+13 -4
View File
@@ -116,9 +116,9 @@
1. [complete] 核对当前执行/保存/API/UI契约、升级机制和测试,确定兼容迁移与验收。
2. [complete] 实现独立任务/运行契约、SQLite状态与追加事件、JSON迁移/备份、恢复和工具结果核对;10个实际退出切点通过。
3. [complete] Runtime、配置/预算、审批/工具身份、任务/运行/工件界面和SSE补发已接入;6组任务UI及手机弹窗目视验收通过。
4. [in_progress] 有界工程识别、npm检查计划/真实job和Git基线已实现并验证;正在建立真实模型跨文件工程交付样本。
5. [in_progress] 当前68项完整测试、基础10/诊断9/任务7组界面通过;便携与源码独立构建/68项回归已通过,正在真实模型工程交付。
6. [in_progress] 1.1.0已保留原进程与连接升级至4318;完整ZIP/清单通过,待补入真实工程记录并封存最终发行。
4. [complete] 有界工程识别、npm检查计划/真实job和Git基线已验证;真实模型四模块工程13失败→14通过、构建及源文件Git交付完成。
5. [complete] 68项完整测试、基础10/诊断9/任务7组界面、便携与源码独立构建/68项回归和真实模型样本通过。
6. [in_progress] 1.1.0已保留原进程与连接升级至4318;正在补入真实工程记录和样本,封存最终发行。
### 本轮执行边界与发现
@@ -139,6 +139,15 @@
- 保留已提交的2ea3485与已有未提交续作,接续审核后继续、日志工件读取、随附npm和封存工程样本。
- [complete] 完善“继续检查与交付”的Task归属、重复操作与请求失败行为,API并发/重启及7组任务界面已通过。
- [complete] 独立端口基础10/诊断9/任务7组回归通过,桌面与390px窄屏截图已目视核对。
- [in_progress] 真实模型验收器已启动,使用现有内存连接修复四模块工程,保护测试/fixtures/构建脚本,保存失败和通过日志。
- [complete] 真实模型四模块工程完成,保护测试/fixtures/构建脚本和既有改动;失败/通过日志、diff、2Run和commit已保存。
## M2首个内置Git交付切片
用户要求继续全量推进。在M1可运行版本与真实样本完成后,继续将审核后的源文件Git提交和确定性交付报告内置;三类工程、ChangeSet与完整M2验收仍另行推进。
1. [in_progress] 明确源文件校验与Git基线的区别,设计当前Task的提交计划、job、归属和恢复契约。
2. [pending] 实现只包含已应用任务路径的审核提交,保留无关工作区/暂存改动;过期、重叠与未知结果不得自动重放。
3. [pending] 保存实际commit/测试/源码hash和交付报告工件,接入任务面板与确认操作。
4. [pending] 实测Git边界、停止/重启、界面和真实模型完整闭环,按小步本地提交后发布后续版本。
- [in_progress] 验证1.1.0便携包及原进程保留连接升级,整理实际能力边界和本地Git提交。
- 恢复时父目录不是Git根目录;已定位到Agent-Workbench仓库。大批读取发生输出截断,后续按文件与关键段读取,不将未返回段落当已核对。