diff --git a/.gitattributes b/.gitattributes index b24b4e88..8b4e5ed3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -90,3 +90,6 @@ docs/release-efficiency-1.23-evidence/** -text whitespace=blank-at-eol,blank-at- docs/release-efficiency-1.23-evidence/**/*.log binary docs/release-efficiency-1.23-evidence/**/*.tap binary docs/release-efficiency-release-identity.json -text whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol + +docs/existing-results-1.24-evidence/** -text whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol +docs/existing-results-*.json -text whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol diff --git a/CHANGELOG.md b/CHANGELOG.md index c89c849b..19a992e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Agent Workbench 更新记录 +## 1.24.0 · 已有成果续接与真实交付(开发验收中) + +- 当前已有文件可经完整读取和SHA核对纳入成果,保存Task/Run、原文件快照、任务要求与显式采用来源。 +- 文件或要求变化会标明失效;模型重复登记不算进展,跨项目/会话和未读完整范围均拒绝。 +- 文件成果、实际修改、工程检查、页面验收与Git分开;允许无新增修改的如实交付,明确修改要求仍需新改动。 +- 新增当前成果界面、results计划类别和手机只读观察,保存失败保留输入,原失败运行不改写。 +- 正式部署、发行与最终验收尚待完成。 + ## 1.23.0 · 发行效率与更新进度(已本地交付) - 运行包保留离线帮助、原研究报告及必要运行时,完整历史证据按原路径/SHA独立分发;源码仍完整。 diff --git a/docs/EXISTING-FILE-RESULTS.md b/docs/EXISTING-FILE-RESULTS.md new file mode 100644 index 00000000..86793141 --- /dev/null +++ b/docs/EXISTING-FILE-RESULTS.md @@ -0,0 +1,15 @@ +# 当前文件成果与无新增修改交付 + +1.24开发范围:把工程里已存在、满足当前任务的文本文件登记为成果,并继续后续工作。部署状态以QA-1.24和发行身份收据为准。 + +在「任务 → 当前文件成果」展开「核对已有文件」,选择项目文件,核对当前内容和SHA-256,填写它满足当前要求的原因。若来自本会话旧Task,显式选择原成果来源,再点击「核对并采用此文件」。源文件不变;原文件字节、采用原因、当前Task/Run、任务要求和旧来源保存为独立工件。 + +任务目标已满足时可以点击「按当前成果结束任务」。系统继续核对明确的修改要求、原工程检查、页面验收及执行计划。原失败运行保持原状态;任务结束不补造一次成功的模型运行。无新增修改时显示对应结果,不生成空提交,也不将用户原有未提交改动纳入本任务Git交付。 + +模型使用`verify_existing_files`前,须用本Task的`read_file`完整分页读取全部所选文件。SHA相同但只读了一段仍会拒绝。原调用ID、参数SHA、返回页和实际文件字节共同核对;同Task续接可沿用仍有效的读取,跨Task必须重新读取并显式选择来源。范围为当前项目、当前会话,单份最多8个1MB以内UTF-8文本文件。 + +文件或任务要求变化后,原凭据保持不变,当前核对显示失效。点击重新打开、核对当前文件,保留原采用原因并修订。相同文件和要求重复登记返回原凭据,不能制造新进展;同Task不能把自身凭据再次设为采用来源。每Task最多64份凭据,旧Task来源列表按当前文件限定。历史读取、当前成果、实际写入、测试、页面观察和Git提交各自保持真实来源。 + +复杂任务的计划可选「当前文件成果」类别,按文件范围引用原成果ID核验;「源码改动」仍要求本Task已应用的真实变更集。文字原因和文件SHA不能独立证明业务功能正确。明确修改、测试或页面行为要求仍需相应实际证据。 + +手机伴随页只显示当前Task/Run、文件SHA、原来源及当前/失效状态,不新增写文件、结束任务或访问宿主配置的权限。桌面390px与实际配对网关浏览器验收分别记录;它们不代替新iPhone实机验收。 diff --git a/docs/PLAN-1.24.md b/docs/PLAN-1.24.md index b2d71430..d867b2ff 100644 --- a/docs/PLAN-1.24.md +++ b/docs/PLAN-1.24.md @@ -1,6 +1,6 @@ # 1.24 计划:已有成果续接与真实交付 -状态:后续方案;先完成 1.23 独立发行验收、保留状态部署和回顾。这里的能力尚未实现,不能写入当前发行的完成清单。 +状态:1.23已交付,1.24开发及独立验收进行中。成果凭据、完成判定、计划类别、报告和界面已实现,发行及正式部署尚未验收;不能当作当前正式能力。见EXISTING-FILE-RESULTS.md,最终状态以QA-1.24和发行身份为准。 目标是让工作台能继续修改、核对和交付工程里已经存在的成果。用户说“继续”“看看刚才的文件”时,应保留原目标与明确限制,根据当前文件和所属证据判断下一步;无需为了满足内部变更门槛而重写相同文件。 diff --git a/findings.md b/findings.md index e2007cd5..3038c2bb 100644 --- a/findings.md +++ b/findings.md @@ -1,5 +1,17 @@ # 汇总发现 +## 1.24 当前成果核对:实现依据 + +开发相关C轮77/77通过(运行期间继续实现,作为开发回归,最终冻结需重新绑定验证)。新增网页D轮首个过期SHA恢复流程通过,随后工件预览断言发现成果JSON缺少自描述kind;已补file-result类别。原D失败截图、DOM和result原件保留。回顾同时补齐:明确点名文件必须覆盖、旧提案晚应用不能满足新修改要求、requirements深复制防旧凭据随contract引用被修改、纯解释/否定修改不算写入、历史来源原工件逐层核对。 + +独立旧版复现保存于.qa/existing-results-baseline-1793599104871/receipt.json:完整read_file后无改动、delivery_incomplete。当前已补独立file_result/原文件快照、原调用分页覆盖、当前需求SHA、跨Task显式采用、results计划类别、运行结束核对和用户手动核对接口。尚未完成UI及发行验收,不记作正式能力。 + +首轮17项中15通过、2失败均为新测试用错既有返回契约(propose_file返回引用而非change对象;步骤核验响应status=completed)。保留原失败,修正测试调用后重验;没有据此改产品状态或降低断言。错误路径artifact-store已按store import定位storage目录;PowerShell rg不接受未展开的通配路径,后续使用实际文件。 + +当前read_file保留整个文件SHA、行范围和字符分页;可用原调用resultArtifact核对实际返回内容,不能把只读取一页当作读完全文。完成分支仅接受本Task applied;原有propose_file相同内容返回unchanged,因而会误暂停。采用独立file_result记录与JSON工件,核对当前需求、文件原字节及原读取覆盖;跨Task须显式采用,不混入Git提交。 + +恢复后补记:根工作目录无AGENTS.md,仓库内存在并已读取;不得向历史.qa递归列举(本次rg输出过大已停止/结束),今后仅搜索精确文件或浅层目录。一次占位补丁未匹配,未改文件;改为按真实标题补丁。源码路径以rg结果为准,避免重复猜测。 + ## 1.22最终交付核对 1.22.0已完成所属Vite预览、独立桌面浏览区、有界DOM/原截图与审批动作、独立登录资料/撤销/下载、手机原观察SHA核对的本地交付。独立源码683/683(C完整原轮通过,D严格绑定后沿用)、33类250组原B串行界面(产品输入相同,严格绑定后沿用)、源码/便携/实际安装各17组浏览流程、同载荷安装7组、正式30页及Edge/Electron两视口通过。原PID36552/Provider保持,17项目/32全部会话/3239记录/6229事件及1780工件文件原字节保持,9229关闭。本轮验收发起真实模型请求0。 @@ -843,6 +855,8 @@ B独立管线已运行,受门控的推广等待独立源码/便携/同载荷 冻结期间复核了历史UI与随包专项的收据归属:all-ui将原结果复制到版本化docs指针,并保留各自日志/独立UUID目录;随后随包环境、原生参数、等待、协议、视觉、缓存、伴随及评测验证器写各自原目录,不覆盖这些主回归docs收据。最终封存仍逐一核对原结果/日志中的显式目录和截图SHA;没有仅凭最新全局指针推断历史结果。此项为静态归属审查,不增加模型或重跑已通过的验证。 # 当前现场:两条基本操作缺口 +1.24接续说明:下段为1.22历史现场。当前0dc0325干净起点,正式1.23已交付;runtime完成及task-plan changes只接受本Task已应用改动。新增成果凭据必须绑定当前文件、原读取工具/工件、任务要求与来源Task/Run,不能用模型文字绕过明确修改/检查要求。沿用中文React工作台,成果核对嵌入任务和文件流程。 + 正式服务实际 1.22.0,URL 的旧 release 参数不代表实际版本。网页的选择文件夹按钮被 desktop 条件隐藏;选中 pelican-bicycle.html 后只有源码且无预览入口。文件包含内联 SVG/JS 动画;现有任务浏览能力要求 Vite/桌面,不适用于直接打开普通 HTML。本次用已认证的本机一层目录浏览补网页选择;HTML 以独立 loopback 源、受限静态资源和 sandbox 渲染,不把项目脚本放进工作台 API 同源。 ## 1.23 开始前回顾 @@ -863,3 +877,10 @@ B独立管线已运行,受门控的推广等待独立源码/便携/同载荷 ### 1.23 最终正式交付与回顾 1.23.0已完成发行效率与真实更新进度的本地交付。运行包10902文件/651935923字节,完整历史证据独立分发,源码完整。703/703测试保留原B来源;C逐输入/日志SHA和22份构建绑定后续接全部剩余阶段通过,B原整轮失败不改写。完整安装11组归属B,C可执行/运行时字节严格绑定后实际重验三归档、便携及正式原安装器。正式网页5组与原生窗口回看通过;原PID36552/Provider、17项目/33全部会话/3239记录/6230事件/1780工件、每表每行/全部导出/工件原字节保持,9229关闭。真实配置模型请求0。正式原操作ddfe9b45e26d4ee34560d161a56bef7312797ee2efd9fa3c1d72935406374452,安装指针revision14,最终manifest 81a90b375bc21c589268c2c3d971165ebc2c146ab9954e3a897d37bdc3421349。原操作计时1017.119秒;外层含前后完整比较1028.473秒,二者不混作安装进程专属时间。证据223份/74383114字节按原SHA封存;私有快照仅哈希收据入Git。最终网页使用CUA实际验证,原生窗口从正式根启动器恢复并留在原文件;不重放已成功安装阶段。下一1.24只读预研确认当前完成分支要求本Task applied改动,计划先复现再增加当前文件采用凭据,尚未实现。 + + +### 1.24 开发切片审查与验收续接 + +I轮实际Edge/Electron各7组、手机真实配对TLS网关观察2组,共16组/8截图通过;不等同新iPhone实机或真实模型自主工程。H轮在12组之后发生隐藏Electron窄屏截图超时,原结果保留;验收改用现有桌面验收器一致的showInactive/setContentSize并等待实际innerWidth,未更改产品渲染规则。 + +审查补齐来源列表请求序号和按路径刷新,拒绝同Task自采用制造新凭据,并将原记录与核验视图的TypeScript类型分开。J轮相关76项75通过,唯一失败是新测试的活动运行夹具缺project字段,修正夹具、保留原失败;K轮最新专项21/21通过。原C77/77及I16组是开发来源,最终冻结另验。版本和源码/便携/全UI/引擎/升级验收白名单同步1.24,未升级正式服务、未读取Key、未发起真实模型请求。 diff --git a/package-lock.json b/package-lock.json index 61a97587..c4f1e7a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "local-agent-workbench", - "version": "1.23.0", + "version": "1.24.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "local-agent-workbench", - "version": "1.23.0", + "version": "1.24.0", "dependencies": { "@babel/parser": "7.29.11", "@peculiar/x509": "3.1.0", diff --git a/package.json b/package.json index b6f7165c..7941332d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "local-agent-workbench", - "version": "1.23.0", + "version": "1.24.0", "private": true, "type": "module", "description": "A local coding workbench with explicit tool execution, reviewable changes and recoverable sessions.", diff --git a/progress.md b/progress.md index 2e2c14df..e92b69b5 100644 --- a/progress.md +++ b/progress.md @@ -1,5 +1,15 @@ # 统一执行进度 +- UI D/E/F开发轮原失败保留:D原成果工件缺kind(已补);E窄屏需从实际“查看任务记录”入口打开(修正验收步骤);F迟到回执脚本在fulfill前unroute,已改为等待原handler终态后解除,不改产品审批/返回逻辑。F19项专项/任务控制通过,F网页已通过6组。一次补丁重复文件操作、一次import上下文不匹配均原子拒绝,已按实际import和单文件修改完成。 + +- 1.24切片B/C:新file_result记录绑定完整当前read_file页/原调用与原文件快照、任务要求及显式旧来源。已接入模型工具/有限上下文、results计划核验、完成判定、只读手机投影和无新增修改报告。17项专项/原任务控制相关回归第二轮17/17通过,首轮15/17原失败仍保留。界面实现待构建与真实流程验收,未部署正式。 + +- 1.24恢复核对:分支与三份计划修改一致,尚无产品实现;已确认read_file全文SHA/分页格式及相同内容提案unchanged,准备保存独立复现。无正式模型请求或用户任务执行。 + +## 1.24启动 + +接续0dc0325并创建feat/existing-results-1.24;正式1.23不动。已读PLAN-1.24及执行规范,采用planning-with-files、product-ui-ux、frontend-design。catchup脚本无额外输出。初次计划补丁因progress标题不匹配拒绝,已改真实标题;一次session-store路径猜测改为rg定位。继续独立复现与成果凭据设计,不将预研当实现。 + ## 1.22最终交付核对 本地发行提交751bbbd后,最终审计拒绝候选A的54份原日志未进入Git(89,748字节),原文件仍在磁盘且全部与A已封存清单SHA/长度一致;B/C/开发/最终发行原件均齐全。按清单精确补入这些原字节,原失败/清单不改写;无需重跑已通过产品检查。后续最终审计必须检查全部五份清单的Git blob,不能只核对本次新增证据目录。该收尾遗漏与1.22实际安装/正式验收通过分别记录。 @@ -1321,3 +1331,12 @@ C严格绑定续接整轮通过:仅.gitattributes与当前桌面验收器差 ### 1.23 最终正式交付与回顾 1.23.0已完成发行效率与真实更新进度的本地交付。运行包10902文件/651935923字节,完整历史证据独立分发,源码完整。703/703测试保留原B来源;C逐输入/日志SHA和22份构建绑定后续接全部剩余阶段通过,B原整轮失败不改写。完整安装11组归属B,C可执行/运行时字节严格绑定后实际重验三归档、便携及正式原安装器。正式网页5组与原生窗口回看通过;原PID36552/Provider、17项目/33全部会话/3239记录/6230事件/1780工件、每表每行/全部导出/工件原字节保持,9229关闭。真实配置模型请求0。正式原操作ddfe9b45e26d4ee34560d161a56bef7312797ee2efd9fa3c1d72935406374452,安装指针revision14,最终manifest 81a90b375bc21c589268c2c3d971165ebc2c146ab9954e3a897d37bdc3421349。原操作计时1017.119秒;外层含前后完整比较1028.473秒,二者不混作安装进程专属时间。证据223份/74383114字节按原SHA封存;私有快照仅哈希收据入Git。最终网页使用CUA实际验证,原生窗口从正式根启动器恢复并留在原文件;不重放已成功安装阶段。下一1.24只读预研确认当前完成分支要求本Task applied改动,计划先复现再增加当前文件采用凭据,尚未实现。 + + +### 1.24 开发切片审查与验收续接 + +I轮实际Edge/Electron各7组、手机真实配对TLS网关观察2组,共16组/8截图通过;不等同新iPhone实机或真实模型自主工程。H轮在12组之后发生隐藏Electron窄屏截图超时,原结果保留;验收改用现有桌面验收器一致的showInactive/setContentSize并等待实际innerWidth,未更改产品渲染规则。 + +审查补齐来源列表请求序号和按路径刷新,拒绝同Task自采用制造新凭据,并将原记录与核验视图的TypeScript类型分开。J轮相关76项75通过,唯一失败是新测试的活动运行夹具缺project字段,修正夹具、保留原失败;K轮最新专项21/21通过。原C77/77及I16组是开发来源,最终冻结另验。版本和源码/便携/全UI/引擎/升级验收白名单同步1.24,未升级正式服务、未读取Key、未发起真实模型请求。 + +构建K轮调用固定npm入口但未固定其子进程PATH,Vite实际使用旧Node16而失败;保留原日志。L轮显式将固定Node24目录置于本次进程PATH首位,完整构建通过。QA Python本轮实测3.12.10/pytest8.4.2,以实际身份为准,不沿用历史3.10数字。 diff --git a/scripts/qa-evidence.mjs b/scripts/qa-evidence.mjs index b15e6a82..3ac35b8c 100644 --- a/scripts/qa-evidence.mjs +++ b/scripts/qa-evidence.mjs @@ -18,6 +18,7 @@ const prefixes = Object.freeze({ '1.22.0': 'embedded-browser', '1.22.1': 'local-files', '1.23.0': 'release-efficiency', + '1.24.0': 'existing-results', }); export function releaseEvidencePrefix(version) { const prefix = prefixes[version]; diff --git a/scripts/upgrade-running.mjs b/scripts/upgrade-running.mjs index dd2889cb..2deb1113 100644 --- a/scripts/upgrade-running.mjs +++ b/scripts/upgrade-running.mjs @@ -64,7 +64,7 @@ export async function upgradeRunning({ url, pid, currentRoot, newRoot, handlerRo if (!fs.existsSync(originalScript) || !fs.existsSync(upgradeScript) || !fs.existsSync(path.join(next, 'dist-client', 'index.html'))) throw new Error('Upgrade bundles are incomplete.'); if (!Number.isInteger(pid) || pid < 1 || pid === process.pid) throw new Error('Invalid target process.'); const before = await readUpgradeJson(origin + '/api/bootstrap', 5000, 'Read original Workbench'); - if (!before.token || !['0.1.0', '1.0.0', '1.1.0', '1.2.0', '1.3.0', '1.4.0', '1.5.0', '1.5.1', '1.6.0', '1.6.1', '1.6.2', '1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.20.2', '1.20.3', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(before.version)) throw new Error('This migration accepts a supported existing Workbench.'); + if (!before.token || !['0.1.0', '1.0.0', '1.1.0', '1.2.0', '1.3.0', '1.4.0', '1.5.0', '1.5.1', '1.6.0', '1.6.1', '1.6.2', '1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.20.2', '1.20.3', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(before.version)) throw new Error('This migration accepts a supported existing Workbench.'); if (before.sessions.some(session => ['running', 'awaiting_approval', 'stopping'].includes(session.status))) throw new Error('Wait for existing tasks and approvals before upgrading.'); let protocol, socket, enabledHere = false, paused = false; const breakpoints = []; diff --git a/scripts/verify-all-ui.mjs b/scripts/verify-all-ui.mjs index 2332ea9d..70ef438f 100644 --- a/scripts/verify-all-ui.mjs +++ b/scripts/verify-all-ui.mjs @@ -9,35 +9,36 @@ import { randomUUID } from 'node:crypto'; if (process.argv.slice(2).some(value => value !== '--help')) throw new Error('Unsupported argument; use --help.'); if (process.argv.includes('--help')) { console.log('node scripts/verify-all-ui.mjs - run serial desktop/390px checks in independent local hosts; use explicit QA Python/Harness/Purge source paths for 1.15.'); process.exit(0); } const version = JSON.parse(fs.readFileSync('package.json', 'utf8')).version; -assert.ok(['1.6.0', '1.6.1', '1.6.2', '1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version), 'Review evidence paths when introducing the next release.'); +assert.ok(['1.6.0', '1.6.1', '1.6.2', '1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version), 'Review evidence paths when introducing the next release.'); const prefix = releaseEvidencePrefix(version), resultFile = `.qa/${prefix}-all-ui-validation.json`, results = []; const qaEnvironment = Object.fromEntries(['AGENT_WORKBENCH_TEST_PYTHON', 'AGENT_WORKBENCH_DEEPSEEK_ROOT', 'AGENT_WORKBENCH_PURGE_178_ROOT', 'AGENT_WORKBENCH_PURGE_181_ROOT'] .filter(name => process.env[name]).map(name => [name, process.env[name]])); for (const [name, value] of Object.entries(qaEnvironment)) assert.ok(path.isAbsolute(value) && fs.existsSync(value), 'Use an existing absolute QA runtime/source path: ' + name); const cases = [ - ...(version === '1.23.0' ? [['verify-release-efficiency-ui.mjs', null]] : []), - ...(['1.22.1', '1.23.0'].includes(version) ? [['verify-local-files.mjs', null]] : []), - ...(['1.22.0', '1.22.1', '1.23.0'].includes(version)?[['verify-embedded-browser.mjs',null]]:[]), - ...(['1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version)?[['verify-environment-ui.mjs',null],['verify-model-fidelity-ui.mjs',null],['verify-model-wait-ui.mjs',null],['verify-task-control-ui.mjs',null]]:[]), - ...(['1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version) ? [['verify-evaluations-ui.mjs', null]] : []), - ...(['1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version) ? [['verify-project-cache-ui.mjs', null]] : []), - ...(['1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version) ? [['verify-vision-ui.mjs', null]] : []), - ...(['1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version) ? [['verify-model-protocols-ui.mjs', null]] : []), - ...(['1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version) ? [['verify-companion-ui.mjs', null]] : []), - ...(['1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version) ? [['verify-controlled-ui.mjs', null], ['verify-purge-ui.mjs', null]] : []), - ...(['1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version) ? [['verify-workers-ui.mjs', null]] : []), - ...(['1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version) ? [['verify-task-plans-ui.mjs', `docs/${prefix}-task-ui-validation.json`]] : []), - ...(['1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version) ? [['verify-browser-ui.mjs', `docs/${prefix}-browser-ui-validation.json`]] : []), + ...(version === '1.24.0' ? [['verify-file-results-ui.mjs', null]] : []), + ...(['1.23.0', '1.24.0'].includes(version) ? [['verify-release-efficiency-ui.mjs', null]] : []), + ...(['1.22.1', '1.23.0', '1.24.0'].includes(version) ? [['verify-local-files.mjs', null]] : []), + ...(['1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version)?[['verify-embedded-browser.mjs',null]]:[]), + ...(['1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version)?[['verify-environment-ui.mjs',null],['verify-model-fidelity-ui.mjs',null],['verify-model-wait-ui.mjs',null],['verify-task-control-ui.mjs',null]]:[]), + ...(['1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version) ? [['verify-evaluations-ui.mjs', null]] : []), + ...(['1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version) ? [['verify-project-cache-ui.mjs', null]] : []), + ...(['1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version) ? [['verify-vision-ui.mjs', null]] : []), + ...(['1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version) ? [['verify-model-protocols-ui.mjs', null]] : []), + ...(['1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version) ? [['verify-companion-ui.mjs', null]] : []), + ...(['1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version) ? [['verify-controlled-ui.mjs', null], ['verify-purge-ui.mjs', null]] : []), + ...(['1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version) ? [['verify-workers-ui.mjs', null]] : []), + ...(['1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version) ? [['verify-task-plans-ui.mjs', `docs/${prefix}-task-ui-validation.json`]] : []), + ...(['1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version) ? [['verify-browser-ui.mjs', `docs/${prefix}-browser-ui-validation.json`]] : []), ['verify-ui.mjs', '.qa/ui-validation.json'], ['verify-diagnostics-ui.mjs', '.qa/diagnostics-ui-validation.json'], ['verify-execution-ui.mjs', '.qa/execution-ui-validation.json'], ['verify-delivery-ui.mjs', '.qa/delivery-ui-validation.json'], ['verify-index-ui.mjs', '.qa/index-ui-result.json'], ['verify-change-sets-ui.mjs', `docs/${prefix}-batch-ui-validation.json`], ['verify-context-ui.mjs', `.qa/${version === '1.6.0' ? 'workspaces-context' : prefix}-ui-validation.json`], ['verify-workspaces-ui.mjs', `docs/${prefix === 'workspaces' ? prefix : prefix + '-workspaces'}-ui-validation.json`], - ...(['1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version) ? [['verify-python-ui.mjs', `docs/${prefix}-python-ui-validation.json`]] : []), - ...(['1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version) ? [['verify-react-delivery.mjs', version === '1.7.0' ? 'docs/react-engine-delivery-validation.json' : `docs/${prefix}-react-delivery-validation.json`]] : []), - ...(['1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version) ? [['verify-research-ui.mjs', `docs/${prefix}-research-ui-validation.json`]] : []), - ...(['1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version) ? [['verify-engines-ui.mjs', version === '1.9.0' ? 'docs/engines-ui-validation.json' : `docs/${prefix}-engines-ui-validation.json`]] : []), - ...(['1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(version) ? ['model-center', 'project-memory', 'task-checkpoints', 'skills', 'mcp', 'mcp-recovery'].map(name => [`verify-${name}-ui.mjs`, null]) : []), + ...(['1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version) ? [['verify-python-ui.mjs', `docs/${prefix}-python-ui-validation.json`]] : []), + ...(['1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version) ? [['verify-react-delivery.mjs', version === '1.7.0' ? 'docs/react-engine-delivery-validation.json' : `docs/${prefix}-react-delivery-validation.json`]] : []), + ...(['1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version) ? [['verify-research-ui.mjs', `docs/${prefix}-research-ui-validation.json`]] : []), + ...(['1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version) ? [['verify-engines-ui.mjs', version === '1.9.0' ? 'docs/engines-ui-validation.json' : `docs/${prefix}-engines-ui-validation.json`]] : []), + ...(['1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(version) ? ['model-center', 'project-memory', 'task-checkpoints', 'skills', 'mcp', 'mcp-recovery'].map(name => [`verify-${name}-ui.mjs`, null]) : []), ]; fs.mkdirSync('.qa', { recursive: true }); const externalHost = new Set(['verify-ui.mjs', 'verify-diagnostics-ui.mjs', 'verify-execution-ui.mjs', 'verify-index-ui.mjs']); @@ -93,7 +94,7 @@ for (const [script, fixedProof] of cases) { } const evidence = JSON.parse(fs.readFileSync(proof, 'utf8')); assert.notEqual(evidence.success, false); assert.notEqual(evidence.passed, false); if (evidence.version) assert.equal(evidence.version, version); - const passed = [evidence.passed, evidence.cases, evidence.assertions, evidence.checks].find(Array.isArray); + const passed = [evidence.passed, evidence.cases, evidence.assertions, evidence.checks, evidence.results].find(Array.isArray); assert.ok(Array.isArray(passed) && passed.length > 0); const errors = evidence.pageErrors ?? [], failures = evidence.requestFailures ?? []; assert.equal(errors.length, 0); assert.equal(failures.length, 0); diff --git a/scripts/verify-controlled-release.mjs b/scripts/verify-controlled-release.mjs index 0f2529a0..ba887c98 100644 --- a/scripts/verify-controlled-release.mjs +++ b/scripts/verify-controlled-release.mjs @@ -22,7 +22,7 @@ export async function verifyControlledApi({ api, url, token, directory, appRoot, const origin = new URL(url); assert.equal(origin.hostname, '127.0.0.1'); assert.notEqual(origin.port, '4318'); const expectedVersion = JSON.parse(fs.readFileSync(path.join(appRoot, fs.existsSync(path.join(appRoot, 'MANIFEST.json')) ? 'MANIFEST.json' : 'package.json'), 'utf8')).version; - assert.ok(['1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.20.2', '1.20.3', '1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(expectedVersion)); + assert.ok(['1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.20.2', '1.20.3', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(expectedVersion)); const bootstrap = await api('/bootstrap'); assert.equal(bootstrap.version, expectedVersion); assert.equal(bootstrap.config.mode, 'demo'); assert.equal(bootstrap.config.hasKey, false); const root = path.join(directory, 'compiled-controlled-node'), hooks = path.join(directory, 'disabled-hooks'); diff --git a/scripts/verify-file-results-ui.mjs b/scripts/verify-file-results-ui.mjs new file mode 100644 index 00000000..3bdca558 --- /dev/null +++ b/scripts/verify-file-results-ui.mjs @@ -0,0 +1,166 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import http from 'node:http'; +import https from 'node:https'; +import assert from 'node:assert/strict'; +import { randomUUID, X509Certificate } from 'node:crypto'; +import { chromium, _electron, expect } from 'playwright/test'; +import { fixture, launchWorkbench } from '../tests/helpers.mjs'; +import { desktopExecutableIdentity } from '../src/core/desktop/app-installation.mjs'; +import { projectEnvironment } from '../src/core/process-environment.mjs'; +import { FileResults } from '../src/core/tasks/file-results.mjs'; +import { readText } from '../src/server/files.mjs'; + +if (process.argv.includes('--help')) { console.log('node scripts/verify-file-results-ui.mjs — isolated Edge/Electron existing-file receipts, changed bytes, explicit adoption, no-change delivery and late-response scope. Optional AGENT_WORKBENCH_QA_APP_ROOT. No model requests.'); process.exit(0); } +if (process.argv.length > 2) throw new Error('Use --help.'); +const appRoot = path.resolve(process.env.AGENT_WORKBENCH_QA_APP_ROOT || '.'), directory = path.resolve('.qa/file-results-ui-' + randomUUID()); fs.mkdirSync(directory, { recursive: true }); +const version = JSON.parse(fs.readFileSync(path.join(appRoot, 'package.json'), 'utf8')).version; +const checks = [], screenshots = [], errors = []; +const mark = name => { checks.push(name); console.log('PASS ' + name); }; +let stage = 'setup', result; +const shot = async (page, name) => { const file = path.join(directory, name + '.png'); await page.screenshot({ path: file, scale: 'css' }); screenshots.push(file); }; +const overflow = page => page.evaluate(() => ({ width: innerWidth, document: document.documentElement.scrollWidth })).then(value => assert.ok(value.document <= value.width + 1, JSON.stringify(value))); + +async function mobileFlow(browser, host, f, htmlPath) { + const initial = await host.api('/companion'); assert.ok(initial.addresses.length); + const address = initial.addresses[0].address, reservation = http.createServer(); await new Promise(resolve => reservation.listen(0, address, resolve)); + const port = reservation.address().port; await new Promise(resolve => reservation.close(resolve)); + const gateway = await host.api('/companion/start', { address, port }), target = new URL(gateway.origin); + const cert = await fetch(host.url + '/api/companion/certificate', { headers: { 'X-Workbench-Token': host.bootstrap.token } }); assert.equal(cert.status, 200); + const ca = new X509Certificate(Buffer.from(await cert.arrayBuffer())).toString(); assert.equal(new X509Certificate(ca).ca, true); + const pair = await host.api('/companion/pair', { projectIds: [f.project.id], permissions: { observe: true, approve: false, stop: false }, expiresInHours: 24 }); + let cookie = ''; + const relay = http.createServer((request, response) => { + const forwarded = https.request(new URL(request.url, target), { method: request.method, ca, servername: '', headers: { Host: target.host, Origin: target.origin, Connection: 'close', ...(cookie ? { Cookie: cookie } : {}), ...(request.headers['content-type'] ? { 'Content-Type': request.headers['content-type'] } : {}) } }, incoming => { + if (incoming.headers['set-cookie']?.length) cookie = incoming.headers['set-cookie'][0].split(';')[0]; + const headers = { ...incoming.headers }; delete headers['set-cookie']; response.writeHead(incoming.statusCode, headers); incoming.pipe(response); + }); + forwarded.on('error', () => { if (!response.headersSent) response.writeHead(503); response.end(); }); request.pipe(forwarded); + }); + await new Promise(resolve => relay.listen(0, '127.0.0.1', resolve)); + const context = await browser.newContext({ viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true }), mobile = await context.newPage(); + mobile.on('pageerror', error => errors.push('mobile: ' + error.message)); + try { + await mobile.goto('http://127.0.0.1:' + relay.address().port + '/#pair=' + new URLSearchParams(new URL(pair.url).hash.slice(1)).get('pair')); + await mobile.getByLabel('设备名称', { exact: true }).fill('当前成果观察夹具'); await mobile.getByRole('button', { name: '连接这台电脑', exact: true }).click(); + await mobile.locator('.mobile-task-row').filter({ hasText: f.session.title }).click(); + const panel = mobile.getByLabel('当前文件成果', { exact: true }); await expect(panel).toContainText('当前文件已核对'); + const row = (await host.api('/sessions/' + f.session.id + '/file-results')).results[0]; await expect(panel).toContainText(row.files[0].sha256); + await expect(panel).toContainText(row.taskId.slice(0, 8)); await expect(panel).toContainText(row.runId.slice(0, 8)); await overflow(mobile); await shot(mobile, 'mobile-current-results'); + await expect(mobile.getByRole('button', { name: '按当前成果结束任务', exact: true })).toHaveCount(0); + mark('mobile 390px: actual paired TLS gateway exposes current Task/Run and file SHA through observation only; no OS trust changes'); + fs.appendFileSync(htmlPath, '\n'); await mobile.reload(); + await expect(mobile.getByRole('heading', { name: '项目任务', exact: true })).toBeVisible(); + await mobile.locator('.mobile-task-row').filter({ hasText: f.session.title }).click(); + await expect(mobile.getByLabel('当前文件成果', { exact: true })).toContainText('文件或要求已变化'); await overflow(mobile); await shot(mobile, 'mobile-stale-results'); + mark('mobile 390px: authenticated refresh reports stale bytes and retains original SHA without granting file/finish permissions'); + } catch (error) { await shot(mobile, 'mobile-failure').catch(() => {}); fs.writeFileSync(path.join(directory, 'mobile-failure.html'), await mobile.content().catch(() => 'unavailable')); throw error; } + finally { await context.close(); relay.closeAllConnections(); await new Promise(resolve => relay.close(resolve)); await host.api('/companion/close', {}); } +} + +async function surface(kind) { + const disposers = [], t = { after: dispose => disposers.push(dispose) }, f = fixture(t); + const htmlPath = path.join(f.projectRoot, 'result.html'); + fs.writeFileSync(htmlPath, '已有成果

当前已有成果

用户保存的内容

\n'); + const begin = (session, goal, title, forceNewTask = false) => { + const run = f.store.beginRun(session, goal, false, f.store.config, { forceNewTask }); session.status = 'paused'; session.title = title; f.store.finishRun(session, run, 'delivery_incomplete'); return run; + }; + const goal = '创建 result.html 文件,已有内容满足时沿用,无需测试'; + const originalRun = begin(f.session, goal, '核对已有HTML'); + const sourceSession = f.store.createSession(f.project.id); + begin(sourceSession, goal, '显式采用旧成果'); + const source = new FileResults(f.store).record(sourceSession, { files: [{ path: 'result.html', sha256: readText(f.project, 'result.html').sha256 }], reason: '原任务已保存HTML成果,作为后续显式采用的来源。' }, { source: 'user' }); + begin(sourceSession, goal, '显式采用旧成果', true); + const blocked = f.store.createSession(f.project.id); begin(blocked, '修改 result.html 文件标题,无需测试', '修改要求不能绕过'); + f.store.close(); + const host = await launchWorkbench(t, f.data, {}, { appRoot }); + assert.notEqual(new URL(host.url).port, '4318'); assert.equal(host.bootstrap.config.hasKey, false); + assert.equal(host.bootstrap.version, version); + let browser, application, page; + try { + if (kind === 'edge') { browser = await chromium.launch({ channel: 'msedge', headless: true }); page = await browser.newPage({ viewport: { width: 1440, height: 1000 } }); await page.goto(host.url); } + else { + const executable = desktopExecutableIdentity(appRoot).path, packaged = executable.toLowerCase().endsWith('agentworkbench.exe'); + application = await _electron.launch({ executablePath: executable, args: [...(packaged ? [] : [path.join(appRoot, 'dist-desktop/main.cjs')]), '--app-root', appRoot, '--data-root', f.data, '--node', process.execPath, '--port', new URL(host.url).port, '--hidden-window'], cwd: appRoot, env: projectEnvironment(), timeout: 60000 }); + page = await application.firstWindow(); await (await application.browserWindow(page)).evaluate(window => { window.showInactive(); window.setContentSize(1440, 1000); }); + await expect.poll(() => page.evaluate(() => innerWidth)).toBe(1440); + } + page.on('pageerror', error => errors.push(kind + ': ' + error.message)); + await page.locator('.connection.connected').waitFor(); + const panel = () => page.getByLabel('当前文件成果', { exact: true }); + const select = async session => { + if (!await page.getByLabel('当前项目', { exact: true }).isVisible()) await page.getByRole('button', { name: '展开项目栏', exact: true }).click(); + await page.getByLabel('当前项目', { exact: true }).selectOption(f.project.id); + await page.locator('.session-list button').filter({ hasText: session.title }).click(); + await page.getByRole('button', { name: '查看任务记录', exact: true }).click(); await expect(panel()).toBeVisible(); + }; + const form = async () => { const details = panel().locator('.file-result-form'); if (!await details.evaluate(node => node.open)) await details.locator('summary').click(); }; + const choose = async () => { await form(); await panel().getByLabel('成果文件', { exact: true }).selectOption('result.html'); await expect(panel().getByLabel('成果文件内容')).toContainText('当前已有成果'); }; + const route = '/sessions/' + f.session.id; + stage = kind + ': stale-save recovery'; await select(f.session); await choose(); + const reason = '核对已有HTML的标题与完整内容,沿用用户已有成果。'; await panel().getByLabel('成果采用原因').fill(reason); + fs.appendFileSync(htmlPath, '\n'); + await panel().getByRole('button', { name: '核对并采用此文件', exact: true }).click(); + await expect(panel().getByRole('status')).toContainText('变化'); await expect(panel().getByLabel('成果采用原因')).toHaveValue(reason); + assert.equal((await host.api(route + '/file-results')).results.length, 0); + await panel().getByRole('button', { name: '重新读取当前文件', exact: true }).click(); await expect(panel().getByLabel('成果文件内容')).toContainText('保存前由用户修改'); + await panel().getByRole('button', { name: '核对并采用此文件', exact: true }).click(); + await expect(panel().locator('.file-result-row')).toHaveCount(1); await expect(panel()).toContainText('当前文件已核对'); + mark(kind + ': changed SHA refuses stale save, retains input, rereads actual bytes and records owned receipt'); await shot(page, kind + '-current-results'); + await panel().getByRole('button', { name: '查看原成果凭据', exact: true }).click(); + const modal = page.getByRole('dialog', { name: '执行结果工件', exact: true }); await expect(modal).toContainText('file-result'); await expect(modal).toContainText('SHA256'); await page.keyboard.press('Escape'); + await panel().getByRole('button', { name: '按当前成果结束任务', exact: true }).click(); + await expect(panel().getByRole('status')).toContainText('任务已按当前成果结束'); + const completed = await host.api(route); assert.equal(completed.status, 'completed'); assert.equal(completed.execution.task.delivery.status, 'existing_verified'); + assert.equal(completed.changes.length, 0); assert.equal(completed.execution.checks.length, 0); assert.equal(completed.execution.deliveries.length, 0); assert.equal(completed.execution.task.usage.requests, 0); + assert.deepEqual(completed.execution.run, originalRun); + mark(kind + ': current receipt ends no-test task, preserves old failed run and creates no file change/check/commit/model request'); + await page.reload(); await page.locator('.connection.connected').waitFor(); await select(f.session); await expect(panel()).toContainText('结束时采用已有成果'); + fs.appendFileSync(htmlPath, '\n'); await panel().getByRole('button', { name: '刷新成果状态', exact: true }).click(); await expect(panel()).toContainText('需要重新核对'); + await panel().getByRole('button', { name: '重新打开此文件核对', exact: true }).click(); await form(); await expect(panel().getByLabel('成果采用原因')).toHaveValue(reason); + await expect(panel().getByLabel('成果文件内容')).toContainText('交付后用户继续编辑'); + mark(kind + ': refresh retains receipt and later file edits produce specific stale recovery without discarding reason'); + stage = kind + ': narrow current results'; + if (application) await (await application.browserWindow(page)).evaluate(window => { window.showInactive(); window.setContentSize(390, 844); }); else await page.setViewportSize({ width: 390, height: 844 }); + await expect.poll(() => page.evaluate(() => innerWidth)).toBe(390); + await page.getByRole('button', { name: '查看任务记录', exact: true }).click(); await expect(panel()).toBeVisible(); await panel().scrollIntoViewIfNeeded(); await overflow(page); await shot(page, kind + '-390-results'); + mark(kind + ': 390px task entry displays readable paths/hashes and actions without page overflow'); + if (application) await (await application.browserWindow(page)).evaluate(window => window.setContentSize(1440, 1000)); else await page.setViewportSize({ width: 1440, height: 1000 }); + await expect.poll(() => page.evaluate(() => innerWidth)).toBe(1440); + stage = kind + ': explicit adoption'; await select(sourceSession); await choose(); await panel().getByLabel('成果采用原因').fill('按当前要求再次核对完整HTML,显式采用原任务成果。'); + await expect(panel().getByRole('button', { name: '核对并采用此文件', exact: true })).toBeDisabled(); + await panel().getByLabel('成果来源').selectOption(source.result_id); await panel().getByRole('button', { name: '核对并采用此文件', exact: true }).click(); + await expect(panel().locator('.file-result-row')).toHaveCount(1); await expect(panel()).toContainText('采用自 Task'); + const adopted = (await host.api('/sessions/' + sourceSession.id + '/file-results')).results[0]; assert.equal(adopted.files[0].origin.resultId, source.result_id); assert.notEqual(adopted.files[0].origin.sha256, adopted.files[0].sha256); + mark(kind + ': new task explicitly selects original source, preserving old/current SHA and Task/Run'); await shot(page, kind + '-adopted'); + stage = kind + ': change guard'; await select(blocked); await choose(); await panel().getByLabel('成果采用原因').fill('只核对现有文件,不能替代本次要求的标题修改。'); + await panel().getByRole('button', { name: '核对并采用此文件', exact: true }).click(); await expect(panel().locator('.file-result-row')).toHaveCount(1); + await panel().getByRole('button', { name: '按当前成果结束任务', exact: true }).click(); await expect(panel().getByRole('status')).toContainText('包含修改'); + assert.equal((await host.api('/sessions/' + blocked.id)).status, 'paused'); + mark(kind + ': unchanged adoption cannot satisfy explicit modification, error retains current task and form'); + stage = kind + ': late response'; await select(f.session); await choose(); + const delayedReason = '延迟回执仍须归属原任务,不能写入后来选择的任务。'; await panel().getByLabel('成果采用原因').fill(delayedReason); + let entered, release, finished, didEnter = false; const held = new Promise(resolve => { entered = resolve; }), released = new Promise(resolve => { release = resolve; }), responded = new Promise(resolve => { finished = resolve; }); + const routeErrors = []; + const matcher = '**/api/sessions/' + f.session.id + '/file-results'; + await page.route(matcher, async route => { + if (route.request().method() !== 'POST') return route.continue(); + try { const response = await route.fetch(); didEnter = true; entered(); await released; await route.fulfill({ response }); } + catch (error) { routeErrors.push(error.message); entered(); } + finally { finished(); } + }); + try { + await panel().getByRole('button', { name: '核对并采用此文件', exact: true }).click(); await held; + await select(blocked); release(); await responded; await page.unroute(matcher); assert.deepEqual(routeErrors, []); + await expect(panel()).not.toContainText(delayedReason); assert.equal((await host.api('/sessions/' + blocked.id)).status, 'paused'); + assert.equal((await host.api(route + '/file-results')).results[0].reason, delayedReason); + mark(kind + ': delayed successful save remains with original Task after UI selection changes'); + } finally { release(); if (didEnter) await responded; await page.unroute(matcher); } + if (kind === 'edge') { stage = 'mobile current files'; await mobileFlow(browser, host, f, htmlPath); } + assert.equal((await host.api('/bootstrap')).config.hasKey, false); + } catch (error) { if (page) { await shot(page, kind + '-failure').catch(() => {}); fs.writeFileSync(path.join(directory, kind + '-failure.html'), await page.content().catch(() => 'unavailable')); } throw error; } + finally { await browser?.close(); await application?.close(); for (const dispose of disposers.reverse()) await dispose(); } +} +try { await surface('edge'); await surface('electron'); assert.deepEqual(errors, []); result = { success: true, version, appRoot, directory, checks, screenshots, errors, realModelRequests: 0, scope: 'Actual isolated Edge and Electron UI; 390px is desktop narrow validation, not a new iPhone test.' }; } +catch (error) { result = { success: false, stage, version, appRoot, directory, checks, screenshots, errors, error: error.stack }; process.exitCode = 1; } +fs.writeFileSync(path.join(directory, 'result.json'), JSON.stringify(result, null, 2)); fs.writeFileSync('.qa/file-results-ui-latest.json', JSON.stringify(result, null, 2)); console.log('EVIDENCE ' + directory); console.log(JSON.stringify(result)); diff --git a/scripts/verify-release.mjs b/scripts/verify-release.mjs index b91fa828..935a1552 100644 --- a/scripts/verify-release.mjs +++ b/scripts/verify-release.mjs @@ -34,7 +34,7 @@ for (const name of Object.keys(env)) if (name.toLowerCase() === 'path') delete e const windowsRoot = process.env.SystemRoot || 'C:\\Windows'; env.PATH = [windowsRoot, path.join(windowsRoot, 'System32'), path.join(windowsRoot, 'System32', 'WindowsPowerShell', 'v1.0')].join(path.delimiter); let externalGit = null; -if (['1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(manifest.version)) { +if (['1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(manifest.version)) { // The controlled project requires external Git. Preserve its observed binary // directory while keeping system Node/npm unavailable to the packaged host. const binary = fs.realpathSync.native(execFileSync('where.exe', ['git.exe'], { env: gitEnvironment(), encoding: 'utf8', windowsHide: true, timeout: 10000 }).trim().split(/\r?\n/)[0]); @@ -88,7 +88,7 @@ try { console.log((await launch()).trim()); assert.equal(JSON.parse(fs.readFileSync(path.join(data, 'service-info.json'), 'utf8')).pid, firstInfo.pid); const example = bootstrap.projects.find(project => project.id === bootstrap.exampleProjectId); - if (['1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(manifest.version)) { + if (['1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(manifest.version)) { assert.equal(path.resolve(example.root).toLowerCase(), path.join(data, 'projects', 'starter-project').toLowerCase()); const compareTemplate = relative => { for (const entry of fs.readdirSync(path.join(appRoot, 'examples/starter-project', relative), { withFileTypes: true })) { const next = path.join(relative, entry.name); if (entry.isDirectory()) compareTemplate(next); @@ -114,7 +114,7 @@ try { 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'))); const actualRea = []; - if (['1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(manifest.version)) { + if (['1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(manifest.version)) { const installation = await api('/research/availability'); assert.equal(installation.status, 'available'); assert.equal(installation.version, '6.8.0'); assert.equal(fs.realpathSync.native(installation.packageRoot), fs.realpathSync.native(path.join(appRoot, 'runtime/node_modules/rea-agents'))); assert.equal(fs.realpathSync.native(installation.node.path), fs.realpathSync.native(path.join(appRoot, 'runtime/node.exe'))); @@ -146,7 +146,7 @@ try { console.log('PASS actual contained REA: ASAR, PE imports and PE resources; zero target execution/model requests'); } let actualEngine = null; - if (['1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(manifest.version) && process.argv.includes('--native-engines')) { + if (['1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(manifest.version) && process.argv.includes('--native-engines')) { const installation = await api('/engines/deepseek/availability'); assert.equal(installation.status, 'available', installation.message); assert.equal(fs.realpathSync.native(installation.node.path), fs.realpathSync.native(path.join(appRoot, 'runtime/node.exe'))); const engineRoot = path.join(data, 'engine-project'); fs.mkdirSync(engineRoot); fs.writeFileSync(path.join(engineRoot, 'README.md'), '# Owned portable engine connection\n'); @@ -166,8 +166,8 @@ try { assert.equal((await api('/research')).length, 4); const page = await fetch(url); assert.equal(page.status, 200); assert.match(await page.text(), /Agent Workbench/); - const actualBrowser = ['1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(manifest.version) ? await verifyBrowserApi({ api, url, token: bootstrap.token, directory: data, appRoot, contained: true }) : null; - const actualControlled = ['1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(manifest.version) ? await verifyControlledApi({ api, url, token: bootstrap.token, directory: data, appRoot, contained: true }) : null; + const actualBrowser = ['1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(manifest.version) ? await verifyBrowserApi({ api, url, token: bootstrap.token, directory: data, appRoot, contained: true }) : null; + const actualControlled = ['1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(manifest.version) ? await verifyControlledApi({ api, url, token: bootstrap.token, directory: data, appRoot, contained: true }) : null; console.log((await stop()).trim()); started = false; await until(async () => { try { await fetch(url + '/api/health'); return false; } catch { return true; } }); for (const file of manifest.files) { @@ -176,7 +176,7 @@ try { } const result = { success: true, date: new Date().toISOString(), appRoot, version: manifest.version, nodeVersion: manifest.nodeVersion, verifiedFiles: manifest.files.length, url, reusedPid: firstInfo.pid, checks: { jobId, status: checked.status, tests: checked.results[0].tests }, actualRea, actualEngine, actualBrowser, actualControlled, externalGit, - steps: ['manifest hashes', 'bundled Node launch', 'same-service reuse', 'packaged example and static page', ...(['1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.22.1', '1.23.0'].includes(manifest.version) ? ['starter project copied to owned user data; original template bytes matched'] : []), 'explicit command consent', 'actual bundled Node version', 'actual bundled npm check without system Node/npm', 'check log artifact', ...(actualRea.length ? ['contained REA installation and Node identity', 'actual ASAR/imports/resources', 'original Bundle and target hash binding', 'verified reuse without producer replay'] : []), 'report availability', 'graceful stop', 'every original packaged file remains unchanged'], realModel: false }; + steps: ['manifest hashes', 'bundled Node launch', 'same-service reuse', 'packaged example and static page', ...(['1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0'].includes(manifest.version) ? ['starter project copied to owned user data; original template bytes matched'] : []), 'explicit command consent', 'actual bundled Node version', 'actual bundled npm check without system Node/npm', 'check log artifact', ...(actualRea.length ? ['contained REA installation and Node identity', 'actual ASAR/imports/resources', 'original Bundle and target hash binding', 'verified reuse without producer replay'] : []), 'report availability', 'graceful stop', 'every original packaged file remains unchanged'], 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 {} } } diff --git a/scripts/verify-source-package.mjs b/scripts/verify-source-package.mjs index 138c7b10..fb56f45a 100644 --- a/scripts/verify-source-package.mjs +++ b/scripts/verify-source-package.mjs @@ -19,7 +19,7 @@ assert.ok(fs.existsSync(npmCli), 'Use Node with its bundled npm.'); const files = (root, relative = '') => fs.readdirSync(path.join(root, relative), { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name)) .flatMap(entry => entry.isDirectory() ? files(root, path.join(relative, entry.name)) : [path.join(relative, entry.name)]); const digest = file => createHash('sha256').update(fs.readFileSync(file)).digest('hex'); -const buildFolders = ['dist-client', 'dist-server', ...(['1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0'].includes(evidence.version) ? ['dist-desktop'] : [])]; +const buildFolders = ['dist-client', 'dist-server', ...(['1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version) ? ['dist-desktop'] : [])]; const expected = Object.fromEntries(buildFolders.flatMap(folder => files(path.join(workspace, folder)).map(relative => [path.join(folder, relative), digest(path.join(workspace, folder, relative))]))); const allowedEnv = /^(path|pathext|systemroot|systemdrive|windir|comspec|temp|tmp|userprofile|homedrive|homepath|home|appdata|localappdata|programfiles(?:\(x86\))?|commonprogramfiles(?:\(x86\))?|lang|lc_all|AGENT_WORKBENCH_TEST_PYTHON|AGENT_WORKBENCH_DEEPSEEK_ROOT|AGENT_WORKBENCH_PURGE_ROOT)$/i; const env = Object.fromEntries(Object.entries(process.env).filter(([key]) => allowedEnv.test(key))); @@ -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', ...(['1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0'].includes(evidence.version) ? ['mobile.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', ...(['1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version) ? ['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; @@ -83,7 +83,7 @@ try { assert.deepEqual(actualFiles.slice().sort(), Object.keys(expected).sort()); for (const [relative, sha256] of Object.entries(expected)) assert.equal(digest(path.join(sourceRoot, relative)), sha256, relative); let actualRea = null; - if (['1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0'].includes(evidence.version)) { + if (['1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version)) { stage = 'contained REA'; const reaOutput = await run(['scripts/verify-rea.mjs', '--app-root', sourceRoot, '--contained'], 'rea.log'); actualRea = JSON.parse(reaOutput.trim().split('\n').at(-1)); @@ -91,7 +91,7 @@ try { assert.ok(actualRea.results.every(item => item.rootExited === true)); } let actualEngine = null; - if (['1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0'].includes(evidence.version) && process.argv.includes('--native-engines')) { + if (['1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version) && process.argv.includes('--native-engines')) { stage = 'native DeepSeek SDK'; const output = await run(['scripts/verify-engines.mjs'], 'engines.log'); actualEngine = JSON.parse(output.trim().split('\n').at(-1)); @@ -99,7 +99,7 @@ try { assert.equal(actualEngine.modelRequests, 0); assert.equal(actualEngine.rootExited, true); assert.equal(actualEngine.nativeMethods.length, 6); } let actualBrowser = null; - if (['1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0'].includes(evidence.version)) { + if (['1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version)) { stage = 'contained browser runtime'; const output = await run(['scripts/verify-browser.mjs', '--app-root', sourceRoot, '--contained'], 'browser.log'); actualBrowser = JSON.parse(output.trim().split('\n').at(-1)); @@ -109,7 +109,7 @@ try { assert.equal(actualBrowser.modelRequests, 0); } let actualControlled = null; - if (['1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0'].includes(evidence.version)) { + if (['1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version)) { stage = 'compiled controlled-engine delivery'; const output = await run(['scripts/verify-controlled-release.mjs', '--app-root', sourceRoot], 'controlled-engine.log'); actualControlled = JSON.parse(output.trim().split('\n').at(-1)); @@ -117,7 +117,7 @@ try { assert.equal(actualControlled.realModelRequests, 0); assert.equal(actualControlled.cases, 4); assert.ok(actualControlled.fixtureModelRequests > 0); } let actualCompanion = null; - if (['1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0'].includes(evidence.version)) { + if (['1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version)) { 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(); @@ -128,7 +128,7 @@ try { assert.equal(actualCompanion.passed.length, 7); assert.deepEqual(actualCompanion.errors, []); assert.equal(actualCompanion.realModelRequests, 0); } let actualProtocols = null; - if (['1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0'].includes(evidence.version)) { + if (['1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version)) { stage = 'contained model protocols and mobile streams'; const output = await run(['scripts/verify-model-protocols-ui.mjs', '--app-root', sourceRoot], 'model-protocols-ui.log'); const location = [...output.matchAll(/^EVIDENCE (.+)\r?$/gm)].at(-1)?.[1]?.trim(); @@ -139,7 +139,7 @@ try { assert.equal(actualProtocols.passed.length, 5); assert.deepEqual(actualProtocols.pageErrors, []); assert.deepEqual(actualProtocols.requestFailures, []); } let actualVision = null; - if (['1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0'].includes(evidence.version)) { + if (['1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version)) { stage = 'contained screenshot inputs and exact Task budget resume'; const output = await run(['scripts/verify-vision-ui.mjs', '--app-root', sourceRoot], 'vision-ui.log'); const location = [...output.matchAll(/^EVIDENCE (.+)\r?$/gm)].at(-1)?.[1]?.trim(); @@ -150,7 +150,7 @@ try { assert.equal(actualVision.passed.length, 5); assert.deepEqual(actualVision.pageErrors, []); assert.equal(actualVision.realModelRequests, 0); } let actualProjectCache = null; - if (['1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0'].includes(evidence.version)) { + if (['1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version)) { stage = 'contained source-verified parsing cache controls'; const output = await run(['scripts/verify-project-cache-ui.mjs', '--app-root', sourceRoot], 'project-cache-ui.log'); const location = [...output.matchAll(/^EVIDENCE (.+)\r?$/gm)].at(-1)?.[1]?.trim(); @@ -161,7 +161,7 @@ try { assert.equal(actualProjectCache.realModelRequests, 0); assert.deepEqual(actualProjectCache.pageErrors, []); } let actualEnvironment = null, actualEnvironmentEngineering = null; - if (['1.21.0','1.22.0', '1.23.0'].includes(evidence.version)) { + if (['1.21.0','1.22.0', '1.23.0', '1.24.0'].includes(evidence.version)) { stage = 'contained environment approval, stop and recovery UI'; const output = await run(['scripts/verify-environment-ui.mjs', '--app-root', sourceRoot], 'environment-ui.log'); const summary = JSON.parse(output.trim().split(/\r?\n/).findLast(line => line.startsWith('{"success":'))); @@ -179,7 +179,7 @@ try { assert.equal(actualEnvironmentEngineering.pythonTests, 2); assert.equal(actualEnvironmentEngineering.realModelRequests, 0); } let actualEmbeddedBrowser = null; - if (['1.22.0', '1.23.0'].includes(evidence.version)) { + if (['1.22.0', '1.23.0', '1.24.0'].includes(evidence.version)) { stage = 'actual embedded Electron, Vite and original mobile observation'; await run(['scripts/verify-embedded-browser.mjs', '--app-root', sourceRoot], 'embedded-browser.log'); actualEmbeddedBrowser = JSON.parse(fs.readFileSync(path.join(sourceRoot, '.qa/embedded-browser-latest.json'), 'utf8')); @@ -189,7 +189,7 @@ try { assert.equal(actualEmbeddedBrowser.realModelRequests, 0); assert.deepEqual(actualEmbeddedBrowser.errors, []); } let actualReleaseEfficiency = null; - if (evidence.version === '1.23.0') { + if (['1.23.0', '1.24.0'].includes(evidence.version)) { stage = 'actual update status Edge/Electron and basic saved HTML flows'; const proofs = []; for (const script of ['verify-release-efficiency-ui.mjs', 'verify-local-files.mjs']) { @@ -202,6 +202,20 @@ try { } actualReleaseEfficiency = proofs; } + let actualFileResults = null; + if (evidence.version === '1.24.0') { + stage = 'current file results Edge, Electron and paired mobile observation'; + await run(['scripts/verify-file-results-ui.mjs'], 'file-results-ui.log'); + actualFileResults = JSON.parse(fs.readFileSync(path.join(sourceRoot, '.qa/file-results-ui-latest.json'), 'utf8')); + assert.equal(actualFileResults.success, true); assert.equal(actualFileResults.version, evidence.version); + assert.equal(fs.realpathSync.native(actualFileResults.appRoot), sourceRoot); assert.equal(actualFileResults.checks.length, 16); + assert.equal(actualFileResults.realModelRequests, 0); assert.deepEqual(actualFileResults.errors, []); + assert.equal(actualFileResults.screenshots.length, 8); + for (const screenshot of actualFileResults.screenshots) { + assert.ok(fs.realpathSync.native(screenshot).startsWith(path.join(sourceRoot, '.qa') + path.sep)); + assert.ok(fs.statSync(screenshot).size > 1000); + } + } // Only this file opens the fixed inspector port. Run it separately so another // test's child host can never compete for that port during the full suite. const testFiles = files(path.join(sourceRoot, 'tests')).filter(file => !file.includes(path.sep) && file.endsWith('.test.mjs')); @@ -229,14 +243,14 @@ try { for (const key of ['fail', 'cancelled', 'skipped', 'todo']) assert.equal(groupStats[key], 0); } let actualTaskControl = null; - if (['1.20.1', '1.21.0', '1.22.0', '1.23.0'].includes(evidence.version)) { + if (['1.20.1', '1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version)) { stage = 'task control desktop and 390px'; await run(['scripts/verify-task-control-ui.mjs', '--app-root', sourceRoot], 'task-control-ui.log'); actualTaskControl = JSON.parse(fs.readFileSync(path.join(sourceRoot, '.qa/task-control-ui-validation.json'), 'utf8')); assert.equal(actualTaskControl.success, true); assert.equal(actualTaskControl.passed.length, 5); assert.equal(actualTaskControl.realModelRequests, 0); } let actualDesktop = null; - if (['1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0'].includes(evidence.version)) { + if (['1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version)) { stage = 'actual contained Electron window'; await run(['scripts/verify-desktop-window.mjs'], 'desktop-window.log'); const window = JSON.parse(fs.readFileSync(path.join(sourceRoot, '.qa/desktop-window-latest.json'), 'utf8')); assert.equal(window.success, true); assert.equal(path.resolve(window.appRoot), sourceRoot); assert.equal(window.results.length, 7); @@ -250,7 +264,7 @@ try { actualDesktop = { window, ui, projects, scope: 'Independently rebuilt source and its shipped Electron binary; original window/engine/engineering assertions. Own credentials/HTTP fixtures; Windows native picker and complete host crash/stop have separate actual evidence.' }; } let actualProtocolEngineering = null; - if (['1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0'].includes(evidence.version)) { + if (['1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version)) { stage = 'Responses SSE actual Node React Python engineering'; await run(['scripts/verify-controlled-projects.mjs', '--responses'], 'responses-engineering.log'); const location = JSON.parse(fs.readFileSync(path.join(sourceRoot, '.qa/responses-engineering-location.json'), 'utf8')); @@ -260,7 +274,7 @@ try { assert.deepEqual(actualProtocolEngineering.results.map(value => value.parentCheck.results[0].tests.passed), [8, 9, 10]); } let actualVisionEngineering = null; - if (['1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0'].includes(evidence.version)) { + if (['1.18.0', '1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version)) { stage = 'screenshot Task Node React Python engineering'; await run(['scripts/verify-vision-projects.mjs'], 'vision-engineering.log'); const location = JSON.parse(fs.readFileSync(path.join(sourceRoot, '.qa/vision-engineering-location.json'), 'utf8')); @@ -270,7 +284,7 @@ try { assert.deepEqual(actualVisionEngineering.results.map(value => value.check.results[0].tests.passed), [8, 9, 10]); } let actualCacheEngineering = null; - if (['1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0'].includes(evidence.version)) { + if (['1.19.0', '1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version)) { stage = 'cached index original requests and Node React Python engineering'; await run(['scripts/verify-project-cache-projects.mjs'], 'project-cache-engineering.log'); const location = JSON.parse(fs.readFileSync(path.join(sourceRoot, '.qa/project-cache-engineering-location.json'), 'utf8')); @@ -280,7 +294,7 @@ try { assert.deepEqual(actualCacheEngineering.results.map(value => value.check.results[0].tests.passed), [8, 9, 10]); } let actualEvaluations = null, actualEvaluationEngineering = null; - if (['1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0'].includes(evidence.version)) { + if (['1.20.0', '1.20.1','1.21.0', '1.22.0', '1.23.0', '1.24.0'].includes(evidence.version)) { stage = 'compiled fixed engineering evaluations'; const output = await run(['scripts/verify-evaluations-release.mjs', '--app-root', sourceRoot], 'evaluations-release.log'); const location = [...output.matchAll(/^EVIDENCE (.+)\r?$/gm)].at(-1)?.[1]?.trim(); @@ -299,7 +313,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, testPlan, actualReleaseEfficiency, actualEmbeddedBrowser, actualEnvironment, actualEnvironmentEngineering, actualTaskControl, actualRea, actualEngine, actualBrowser, actualControlled, actualDesktop, actualCompanion, actualProtocols, actualProtocolEngineering, actualVision, actualVisionEngineering, actualProjectCache, actualCacheEngineering, actualEvaluations, actualEvaluationEngineering, 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, testPlan, actualFileResults, actualReleaseEfficiency, actualEmbeddedBrowser, actualEnvironment, actualEnvironmentEngineering, actualTaskControl, actualRea, actualEngine, actualBrowser, actualControlled, actualDesktop, actualCompanion, actualProtocols, actualProtocolEngineering, actualVision, actualVisionEngineering, actualProjectCache, actualCacheEngineering, actualEvaluations, actualEvaluationEngineering, 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/src/client/DeliveryPanel.tsx b/src/client/DeliveryPanel.tsx index a150cd9a..17ecc6eb 100644 --- a/src/client/DeliveryPanel.tsx +++ b/src/client/DeliveryPanel.tsx @@ -29,6 +29,7 @@ export function DeliveryPanel({ session, busy, onSession, onError, openArtifact const unresolved = jobs.some(job => job.requiresVerification); const pending = session.changes.some(change => ['pending', 'conflict'].includes(change.status)); const hasApplied = session.changes.some(change => change.taskId === task?.id && change.status === 'applied'); + const existingOnly = !hasApplied && !!session.execution?.fileResults?.length; const reports = session.execution?.artifacts.filter(artifact => artifact.kind === 'delivery-report-markdown') ?? []; const latestReport = reports.at(-1); const waitingPlan = (session.execution?.deliveryPlans ?? []).filter(plan => plan.taskId === task?.id @@ -105,7 +106,7 @@ export function DeliveryPanel({ session, busy, onSession, onError, openArtifact