fix: distinguish reference inputs and validate installed result workflows
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
# 1.25 计划:任务要求与交付复核
|
||||
|
||||
状态:后续方案,尚未实现。先完成1.24独立发行、安装、正式状态保持与回顾,再按本计划实施。
|
||||
|
||||
1.24增加的是当前文件与来源的核对。文件SHA、采用原因和检查通过仍不能单独证明所有业务要求已满足。下一阶段把任务要求、实际成果及尚未验证事项联系起来,让用户知道“完成了哪些、依据是什么、哪里还需要体验”。
|
||||
|
||||
## A:保留真实失败与要求来源
|
||||
|
||||
使用独立工程复现多文件交付、用户中途追加要求、仅诊断、不测试及已有成果场景。保留原目标、原话、追加时间、Task/Run和失败。对1.24的保守文件名识别误判边界做样本审查,不把参考文件自动当输出文件,不把“解释怎么修改”当成执行指令。
|
||||
|
||||
## B:明确交付范围与验收约定
|
||||
|
||||
按所属修订记录交付文件、需要修改的范围、明确禁止操作、检查约定和待体验事项。自动提取只生成可审查草案;未确认或含糊的内容保留来源及未知状态,不静默把猜测固化为要求。普通任务继续使用现有入口,新增流程应减少重复输入。
|
||||
|
||||
## C:要求与证据对应
|
||||
|
||||
每项对应当前文件、实际改动、检查、页面观察或用户验收记录。证据绑定当前Task、要求修订和输入SHA;输入或要求变化后重新判断。模型“已完成”的文字作为答复保留,不能自动变成业务验收通过。不重跑原命令,不重写原失败,不把固定HTTP夹具结果当自主推理收益。
|
||||
|
||||
## D:交付与诊断闭环
|
||||
|
||||
在任务和交付报告中显示已验证、待验证、失败、按约定未执行及相应下一步。用户追问错误时,回答绑定原项目/Task/Run和原错误;诊断之后回到仍未完成的原目标。界面优先整合到现有任务、文件和报告路径,避免增加无用控制台。
|
||||
|
||||
## E:验收与交付
|
||||
|
||||
先做相关契约、HTTP、断线/切换/并发和旧记录兼容验证,再完成网页、实际Electron、项目选择、浏览文件、HTML预览/源码/保存刷新和失败恢复。手机只开放经验证的权限。完成独立源码、不可变发行、实际安装、保留状态正式升级、原证据封存、回顾和本地Git后才标已交付。
|
||||
|
||||
真实模型自主项目评测、其它引擎适配、语音和通用电脑操作仍按各自计划与预算验收;不为了扩大功能清单并入本阶段。
|
||||
@@ -0,0 +1,32 @@
|
||||
# 1.24 已有成果续接验收
|
||||
|
||||
状态:实现及开发专项完成,最终独立发行与正式部署进行中。当前正式运行版仍为1.23.0;最终结论须以本文件更新和发行身份收据为准。
|
||||
|
||||
## 实现与使用
|
||||
|
||||
见[当前文件成果说明](EXISTING-FILE-RESULTS.md)。当前文件可经完整读取、当前SHA和所属来源核对后采用;不生成文件改动、测试或空提交。明确修改、新追加要求、工程检查、页面验收和执行计划仍保留原门槛。
|
||||
|
||||
本地实现提交d5d9df8,升级管理器/验收路径修复de9723a。原1.23误暂停独立复现和全部开发尝试保留在本轮证据范围内,不续跑原用户任务。
|
||||
|
||||
## 开发来源
|
||||
|
||||
| 来源 | 结果与边界 |
|
||||
| --- | --- |
|
||||
| 旧版独立复现 | 已完整读取现成HTML,0改动,原版仍暂停delivery_incomplete;保留原失败 |
|
||||
| C轮相关回归 | 77/77,开发期间来源,不当作最终冻结整轮 |
|
||||
| J轮相关回归 | 75/76;唯一失败是新增活动运行测试夹具缺project字段,原失败保持 |
|
||||
| K轮最新专项 | 21/21,涵盖成果/API/真实宿主重启/当前修改要求/活动与任务切换 |
|
||||
| I轮真实界面 | Edge7、实际Electron7、真实配对TLS网关手机观察2,共16组/8截图;尚非最终冻结版 |
|
||||
| 构建 | K轮子进程误用旧Node16,L/M轮显式固定Node24.22.1后完整构建通过 |
|
||||
| 全UI A轮 | 成果16、进度7及基础文件9组实际通过,编排因root/directory结果字段差异失败;原整轮仍失败 |
|
||||
|
||||
## 最终验收待办
|
||||
|
||||
- 冻结后的完整界面、独立源码离线重建/全部测试及实际内置引擎。
|
||||
- 不可变三归档、便携运行、实际安装/升级/故障回退/重启/卸载,以及安装副本的成果/基础文件流程。
|
||||
- 原宿主、Provider、模型配置、全部项目/会话/记录/事件/工件原字节保持的正式升级;网页及原生回看、9229关闭。
|
||||
- 原日志、成功/失败分母、截图、源码/构建与发行身份封存,本地Git和阶段回顾。
|
||||
|
||||
## 验收范围
|
||||
|
||||
本轮使用独立数据、端口、自有工程和声明的本地HTTP/工具夹具,真实配置模型请求为0。桌面390px和配对网关浏览器观察不替代新iPhone实机验收。文件SHA和文字采用原因不证明业务需求全部正确,真实模型自主工程与Purge收益继续单独待验。
|
||||
@@ -1342,3 +1342,5 @@ I轮实际Edge/Electron各7组、手机真实配对TLS网关观察2组,共16
|
||||
构建K轮调用固定npm入口但未固定其子进程PATH,Vite实际使用旧Node16而失败;保留原日志。L轮显式将固定Node24目录置于本次进程PATH首位,完整构建通过。QA Python本轮实测3.12.10/pytest8.4.2,以实际身份为准,不沿用历史3.10数字。
|
||||
|
||||
全UI A轮新增成果16组、更新进度7组及基础文件9组实际通过;总编排在基础文件结果路径解析失败(原脚本返回root、编排只接受directory)。保留A原结果/原日志,补齐两种实际输出字段后继续,不把原整轮标为成功。热升级审查同时补齐新增FileResults管理器的重建,防未来升级沿用旧模块实例;构建M通过。
|
||||
|
||||
N轮21/21专项及完整构建通过,修复参考文件和禁止修改内容被误当输出路径。全UI B轮前10类84组通过,视觉前4/5组通过后停止场景被真实预算门槛正确暂停:新工具开销使必需输入12367超过12352可用tokens。停止场景与低预算场景职责不同,仅将停止夹具容量设为64000,原低预算拒绝/显式续接断言不改;保留B原失败、原统计和日志,重新执行完整C轮。完整安装验收器新增实际安装副本16组成果和9组基础文件路径,尚待运行。
|
||||
|
||||
@@ -24,7 +24,7 @@ const reserved = net.createServer(); await new Promise(resolve => reserved.liste
|
||||
const record = (name, detail = {}) => { results.push({ name, passed: true, ...detail }); console.log('PASS ' + name); };
|
||||
const until = async (action, timeout = 60000) => { const end = Date.now() + timeout; while (!await action()) { if (Date.now() > end) throw Error('Timeout: ' + stage); await new Promise(resolve => setTimeout(resolve, 100)); } };
|
||||
const run = promisify(execFile), env = projectEnvironment();
|
||||
let stage = 'prepare owned full releases', controller, application, ownedModel, report, heldRequest, releaseRequest, original;
|
||||
let stage = 'prepare owned full releases', controller, application, ownedModel, report, heldRequest, releaseRequest, original, installedUI = null;
|
||||
const launcher = path.resolve('.qa/native-launcher/AgentWorkbench.exe'); buildNativeLauncher(appRoot, launcher); const desktop = planDesktopBundle(appRoot);
|
||||
function payload(name) {
|
||||
const directory = path.join(root, name); fs.mkdirSync(directory);
|
||||
@@ -143,12 +143,30 @@ try {
|
||||
const beforeRestart = snapshotPersistentData(dataRoot); await controller.stop(); const restarted = (await controller.start()).identity;
|
||||
assert.notEqual(restarted.pid, original.pid); assert.deepEqual(snapshotPersistentData(dataRoot), beforeRestart);
|
||||
await controller.api('/model-center/probe', { method: 'POST', input: { id: connectionId } }); assert.equal(authenticated, 3); record(stage, { originalPid: original.pid, restartedPid: restarted.pid, authenticatedRequests: authenticated });
|
||||
if (version === '1.24.0') {
|
||||
stage = 'actual installed current results and saved HTML user paths';
|
||||
const pointer = JSON.parse(fs.readFileSync(path.join(installRoot, 'current.json')));
|
||||
const installedRoot = fs.realpathSync.native(path.join(installRoot, 'versions', pointer.active.directory)), proofs = [];
|
||||
for (const script of ['verify-file-results-ui.mjs', 'verify-local-files.mjs']) {
|
||||
const output = await run(process.execPath, [path.join(appRoot, 'scripts', script)], { cwd: appRoot,
|
||||
env: { ...env, AGENT_WORKBENCH_QA_APP_ROOT: installedRoot }, windowsHide: true, timeout: 180000, maxBuffer: 1024 * 1024 });
|
||||
const log = path.join(root, 'installed-' + script + '.log'); fs.writeFileSync(log, output.stdout + output.stderr);
|
||||
const summary = JSON.parse(output.stdout.trim().split(/\r?\n/).findLast(line => line.startsWith('{"success":')));
|
||||
const proofRoot = summary.directory ?? summary.root; assert.ok(proofRoot && path.resolve(proofRoot).startsWith(path.join(appRoot, '.qa') + path.sep));
|
||||
const proof = JSON.parse(fs.readFileSync(path.join(proofRoot, 'result.json'), 'utf8'));
|
||||
assert.equal(proof.success, true); assert.equal(proof.version, version); assert.equal(fs.realpathSync.native(proof.appRoot), installedRoot);
|
||||
assert.equal(proof.checks.length, script === 'verify-file-results-ui.mjs' ? 16 : 9); assert.deepEqual(proof.errors, []);
|
||||
assert.equal(proof.realModelRequests, 0); proofs.push({ script, proof, log, sha256: hash(fs.readFileSync(log)) });
|
||||
}
|
||||
installedUI = { success: true, version, installedRoot, packagedSource, proofs, realModelRequests: 0 };
|
||||
fs.writeFileSync('.qa/existing-results-installed-ui.json', JSON.stringify(installedUI, null, 2)); record(stage, installedUI);
|
||||
}
|
||||
stage = 'actual uninstall closes only the idle owned host and preserves user data';
|
||||
const uninstallSnapshot = snapshotPersistentData(dataRoot), uninstallLog = path.join(root, 'uninstall.log');
|
||||
await run(path.join(installRoot, 'unins000.exe'), ['/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART', '/LOG=' + uninstallLog], { windowsHide: true, timeout: 180000, env });
|
||||
assert.equal(observeWindowsProcess(restarted.pid), null); assert.deepEqual(snapshotPersistentData(dataRoot), uninstallSnapshot); assert.equal(fs.existsSync(path.join(installRoot, 'AgentWorkbench.exe')), false); assert.equal(fs.existsSync(path.join(installRoot, 'current.json')), false);
|
||||
record(stage, { log: uninstallLog, originalDataRoot: dataRoot, data: uninstallSnapshot });
|
||||
report = { success: true, version, root, installRoot, dataRoot, port, appId, packagedSource, results, realModelRequests: 0, scope: 'Actual isolated user-level Windows installers and shipped Electron/Node runtimes; own credentials and HTTP fixture only. QA appId, corruption, pointer-fault and crash fixtures explicitly recorded.' };
|
||||
report = { success: true, version, root, installRoot, dataRoot, port, appId, packagedSource, results, installedUI, realModelRequests: 0, scope: 'Actual isolated user-level Windows installers and shipped Electron/Node runtimes; own credentials and HTTP fixture only. QA appId, corruption, pointer-fault and crash fixtures explicitly recorded.' };
|
||||
} catch (error) { report = { success: false, version, root, installRoot, dataRoot, port, stage, error: error.stack, results, realModelRequests: 0 }; throw error; }
|
||||
finally {
|
||||
releaseRequest?.(); await application?.close().catch(() => {});
|
||||
|
||||
@@ -81,7 +81,9 @@ try{
|
||||
await expect(mobile.locator('.mobile-input-image')).toContainText('SHA-256 已核对');await mobile.locator('.mobile-input-image summary').click();await shot(mobile,'companion-image');await mobile.reload();await expect(mobile.locator('.mobile-task-row').first()).toBeVisible();await mobile.locator('.mobile-task-row').first().click();await expect(mobile.locator('.mobile-input-image')).toContainText('SHA-256 已核对');
|
||||
const device=(await host.api('/companion')).devices.find(row=>row.status==='active');await host.api('/companion/devices/'+device.id+'/revoke',{revision:device.revision});await mobile.getByRole('button',{name:'刷新任务',exact:true}).click();await expect(mobile.locator('.mobile-input-image')).toHaveCount(0);await expect(mobile.getByRole('button',{name:'连接这台电脑',exact:true})).toBeVisible();mark('paired TLS companion verifies same screenshot, refresh restores it and revoke clears project/image content');
|
||||
await host.api('/companion/close',{});gateway=null;
|
||||
await host.api('/config',{...(await host.api('/bootstrap')).config,contextLimit:16000,maxSteps:3});
|
||||
// This case measures cancellation, independently of the deliberate low-budget
|
||||
// case above. Leave room for the current shipped tool definitions and image.
|
||||
await host.api('/config',{...(await host.api('/bootstrap')).config,contextLimit:64000,maxSteps:3});
|
||||
const connection=(await host.api('/model-center')).connections.find(row=>row.id===visionId);await host.api('/model-center/connections',{...connection,streaming:true,capabilityDeclarations:{...connection.capabilityDeclarations,streaming:'supported'}});await host.api('/model-center/select',{type:'connection',id:visionId});mode='hold';
|
||||
await page.reload();await page.getByLabel('选择工程截图',{exact:true}).setInputFiles(imageFile);await expect(page.locator('.input-draft')).toContainText('SHA-256 已核对');await page.getByLabel('任务内容',{exact:true}).fill('截图流式停止验收');await page.getByRole('button',{name:'发送任务',exact:true}).click();await expect(page.getByLabel('模型输出片段',{exact:true}).last()).toContainText('截图正在核对');const stopping=await get();await page.getByRole('button',{name:'停止',exact:true}).click();await until(async()=>(await get()).status==='paused'&&closed===1,15000);session=await get();assert.equal(session.events.filter(row=>row.kind==='tool'&&row.runId===stopping.runId).length,0);await shot(page,'desktop-image-stopped');mark('stopping screenshot SSE closes original HTTP and dispatches zero partial tools');
|
||||
assert.deepEqual(errors,[]);fs.writeFileSync(path.join(directory,'result.json'),JSON.stringify({success:true,version:host.bootstrap.version,appRoot,containedRuntime:args.length>0,realModelRequests:0,passed,screenshots,requests:requests.map(value=>({route:value.route,sha256:sha(JSON.stringify(value.body)),imageCount:requestImages(value.body).length})),pageErrors:errors},null,2));
|
||||
|
||||
@@ -6,8 +6,11 @@ export function requestedFilePaths(text) {
|
||||
const action = /(?:创建|新建|保存|写入|修改|重写|修复|调整|替换)|\b(?:create|save|write|modify|rewrite|fix|change|replace)\b/i.exec(clause);
|
||||
if (!action || negatedFileAction(clause.slice(0, action.index))) continue;
|
||||
const suffix = clause.slice(action.index + action[0].length);
|
||||
if (/\b(?:from|using|based on)\b|(?:根据|参考)/i.test(suffix.split(/(?:[\w\u3400-\u9fff@.-]+\/)*[\w\u3400-\u9fff@-]+\.(?:html?|svg|txt|md|json|[cm]?[jt]sx?|css|py|ya?ml)\b/i)[0])) continue;
|
||||
for (const match of suffix.matchAll(/(?:[\w\u3400-\u9fff@.-]+\/)*[\w\u3400-\u9fff@-]+\.(?:html?|svg|txt|md|json|[cm]?[jt]sx?|css|py|ya?ml)\b/ig)) paths.push(match[0]);
|
||||
// Stop at a reference or prohibition instead of treating its input file as
|
||||
// another required output. Ambiguous wording stays outside this small gate.
|
||||
const boundary = /\b(?:from|using|based on)\b|(?:根据|参考|参照|不要|无需|不用|禁止|不得)/i.exec(suffix);
|
||||
const outputs = boundary ? suffix.slice(0, boundary.index) : suffix;
|
||||
for (const match of outputs.matchAll(/(?:[\w\u3400-\u9fff@.-]+\/)*[\w\u3400-\u9fff@-]+\.(?:html?|svg|txt|md|json|[cm]?[jt]sx?|css|py|ya?ml)\b/ig)) paths.push(match[0]);
|
||||
}
|
||||
return [...new Set(paths)];
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import { DeliveryReporter, renderDeliveryMarkdown } from '../src/core/delivery-r
|
||||
import { mobileSession } from '../src/core/companion/projection.mjs';
|
||||
import { readText, readLines, proposeFile, applyChange } from '../src/server/files.mjs';
|
||||
import { filePage } from '../src/core/context/read-budget.mjs';
|
||||
import { requestedFilePaths } from '../src/shared/contracts/file-intent.mjs';
|
||||
import { fixture, call, assertToolPairs } from './helpers.mjs';
|
||||
|
||||
const answer = content => ({ message: { role: 'assistant', content }, usage: { prompt_tokens: 11, completion_tokens: 3 } });
|
||||
@@ -36,6 +37,14 @@ function read(f, args) {
|
||||
}
|
||||
function input(f, extra = {}) { return { files: [{ path: 'README.md', sha256: readText(f.project, 'README.md').sha256, ...extra }], reason: '已按当前目标核对现有文件内容。' }; }
|
||||
|
||||
test('file targets exclude referenced inputs and prohibited subsequent modifications', () => {
|
||||
for (const goal of ['create result.html using template.html', '创建 result.html 参考 README.md', '创建 result.html 不要修改 README.md']) {
|
||||
assert.deepEqual(requestedFilePaths(goal), ['result.html']);
|
||||
}
|
||||
assert.deepEqual(requestedFilePaths('创建 result.html 和 style.css,参考 README.md'), ['result.html', 'style.css']);
|
||||
assert.deepEqual(requestedFilePaths('创建基于参考 README.md 的说明'), []);
|
||||
});
|
||||
|
||||
test('full actual read and existing receipt complete a no-test file task without fabricating changes, checks or commits', async t => {
|
||||
const f = harness(t, (round, f) => round === 0 ? calls(call('existing-read', 'read_file', { path: 'README.md' }))
|
||||
: round === 1 ? calls(call('existing-result', 'verify_existing_files', input(f, { read_call_ids: ['existing-read'] }))) : answer('已核对已有成果,无新增修改。'));
|
||||
|
||||
Reference in New Issue
Block a user