diff --git a/AGENTS.md b/AGENTS.md index 8aeb8982..96561b48 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,5 +1,7 @@ # Agent Workbench项目执行规范 +Q已实现所属连接DNS/TCP/TLS有界诊断,1.24.6准备独立发行。69相关、11宿主、14安装/旧版升级和补强4热升级回归通过,新UI9组/历史五类26组通过并回看截图;正式初始61项目77会话/6167记录/13115事件/outbox基线已保存,原PID36552/Provider和Key保持,原生窗口已关闭。诊断无凭据/HTTP/模型调用,只证明端点直连,不认证代理API路线或模型能力。按docs/QA-NETWORK-DIAGNOSTICS-Q.md完成不可变独立重建、安装、正式升级/全原状态、原生入口、封存后再新有界Node,不重跑旧失败。无子代理、不推送。 + P已完成新的jojocode5b4/Chat JSON独立实测:预检1请求/112报告tokens/0工具/strict matched;新Node首请求UND_ERR_CONNECT_TIMEOUT,0工具/修改/检查/交付,1未知预留10141,未重试切池或续跑旧Task。两轮12次无HTTP TLS握手11成功/1固定IPv6超时,仅证明观察波动,不是唯一根因或API稳定性证明。正式仍1.24.5/source676103c4/PID36552/原Provider,未改产品或重打包。原59公开项目75导出/3605工件/207原尝试及原行、预算/高性能池按声明核对保持;当前61项目77会话/6167记录/13115事件/outbox/3610工件,新增均归属P。目标连接3→4→5/凭据1,原缺省身份三字段显式恢复record/[]/空串规范化单列;全局/legacy展示修订61→65,9229关闭。75份/55891232字节证据离线通过,见docs/QA-LIVE-DELIVERY-P.md及回顾。下一先所属连接DNS/TCP/TLS诊断开发和独立验证,再新有界Node;不能为通过强制IPv4/关闭证书/扩大预算。真实Node、React/Python、原版Purge收益仍未验收,1.25和更新性能保持计划。不委派子代理、不重启正式进程、不提取/复制/重存Key,不推送。 O已本地交付:1.24.5/source676103c4/候选20261103133956264,重复goal和计划诊断回声定向修复,105相关/25升级安装、552输入独立重建22/22、三归档/便携、三载荷16K回放、源码25历史UI、12实际安装及16+9安装文件流程通过。正式保留PID36552/Provider,原58项目74会话与全部原行/导出/工件/模型中心在网页/原生回看后再次精确保持,9229关闭。新同预算Node2请求/4838报告tokens/1未知预留11095,第二上游502/Retry-After60,0修改/检查/交付,旧失败不续跑;原74导出/3596工件/205尝试与声明原状态恢复通过,凭据1、连接3→4→5。315份/140408882字节证据离线通过,本轮合计5请求/16227报告tokens/1未知,Purge收益未测试,见docs/QA-LIVE-CONTEXT-O.md及回顾。保持当前用户高性能池jojocode+93d,不恢复过期N池或启用旧09b。原旧Node metadata registry逆算未匹配的限制保持;新恢复不倒推旧结果。正式更新677958ms重复核验单列性能,下一先新预检/Node闭环,再React/Python/Purge,1.25仍计划。 diff --git a/CHANGELOG.md b/CHANGELOG.md index acd00329..3223165f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Agent Workbench 更新记录 +## 1.24.6 · 所属连接网络诊断(发行验收中) + +- 模型中心新增“连接诊断”,连接卡可直接进入;显示 DNS、TCP、TLS 耗时、地址族和证书结果。 +- 绑定原连接修订,最多约12秒,一次一项;可停止、刷新、重新打开并查看最近30条历史,重启中断不重放。 +- 无需模型Key,不发送HTTP或模型请求;代理存在时明确只检查端点直连,不更改模型选线、预算、健康或能力结论。 +- 诊断纳入宿主停止和升级活动控制,保留证书校验与现有运输参数,不强制IPv4。真实工程交付和Purge收益保持独立验收。 + ## 1.24.5 · 真实任务上下文去重(已本地交付) - 完整任务目标在系统请求视图只保留一次,原合同、追加要求、限制与验收条件仍完整保存。 diff --git a/docs/QA-NETWORK-DIAGNOSTICS-Q.md b/docs/QA-NETWORK-DIAGNOSTICS-Q.md new file mode 100644 index 00000000..10dda96f --- /dev/null +++ b/docs/QA-NETWORK-DIAGNOSTICS-Q.md @@ -0,0 +1,24 @@ +# Q:模型连接诊断与交付验收 + +本阶段接续 P 的连接超时实测,先让连接故障可以按阶段核对,再开展新的真实工程实验。原 P/O 失败与用量不改写,错误配置已由用户确认的历史不重新推断为 Claude 线路故障。 + +## 本次能力 + +模型中心提供“连接诊断”和连接卡直接入口。检查绑定连接 ID、原修订、端点和当时安全运输参数;冻结 DNS 地址,分别检查自动选择、固定 IPv4 和 IPv6 的 TCP/TLS,保留阶段耗时、错误码和证书校验结果。一次一项,约 12 秒总上限;显式停止等待所属套接字关闭,刷新和重新打开可查看原检查。历史最多 30 条,重启中的任务记中断,不重放。 + +不访问模型凭据,不发送 HTTP 或模型请求。检查端点直连路径;环境代理、NO_PROXY 或自定义运输存在时明确说明实际 API 路线尚未核验。CONNECT 本身属于 HTTP,本阶段不绕过此范围承诺。握手通过不改变模型健康、能力、选线、预算或模型尝试账本。不强制 IPv4,不关闭证书校验,不修改操作系统网络设置。 + +## 已完成验证 + +- 11 项核心专项和 69 项相关回归通过:DNS 失败/停顿、TCP 拒绝、受信任与未受信任证书、TLS 停顿、取消与关闭、双栈回退、代理范围、修订、历史、中断、API 权限与活动控制。 +- 11 项宿主相关、14 项安装/启动/旧版升级通过;补强后的 4 项热升级回归通过,空闲诊断管理器保留、原型更新和失败恢复有断言。 +- TypeScript/Vite/移动与服务/桌面构建通过。新界面 9 组桌面/390px 流程通过,已查看实际截图;5 类历史模型界面共 26 组通过。 +- 正式初始只读基线为 1.24.5 / PID36552,61 项目、77 会话、6167 记录、13115 事件及 outbox。全部原表行、导出和工件 SHA 已记录,未读取 Key 值。原生窗口回看后关闭,原宿主保持。 + +首 npm 构建因子进程使用系统 Node16 失败,修正本轮 PATH 后通过;不改用户全局 Node。首 UI patch 上下文拒绝,未部分应用。截图回查发现验收器可能读到上一修订“通过”,已改为等待新修订和活动结束,原结果保持。首次原生未前置窗口的遮挡截图不算正式工作台目视证据。 + +## 发行状态 + +1.24.6 进入不可变候选的独立源码重建、归档、便携和实际安装验收。正式升级、升级后全原状态核对、实际入口回看与封存以随后收据为准,未完成项目不提前记通过。 + +本阶段配置模型请求为 0。新 Node 完整交付、React/Python 及原版 Purge 收益仍按后续独立预算验收。 diff --git a/docs/RETROSPECTIVE-NETWORK-Q.md b/docs/RETROSPECTIVE-NETWORK-Q.md new file mode 100644 index 00000000..b1e3a46e --- /dev/null +++ b/docs/RETROSPECTIVE-NETWORK-Q.md @@ -0,0 +1,15 @@ +# Q 回顾与后续顺序 + +P 的单次连接超时不能仅凭若干 TLS 成功或一个 IPv6 失败判定唯一根因。Q 将 DNS、TCP、TLS 的可核对结果接到所属连接,保留失败阶段与原修订;API、协议、Key、型号及工程能力继续分别判断。 + +开发验收已通过核心、相关模型/宿主/升级回归,以及新界面和五类旧界面。回查截图修正了验收器等待旧结果的竞态,避免“测试通过但没有核对当前结果”。正式基线、不可变构建身份、安装与最终全原状态收据需要完整绑定后才交付。 + +后续按以下顺序执行: + +1. 完成 Q 发行、正式原 PID/Provider 升级、原状态复核、网页/原生入口和离线证据核验,本地 Git 收尾。 +2. 明确选择已启用连接,先运行所属诊断;代理存在时直连结果只作为范围有限的观察。另建单次有界身份预检,保留请求/返回与用量,不续跑 P/O 旧任务。 +3. 新 Node 工程保持原九测试与 16K/2048 配置、最多 8 请求/90000 tokens;检查完整修改、测试、审查和 Git 闭环。失败保留,未知用量不补造,不自动增加预算或切池。 +4. Node 通过再分别做 React/Python,最后执行原版 Purge 的独立 AB/BA。原版已加载与是否带来收益分别判定,停止或失败不记作节省。 +5. 1.25 的其余能力和完整目录重复核验性能保持计划。先量化更新耗时,不以取消完整性或防篡改校验换取快。 + +本阶段不发送配置模型请求;不更改用户当前高性能池或重新启用旧连接,不提取、复制、重存 Key,不推送远端。 diff --git a/findings.md b/findings.md index 8a7f7865..aa688040 100644 --- a/findings.md +++ b/findings.md @@ -1,5 +1,13 @@ # 汇总发现 +## Q:所属连接诊断的实现边界 + +已比较卡片内展开与独立诊断分类两种结构:卡片内嵌会把DNS/多路径/历史挤入每条连接,选择沿用模型中心分类页,连接条目提供直达按钮;主区域展示所选连接的DNS和三种地址族路径,旁边保留近期历史,窄屏顺序折叠。界面不增加全屏仪表盘。核心实现记录有界元数据,获取历史不创建新元数据;停止等待所属socket真正关闭,宿主停止/升级门禁包含活动诊断,重启仅标记中断而不重放。 + +当前ModelTransport使用undici7.30.1与autoSelectFamily/250ms,连接超时10000ms;配置环境代理时使用EnvHttpProxyAgent。P独立tls.connect默认模式并不经过HTTP代理,不能把它等同实际代理路线。诊断必须绑定所选连接和运输快照,零HTTP/Key,代理配置存在时准确说明实际API代理路线尚未通过此握手核验。 + +本轮UI保留现有模型中心与中文工作流:连接条目为入口,选中一条展开阶段记录和取消操作,不另建全屏仪表盘。开始→运行→完成/失败/取消→刷新/关闭后重开可回看;结果不修改模型能力或用户默认号池。具体阶段/持久性与宿主活动契约待源码核对。 + ## P:新的固定连接与验收范围 两轮只读DNS/TLS12次握手,11成功/1固定IPv6超时,证书校验始终启用、0HTTP/0模型;默认地址族选择四次均通过,不能据此认定原超时唯一原因或API稳定。最终核对原59公开项目/75导出/3605工件/207原尝试和声明原行保持,当前61项目77会话/6167记录/13115事件与outbox/3610工件。首最终核对误比legacy展示修订61→65,原驱动/日志和冻结快照保留,按全局configRevision精确声明后只读核对通过。75份/55891232字节P材料封存,manifest c2ea37b5c3e34ae76e0e9283c937eb0d4082aaceedae06ecab355c8c6eb5d0aa;独立离线原字节/身份/预算/用量/恢复/Git基线核验通过。无产品源码变化,正式仍1.24.5;具体下一诊断开发见RETROSPECTIVE-LIVE-DELIVERY-P。 @@ -1076,3 +1084,5 @@ M 首23专项22通过/1失败:真实 JSON/SSE 两轮原工具与缓存用量 M最终实证:1.24.4正式保持原宿主完成本地升级;Messages原生路径https://api.apikey.fan/v1/messages与请求体已真实使用,原message_start.message.model仍是gpt-6.1-sol,请求claude-opus-5-5。221报告tokens、一次无工具/重试/切池的完整SSE并被严格暂停。这排除了本样本由legacy调用/池内切换或客户端默认GPT回填解释;仅补协议不能解决原线路。供应商映射、Key分组和底层权重未知,不添加无依据别名,不宣称Claude已恢复或工程/Purge收益成立。 发布与证据目录契约不同:源码归档只携带构建输入,编译输出应从已验便携载荷取证并和冻结/独立重建逐项SHA绑定。首封存误取sourceRoot的编译路径明确失败;保留原件后修正取证路径,不修改产品或重复真实调用。745份原字节离线核对通过仅证明证据一致,不能将身份拒绝样本记为成功。 + +Q验收复核:测试必须等待新修订的结果,不能只等待“通过”字样,以免误认旧历史;最终新UI会等待修订2/active=0后封图。实际390px三路径表/历史可操作,无页面溢出;正式基线61项目77会话不新增模型尝试。原生首次未激活截图显示遮挡内容,只用于定位,不封存为正式工作台画面;前置后实际窗口已核对。 diff --git a/package-lock.json b/package-lock.json index 6038a647..08f65593 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "local-agent-workbench", - "version": "1.24.5", + "version": "1.24.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "local-agent-workbench", - "version": "1.24.5", + "version": "1.24.6", "dependencies": { "@babel/parser": "7.29.11", "@peculiar/x509": "3.1.0", diff --git a/package.json b/package.json index e40e5f95..f4d3ff00 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "local-agent-workbench", - "version": "1.24.5", + "version": "1.24.6", "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 587a012e..ac46282a 100644 --- a/progress.md +++ b/progress.md @@ -1,5 +1,13 @@ # 统一执行进度 +## Q:模型连接诊断开发 + +69相关回归、11宿主相关和14安装/旧版升级回归全部通过;五类历史UI共26组通过,新UI9组桌面/390px流程已实测并查看原截图。新修订验收器先等原修订通过的竞态已修正,原截图/结果保留;最终需等待新修订和active=0。正式初始只读快照61项目/77会话/6167记录/13115事件及outbox,全部原行、导出与工件SHA已记录。原生1.24.5回看,窗口已关闭,PID36552保持。最后源码审查补充空闲诊断管理器热升级/回滚对象保留断言。准备冻结与独立发行,真实模型调用0。 + +核心11专项首轮通过:真实本机TCP/TLS/证书、双栈回退、DNS失败/超时/取消、代理范围、历史/中断、API权限/宿主活动/升级停止。UI首多文件patch因预算组件上下文不匹配被原子拒绝,未产生部分新文件,按实际行重新应用。首npm构建被子进程PATH中的系统Node16拦下(显式npm本体是Node24但子命令仍旧Node),原日志保留;修正仅本轮命令PATH,继续构建,不改用户系统Node。 + +接续P实测/回顾,建立feat/connection-diagnostics-q。开始实现上一轮明确的连接诊断切片,已读取规划及产品UI/UX、frontend-design技能。保持现有产品结构,不委派、不重放真实失败任务;正式宿主和凭据保持,先完成隔离实现与验收再独立发行。 + ## P:新的连接预检与工程闭环 最终Git索引含清单76份/55904611字节与75份封存原件逐SHA一致,离线核验与diff检查通过。全局*.log导致首次索引漏收,本目录精确例外和原字节属性已补齐,首次日志独立保留。报告、回顾、下一诊断开发切片和规划按本轮范围本地保存;没有产品新发行、远端推送或额外模型调用。 diff --git a/scripts/qa-evidence.mjs b/scripts/qa-evidence.mjs index 28236bc0..bbf74932 100644 --- a/scripts/qa-evidence.mjs +++ b/scripts/qa-evidence.mjs @@ -23,6 +23,7 @@ const prefixes = Object.freeze({ '1.24.2': 'delivery-integrity', '1.24.3': 'model-selection', '1.24.5': 'live-context-o', + '1.24.6': 'network-q', }); export function releaseEvidencePrefix(version) { const prefix = prefixes[version]; diff --git a/scripts/upgrade-running.mjs b/scripts/upgrade-running.mjs index eef7c78b..df5cc172 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', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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 716dc70b..79f6cd85 100644 --- a/scripts/verify-all-ui.mjs +++ b/scripts/verify-all-ui.mjs @@ -9,36 +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', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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 = [ - ...(['1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].includes(version) ? [['verify-file-results-ui.mjs', null]] : []), - ...(['1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].includes(version) ? [['verify-release-efficiency-ui.mjs', null]] : []), - ...(['1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].includes(version) ? [['verify-local-files.mjs', null]] : []), - ...(['1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].includes(version)?[['verify-embedded-browser.mjs',null]]:[]), - ...(['1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].includes(version) ? [['verify-browser-ui.mjs', `docs/${prefix}-browser-ui-validation.json`]] : []), + ...(['1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].includes(version) ? [['verify-file-results-ui.mjs', null]] : []), + ...(['1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].includes(version) ? [['verify-release-efficiency-ui.mjs', null]] : []), + ...(['1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].includes(version) ? [['verify-local-files.mjs', null]] : []), + ...(['1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].includes(version)?[['verify-embedded-browser.mjs',null]]:[]), + ...(['1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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']); diff --git a/scripts/verify-controlled-release.mjs b/scripts/verify-controlled-release.mjs index b2a8396d..c647515c 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', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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-desktop-install.mjs b/scripts/verify-desktop-install.mjs index ccdc5ea7..5b3f9519 100644 --- a/scripts/verify-desktop-install.mjs +++ b/scripts/verify-desktop-install.mjs @@ -149,7 +149,7 @@ 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 (['1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].includes(version)) { + if (['1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].includes(version)) { 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 = []; diff --git a/scripts/verify-network-diagnostics-ui.mjs b/scripts/verify-network-diagnostics-ui.mjs new file mode 100644 index 00000000..5c2ca0bf --- /dev/null +++ b/scripts/verify-network-diagnostics-ui.mjs @@ -0,0 +1,102 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import net from 'node:net'; +import assert from 'node:assert/strict'; +import { randomUUID } from 'node:crypto'; +import { chromium, expect } from 'playwright/test'; +import { fixture, launchWorkbench, until } from '../tests/helpers.mjs'; +import { Provider } from '../src/server/provider.mjs'; + +if (process.argv.includes('--help')) { console.log('node scripts/verify-network-diagnostics-ui.mjs [--app-root ABSOLUTE_ROOT] — owned TCP/TLS-only diagnostics, stop/reload/revision/proxy scopes, desktop and 390px. Zero configured-model calls.'); process.exit(0); } +const args = process.argv.slice(2); assert.ok(!args.length || args.length === 2 && args[0] === '--app-root' && path.isAbsolute(args[1])); +const appRoot = args.length ? fs.realpathSync.native(args[1]) : process.cwd(); +const targetVersion = JSON.parse(fs.readFileSync(path.join(appRoot, fs.existsSync(path.join(appRoot, 'MANIFEST.json')) ? 'MANIFEST.json' : 'package.json'))).version; +const root = path.resolve('.qa', 'network-q-ui-' + randomUUID()); fs.mkdirSync(root); +const disposers = [], f = fixture({ after: action => disposers.push(action) }), checks = [], screenshots = [], errors = [], traffic = []; +const sockets = new Set(); let plainBytes = 0, tlsOpen = 0; +const listen = async server => { server.on('connection', socket => { sockets.add(socket); socket.on('close', () => sockets.delete(socket)); }); + await new Promise(resolve => server.listen(0, '127.0.0.1', resolve)); return server.address().port; }; +const plain = net.createServer(socket => socket.on('data', chunk => { plainBytes += chunk.length; })); +const stalled = net.createServer(socket => { tlsOpen++; socket.on('data', chunk => { traffic.push({ bytes: chunk.length, tls: chunk[0] === 22 }); }); socket.on('close', () => tlsOpen--); }); +const plainPort = await listen(plain), tlsPort = await listen(stalled), refused = net.createServer(), refusedPort = await listen(refused); +await new Promise(resolve => refused.close(resolve)); +const provider = new Provider(), hub = provider.modelHub(f.store); +const add = (name, scheme, port) => hub.upsert({ name, model: 'owned-no-model', baseUrl: scheme + '://127.0.0.1:' + port + '/v1', requiresKey: true }); +const good = add('本机 TCP · 不需要模型凭据', 'http', plainPort), bad = add('本机拒绝连接 · 失败样例', 'https', refusedPort), waiting = add('本机 TLS 等待 · 可停止样例', 'https', tlsPort); +const initialConfig = structuredClone(f.store.config), initialCenter = hub.view(); f.store.close(); +const nodePath = fs.existsSync(path.join(appRoot, 'runtime/node.exe')) ? path.join(appRoot, 'runtime/node.exe') : process.execPath; +const host = await launchWorkbench({ after: action => disposers.push(action) }, f.data, + { HTTPS_PROXY: 'http://owned-proxy-user:owned-proxy-secret@127.0.0.1:9', NO_PROXY: '127.0.0.1' }, { appRoot, nodePath }); +assert.notEqual(new URL(host.url).port, '4318'); +const browser = await chromium.launch({ channel: 'msedge', headless: true }), page = await browser.newPage({ viewport: { width: 1440, height: 1000 } }); +page.on('pageerror', error => errors.push(error.message)); +let result; +const mark = value => { checks.push(value); console.log('PASS ' + value); }; +const capture = async name => { const file = path.join(root, name + '.png'); await page.screenshot({ path: file, fullPage: true }); screenshots.push(file); }; +const open = async () => { await page.getByRole('button', { name: '打开模型中心', exact: true }).click(); const dialog = page.getByRole('dialog', { name: '模型中心', exact: true }); await expect(dialog).toBeVisible(); return dialog; }; +const tab = dialog => dialog.getByRole('navigation', { name: '模型中心分类' }).getByRole('button', { name: '连接诊断', exact: true }); +const panel = () => page.getByRole('region', { name: '模型连接诊断', exact: true }); +const start = async () => { await panel().getByRole('button', { name: '开始直连检查', exact: true }).click(); }; +try { + await page.goto(host.url); await page.waitForLoadState('networkidle'); let dialog = await open(); + const card = dialog.locator('.mc-connection').filter({ hasText: good.name }); await card.getByRole('button', { name: '连接诊断', exact: true }).click(); + await expect(panel().getByLabel('诊断连接', { exact: true })).toHaveValue(good.id); await expect(panel()).toContainText('这条连接还没有检查记录'); + await expect(panel().getByRole('button', { name: '开始直连检查', exact: true })).toBeEnabled(); await capture('empty-desktop'); + mark('connection-card entry binds the exact saved target, works without a Key and shows an honest empty state'); + await start(); await expect(panel().getByRole('status')).toContainText('直连握手通过', { timeout: 10000 }); + await expect(panel()).toContainText('HTTP 端点无需 TLS'); await expect(panel()).toContainText('DNS 未返回此地址族'); + await expect(panel()).toContainText('实际 API 路线尚未核验'); await panel().getByText('查看原诊断范围与运输参数', { exact: true }).click(); + await expect(panel()).toContainText('未请求;能力与连接健康结论保持原记录'); await capture('passed-desktop'); + mark('real loopback TCP success separates missing IPv6, HTTPS proxy scope and untested model API capability'); + let view = await host.api('/model-center/network-diagnostics'); const goodId = view.jobs[0].id; + await page.reload(); dialog = await open(); await tab(dialog).click(); + await panel().getByLabel('诊断连接', { exact: true }).selectOption(good.id); + await expect(panel().getByRole('status')).toContainText('直连握手通过'); + assert.equal((await host.api('/model-center/network-diagnostics')).jobs[0].id, goodId); mark('refresh restores the original saved result without repeating network work'); + await panel().getByLabel('诊断连接', { exact: true }).selectOption(bad.id); await start(); + await expect(panel().getByRole('status')).toContainText('未通过', { timeout: 10000 }); await expect(panel()).toContainText('ECONNREFUSED'); await capture('refused-desktop'); + mark('connection failure stays attached to the selected endpoint and shows its real TCP error code'); + await panel().getByLabel('诊断连接', { exact: true }).selectOption(waiting.id); await start(); + await expect(panel()).toContainText('TLS 握手中'); await expect(panel().getByRole('button', { name: '开始直连检查', exact: true })).toBeDisabled(); + assert.equal((await host.api('/host/status')).activity.counts.networkDiagnostics, 1); + await panel().getByRole('button', { name: '停止诊断', exact: true }).click(); await expect(panel().getByRole('status')).toContainText('已停止'); await until(() => tlsOpen === 0); + mark('running TLS check disables duplicate start and explicit stop closes owned sockets before reporting stopped'); + await start(); await expect(panel()).toContainText('TLS 握手中'); view = await host.api('/model-center/network-diagnostics'); const runningId = view.jobs[0].id; + await dialog.locator('.modal-heading .icon-button').click(); dialog = await open(); await tab(dialog).click(); + await expect(panel()).toContainText('正在检查'); await panel().getByRole('button', { name: '查看正在运行的诊断', exact: true }).click(); + await panel().getByRole('button', { name: '停止诊断', exact: true }).click(); await expect(panel().getByRole('status')).toContainText('已停止'); + assert.equal((await host.api('/model-center/network-diagnostics')).jobs[0].id, runningId); mark('closing and reopening the model center recovers the same active check and retains explicit stop'); + await host.api('/model-center/toggle', { id: good.id, enabled: false }); await panel().getByLabel('诊断连接', { exact: true }).selectOption(good.id); + await panel().getByRole('button', { name: '刷新连接诊断', exact: true }).click(); await expect(panel()).toContainText('连接配置已变化'); + await start(); await expect(panel().getByRole('alert')).toContainText('连接已变化'); + await dialog.getByRole('button', { name: '刷新模型中心', exact: true }).click(); + await start(); + await expect(panel().locator('.mn-result-heading .mn-revision')).toHaveText('修订 2'); + await expect(panel().getByRole('status')).toContainText('直连握手通过'); + await until(async () => (await host.api('/model-center/network-diagnostics')).active === 0); + mark('old revisions remain visible, stale starts reject before any socket, and refreshing permits a new bounded check'); + await page.setViewportSize({ width: 390, height: 844 }); await capture('passed-390'); + await panel().locator('.mn-result-heading').scrollIntoViewIfNeeded(); await capture('passed-result-390'); + await panel().locator('.mn-paths').scrollIntoViewIfNeeded(); await capture('passed-paths-390'); + await panel().getByRole('complementary', { name: '连接诊断历史' }).scrollIntoViewIfNeeded(); await capture('history-390'); + assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)); + assert.ok(await panel().evaluate(element => element.scrollWidth <= element.clientWidth + 1)); + const startBox = await panel().getByRole('button', { name: '开始直连检查', exact: true }).boundingBox(); assert.ok(startBox.height >= 44); + await panel().getByLabel('诊断连接', { exact: true }).selectOption(bad.id); await expect(panel()).toContainText('ECONNREFUSED'); + await panel().locator('.mn-result-heading').scrollIntoViewIfNeeded(); await capture('refused-390'); + mark('390px success and failure states fit without page or panel overflow and retain touch-sized actions'); + view = await host.api('/model-center/network-diagnostics'); const center = await host.api('/model-center'), boot = await host.api('/bootstrap'); + assert.deepEqual(center.selected, initialCenter.selected); assert.deepEqual(center.pools, initialCenter.pools); assert.deepEqual(boot.config, { ...initialConfig, hasKey: false }); + assert.deepEqual(center.attempts, []); assert.ok(center.connections.every(value => Object.values(value.capabilities).every(state => state !== 'verified'))); + assert.equal(plainBytes, 0); assert.ok(traffic.length > 0 && traffic.every(value => value.tls)); assert.equal(JSON.stringify(view).includes('owned-proxy-secret'), false); + assert.equal((await page.locator('body').innerText()).includes('owned-proxy-secret'), false); assert.deepEqual(errors, []); + mark('original routing, budgets, model ledger and capability results remain unchanged; no HTTP or credential text is sent'); + result = { success: true, appRoot, targetVersion, checks, screenshots, errors, httpRequests: 0, realModelRequests: 0, + plainBytes, tlsFrames: traffic.length, jobs: view.jobs, originalSelectionPreserved: true, originalBudgetsPreserved: true }; +} catch (error) { await capture('failure').catch(() => {}); result = { success: false, error: error.stack, checks, screenshots, errors, realModelRequests: 0 }; throw error; } +finally { + fs.writeFileSync(path.join(root, 'result.json'), JSON.stringify(result, null, 2)); console.log(JSON.stringify({ success: result.success, root, checks: checks.length })); + await browser.close(); for (const socket of sockets) socket.destroy(); + for (const server of [plain, stalled]) await new Promise(resolve => server.close(resolve)); + for (const dispose of disposers.reverse()) await dispose(); +} diff --git a/scripts/verify-release.mjs b/scripts/verify-release.mjs index 3f25ad5c..37567880 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', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5'].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', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5', '1.24.6'].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/src/client/ModelCenter.tsx b/src/client/ModelCenter.tsx index 14387ddb..e465c22d 100644 --- a/src/client/ModelCenter.tsx +++ b/src/client/ModelCenter.tsx @@ -10,6 +10,7 @@ import { NativeParameters } from './NativeParameters'; import { ModelErrorDetails } from './ModelErrorDetails'; import { ModelBudgetSettings } from './ModelBudgetSettings'; import { modelRequestUrl, protocolLabel } from '../shared/contracts/model-endpoint.mjs'; +import { ModelNetworkDiagnostics } from './ModelNetworkDiagnostics'; const previewUrl = (value: { protocol: string; baseUrl: string }) => { try { return modelRequestUrl(value); } catch { return '请填写有效的接口根地址'; } }; @@ -42,6 +43,7 @@ export function ModelCenter({ onConfig, onLegacy, busy, runModel }: { onConfig: const [working, setWorking] = useState(false), [notice, setNotice] = useState(''); const [noticeFailure, setNoticeFailure] = useState(null); const [probeScopes, setProbeScopes] = useState>({}); + const [networkTarget, setNetworkTarget] = useState(''); const [operations, setOperations] = useState(null), [autoInspect, setAutoInspect] = useState(false); const [importPath, setImportPath] = useState(''), [importSource, setImportSource] = useState('ccswitch'); const [preview, setPreview] = useState<{ id: string; entries: { id: string; name: string; model: string; baseUrl: string; hasKey: boolean }[]; notices: string[] } | null>(null); @@ -87,7 +89,7 @@ export function ModelCenter({ onConfig, onLegacy, busy, runModel }: { onConfig: const locked = working || busy; return
MODEL CONTROL

选择模型,继续开发。

连接、模型池和实际请求使用同一个入口。

新任务默认{runtimeConfig?.mode === 'demo' ? '离线演示' : selectionName || '正在读取'}{view?.waiting ?? 0} 等待
-