diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d6cc572..edee7eb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,10 @@ # Agent Workbench 更新记录 -## 1.16.0 候选 · 手机伴随端(真实iPhone待验) +## 1.16.0 候选 · 手机伴随端(实机核心通过,最终发行待验) - 增加默认关闭的局域网HTTPS网关、Windows用户加密证书、两分钟单次配对和逐设备项目/观察/审批/停止授权;手机不接收管理令牌或模型凭据。 - 独立PWA围绕原Task/Run显示进展、差异、检查、预算、unknown和原报告;原seq补发只读恢复,结果SHA核对,撤销实际断开设备连接。离线缓存仅含页面壳。 -- 手机审批绑定原输入/当前修订,确认请求幂等,停止等待所属进程;未知回执在刷新后仍显示,原工具不重放。24项专项和7组本地宽窄屏流程通过,完整候选回归、iPhone证书/Safari/PWA和正式发行待验,见[QA-1.16](docs/QA-1.16.md)。 +- 手机审批绑定原输入/当前修订,确认请求幂等,停止等待所属进程;未知回执在刷新后仍显示,原工具不重放。当前源码519/519、24类186组UI及真实iPhone核心验收通过:用户确认信任/审批/摘要/主屏幕/锁屏切网/停止/撤销,宿主审计与进程/文件另行核对。iPhone 14 Pro Max/iOS 27.2为用户提供,无手机截图;最终独立源码、便携、安装和正式升级待验,见[QA-1.16](docs/QA-1.16.md)。 ## 1.15.0 · 2026-10-31 diff --git a/README.md b/README.md index 5fcc67c4..8965062d 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Agent Workbench 将 Claude Code 与 Cursor 的机制研究整合为独立的本地 AI 编程工作台,并内置模型池、项目记忆、Skills/MCP、REA 工件研究、受控DeepSeek Harness工程引擎、实际页面验收和有依赖的执行计划。工程索引、精确补丁、多文件整批审查、Node/Python实际检查、浏览器交互、本地Git提交及交付报告可以在同一个Task中完成。 +1.16.0手机伴随端候选已完成当前源码519项、24类186组UI及真实iPhone核心验收。iPhone可配对后查看同一任务、核对差异/报告、确认原审批并停止所属执行;已核对锁屏、断网恢复和设备撤销。设备iPhone 14 Pro Max/iOS 27.2为用户提供,原宿主审计和进程/文件单独验证;最终独立源码/完整发行与正式升级仍待完成。当前正式服务仍为1.15,具体证据见[QA-1.16](docs/QA-1.16.md)。 + 1.15.0已正式本地交付Windows桌面应用、本机可选加密连接、后台任务/窗口分离、单实例、所属项目入口、可回退安装与分页巡检。495/495独立源码、23类179组历史UI、真实窗口7/原生UI9/三工程16节点、父8/8、9/9、10/10、同载荷安装/重启/卸载7组(隔离测试登记,正式产品安装器另行stage)、正式18页、1446条工件记录和1357个去重文件核对通过;当前2连接配置/1池、17项目/29全部会话/2567记录/4599事件,正式纠正升级前后每行/全导出/全部工件原字节保持(相对初始16项目,用户启动新增1个示例并将原列表顺移;体验期间另新增1个空白idle会话及对应1事件,全部原28会话/记录/工件保持);旧PID23172已在恢复检查前退出,用户体验时手动启动1.14/PID36552,随后保留这个进程/Provider升级;旧内存Key不可恢复,需在界面重新填写,9229关闭。双击安装目录AgentWorkbench.exe使用原项目和连接配置;见[本地工作台](http://127.0.0.1:4318/?release=1.15.0)、[实际验收](docs/QA-1.15.md)、[桌面说明](docs/DESKTOP.md)与[发行身份](docs/desktop-host-release-identity.json)。 1.14.0已正式本地交付固定版本的受控引擎与工具/模型桥,原生prompt、审批、预算、原结果和停止进入所属Task/Run;独立工作区成果由父工程审查、检查及Git交付。Purge两版本来源锁定的提示实验默认关闭。三个真实功能工程13节点、23类178组UI、独立源码445/445及最终源码/便携验收通过;原PID、模型连接和全部历史保持,部署后14页复验通过。1.14的发行身份与具体结果见[QA-1.14](docs/QA-1.14.md)。真实模型推理收益按原选择独立待验。 diff --git a/docs/QA-1.16.md b/docs/QA-1.16.md index 99c0d79b..56885aaf 100644 --- a/docs/QA-1.16.md +++ b/docs/QA-1.16.md @@ -45,3 +45,7 @@ 新的原Task检查4/4通过,0失败/跳过,报告`da8fb865-64f3-4bbe-a3fb-6740ded44b6a`已生成;原npm失败不改写为成功。用户确认候选重启后原任务能打开,差异及报告均显示SHA-256核对;随后确认主屏幕、锁屏和断Wi-Fi恢复均正常。服务器复核Task/Run、原事件/消息/改动/审批完整SHA和原报告SHA保持,已完成命令仍只有一次。[原始手机与候选修复证据](companion-f-iphone-evidence/manifest.json)和[阶段结果](mobile-companion-real-iphone-validation.json)分别保存。 用户随后批准并停止专用原Task `1754088e-ffea-4b86-8cc6-a13b1412d975`,原Node子进程14596已退出;33行心跳在停止后和撤销后复核均不再增长。仅一次loopback合成模型请求,实际命令由原Runtime登记/启动一次,最终任务paused;合成用量不算真实模型消耗。撤销原设备后用户确认内容清空、提示重新连接,宿主核对设备revoked和审计完成。候选48024恢复demo/hasKey=false,正式36552/1.15.0保持。[恢复/停止/撤销15份原字节证据及最终复核](companion-f-iphone-recovery-evidence/manifest.json)封存。真实iPhone核心通过;最终独立源码、便携、同载荷安装和保留状态升级仍待完成,1.16尚未记完整交付。重新体验需生成新配对码,不能恢复旧cookie。 + +## 最终发行前预检 + +补齐独立源码输入中的根`mobile.html`,增加独立重建源码实际随包手机流程阶段。手机验收器支持显式发行目录,启动该目录自带Node/服务端,核对实际runtimeRoot及随包npm;默认工作区调用保持兼容。修正手机QA候选的7组真实Edge/TLS中继流程再次通过,24/24相关回归、构建及语法检查通过;属于验收器补强,不代表最终包已通过。原实机39份文件及Git索引SHA全部核对一致;三份已显式替换的启动器按original/current双份清单核对,其他原件保持。 diff --git a/progress.md b/progress.md index 195a705b..d0c68efc 100644 --- a/progress.md +++ b/progress.md @@ -1,5 +1,7 @@ # 统一执行进度 +1.16发行预检补强:verify-source-package把mobile.html纳入输入快照,新增独立源码的随包手机7组阶段;verify-companion-ui可显式指定appRoot并调用其中Node/服务端,实际runtimeRoot与随包npm核对,默认helper行为保持。新候选7组、相关24/24及build通过,未改变产品源码。39份实机原证据逐SHA与Git索引核对后提交73aa717;接下来冻结源码/构建并生成最终不可变发行。 + 实机封存后索引预检首轮错误假定所有原路径仍不变,拒绝已按记录更新的start启动脚本,未暂存或提交。原24份清单已明确同时保留三份original-launchers/current-launchers;预检改为只允许这三个原路径与各自current清单匹配,其他原件仍必须逐SHA一致;不修改历史封存字节。 2026-10-31 1.16真实手机核心验收收口:用户确认信任、原审批、差异/报告SHA、主屏幕、锁屏/切Wi-Fi恢复、运行中停止及撤销清空;设备iPhone 14 Pro Max/iOS 27.2由用户提供,未录制手机屏幕。宿主原审计、Task/Run和完整记录保持;node --version仅完成一次、exit0/v24.22.1,新4/4工程检查通过。真实停止14596进程并核对33行心跳不再增长,设备已撤销;本地合成模型仅1请求、真实模型0请求,候选恢复demo无Key。封存24份初验和15份恢复/停止/撤销原字节证据,最终独立源码/完整发行与正式升级仍待完成。旧QA候选漏npm失败保留;新候选添加1926个npm文件,原32文件不变,同数据目录受控重启保持全部原状态,正式36552/1.15未操作。 diff --git a/scripts/verify-companion-ui.mjs b/scripts/verify-companion-ui.mjs index 70adb407..8ec76918 100644 --- a/scripts/verify-companion-ui.mjs +++ b/scripts/verify-companion-ui.mjs @@ -2,19 +2,25 @@ import fs from 'node:fs'; import path from 'node:path'; import http from 'node:http'; import https from 'node:https'; -import { X509Certificate, randomUUID } from 'node:crypto'; +import { X509Certificate, randomUUID, createHash } from 'node:crypto'; import assert from 'node:assert/strict'; import { chromium, expect } from 'playwright/test'; import { fixture, launchWorkbench, until } from '../tests/helpers.mjs'; -if (process.argv.includes('--help')) { console.log('node scripts/verify-companion-ui.mjs - isolated desktop and mobile UI via a loopback QA relay that verifies the actual gateway CA; does not modify certificate trust or substitute for iPhone Safari acceptance.'); process.exit(0); } -if (process.argv.length > 2) throw new Error('Unsupported arguments.'); +if (process.argv.includes('--help')) { console.log('node scripts/verify-companion-ui.mjs [--app-root ] - isolated desktop/mobile UI; an explicit package runs its contained Node and actual server. Loopback relay verifies the gateway CA; does not modify OS trust or substitute for iPhone acceptance.'); process.exit(0); } +const args = process.argv.slice(2); +if (args.length && (args.length !== 2 || args[0] !== '--app-root' || !path.isAbsolute(args[1]))) throw new Error('Use --app-root with an absolute package directory, or no arguments.'); +const appRoot = fs.realpathSync.native(args.length ? args[1] : process.cwd()); +const nodePath = args.length ? path.join(appRoot, 'runtime', 'node.exe') : process.execPath; +assert.ok(fs.existsSync(nodePath)); +if (args.length) assert.ok(fs.existsSync(path.join(appRoot, 'runtime', 'node_modules', 'npm', 'bin', 'npm-cli.js')), 'The contained engineering runner requires bundled npm.'); const directory = path.resolve('.qa', 'companion-ui-' + randomUUID()); fs.mkdirSync(directory, { recursive: true }); const disposers = [], t = { after: action => disposers.push(action) }, f = fixture(t); fs.writeFileSync(path.join(f.projectRoot, 'package.json'), JSON.stringify({ name: 'owned-companion-ui', private: true, type: 'module', scripts: { test: 'node --test fixture.test.mjs' } })); fs.writeFileSync(path.join(f.projectRoot, 'fixture.test.mjs'), "import test from 'node:test';import assert from 'node:assert/strict';test('owned mobile fixture',()=>assert.equal(1+1,2));\n"); f.store.close(); -const host = await launchWorkbench(t, f.data, { Path: path.dirname(process.execPath) + path.delimiter + process.env.Path }); +const host = await launchWorkbench(t, f.data, { Path: path.dirname(nodePath) + path.delimiter + (process.env.Path || process.env.PATH || '') }, { appRoot, nodePath }); +assert.equal(fs.realpathSync.native(host.bootstrap.runtimeRoot), appRoot, 'The isolated host must actually serve the selected package.'); await host.api('/sessions/' + f.session.id + '/messages', { content: '手机伴随端验收:读取项目、准备原差异并等待手机审批。明确为本地离线夹具。' }); await until(async () => (await host.api('/sessions/' + f.session.id)).status === 'awaiting_approval'); const before = await host.api('/sessions/' + f.session.id), browser = await chromium.launch({ channel: 'msedge', headless: true }); @@ -114,7 +120,8 @@ try { assert.equal((await host.api('/sessions/' + f.session.id)).events.filter(item => item.tool === 'run_command').length, 1); mark('desktop revocation removes mobile project content immediately on the next read while preserving the original completed tool'); assert.deepEqual(errors, []); - const result = { success: true, passed, screenshots, errors, viewports: [1440, 390, 768], browser: 'Microsoft Edge via Playwright; owned loopback QA relay with actual CA verification', + const result = { success: true, version: host.bootstrap.version, appRoot, nodePath, nodeSha256: createHash('sha256').update(fs.readFileSync(nodePath)).digest('hex'), containedRuntime: args.length > 0, + passed, screenshots, errors, viewports: [1440, 390, 768], browser: 'Microsoft Edge via Playwright; owned loopback QA relay with actual CA verification', nativeSafariTrustCookiePWA: 'pending-real-iPhone', osTrustChanged: false, certificateWarningsBypassed: false, realModelRequests: 0, taskId: before.taskId, runId: before.runId }; fs.writeFileSync(path.join(directory, 'result.json'), JSON.stringify(result, null, 2)); } catch (error) { diff --git a/scripts/verify-source-package.mjs b/scripts/verify-source-package.mjs index ba8bc5ee..6f06804b 100644 --- a/scripts/verify-source-package.mjs +++ b/scripts/verify-source-package.mjs @@ -30,7 +30,7 @@ const directory = path.join(sourceRoot, '.qa', 'package-validation-' + randomUUI fs.mkdirSync(directory, { recursive: true }); const inputFolders = ['src', 'tests', 'scripts', ...['benchmarks', 'public', 'examples', 'research'].filter(folder => fs.existsSync(path.join(sourceRoot, folder)))]; const inputNames = [...inputFolders.flatMap(folder => files(path.join(sourceRoot, folder)).map(relative => path.join(folder, relative))), - 'package.json', 'package-lock.json', 'vite.config.ts', 'tsconfig.json', 'index.html', ...['.gitattributes', '.gitignore', 'Start-Desktop.cmd', 'Start-Workbench.cmd', 'Stop-Workbench.cmd'].filter(name => fs.existsSync(path.join(sourceRoot, name)))].sort(); + 'package.json', 'package-lock.json', 'vite.config.ts', 'tsconfig.json', 'index.html', ...(evidence.version === '1.16.0' ? ['mobile.html'] : []), ...['.gitattributes', '.gitignore', 'Start-Desktop.cmd', 'Start-Workbench.cmd', 'Stop-Workbench.cmd'].filter(name => fs.existsSync(path.join(sourceRoot, name)))].sort(); const snapshot = () => inputNames.map(relative => ({ path: relative.replaceAll('\\', '/'), bytes: fs.statSync(path.join(sourceRoot, relative)).size, sha256: digest(path.join(sourceRoot, relative)) })); const inputs = snapshot(); fs.writeFileSync(path.join(directory, 'inputs.json'), JSON.stringify(inputs, null, 2)); let stage = 'environment preflight', python = null; @@ -116,6 +116,17 @@ try { assert.equal(actualControlled.success, true); assert.equal(actualControlled.version, evidence.version); assert.equal(actualControlled.rootExited, true); assert.equal(actualControlled.realModelRequests, 0); assert.equal(actualControlled.cases, 4); assert.ok(actualControlled.fixtureModelRequests > 0); } + let actualCompanion = null; + if (evidence.version === '1.16.0') { + stage = 'contained companion gateway and UI'; + const output = await run(['scripts/verify-companion-ui.mjs', '--app-root', sourceRoot], 'companion-ui.log'); + const location = [...output.matchAll(/^EVIDENCE (.+)\r?$/gm)].at(-1)?.[1]?.trim(); + assert.ok(location && path.resolve(location).startsWith(path.join(sourceRoot, '.qa') + path.sep)); + actualCompanion = JSON.parse(fs.readFileSync(path.join(location, 'result.json'), 'utf8')); + assert.equal(actualCompanion.success, true); assert.equal(actualCompanion.version, evidence.version); + assert.equal(fs.realpathSync.native(actualCompanion.appRoot), sourceRoot); assert.equal(actualCompanion.containedRuntime, true); + assert.equal(actualCompanion.passed.length, 7); assert.deepEqual(actualCompanion.errors, []); assert.equal(actualCompanion.realModelRequests, 0); + } stage = 'tests'; const output = await run(['--test', '--test-concurrency=2', '--test-reporter=tap', ...files(path.join(sourceRoot, 'tests')).filter(file => !file.includes(path.sep) && file.endsWith('.test.mjs')).map(file => path.join('tests', file))], 'tests.tap'); const stats = Object.fromEntries([...output.matchAll(/^# (tests|pass|fail|cancelled|skipped|todo) (\d+)\s*$/gm)].map(match => [match[1], Number(match[2])])); @@ -136,7 +147,7 @@ try { } assert.deepEqual(snapshot(), inputs, 'Source package inputs changed during validation.'); const result = { success: true, version: evidence.version, testedAt: new Date().toISOString(), sourceRoot, directory, nodeVersion: process.version, python, offlineInstall: true, - inputs, inputFiles: inputs.length, logs, buildMatchedFiles: Object.keys(expected).length, buildFiles: Object.entries(expected).map(([path, sha256]) => ({ path: path.replaceAll('\\', '/'), sha256 })), tests: stats, actualRea, actualEngine, actualBrowser, actualControlled, actualDesktop, credentialsHandling: 'Only build/runtime environment paths are inherited; no configured model credentials are used. The controlled-engine stage supplies a declared owned local response fixture.' }; + inputs, inputFiles: inputs.length, logs, buildMatchedFiles: Object.keys(expected).length, buildFiles: Object.entries(expected).map(([path, sha256]) => ({ path: path.replaceAll('\\', '/'), sha256 })), tests: stats, actualRea, actualEngine, actualBrowser, actualControlled, actualDesktop, actualCompanion, credentialsHandling: 'Only build/runtime environment paths are inherited; no configured model credentials are used. The controlled-engine stage supplies a declared owned local response fixture.' }; save(result); console.log(JSON.stringify({ success: true, version: result.version, sourceRoot, directory, tests: stats, nodeVersion: process.version, python, inputFiles: inputs.length, buildMatchedFiles: result.buildMatchedFiles, rea: !!actualRea?.success, engine: !!actualEngine?.success, browser: !!actualBrowser?.success, controlled: !!actualControlled?.success })); } catch (error) { save({ success: false, version: evidence.version, testedAt: new Date().toISOString(), stage, error: error.message, sourceRoot, directory, nodeVersion: process.version, python, inputs, logs }); diff --git a/tests/helpers.mjs b/tests/helpers.mjs index be1aaac4..bb9bcd24 100644 --- a/tests/helpers.mjs +++ b/tests/helpers.mjs @@ -80,10 +80,10 @@ export function assertToolPairs(messages) { } } -export async function launchWorkbench(t, data, extraEnv = {}) { - const env = { ...process.env, AGENT_WORKBENCH_APP_DIR: workspace, AGENT_WORKBENCH_DATA_DIR: data, AGENT_WORKBENCH_PORT: '0', ...extraEnv }; +export async function launchWorkbench(t, data, extraEnv = {}, { appRoot = workspace, nodePath = process.execPath } = {}) { + const env = { ...process.env, AGENT_WORKBENCH_APP_DIR: appRoot, AGENT_WORKBENCH_DATA_DIR: data, AGENT_WORKBENCH_PORT: '0', ...extraEnv }; delete env.AGENT_WORKBENCH_API_KEY; - const child = spawn(process.execPath, [path.join(workspace, 'dist-server', 'server.mjs')], { cwd: workspace, env, windowsHide: true, stdio: ['ignore', 'pipe', 'pipe'] }); + const child = spawn(nodePath, [path.join(appRoot, 'dist-server', 'server.mjs')], { cwd: appRoot, env, windowsHide: true, stdio: ['ignore', 'pipe', 'pipe'] }); let output = '', errors = '', url = ''; child.stdout.on('data', bytes => { output += bytes.toString('utf8');