feat: continue reviewed tasks and add reproducible engineering delivery validation

This commit is contained in:
Agent Workbench Dev
2026-10-29 14:45:39 +08:00
parent 2ea34850c4
commit 6d3a4c6705
47 changed files with 619 additions and 60 deletions
+8
View File
@@ -46,6 +46,7 @@ const model = http.createServer(async (request, response) => {
let call;
if (mode === 'checks') call = !results.length ? ['inspect_project', {}] : results.length === 1 ? ['plan_checks', {}] : results.length === 2 ? ['run_checks', { plan_id: plan.id }] : null;
if (mode === 'budget') call = ['list_files', { path: '' }];
if (mode === 'proposal') call = !results.length ? ['propose_file', { path: 'src.mjs', content: 'export const add = (a, b) => a + b + 0;\n', reason: 'Verify reviewed task continuation' }] : null;
response.writeHead(200, { 'Content-Type': 'application/json' });
response.end(JSON.stringify({ choices: [{ message: { role: 'assistant', content: call ? '' : mode === 'answer' ? '依据已保存记录完成本次回应。' : '已记录实际工程检查和日志。', ...(call ? { tool_calls: [{ id: randomUUID(), type: 'function', function: { name: call[0], arguments: JSON.stringify(call[1]) } }] } : {}) }, finish_reason: call ? 'tool_calls' : 'stop' }], usage: mode === 'budget' ? { prompt_tokens: 1000, completion_tokens: 100 } : { prompt_tokens: 40, completion_tokens: 20 } }));
} catch (error) { response.writeHead(500, { 'Content-Type': 'application/json' }); response.end(JSON.stringify({ error: { message: error.message } })); }
@@ -118,6 +119,13 @@ try {
await expect(taskPanel()).toContainText('到达本次 token 预算'); await expect(taskPanel()).toContainText('1,000 tokens'); await screenshot('execution-budget-history');
mark('budget controls pause before tools and preserve the goal across recorded runs');
mode = 'proposal'; await newTask('应用后继续同一个工程任务'); await waitState('needs_review'); const reviewed = await state();
await page.locator('.inspector-tabs').getByRole('button', { name: /改动/ }).click(); await page.getByRole('button', { name: '应用这项改动', exact: true }).click();
await waitState('completed'); mode = 'checks'; await page.getByRole('button', { name: '继续检查与交付', exact: true }).click(); await waitState('awaiting_approval');
await page.getByRole('button', { name: '确认执行', exact: true }).click(); await waitState('completed');
const delivered = await state(); assert.equal(delivered.execution.task.id, reviewed.execution.task.id); assert.equal(delivered.execution.task.goal, '应用后继续同一个工程任务'); assert.equal(delivered.execution.checks.at(-1).status, 'passed');
mark('applied proposals continue the original task into actual engineering verification');
assert.deepEqual(errors, []); assert.deepEqual(requestFailures, []);
const result = { success: true, version: bootstrap.version, testedAt: new Date().toISOString(), browser: browser.version(), passed, pageErrors: errors, requestFailures, projectRoot, model: 'controlled local HTTP fixture' };
fs.writeFileSync('.qa/execution-ui-validation.json', JSON.stringify(result, null, 2)); console.log(JSON.stringify(result, null, 2));