release: validate portable Node npm host and preserve live connection in 1.1.0 upgrade

This commit is contained in:
Agent Workbench Dev
2026-10-29 15:20:28 +08:00
parent 6d3a4c6705
commit 04c93eafec
12 changed files with 465 additions and 12 deletions
+9 -1
View File
@@ -72,13 +72,21 @@ try {
await until(async () => { current = await api('/sessions/' + session.id); return current.status === 'needs_review'; });
const command = current.events.find(event => event.tool === 'run_command');
assert.equal(command.phase, 'completed'); assert.match(command.output, new RegExp(manifest.nodeVersion.replaceAll('.', '\\.')));
for (const proposal of current.changes.filter(change => change.status === 'pending')) await api('/sessions/' + session.id + '/changes/' + proposal.id + '/reject', {});
const planned = await api('/sessions/' + session.id + '/check-plans', { names: ['test'] });
const plan = planned.execution.plans.at(-1); assert.ok(plan.checks.some(check => check.name === 'test'));
const accepted = await api('/sessions/' + session.id + '/check-jobs', { planId: plan.id }); const jobId = accepted.execution.checks.at(-1).id;
let checked; await until(async () => { checked = await api('/sessions/' + session.id + '/check-jobs/' + jobId); return !['queued', 'running'].includes(checked.status); });
assert.equal(checked.status, 'passed'); assert.equal(checked.results[0].tests.total, 4); assert.equal(checked.results[0].tests.passed, 4);
const checkLog = await api('/artifacts/' + checked.results[0].logArtifactId + '?session=' + session.id); assert.match(checkLog.content, /tests 4/);
assert.ok(fs.existsSync(path.join(appRoot, 'runtime/node_modules/npm/bin/npm-cli.js')));
assert.equal((await api('/research')).length, 4);
const page = await fetch(url); assert.equal(page.status, 200);
assert.match(await page.text(), /Agent Workbench/);
console.log((await stop()).trim()); started = false;
await until(async () => { try { await fetch(url + '/api/health'); return false; } catch { return true; } });
const result = { success: true, date: new Date().toISOString(), appRoot, version: manifest.version, nodeVersion: manifest.nodeVersion,
verifiedFiles: manifest.files.length, url, reusedPid: firstInfo.pid, steps: ['manifest hashes', 'bundled Node launch', 'same-service reuse', 'packaged example and static page', 'explicit command consent', 'actual bundled Node version', 'report availability', 'graceful stop'], realModel: false };
verifiedFiles: manifest.files.length, url, reusedPid: firstInfo.pid, checks: { jobId, status: checked.status, tests: checked.results[0].tests }, steps: ['manifest hashes', 'bundled Node launch', 'same-service reuse', 'packaged example and static page', 'explicit command consent', 'actual bundled Node version', 'actual bundled npm check without system Node/npm', 'check log artifact', 'report availability', 'graceful stop'], realModel: false };
fs.writeFileSync('.qa/release-validation.json', JSON.stringify(result, null, 2));
console.log(JSON.stringify(result, null, 2));
} finally { if (started) { try { await stop(); } catch {} } }