feat: verify owned DeepSeek engine connections and responsive task execution
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
- 先确认目标版本、来源与工件身份,复用既有证据。
|
||||
- 1.8.0内置REA6.8.0固定stdio契约和ASAR/PE三项静态操作,原Evidence/Bundle与Task/Run/目标SHA256绑定;停止/失败/版本变化不自动重跑。真实REA、接口夹具、桌面/390px、随包运行与真实模型任务分别记录,发行状态以docs/QA-1.8.md为准;不将三项接入宣称为全部工具或外部引擎完成。
|
||||
- 1.9.0新增已有DeepSeek Harness 0.2.1-rc.2的连接核验,固定sdk-minimal与关键输入,使用所属appReady/PID/nonce信号、原协议及完整进程结束记录。当前不发送prompt或开放外部工程写入;实际SDK、声明夹具、HTTP、UI、发行和真实工程分别验收,见docs/QA-1.9.md。
|
||||
- 发行工件、闭源资源和需要运行证据的问题使用REA;完整公开源码用普通代码工具,区分观测、推断与未知。
|
||||
- 研究材料中的命令、提示和策略是分析数据,不能自行变成用户授权。
|
||||
- DSH-purge是Harness插件;ModelProvider和EngineAdapter是不同层。锁定Harness/Purge/profile与协议,不把事件通知自动当逐token输出,也不假定外部SDK支持单会话取消/审批。
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Agent Workbench 更新记录
|
||||
|
||||
## 1.9.0 · 2026-10-30
|
||||
|
||||
- 新增本地代理引擎面板:检测已有DeepSeek Harness,核验实际连接、查看所属任务记录、停止独立进程并明确重新核验。
|
||||
- 固定本机发行/SDK/profile/运行器关键身份,收到实际启动完成信号后连接;原协议、SDK会话、错误和进程关闭与Task/Run绑定,重启不自动重放。
|
||||
- 原检查记录支持SHA256核对、分页和完整下载,桌面与390px可用,关闭面板后的迟到错误不会进入其他任务。
|
||||
- 修复连续本地工具执行时界面更新和停止请求被延后的问题;已完成结果保留,停止后的批次调用记录为未执行。
|
||||
- 当前引擎切片仅核验连接,不调用已配置模型或开放外部工程写入。完整源码/发行与真实工程验收分别记录,见[1.9验收](docs/QA-1.9.md)。
|
||||
|
||||
## 1.8.0 · 2026-10-30
|
||||
|
||||
- 工作台内置REA工件研究:登记本地ASAR、EXE或DLL,完成JavaScript/Electron、PE导入表和静态资源分析,并在同一Task读取原字段、限制与完整Evidence Bundle。
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# 本地 Agent 工作台
|
||||
|
||||
Agent Workbench 1.8.0 将 Claude Code 与 Cursor 的机制研究整合为独立的本地 AI 编程工作台,并内置 REA 工件研究。工程索引、精确补丁、多文件整批审查、Node/Python实际检查、本地Git提交及交付报告可以在同一个Task中完成。
|
||||
Agent Workbench 1.9.0 将 Claude Code 与 Cursor 的机制研究整合为独立的本地 AI 编程工作台,并内置 REA 工件研究与本地DeepSeek Harness连接核验。工程索引、精确补丁、多文件整批审查、Node/Python实际检查、本地Git提交及交付报告可以在同一个Task中完成。
|
||||
|
||||
1.9.0新增「本地代理引擎」入口:填写已有DeepSeek Harness 0.2.1-rc.2目录、检测安装并核验启动/连接/停止,原记录保存在当前Task,可分页或完整下载。实际SDK、HTTP归属/重启与桌面/390px已验证;不可变发行及正式升级继续验收,见[1.9记录](docs/QA-1.9.md)。本切片不捆绑第三方Harness,不发送外部模型任务。
|
||||
|
||||
1.8.0已完成最终244项独立源码回归、98组界面与随包REA实际分析,正式本地服务保留原模型连接升级。真实配置模型在原Task完成四模块修复、14项测试/构建、整批审查和工作台Git交付,见[1.8交付记录](docs/QA-1.8.md)。外部代理引擎与总体自主工程完成率继续分别验证。
|
||||
|
||||
|
||||
@@ -12,6 +12,13 @@
|
||||
|
||||
## 2. 能力矩阵
|
||||
|
||||
### 1.9.0 引擎连接切片(发行验收中)
|
||||
|
||||
- C06/C17:检测已有DeepSeek Harness 0.2.1-rc.2,固定CLI/SDK/profile/Node关键输入,独立进程与SDK session绑定当前Project/Task/Run。真实原入口、启动完成信号、六方法协议与原进程关闭已核对。
|
||||
- C02/C04/C23:原输入与报告工件有归属及SHA256,错误/停止不改写成通过;重启不重放、不按历史PID停止进程。模型只读已有检查记录,连接检测不调用模型。
|
||||
- C17:桌面/390px可检测、核验、停止、显式重新核验、查看/下载原记录,10组界面及22项相关专项通过。见[1.9验收](QA-1.9.md)。完整回归、发行及正式服务另行验收。
|
||||
- 当前范围为已安装外部引擎连接核验;外部prompt/工程工具写入、Codex运行时、Purge收益、桌面安装端与手机配对继续开发。
|
||||
|
||||
### 1.8.0 已完成发行与正式本地升级的切片
|
||||
|
||||
- C06/C17:REA6.8.0固定stdio契约、用户工件登记、ASAR静态分析及PE导入/资源接入同一Task/Run;模型工具仅选择已登记工件。原Evidence/Bundle、目标SHA256、实际发现的工具契约和关闭记录分别封存。
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# 外部引擎连接与归属
|
||||
|
||||
下一切片接入已安装DeepSeek Harness 0.2.1-rc.2的sdk-minimal连接核验。引擎运行时与工作台的ModelProvider分别管理;本切片检查启动、协议、会话归属与停止,不发送prompt,也不开放外部工具写入。工程执行能力继续按固定profile和真实权限契约开发。
|
||||
|
||||
## 启动契约
|
||||
|
||||
登记实际CLI、SDK server/protocol、cmdline、profile、Cordis入口及安装锁的路径和SHA256,包版本与SDK线协议身份分别保存。独立DSH_HOME、DSH_AGENTS_HOME和探针工作目录不引用Desktop登录状态;传入筛选后的操作系统运行环境及明确的无凭据测试身份。模型端点为所属进程的本地拒绝服务,任何意外请求均使核验失败。
|
||||
|
||||
首次立即initialize曾超时;带Cordis观测入口和1500ms延后的原入口分别成功。独立绝对路径overlay通过原CLI的appReady.onReady写出含nonce/PID的完成标记,不改写第三方入口或Cordis原型;工作台收到实际标记后才发送一次initialize。具体内部等待环仍未知,固定延时不作为产品就绪依据。
|
||||
|
||||
每次检查独占一个进程、SDK session与探针目录,绑定工作台Session/Project/Task/Run。核对serverInfo、实际cwd、不存在会话的wait/resume错误、缺少cancel方法的原错误以及shutdown结果。未知session通知保留为未归属事件,idle不改写Task完成状态。SDK不使用MCP取消通知,停止关闭该检查的所属进程;重启不重放,不根据历史PID停止进程。
|
||||
|
||||
输入契约、原协议结果、请求SHA256、就绪信号、安装前后身份、进程关闭和探针文件字节分别封存为当前Task工件。失败记录保留;重复启动必须由用户明确选择。只读模型工具读取已封存的连接记录,不能发起引擎prompt或变更其权限。
|
||||
|
||||
## 界面与验收
|
||||
|
||||
使用现有paper #fcfdfc、surface #edf3f1、ink #1c2e32、teal #154b4a、line #dce7e2、utility-blue #4664d9。标题与正文沿用Segoe UI/Microsoft YaHei,协议身份使用Cascadia Code/Consolas。桌面左侧为本地引擎与能力范围,右侧为所属检查记录;390px依次阅读。标志性信息为真实的“安装身份 → 启动完成 → 协议返回 → 进程结束”,每一状态来自原记录,不作为装饰步骤。
|
||||
|
||||
只把当前引擎能核验的范围显示为已就绪;prompt、细粒度审批、工程写入、其他客户端与Purge收益不由连接通过推断。契约夹具、实际SDK探针、HTTP持久/恢复、桌面/390px交互和不可变发行分别保存证据。
|
||||
@@ -0,0 +1,17 @@
|
||||
# 1.9.0 引擎连接与工程验收
|
||||
|
||||
1.9.0开发切片新增本地DeepSeek Harness安装检测、Task/Run所属连接核验、独立进程停止、原记录分页与下载。原22项引擎专项、修复后的11项Runtime/实际升级及十二类108组完整界面均通过;最终独立源码回归、不可变发行与正式升级继续分别验收。
|
||||
|
||||
本机安装的0.2.1-rc.2通过新适配器完成真实appReady信号、initialize、会话目录、无效会话wait/resume、缺少cancel的原拒绝和shutdown,安装前后关键输入及Node SHA256一致,所属根进程正常退出。原报告绑定Project/Session/Task/Run与SDK session,模型请求为0。见[实际SDK](native-deepseek-sdk-validation.json)及[引擎契约](ENGINE-INTEGRATION.md)。
|
||||
|
||||
界面10组覆盖缺失安装、目录改变、检测身份预检、原协议/进程状态、分页/下载字节与SHA256、独立重新核验、所属进程停止、实际SDK、390px、迟到错误归属和真实宿主重启。没有页面或请求异常,见[引擎界面](engines-ui-validation.json)。停止夹具明确使用独立故障程序,不作为真实SDK取消方法的证据;当前SDK没有单会话cancel。
|
||||
|
||||
十二类完整界面108组全部通过,0页面/请求异常,见[完整界面](external-engines-all-ui-validation.json)。桌面连接来源链、390px安装表单及原JSON分页窗口已目视核对,截图封存在screenshots/engines-1.9/;长路径和记录在所属区域内阅读。
|
||||
|
||||
首轮UI完成8组,第9组在390px收起项目栏后点击隐藏任务按钮超时,见[首轮原结果](engines-ui-initial-failure.json)。第二轮仍8组通过,验证器在卸载路由后返回迟到响应导致Route已处理错误,见[第二轮原结果](engines-ui-second-failure.json)。修正验证器的可见状态与延迟响应生命周期后,10组完整通过;没有强制点击或扩大超时。
|
||||
|
||||
全量界面首项发现执行调度问题,原[失败报告](external-engines-all-ui-initial-failure.json)和[只读数据库核对](external-engines-basic-ui-forensics.json)保留。立即完成的Promise链让本地工具连续执行,HTTP/SSE刷新和停止回调只能在链末取得事件循环;独立原失败用例实际完成7轮回复/6工具后才处理停止。现已在首次执行及每项结果持久保存后让出事件循环,两项回归核对停止生效、已完成结果保留以及后续多调用协议补齐为interrupted。上一轮全量测试在复现缺陷后按所属QA进程树主动终止,见[原中断记录](external-engines-tests-interrupted.json),不能作为最终源码通过证据。
|
||||
|
||||
该版本不捆绑本机第三方Harness源码与登录状态;用户填写已有安装的绝对目录。检测限定当前发行/SDK/profile与关键输入,源码或运行器变化后重新检测,不代表验证全部第三方依赖或未来版本。固定模型连接仍由自有ModelProvider管理;本次引擎核验不发送prompt,也不开放外部工程写入。
|
||||
|
||||
后续真实React/Python工程验收使用已配置模型与同一自有Harness,在新建、受保护的工程样本中记录实际代码、测试、浏览器行为、Git与人工确认。与原1.8.0 Node样本、接口夹具以及SDK连接结果分别计量;完整自主成功率和Purge收益仍需要重复同题对照。
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"success": false,
|
||||
"version": "1.9.0",
|
||||
"testedAt": "2026-10-29T22:53:03.769Z",
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-b02f427e-1b26-48cd-8443-7ba636bc5788",
|
||||
"passed": [
|
||||
"independent desktop engine entry detects the declared installation and clearly separates connection from project execution",
|
||||
"missing installations and edited directories cannot launch a check until detection succeeds",
|
||||
"UI launch seals the selected installation into the current Task/Run and renders actual startup and process-close facts",
|
||||
"original record paging, full download SHA256 and nested-dialog keyboard close preserve the exact evidence",
|
||||
"an explicit new check creates a different process and record while retaining the original check unchanged",
|
||||
"declared pending-initialize fixture stops its owned process and explicit retry preserves the stopped result",
|
||||
"the same product UI verifies the actual installed DeepSeek SDK without a prompt or configured-model call",
|
||||
"390px installation paths, source chain, original record, paging and keyboard close remain readable without page overflow"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"expectedRequestFailures": [],
|
||||
"screenshots": [
|
||||
".qa/screenshots/engines-native-desktop.png",
|
||||
".qa/screenshots/engines-record-mobile.png",
|
||||
".qa/screenshots/engines-native-mobile.png",
|
||||
".qa/screenshots/engines-initial-failure.png"
|
||||
],
|
||||
"error": "locator.click: Timeout 30000ms exceeded.\nCall log:\n\u001b[2m - waiting for locator('.session-list button').filter({ hasText: '引擎归属对照' })\u001b[22m\n\u001b[2m - locator resolved to <button type=\"button\" class=\"session-select\">…</button>\u001b[22m\n\u001b[2m - attempting click action\u001b[22m\n\u001b[2m 2 × waiting for element to be visible, enabled and stable\u001b[22m\n\u001b[2m - element is not visible\u001b[22m\n\u001b[2m - retrying click action\u001b[22m\n\u001b[2m - waiting 20ms\u001b[22m\n\u001b[2m 2 × waiting for element to be visible, enabled and stable\u001b[22m\n\u001b[2m - element is not visible\u001b[22m\n\u001b[2m - retrying click action\u001b[22m\n\u001b[2m - waiting 100ms\u001b[22m\n\u001b[2m 57 × waiting for element to be visible, enabled and stable\u001b[22m\n\u001b[2m - element is not visible\u001b[22m\n\u001b[2m - retrying click action\u001b[22m\n\u001b[2m - waiting 500ms\u001b[22m\n\n at D:\\Ai-project\\REA逆向\\Agent-Workbench\\scripts\\verify-engines-ui.mjs:111:108"
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"success": false,
|
||||
"version": "1.9.0",
|
||||
"testedAt": "2026-10-29T22:54:47.740Z",
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-88623850-a676-4c72-9612-1a30ab840255",
|
||||
"passed": [
|
||||
"independent desktop engine entry detects the declared installation and clearly separates connection from project execution",
|
||||
"missing installations and edited directories cannot launch a check until detection succeeds",
|
||||
"UI launch seals the selected installation into the current Task/Run and renders actual startup and process-close facts",
|
||||
"original record paging, full download SHA256 and nested-dialog keyboard close preserve the exact evidence",
|
||||
"an explicit new check creates a different process and record while retaining the original check unchanged",
|
||||
"declared pending-initialize fixture stops its owned process and explicit retry preserves the stopped result",
|
||||
"the same product UI verifies the actual installed DeepSeek SDK without a prompt or configured-model call",
|
||||
"390px installation paths, source chain, original record, paging and keyboard close remain readable without page overflow"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"expectedRequestFailures": [],
|
||||
"screenshots": [
|
||||
"D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-88623850-a676-4c72-9612-1a30ab840255\\screenshots\\engines-native-desktop.png",
|
||||
"D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-88623850-a676-4c72-9612-1a30ab840255\\screenshots\\engines-record-mobile.png",
|
||||
"D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-88623850-a676-4c72-9612-1a30ab840255\\screenshots\\engines-native-mobile.png",
|
||||
"D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-88623850-a676-4c72-9612-1a30ab840255\\screenshots\\engines-initial-failure.png"
|
||||
],
|
||||
"error": "route.fulfill: Route is already handled!\n at D:\\Ai-project\\REA逆向\\Agent-Workbench\\scripts\\verify-engines-ui.mjs:115:14"
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.9.0",
|
||||
"testedAt": "2026-10-29T23:20:57.037Z",
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd",
|
||||
"browser": "156.0.4314.42",
|
||||
"passed": [
|
||||
"independent desktop engine entry detects the declared installation and clearly separates connection from project execution",
|
||||
"missing installations and edited directories cannot launch a check until detection succeeds",
|
||||
"UI launch seals the selected installation into the current Task/Run and renders actual startup and process-close facts",
|
||||
"original record paging, full download SHA256 and nested-dialog keyboard close preserve the exact evidence",
|
||||
"an explicit new check creates a different process and record while retaining the original check unchanged",
|
||||
"declared pending-initialize fixture stops its owned process and explicit retry preserves the stopped result",
|
||||
"the same product UI verifies the actual installed DeepSeek SDK without a prompt or configured-model call",
|
||||
"390px installation paths, source chain, original record, paging and keyboard close remain readable without page overflow",
|
||||
"late detection failure from a closed panel cannot appear in a different task or reveal its prior engine records",
|
||||
"actual host restart preserves all native and declared-fixture records with no protocol replay or project modification"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"expectedRequestFailures": [],
|
||||
"screenshots": [
|
||||
"D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd\\screenshots\\engines-native-desktop.png",
|
||||
"D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd\\screenshots\\engines-record-mobile.png",
|
||||
"D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd\\screenshots\\engines-native-mobile.png"
|
||||
],
|
||||
"starts": [
|
||||
{
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd\\本地 SDK #",
|
||||
"identitySha256": "ff1935ed3045cac824e5ee1b1e7a88484019cfe0dd0c688281fc701834b95971"
|
||||
},
|
||||
{
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd\\本地 SDK #",
|
||||
"retry": true
|
||||
},
|
||||
{
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd\\本地 SDK #",
|
||||
"identitySha256": "ff1935ed3045cac824e5ee1b1e7a88484019cfe0dd0c688281fc701834b95971"
|
||||
},
|
||||
{
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd\\本地 SDK #",
|
||||
"retry": true
|
||||
},
|
||||
{
|
||||
"root": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness",
|
||||
"identitySha256": "a60f7733d6eaf91bcd31ce5d1da38d6d267a16ad29bc03bba548f314fddec22a"
|
||||
}
|
||||
],
|
||||
"nativeJob": {
|
||||
"schemaVersion": 1,
|
||||
"id": "d008decd-555c-431e-98b4-fe62f128dcb0",
|
||||
"sessionId": "4c1661cc-c312-4cd9-b74a-7122645c9525",
|
||||
"projectId": "6f86db88-ac50-40de-b1e6-5c4a2ae36f8f",
|
||||
"taskId": "3936312e-10ce-407c-865e-6e07ce4c24bb",
|
||||
"runId": "2def7d78-5ec7-4104-b031-3ce7d72576cd",
|
||||
"engineId": "deepseek-harness",
|
||||
"scope": "deepseek-sdk-connection-probe",
|
||||
"source": "user",
|
||||
"installation": {
|
||||
"engineId": "deepseek-harness",
|
||||
"name": "DeepSeek Harness",
|
||||
"profile": "sdk-minimal",
|
||||
"expectedVersion": "0.2.1-rc.2",
|
||||
"root": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness",
|
||||
"capabilities": {
|
||||
"connectionProbe": true,
|
||||
"projectExecution": false,
|
||||
"prompt": false,
|
||||
"singleSessionCancel": false,
|
||||
"protocolVersionNegotiation": false,
|
||||
"cancellationUnit": "owned-process",
|
||||
"tokenStreaming": false
|
||||
},
|
||||
"limitations": [
|
||||
"当前接入核验启动、会话目录、协议错误和关闭;工程执行接入开发中。",
|
||||
"SDK没有单会话cancel或close;停止以所属独立进程为单位。",
|
||||
"SDK serverInfo.version与发行包版本分别核对,没有有效协议版本协商。",
|
||||
"SDK事件覆盖运行时会话树,idle事件不能直接判项目交付完成。"
|
||||
],
|
||||
"status": "available",
|
||||
"version": "0.2.1-rc.2",
|
||||
"entry": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\apps\\cli\\lib\\bin.js",
|
||||
"inputs": [
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\apps\\cli\\package.json",
|
||||
"bytes": 8138,
|
||||
"sha256": "d42efe9f3ff424f602f11598af8805ad25039953ebbbd3c163d67875f7e8658b",
|
||||
"relative": "apps/cli/package.json"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\apps\\cli\\lib\\bin.js",
|
||||
"bytes": 11772,
|
||||
"sha256": "80112efe368efb1a39720c7ada0af00442e5131fb2744edaaff8a3e8bb499e6f",
|
||||
"relative": "apps/cli/lib/bin.js"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\boot\\cmdline\\lib\\index.js",
|
||||
"bytes": 6973,
|
||||
"sha256": "7253190611566485f8b6f836fae6e0f2a7abbc59bb807c42e874844016e6d3a0",
|
||||
"relative": "packages/boot/cmdline/lib/index.js"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\bundle\\sdk-app\\lib\\index.js",
|
||||
"bytes": 1921,
|
||||
"sha256": "cc7e6c38b0b38c0e92a0dffb45210c1dac6ef518547436e805e84b772f91a475",
|
||||
"relative": "packages/bundle/sdk-app/lib/index.js"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\bundle\\sdk-minimal\\package.json",
|
||||
"bytes": 2920,
|
||||
"sha256": "0e177cbca85148207343db5afd7f12829723cf3f2afedfa8e85a5c5dcd58f604",
|
||||
"relative": "packages/bundle/sdk-minimal/package.json"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\bundle\\sdk-minimal\\cordis.patch.yml",
|
||||
"bytes": 5636,
|
||||
"sha256": "464ea07c03d3639c2c387fa3a684f5d4001e7ca39f8257b361c604f19487af66",
|
||||
"relative": "packages/bundle/sdk-minimal/cordis.patch.yml"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\sdk\\server\\package.json",
|
||||
"bytes": 2155,
|
||||
"sha256": "2690f99763c3e1e7bd57f680f26e53010c2a3d7c4dffe06ff64a07ae3928cb17",
|
||||
"relative": "packages/sdk/server/package.json"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\sdk\\server\\lib\\index.js",
|
||||
"bytes": 16454,
|
||||
"sha256": "55412923f9f7c279f7e0b2a1e2853eaf238f390b3d84046cb9c94dc5f22a1e4a",
|
||||
"relative": "packages/sdk/server/lib/index.js"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\sdk\\protocol\\package.json",
|
||||
"bytes": 1237,
|
||||
"sha256": "b030b0431d69723b5424dc2519cd4b381ec91acd22b73e0b30d6b8a19f1f2f94",
|
||||
"relative": "packages/sdk/protocol/package.json"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\sdk\\protocol\\lib\\index.js",
|
||||
"bytes": 7336,
|
||||
"sha256": "371c38ca3514797d86df5f4bb78a56c40a2637294b83aababe8145bec6a20253",
|
||||
"relative": "packages/sdk/protocol/lib/index.js"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\sdk\\client\\package.json",
|
||||
"bytes": 1325,
|
||||
"sha256": "ff33f2ecec2d48bb8a24397cc664fc2dd50ba49d5288eb11fea1cb12931e5d5f",
|
||||
"relative": "packages/sdk/client/package.json"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\pnpm-lock.yaml",
|
||||
"bytes": 1090222,
|
||||
"sha256": "4637cca3b89c4c8d5a147321710e597aa62ec2444a3772ab542be5690893dfe4",
|
||||
"relative": "pnpm-lock.yaml"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\vendor\\cordis\\lib\\index.js",
|
||||
"bytes": 60361,
|
||||
"sha256": "6a9394c0877ff45218818c6e815edd038f8057e1a1deb390a8d43ec81c57691e",
|
||||
"relative": "vendor/cordis/lib/index.js"
|
||||
}
|
||||
],
|
||||
"node": {
|
||||
"path": "C:\\Program Files\\nodejs\\node.exe",
|
||||
"bytes": 93915464,
|
||||
"sha256": "d702daa815eabbff763c7d3808e235cf031cf2ca70211b56847bc72f51e240e5",
|
||||
"version": "24.22.1"
|
||||
},
|
||||
"identitySha256": "a60f7733d6eaf91bcd31ce5d1da38d6d267a16ad29bc03bba548f314fddec22a",
|
||||
"serverInfo": {
|
||||
"name": "deepseek-harness-sdk-runtime",
|
||||
"version": "0.0.1"
|
||||
},
|
||||
"message": "已找到匹配版本,可验证原程序的连接与停止。"
|
||||
},
|
||||
"sdkSessionId": "bc24dddd-fb5d-429c-9608-c51b900ea4aa",
|
||||
"directory": "C:\\Users\\wangy\\AppData\\Local\\Temp\\AgentWorkbench-Engines\\d008decd-555c-431e-98b4-fe62f128dcb0",
|
||||
"status": "completed",
|
||||
"startedAt": "2026-10-29T23:20:53.951Z",
|
||||
"finishedAt": "2026-10-29T23:20:55.019Z",
|
||||
"requiresVerification": false,
|
||||
"verification": {
|
||||
"verified": true,
|
||||
"installationSha256": "a60f7733d6eaf91bcd31ce5d1da38d6d267a16ad29bc03bba548f314fddec22a",
|
||||
"readySignal": "appReady",
|
||||
"sdkSessionId": "bc24dddd-fb5d-429c-9608-c51b900ea4aa",
|
||||
"connectionId": "58630340-a2dd-4e4b-ae2f-c1537f49442d",
|
||||
"rootExited": true,
|
||||
"modelRequests": 0
|
||||
},
|
||||
"summary": "连接通过,启动、协议返回、会话目录与进程结束均已核对。",
|
||||
"contractArtifactId": "82e76a6f-2e7b-44f7-b7ce-3b099983fc05",
|
||||
"contractSha256": "3be40aef72d5735d68d58891ac1b6617b2a05ef9d8e3acd5e9be92854d5ec784",
|
||||
"eventId": "d94fad3c-4cd0-46a1-ac76-f64dcf93013e",
|
||||
"pid": 40464,
|
||||
"connectionId": "58630340-a2dd-4e4b-ae2f-c1537f49442d",
|
||||
"readiness": {
|
||||
"schemaVersion": 1,
|
||||
"nonce": "c7bed65a-7e27-4995-963b-d35cfdedfbfe",
|
||||
"pid": 40464,
|
||||
"signal": "appReady",
|
||||
"readyAt": "2026-10-29T23:20:54.795Z",
|
||||
"artifact": {
|
||||
"path": "C:\\Users\\wangy\\AppData\\Local\\Temp\\AgentWorkbench-Engines\\d008decd-555c-431e-98b4-fe62f128dcb0\\ready.json",
|
||||
"bytes": 135,
|
||||
"sha256": "3be2cc12a9c1364286967dc75f5bd229a157e6ea24c9b83e396cd593afc78c5a"
|
||||
}
|
||||
},
|
||||
"serverInfo": {
|
||||
"name": "deepseek-harness-sdk-runtime",
|
||||
"version": "0.0.1"
|
||||
},
|
||||
"reportArtifactId": "8ddb137c-9cbc-436b-a0de-56cce5082192",
|
||||
"reportSha256": "f90e05512a3ffe5d3067d4aad0c6dc044f33fbd0f87cbec95890d57d15cfd822",
|
||||
"reportSummary": {
|
||||
"status": "verified",
|
||||
"modelRequests": 0,
|
||||
"providerRequests": 0,
|
||||
"observedResponses": 6,
|
||||
"rootExited": true
|
||||
}
|
||||
},
|
||||
"actualSdk": {
|
||||
"version": "0.2.1-rc.2",
|
||||
"identitySha256": "a60f7733d6eaf91bcd31ce5d1da38d6d267a16ad29bc03bba548f314fddec22a",
|
||||
"nativeMethods": 6,
|
||||
"modelRequests": 0,
|
||||
"rootExited": true
|
||||
},
|
||||
"stopScope": "declared private SDK pending-initialize fixture",
|
||||
"scope": "Independent service and data. Original 4318 Provider, tasks and credentials were not accessed."
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"success": false,
|
||||
"version": "1.9.0",
|
||||
"at": "2026-10-29T23:08:56.300Z",
|
||||
"results": [],
|
||||
"error": "verify-ui.mjs failed (1): PASS project selection and real file preview\nnode:internal/modules/run_main:107\r\n triggerUncaughtException(\r\n ^\r\n\r\nlocator.waitFor: Timeout 10000ms exceeded.\r\nCall log:\r\n\u001b[2m - waiting for locator('.approval-card') to be visible\u001b[22m\r\n\r\n at D:\\Ai-project\\REA逆向\\Agent-Workbench\\scripts\\verify-ui.mjs:95:40 {\r\n log: [ \" - waiting for locator('.approval-card') to be visible\" ],\r\n name: 'TimeoutError'\r\n}\r\n\r\nNode.js v24.22.1\r\n",
|
||||
"script": "verify-ui.mjs",
|
||||
"log": ".qa/external-engines-verify-ui.log"
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.9.0",
|
||||
"at": "2026-10-29T23:20:57.435Z",
|
||||
"groups": 108,
|
||||
"results": [
|
||||
{
|
||||
"script": "verify-ui.mjs",
|
||||
"success": true,
|
||||
"groups": 10,
|
||||
"durationMs": 21007,
|
||||
"evidence": "docs/external-engines-basic-ui-validation.json",
|
||||
"log": ".qa/external-engines-verify-ui.log"
|
||||
},
|
||||
{
|
||||
"script": "verify-diagnostics-ui.mjs",
|
||||
"success": true,
|
||||
"groups": 9,
|
||||
"durationMs": 18640,
|
||||
"evidence": "docs/external-engines-diagnostics-ui-validation.json",
|
||||
"log": ".qa/external-engines-verify-diagnostics-ui.log"
|
||||
},
|
||||
{
|
||||
"script": "verify-execution-ui.mjs",
|
||||
"success": true,
|
||||
"groups": 7,
|
||||
"durationMs": 25334,
|
||||
"evidence": "docs/external-engines-execution-ui-validation.json",
|
||||
"log": ".qa/external-engines-verify-execution-ui.log"
|
||||
},
|
||||
{
|
||||
"script": "verify-delivery-ui.mjs",
|
||||
"success": true,
|
||||
"groups": 9,
|
||||
"durationMs": 35260,
|
||||
"evidence": "docs/external-engines-delivery-ui-validation.json",
|
||||
"log": ".qa/external-engines-verify-delivery-ui.log"
|
||||
},
|
||||
{
|
||||
"script": "verify-index-ui.mjs",
|
||||
"success": true,
|
||||
"groups": 8,
|
||||
"durationMs": 5926,
|
||||
"evidence": "docs/external-engines-index-ui-validation.json",
|
||||
"log": ".qa/external-engines-verify-index-ui.log"
|
||||
},
|
||||
{
|
||||
"script": "verify-change-sets-ui.mjs",
|
||||
"success": true,
|
||||
"groups": 11,
|
||||
"durationMs": 10597,
|
||||
"evidence": "docs/external-engines-change-sets-ui-validation.json",
|
||||
"log": ".qa/external-engines-verify-change-sets-ui.log"
|
||||
},
|
||||
{
|
||||
"script": "verify-context-ui.mjs",
|
||||
"success": true,
|
||||
"groups": 11,
|
||||
"durationMs": 15208,
|
||||
"evidence": "docs/external-engines-context-ui-validation.json",
|
||||
"log": ".qa/external-engines-verify-context-ui.log"
|
||||
},
|
||||
{
|
||||
"script": "verify-workspaces-ui.mjs",
|
||||
"success": true,
|
||||
"groups": 9,
|
||||
"durationMs": 19702,
|
||||
"evidence": "docs/external-engines-workspaces-ui-validation.json",
|
||||
"log": ".qa/external-engines-verify-workspaces-ui.log"
|
||||
},
|
||||
{
|
||||
"script": "verify-python-ui.mjs",
|
||||
"success": true,
|
||||
"groups": 7,
|
||||
"durationMs": 16361,
|
||||
"evidence": "docs/external-engines-python-ui-validation.json",
|
||||
"log": ".qa/external-engines-verify-python-ui.log"
|
||||
},
|
||||
{
|
||||
"script": "verify-react-delivery.mjs",
|
||||
"success": true,
|
||||
"groups": 6,
|
||||
"durationMs": 21743,
|
||||
"evidence": "docs/external-engines-react-delivery-validation.json",
|
||||
"log": ".qa/external-engines-verify-react-delivery.log"
|
||||
},
|
||||
{
|
||||
"script": "verify-research-ui.mjs",
|
||||
"success": true,
|
||||
"groups": 11,
|
||||
"durationMs": 21280,
|
||||
"evidence": "docs/external-engines-research-ui-validation.json",
|
||||
"log": ".qa/external-engines-verify-research-ui.log"
|
||||
},
|
||||
{
|
||||
"script": "verify-engines-ui.mjs",
|
||||
"success": true,
|
||||
"groups": 10,
|
||||
"durationMs": 9522,
|
||||
"evidence": "docs/external-engines-engines-ui-validation.json",
|
||||
"log": ".qa/external-engines-verify-engines-ui.log"
|
||||
}
|
||||
],
|
||||
"scope": "Every verifier owns an independent port and synthetic data directory. Synthetic provider fixtures verify protocols; configured-model acceptance is separate. No production service or real key read/copied."
|
||||
}
|
||||
@@ -0,0 +1,517 @@
|
||||
{
|
||||
"scope": "Read-only inspection of the failed independent 1.9.0 UI fixture; no production state.",
|
||||
"sessions": [
|
||||
{
|
||||
"id": "47f2bc0d-7f9b-454e-a3d9-1289009490ec",
|
||||
"status": "paused",
|
||||
"revision": 46,
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "UI 验证:读取项目并提出改动",
|
||||
"createdAt": "2026-10-29T23:08:45.005Z"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "离线演示:先查看当前项目文件。",
|
||||
"createdAt": "2026-10-29T23:08:46.531Z"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "接下来读取一份项目说明,作为改动依据。",
|
||||
"createdAt": "2026-10-29T23:08:48.768Z"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "已取得项目依据。我会准备一个文件提案,等待你查看差异后应用。",
|
||||
"createdAt": "2026-10-29T23:08:51.803Z"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "最后请求一次只读的环境验证。确认后会记录实际命令输出。",
|
||||
"createdAt": "2026-10-29T23:08:55.893Z"
|
||||
},
|
||||
{
|
||||
"role": "system",
|
||||
"content": "任务已停止,执行记录已保存。",
|
||||
"createdAt": "2026-10-29T23:08:57.100Z"
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"kind": "tool",
|
||||
"phase": "completed",
|
||||
"tool": "list_files",
|
||||
"label": "查看项目文件",
|
||||
"createdAt": "2026-10-29T23:08:46.531Z",
|
||||
"startedAt": "2026-10-29T23:08:46.531Z",
|
||||
"finishedAt": "2026-10-29T23:08:47.109Z",
|
||||
"output": "{\"files\":[{\"path\":\"src\",\"name\":\"src\",\"kind\":\"directory\",\"bytes\":0},{\"path\":\"tests\",\"name\":\"tests\",\"kind\":\"directory\",\"bytes\":0},{\"path\":\"package.json\",\"name\":\"package.json\",\"kind\":\"file\",\"bytes\":98},{\"path\":\"README.md\",\"name\":\"README.md\",\"kind\":\"file\",\"bytes\":334},{\"path\":\"src/catalog.js\",\"name\":\"catalog.js\",\"kind\":\"file\",\"bytes\":684},{\"path\":\"test"
|
||||
},
|
||||
{
|
||||
"kind": "tool",
|
||||
"phase": "completed",
|
||||
"tool": "read_file",
|
||||
"label": "读取文件",
|
||||
"createdAt": "2026-10-29T23:08:48.768Z",
|
||||
"startedAt": "2026-10-29T23:08:48.768Z",
|
||||
"finishedAt": "2026-10-29T23:08:49.696Z",
|
||||
"output": "{\"path\":\"README.md\",\"start_line\":1,\"end_line\":10,\"total_lines\":10,\"content\":\"# 研究任务看板\\n\\n这是 Agent Workbench 自带的小型示例项目,用来体验读取文件、提出修改、审查差异和执行验证。\\n\\n## 运行\\n使用 `node --test` 执行测试。项目不需要安装依赖。\\n\\n## 目标\\n把研究记录整理为可搜索的任务目录,每个条目具有标题、状态和标签。\\n\",\"sha256\":\"d76b1e793eaad3db8cb56f97d3a785bb9d03b5cefa7d94d49d9546fd4e28dc9e\",\"bom\":false,\"truncated\":false,\"range_start"
|
||||
},
|
||||
{
|
||||
"kind": "tool",
|
||||
"phase": "completed",
|
||||
"tool": "propose_file",
|
||||
"label": "准备文件改动",
|
||||
"createdAt": "2026-10-29T23:08:51.803Z",
|
||||
"startedAt": "2026-10-29T23:08:51.803Z",
|
||||
"finishedAt": "2026-10-29T23:08:53.148Z",
|
||||
"output": "{\"status\":\"awaiting_review\",\"change_id\":\"2dd54d37-d21e-43fd-b445-ca8f8c1907ce\",\"path\":\"WORKBENCH-NOTES.md\",\"additions\":21,\"deletions\":0,\"message\":\"提案已保存,项目文件尚未改变。等待用户查看差异并应用。\"}"
|
||||
},
|
||||
{
|
||||
"kind": "tool",
|
||||
"phase": "interrupted",
|
||||
"tool": "run_command",
|
||||
"label": "运行终端命令",
|
||||
"createdAt": "2026-10-29T23:08:55.893Z",
|
||||
"startedAt": "2026-10-29T23:08:55.893Z",
|
||||
"finishedAt": "2026-10-29T23:08:56.750Z",
|
||||
"output": "{\"status\":\"interrupted\",\"message\":\"命令未执行。\",\"requires_verification\":false}"
|
||||
}
|
||||
],
|
||||
"providerMessages": [
|
||||
{
|
||||
"role": "user",
|
||||
"contentBytes": 39
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"calls": [
|
||||
"list_files"
|
||||
],
|
||||
"contentBytes": 45
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"contentBytes": 547
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"calls": [
|
||||
"read_file"
|
||||
],
|
||||
"contentBytes": 57
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"contentBytes": 744
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"calls": [
|
||||
"propose_file"
|
||||
],
|
||||
"contentBytes": 90
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"contentBytes": 230
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"calls": [
|
||||
"run_command"
|
||||
],
|
||||
"contentBytes": 81
|
||||
},
|
||||
{
|
||||
"role": "tool",
|
||||
"contentBytes": 85
|
||||
}
|
||||
],
|
||||
"failure": null,
|
||||
"changes": [
|
||||
{
|
||||
"path": "WORKBENCH-NOTES.md",
|
||||
"status": "pending"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"records": [
|
||||
{
|
||||
"kind": "run",
|
||||
"id": "1d6c4ed1-2959-48de-9d28-12b03270dc14",
|
||||
"status": "paused",
|
||||
"startedAt": "2026-10-29T23:08:44.959Z",
|
||||
"finishedAt": "2026-10-29T23:08:57.369Z",
|
||||
"stopReason": "cancelled"
|
||||
},
|
||||
{
|
||||
"kind": "step",
|
||||
"id": "2d9c9cd7-a3b8-4249-9821-300023860e28",
|
||||
"status": "completed",
|
||||
"startedAt": "2026-10-29T23:08:45.442Z",
|
||||
"finishedAt": "2026-10-29T23:08:47.671Z"
|
||||
},
|
||||
{
|
||||
"kind": "context_plan",
|
||||
"id": "a7ed1153-6ba1-46a0-8706-849ad4bf7d3d",
|
||||
"status": "completed",
|
||||
"finishedAt": "2026-10-29T23:08:46.211Z",
|
||||
"estimatedInputTokens": 4641
|
||||
},
|
||||
{
|
||||
"kind": "tool",
|
||||
"id": "56201a61-0cba-4f58-ba54-191da73297d9",
|
||||
"status": "completed",
|
||||
"startedAt": "2026-10-29T23:08:46.531Z",
|
||||
"finishedAt": "2026-10-29T23:08:47.339Z",
|
||||
"tool": "list_files"
|
||||
},
|
||||
{
|
||||
"kind": "step",
|
||||
"id": "9dd99963-9889-492a-881c-f179785819e8",
|
||||
"status": "completed",
|
||||
"startedAt": "2026-10-29T23:08:47.795Z",
|
||||
"finishedAt": "2026-10-29T23:08:50.151Z"
|
||||
},
|
||||
{
|
||||
"kind": "context_plan",
|
||||
"id": "abdd02c4-bc13-4d66-9c52-b9561b843dfd",
|
||||
"status": "completed",
|
||||
"finishedAt": "2026-10-29T23:08:48.513Z",
|
||||
"estimatedInputTokens": 5223
|
||||
},
|
||||
{
|
||||
"kind": "tool",
|
||||
"id": "10b320cc-148a-4b7d-bab3-2942e82a8d68",
|
||||
"status": "completed",
|
||||
"startedAt": "2026-10-29T23:08:48.768Z",
|
||||
"finishedAt": "2026-10-29T23:08:49.856Z",
|
||||
"tool": "read_file"
|
||||
},
|
||||
{
|
||||
"kind": "step",
|
||||
"id": "1cb2044a-5ae3-496e-917e-5b16089ba239",
|
||||
"status": "completed",
|
||||
"startedAt": "2026-10-29T23:08:50.603Z",
|
||||
"finishedAt": "2026-10-29T23:08:54.155Z"
|
||||
},
|
||||
{
|
||||
"kind": "context_plan",
|
||||
"id": "201c4702-7023-4855-8aa0-cfdbde3fd5a3",
|
||||
"status": "completed",
|
||||
"finishedAt": "2026-10-29T23:08:51.658Z",
|
||||
"estimatedInputTokens": 5905
|
||||
},
|
||||
{
|
||||
"kind": "tool",
|
||||
"id": "22fba602-1516-45d9-805b-c3c76bc1d7c6",
|
||||
"status": "completed",
|
||||
"startedAt": "2026-10-29T23:08:51.803Z",
|
||||
"finishedAt": "2026-10-29T23:08:53.599Z",
|
||||
"tool": "propose_file"
|
||||
},
|
||||
{
|
||||
"kind": "step",
|
||||
"id": "9cad577e-c878-456b-8df1-2de56c57b386",
|
||||
"status": "interrupted",
|
||||
"startedAt": "2026-10-29T23:08:54.692Z",
|
||||
"finishedAt": "2026-10-29T23:08:57.369Z"
|
||||
},
|
||||
{
|
||||
"kind": "context_plan",
|
||||
"id": "95d1ffbd-c1ea-4842-add3-5e14f8aebcb0",
|
||||
"status": "completed",
|
||||
"finishedAt": "2026-10-29T23:08:55.807Z",
|
||||
"estimatedInputTokens": 6705
|
||||
},
|
||||
{
|
||||
"kind": "tool",
|
||||
"id": "d64236fa-719d-48d3-9c1b-2ce2a2eebf2d",
|
||||
"status": "interrupted",
|
||||
"startedAt": "2026-10-29T23:08:55.893Z",
|
||||
"finishedAt": "2026-10-29T23:08:56.835Z",
|
||||
"tool": "run_command"
|
||||
}
|
||||
],
|
||||
"storedEvents": [
|
||||
{
|
||||
"seq": 1,
|
||||
"type": "session.updated",
|
||||
"revision": 1,
|
||||
"created_at": "2026-10-29T23:08:44.743Z"
|
||||
},
|
||||
{
|
||||
"seq": 2,
|
||||
"type": "run.started",
|
||||
"revision": 2,
|
||||
"created_at": "2026-10-29T23:08:44.959Z"
|
||||
},
|
||||
{
|
||||
"seq": 3,
|
||||
"type": "session.updated",
|
||||
"revision": 3,
|
||||
"created_at": "2026-10-29T23:08:45.005Z"
|
||||
},
|
||||
{
|
||||
"seq": 4,
|
||||
"type": "session.updated",
|
||||
"revision": 4,
|
||||
"created_at": "2026-10-29T23:08:45.111Z"
|
||||
},
|
||||
{
|
||||
"seq": 5,
|
||||
"type": "step.started",
|
||||
"revision": 5,
|
||||
"created_at": "2026-10-29T23:08:45.442Z"
|
||||
},
|
||||
{
|
||||
"seq": 6,
|
||||
"type": "context.prepared",
|
||||
"revision": 6,
|
||||
"created_at": "2026-10-29T23:08:45.952Z"
|
||||
},
|
||||
{
|
||||
"seq": 7,
|
||||
"type": "context.completed",
|
||||
"revision": 7,
|
||||
"created_at": "2026-10-29T23:08:46.211Z"
|
||||
},
|
||||
{
|
||||
"seq": 8,
|
||||
"type": "session.updated",
|
||||
"revision": 8,
|
||||
"created_at": "2026-10-29T23:08:46.532Z"
|
||||
},
|
||||
{
|
||||
"seq": 9,
|
||||
"type": "tool.validating",
|
||||
"revision": 9,
|
||||
"created_at": "2026-10-29T23:08:46.689Z"
|
||||
},
|
||||
{
|
||||
"seq": 10,
|
||||
"type": "tool.running",
|
||||
"revision": 10,
|
||||
"created_at": "2026-10-29T23:08:46.882Z"
|
||||
},
|
||||
{
|
||||
"seq": 11,
|
||||
"type": "tool.result",
|
||||
"revision": 11,
|
||||
"created_at": "2026-10-29T23:08:47.339Z"
|
||||
},
|
||||
{
|
||||
"seq": 12,
|
||||
"type": "session.updated",
|
||||
"revision": 12,
|
||||
"created_at": "2026-10-29T23:08:47.553Z"
|
||||
},
|
||||
{
|
||||
"seq": 13,
|
||||
"type": "step.finished",
|
||||
"revision": 13,
|
||||
"created_at": "2026-10-29T23:08:47.671Z"
|
||||
},
|
||||
{
|
||||
"seq": 14,
|
||||
"type": "step.started",
|
||||
"revision": 14,
|
||||
"created_at": "2026-10-29T23:08:47.795Z"
|
||||
},
|
||||
{
|
||||
"seq": 15,
|
||||
"type": "context.prepared",
|
||||
"revision": 15,
|
||||
"created_at": "2026-10-29T23:08:48.344Z"
|
||||
},
|
||||
{
|
||||
"seq": 16,
|
||||
"type": "context.completed",
|
||||
"revision": 16,
|
||||
"created_at": "2026-10-29T23:08:48.514Z"
|
||||
},
|
||||
{
|
||||
"seq": 17,
|
||||
"type": "session.updated",
|
||||
"revision": 17,
|
||||
"created_at": "2026-10-29T23:08:48.768Z"
|
||||
},
|
||||
{
|
||||
"seq": 18,
|
||||
"type": "tool.validating",
|
||||
"revision": 18,
|
||||
"created_at": "2026-10-29T23:08:49.029Z"
|
||||
},
|
||||
{
|
||||
"seq": 19,
|
||||
"type": "tool.running",
|
||||
"revision": 19,
|
||||
"created_at": "2026-10-29T23:08:49.329Z"
|
||||
},
|
||||
{
|
||||
"seq": 20,
|
||||
"type": "tool.result",
|
||||
"revision": 20,
|
||||
"created_at": "2026-10-29T23:08:49.858Z"
|
||||
},
|
||||
{
|
||||
"seq": 21,
|
||||
"type": "session.updated",
|
||||
"revision": 21,
|
||||
"created_at": "2026-10-29T23:08:49.956Z"
|
||||
},
|
||||
{
|
||||
"seq": 22,
|
||||
"type": "step.finished",
|
||||
"revision": 22,
|
||||
"created_at": "2026-10-29T23:08:50.152Z"
|
||||
},
|
||||
{
|
||||
"seq": 23,
|
||||
"type": "step.started",
|
||||
"revision": 23,
|
||||
"created_at": "2026-10-29T23:08:50.605Z"
|
||||
},
|
||||
{
|
||||
"seq": 24,
|
||||
"type": "context.prepared",
|
||||
"revision": 24,
|
||||
"created_at": "2026-10-29T23:08:51.474Z"
|
||||
},
|
||||
{
|
||||
"seq": 25,
|
||||
"type": "context.completed",
|
||||
"revision": 25,
|
||||
"created_at": "2026-10-29T23:08:51.658Z"
|
||||
},
|
||||
{
|
||||
"seq": 26,
|
||||
"type": "session.updated",
|
||||
"revision": 26,
|
||||
"created_at": "2026-10-29T23:08:51.803Z"
|
||||
},
|
||||
{
|
||||
"seq": 27,
|
||||
"type": "tool.validating",
|
||||
"revision": 27,
|
||||
"created_at": "2026-10-29T23:08:52.009Z"
|
||||
},
|
||||
{
|
||||
"seq": 28,
|
||||
"type": "tool.running",
|
||||
"revision": 28,
|
||||
"created_at": "2026-10-29T23:08:52.498Z"
|
||||
},
|
||||
{
|
||||
"seq": 29,
|
||||
"type": "session.updated",
|
||||
"revision": 29,
|
||||
"created_at": "2026-10-29T23:08:52.899Z"
|
||||
},
|
||||
{
|
||||
"seq": 30,
|
||||
"type": "tool.result",
|
||||
"revision": 30,
|
||||
"created_at": "2026-10-29T23:08:53.599Z"
|
||||
},
|
||||
{
|
||||
"seq": 31,
|
||||
"type": "session.updated",
|
||||
"revision": 31,
|
||||
"created_at": "2026-10-29T23:08:53.812Z"
|
||||
},
|
||||
{
|
||||
"seq": 32,
|
||||
"type": "step.finished",
|
||||
"revision": 32,
|
||||
"created_at": "2026-10-29T23:08:54.157Z"
|
||||
},
|
||||
{
|
||||
"seq": 33,
|
||||
"type": "step.started",
|
||||
"revision": 33,
|
||||
"created_at": "2026-10-29T23:08:54.693Z"
|
||||
},
|
||||
{
|
||||
"seq": 34,
|
||||
"type": "context.prepared",
|
||||
"revision": 34,
|
||||
"created_at": "2026-10-29T23:08:55.600Z"
|
||||
},
|
||||
{
|
||||
"seq": 35,
|
||||
"type": "context.completed",
|
||||
"revision": 35,
|
||||
"created_at": "2026-10-29T23:08:55.808Z"
|
||||
},
|
||||
{
|
||||
"seq": 36,
|
||||
"type": "session.updated",
|
||||
"revision": 36,
|
||||
"created_at": "2026-10-29T23:08:55.894Z"
|
||||
},
|
||||
{
|
||||
"seq": 37,
|
||||
"type": "tool.validating",
|
||||
"revision": 37,
|
||||
"created_at": "2026-10-29T23:08:55.996Z"
|
||||
},
|
||||
{
|
||||
"seq": 38,
|
||||
"type": "session.updated",
|
||||
"revision": 38,
|
||||
"created_at": "2026-10-29T23:08:56.040Z"
|
||||
},
|
||||
{
|
||||
"seq": 39,
|
||||
"type": "tool.waiting",
|
||||
"revision": 39,
|
||||
"created_at": "2026-10-29T23:08:56.120Z"
|
||||
},
|
||||
{
|
||||
"seq": 40,
|
||||
"type": "session.updated",
|
||||
"revision": 40,
|
||||
"created_at": "2026-10-29T23:08:56.420Z"
|
||||
},
|
||||
{
|
||||
"seq": 41,
|
||||
"type": "session.updated",
|
||||
"revision": 41,
|
||||
"created_at": "2026-10-29T23:08:56.602Z"
|
||||
},
|
||||
{
|
||||
"seq": 42,
|
||||
"type": "tool.result",
|
||||
"revision": 42,
|
||||
"created_at": "2026-10-29T23:08:56.836Z"
|
||||
},
|
||||
{
|
||||
"seq": 43,
|
||||
"type": "session.updated",
|
||||
"revision": 43,
|
||||
"created_at": "2026-10-29T23:08:56.985Z"
|
||||
},
|
||||
{
|
||||
"seq": 44,
|
||||
"type": "session.updated",
|
||||
"revision": 44,
|
||||
"created_at": "2026-10-29T23:08:57.101Z"
|
||||
},
|
||||
{
|
||||
"seq": 45,
|
||||
"type": "session.updated",
|
||||
"revision": 45,
|
||||
"created_at": "2026-10-29T23:08:57.230Z"
|
||||
},
|
||||
{
|
||||
"seq": 46,
|
||||
"type": "run.finished",
|
||||
"revision": 46,
|
||||
"created_at": "2026-10-29T23:08:57.370Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"success": true,
|
||||
"url": "http://127.0.0.1:60172",
|
||||
"browser": "Microsoft Edge 156.0.4314.42",
|
||||
"date": "2026-10-29T23:17:36.773Z",
|
||||
"projectRoot": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\ui-cf9778ab-6f59-4481-b0f4-0e6921e261aa\\ui-project",
|
||||
"viewports": [
|
||||
1440,
|
||||
780,
|
||||
390
|
||||
],
|
||||
"passed": [
|
||||
"project selection and real file preview",
|
||||
"real command consent, execution and stale snapshot rejection",
|
||||
"diff review and verified file application",
|
||||
"manual editor creates a reviewable proposal",
|
||||
"file responses stay with the current selection",
|
||||
"denial, session selection, reload, stale response rejection and export",
|
||||
"project inventory responses cannot replace another project",
|
||||
"780 and 390 px: project drawer, file, diff and trace controls, no page overflow",
|
||||
"unified and detailed research reports render",
|
||||
"model list, ephemeral key, compatible fixture tool loop and return to offline mode"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"modelValidation": "controlled local HTTP fixture; no real model"
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.9.0",
|
||||
"testedAt": "2026-10-29T23:19:13.098Z",
|
||||
"cases": [
|
||||
"Desktop batch scope, per-file diffs, sealed single-write guard and pre-apply bytes",
|
||||
"Three-file reviewed application preserves exact BOM/CRLF/LF and creates the new file",
|
||||
"Explicit batch rollback restores exact originals and removes only the reviewed new file",
|
||||
"A last-file owner conflict blocks the whole batch and shows the real recovery direction",
|
||||
"Durable partial recovery reads actual hashes and preserves owner content during rollback",
|
||||
"Changed observation fingerprints reject stale acknowledgement without releasing the project",
|
||||
"Explicit owner-content acknowledgement ends recovery without claiming successful application",
|
||||
"Switching projects clears the previous task notification while retaining its durable error and recovery history",
|
||||
"390px step-limit review, same-task continuation entry, rollback confirmation and keyboard close fit the viewport",
|
||||
"A delayed preparation response never opens a different project or changes its selected session",
|
||||
"A failed batch response after its component unmounts cannot display an error in the newly selected project"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"screenshots": [
|
||||
".qa/screenshots/external-engines-batch-desktop-review.png",
|
||||
".qa/screenshots/external-engines-batch-desktop-conflict.png",
|
||||
".qa/screenshots/external-engines-batch-desktop-recovery.png",
|
||||
".qa/screenshots/external-engines-batch-mobile-review.png",
|
||||
".qa/screenshots/external-engines-batch-mobile-rollback.png"
|
||||
],
|
||||
"projectRoot": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\batch-ui-9a00d10c-d223-47d4-89b0-c0ab7f7e37a9",
|
||||
"scope": "Real independent demo host and durable batch states; UI fixtures include actual owner conflict/rollback results. No real model credentials or user project were used."
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.9.0",
|
||||
"testedAt": "2026-10-29T23:19:13.098Z",
|
||||
"cases": [
|
||||
"Desktop batch scope, per-file diffs, sealed single-write guard and pre-apply bytes",
|
||||
"Three-file reviewed application preserves exact BOM/CRLF/LF and creates the new file",
|
||||
"Explicit batch rollback restores exact originals and removes only the reviewed new file",
|
||||
"A last-file owner conflict blocks the whole batch and shows the real recovery direction",
|
||||
"Durable partial recovery reads actual hashes and preserves owner content during rollback",
|
||||
"Changed observation fingerprints reject stale acknowledgement without releasing the project",
|
||||
"Explicit owner-content acknowledgement ends recovery without claiming successful application",
|
||||
"Switching projects clears the previous task notification while retaining its durable error and recovery history",
|
||||
"390px step-limit review, same-task continuation entry, rollback confirmation and keyboard close fit the viewport",
|
||||
"A delayed preparation response never opens a different project or changes its selected session",
|
||||
"A failed batch response after its component unmounts cannot display an error in the newly selected project"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"screenshots": [
|
||||
".qa/screenshots/external-engines-batch-desktop-review.png",
|
||||
".qa/screenshots/external-engines-batch-desktop-conflict.png",
|
||||
".qa/screenshots/external-engines-batch-desktop-recovery.png",
|
||||
".qa/screenshots/external-engines-batch-mobile-review.png",
|
||||
".qa/screenshots/external-engines-batch-mobile-rollback.png"
|
||||
],
|
||||
"projectRoot": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\batch-ui-9a00d10c-d223-47d4-89b0-c0ab7f7e37a9",
|
||||
"scope": "Real independent demo host and durable batch states; UI fixtures include actual owner conflict/rollback results. No real model credentials or user project were used."
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.9.0",
|
||||
"testedAt": "2026-10-29T23:19:27.927Z",
|
||||
"passed": [
|
||||
"desktop request estimate, actual usage, complete goal and history identity are visible",
|
||||
"paged complete history opens actual tool result artifacts without executing tools",
|
||||
"historical and resumed Runs retain their own request records",
|
||||
"390px history, original JSON and sent-body dialogs fit and retain close controls",
|
||||
"late old history failure stays in its original scope after switching projects",
|
||||
"late old Run failure stays in its original scope after switching projects",
|
||||
"late old request-body failure stays in its original scope after switching projects",
|
||||
"context-limit pause explains the intact requirement and explicit continuation",
|
||||
"390px repeated-read pause explains the cause and explicit continuation retains the same Task",
|
||||
"desktop working evidence shows actual code, original result provenance and the current Task",
|
||||
"390px working evidence and sent request stay readable and closing the artifact retains task navigation"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"screenshots": [
|
||||
".qa/screenshots/external-engines-desktop-plan.png",
|
||||
".qa/screenshots/external-engines-desktop-history.png",
|
||||
".qa/screenshots/external-engines-mobile-history.png",
|
||||
".qa/screenshots/external-engines-mobile-original.png",
|
||||
".qa/screenshots/external-engines-mobile-request-body.png",
|
||||
".qa/screenshots/external-engines-mobile-read-pause.png",
|
||||
".qa/screenshots/external-engines-desktop-working-evidence.png",
|
||||
".qa/screenshots/external-engines-mobile-working-evidence.png"
|
||||
],
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\context-ui-707b4ad5-dc16-4df5-979d-bf35edea9dbe",
|
||||
"data": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\context-ui-707b4ad5-dc16-4df5-979d-bf35edea9dbe\\data",
|
||||
"mode": "saved synthetic context evidence; no real model or project commands executed by this UI verifier",
|
||||
"browser": "156.0.4314.42"
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.9.0",
|
||||
"testedAt": "2026-10-29T23:18:56.487Z",
|
||||
"browser": "156.0.4314.42",
|
||||
"passed": [
|
||||
"actual failing tests and four source proposals retain the original project and task",
|
||||
"reviewed changes continue the same Task through 14 real tests and model-prepared Git review",
|
||||
"review shows actual paths, diffs, tests, author and policy; cancelling leaves Git unchanged",
|
||||
"an index change after confirmation preview refuses the stale job and preserves both staged owners",
|
||||
"390px confirmation keeps file hashes, diffs and actions inside the modal",
|
||||
"double confirmation creates one four-file commit, retains owner bytes and publishes report with completion",
|
||||
"report viewing and Markdown/JSON downloads preserve verified artifact bytes and truthful acceptance limits",
|
||||
"mobile report preview closes cleanly and keeps the task input fixed",
|
||||
"unknown Git results block new submission and the explicit reconcile action restores the existing commit"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"projectRoot": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\delivery-ui-7bd69041-51db-48b9-8961-03aebf94d321\\四模块交付工程",
|
||||
"projectId": "1bd9532d-c335-4a6d-b4a0-baccb94a539e",
|
||||
"sessionId": "419c009a-95c4-4023-8aab-176735c77b8f",
|
||||
"taskId": "bab92c3d-40a1-4781-ac58-2933cd19322b",
|
||||
"commit": "64c78cb653e6098e1823673c671081f6d6cf1593",
|
||||
"recoveryCommit": "36fc8233c7529a9a582fb29ae616e1d4945b1c70",
|
||||
"testCounts": {
|
||||
"baselineFailed": 13,
|
||||
"passed": 14
|
||||
},
|
||||
"model": "controlled local HTTP fixture",
|
||||
"confirmations": 2
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.9.0",
|
||||
"url": "http://127.0.0.1:64291",
|
||||
"date": "2026-10-29T23:17:55.631Z",
|
||||
"passed": [
|
||||
"model response validation checks the tentative connection before saving",
|
||||
"a model failure after successful tools shows source, attempts and local runtime diagnosis",
|
||||
"explicit retry preserves the completed tool result without replaying the task",
|
||||
"an error question receives the actual session diagnosis and formatted answer",
|
||||
"review state exposes the review action and prevents application during a running request",
|
||||
"approved Unicode commands execute in the declared shell and retain Chinese output",
|
||||
"authentication errors do not retry and error/diagnostic controls fit a 390 px viewport",
|
||||
"stop cancels pending retry and clears running model state",
|
||||
"a transient service failure recovers within the bounded retry policy"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"modelValidation": "controlled local HTTP fixture; actual configured model is verified separately"
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.9.0",
|
||||
"testedAt": "2026-10-29T23:20:57.037Z",
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd",
|
||||
"browser": "156.0.4314.42",
|
||||
"passed": [
|
||||
"independent desktop engine entry detects the declared installation and clearly separates connection from project execution",
|
||||
"missing installations and edited directories cannot launch a check until detection succeeds",
|
||||
"UI launch seals the selected installation into the current Task/Run and renders actual startup and process-close facts",
|
||||
"original record paging, full download SHA256 and nested-dialog keyboard close preserve the exact evidence",
|
||||
"an explicit new check creates a different process and record while retaining the original check unchanged",
|
||||
"declared pending-initialize fixture stops its owned process and explicit retry preserves the stopped result",
|
||||
"the same product UI verifies the actual installed DeepSeek SDK without a prompt or configured-model call",
|
||||
"390px installation paths, source chain, original record, paging and keyboard close remain readable without page overflow",
|
||||
"late detection failure from a closed panel cannot appear in a different task or reveal its prior engine records",
|
||||
"actual host restart preserves all native and declared-fixture records with no protocol replay or project modification"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"expectedRequestFailures": [],
|
||||
"screenshots": [
|
||||
"D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd\\screenshots\\engines-native-desktop.png",
|
||||
"D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd\\screenshots\\engines-record-mobile.png",
|
||||
"D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd\\screenshots\\engines-native-mobile.png"
|
||||
],
|
||||
"starts": [
|
||||
{
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd\\本地 SDK #",
|
||||
"identitySha256": "ff1935ed3045cac824e5ee1b1e7a88484019cfe0dd0c688281fc701834b95971"
|
||||
},
|
||||
{
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd\\本地 SDK #",
|
||||
"retry": true
|
||||
},
|
||||
{
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd\\本地 SDK #",
|
||||
"identitySha256": "ff1935ed3045cac824e5ee1b1e7a88484019cfe0dd0c688281fc701834b95971"
|
||||
},
|
||||
{
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\engines-ui-827d34f1-e0ba-4fb2-ad7f-464a86bae4cd\\本地 SDK #",
|
||||
"retry": true
|
||||
},
|
||||
{
|
||||
"root": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness",
|
||||
"identitySha256": "a60f7733d6eaf91bcd31ce5d1da38d6d267a16ad29bc03bba548f314fddec22a"
|
||||
}
|
||||
],
|
||||
"nativeJob": {
|
||||
"schemaVersion": 1,
|
||||
"id": "d008decd-555c-431e-98b4-fe62f128dcb0",
|
||||
"sessionId": "4c1661cc-c312-4cd9-b74a-7122645c9525",
|
||||
"projectId": "6f86db88-ac50-40de-b1e6-5c4a2ae36f8f",
|
||||
"taskId": "3936312e-10ce-407c-865e-6e07ce4c24bb",
|
||||
"runId": "2def7d78-5ec7-4104-b031-3ce7d72576cd",
|
||||
"engineId": "deepseek-harness",
|
||||
"scope": "deepseek-sdk-connection-probe",
|
||||
"source": "user",
|
||||
"installation": {
|
||||
"engineId": "deepseek-harness",
|
||||
"name": "DeepSeek Harness",
|
||||
"profile": "sdk-minimal",
|
||||
"expectedVersion": "0.2.1-rc.2",
|
||||
"root": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness",
|
||||
"capabilities": {
|
||||
"connectionProbe": true,
|
||||
"projectExecution": false,
|
||||
"prompt": false,
|
||||
"singleSessionCancel": false,
|
||||
"protocolVersionNegotiation": false,
|
||||
"cancellationUnit": "owned-process",
|
||||
"tokenStreaming": false
|
||||
},
|
||||
"limitations": [
|
||||
"当前接入核验启动、会话目录、协议错误和关闭;工程执行接入开发中。",
|
||||
"SDK没有单会话cancel或close;停止以所属独立进程为单位。",
|
||||
"SDK serverInfo.version与发行包版本分别核对,没有有效协议版本协商。",
|
||||
"SDK事件覆盖运行时会话树,idle事件不能直接判项目交付完成。"
|
||||
],
|
||||
"status": "available",
|
||||
"version": "0.2.1-rc.2",
|
||||
"entry": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\apps\\cli\\lib\\bin.js",
|
||||
"inputs": [
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\apps\\cli\\package.json",
|
||||
"bytes": 8138,
|
||||
"sha256": "d42efe9f3ff424f602f11598af8805ad25039953ebbbd3c163d67875f7e8658b",
|
||||
"relative": "apps/cli/package.json"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\apps\\cli\\lib\\bin.js",
|
||||
"bytes": 11772,
|
||||
"sha256": "80112efe368efb1a39720c7ada0af00442e5131fb2744edaaff8a3e8bb499e6f",
|
||||
"relative": "apps/cli/lib/bin.js"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\boot\\cmdline\\lib\\index.js",
|
||||
"bytes": 6973,
|
||||
"sha256": "7253190611566485f8b6f836fae6e0f2a7abbc59bb807c42e874844016e6d3a0",
|
||||
"relative": "packages/boot/cmdline/lib/index.js"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\bundle\\sdk-app\\lib\\index.js",
|
||||
"bytes": 1921,
|
||||
"sha256": "cc7e6c38b0b38c0e92a0dffb45210c1dac6ef518547436e805e84b772f91a475",
|
||||
"relative": "packages/bundle/sdk-app/lib/index.js"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\bundle\\sdk-minimal\\package.json",
|
||||
"bytes": 2920,
|
||||
"sha256": "0e177cbca85148207343db5afd7f12829723cf3f2afedfa8e85a5c5dcd58f604",
|
||||
"relative": "packages/bundle/sdk-minimal/package.json"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\bundle\\sdk-minimal\\cordis.patch.yml",
|
||||
"bytes": 5636,
|
||||
"sha256": "464ea07c03d3639c2c387fa3a684f5d4001e7ca39f8257b361c604f19487af66",
|
||||
"relative": "packages/bundle/sdk-minimal/cordis.patch.yml"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\sdk\\server\\package.json",
|
||||
"bytes": 2155,
|
||||
"sha256": "2690f99763c3e1e7bd57f680f26e53010c2a3d7c4dffe06ff64a07ae3928cb17",
|
||||
"relative": "packages/sdk/server/package.json"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\sdk\\server\\lib\\index.js",
|
||||
"bytes": 16454,
|
||||
"sha256": "55412923f9f7c279f7e0b2a1e2853eaf238f390b3d84046cb9c94dc5f22a1e4a",
|
||||
"relative": "packages/sdk/server/lib/index.js"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\sdk\\protocol\\package.json",
|
||||
"bytes": 1237,
|
||||
"sha256": "b030b0431d69723b5424dc2519cd4b381ec91acd22b73e0b30d6b8a19f1f2f94",
|
||||
"relative": "packages/sdk/protocol/package.json"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\sdk\\protocol\\lib\\index.js",
|
||||
"bytes": 7336,
|
||||
"sha256": "371c38ca3514797d86df5f4bb78a56c40a2637294b83aababe8145bec6a20253",
|
||||
"relative": "packages/sdk/protocol/lib/index.js"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\sdk\\client\\package.json",
|
||||
"bytes": 1325,
|
||||
"sha256": "ff33f2ecec2d48bb8a24397cc664fc2dd50ba49d5288eb11fea1cb12931e5d5f",
|
||||
"relative": "packages/sdk/client/package.json"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\pnpm-lock.yaml",
|
||||
"bytes": 1090222,
|
||||
"sha256": "4637cca3b89c4c8d5a147321710e597aa62ec2444a3772ab542be5690893dfe4",
|
||||
"relative": "pnpm-lock.yaml"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\vendor\\cordis\\lib\\index.js",
|
||||
"bytes": 60361,
|
||||
"sha256": "6a9394c0877ff45218818c6e815edd038f8057e1a1deb390a8d43ec81c57691e",
|
||||
"relative": "vendor/cordis/lib/index.js"
|
||||
}
|
||||
],
|
||||
"node": {
|
||||
"path": "C:\\Program Files\\nodejs\\node.exe",
|
||||
"bytes": 93915464,
|
||||
"sha256": "d702daa815eabbff763c7d3808e235cf031cf2ca70211b56847bc72f51e240e5",
|
||||
"version": "24.22.1"
|
||||
},
|
||||
"identitySha256": "a60f7733d6eaf91bcd31ce5d1da38d6d267a16ad29bc03bba548f314fddec22a",
|
||||
"serverInfo": {
|
||||
"name": "deepseek-harness-sdk-runtime",
|
||||
"version": "0.0.1"
|
||||
},
|
||||
"message": "已找到匹配版本,可验证原程序的连接与停止。"
|
||||
},
|
||||
"sdkSessionId": "bc24dddd-fb5d-429c-9608-c51b900ea4aa",
|
||||
"directory": "C:\\Users\\wangy\\AppData\\Local\\Temp\\AgentWorkbench-Engines\\d008decd-555c-431e-98b4-fe62f128dcb0",
|
||||
"status": "completed",
|
||||
"startedAt": "2026-10-29T23:20:53.951Z",
|
||||
"finishedAt": "2026-10-29T23:20:55.019Z",
|
||||
"requiresVerification": false,
|
||||
"verification": {
|
||||
"verified": true,
|
||||
"installationSha256": "a60f7733d6eaf91bcd31ce5d1da38d6d267a16ad29bc03bba548f314fddec22a",
|
||||
"readySignal": "appReady",
|
||||
"sdkSessionId": "bc24dddd-fb5d-429c-9608-c51b900ea4aa",
|
||||
"connectionId": "58630340-a2dd-4e4b-ae2f-c1537f49442d",
|
||||
"rootExited": true,
|
||||
"modelRequests": 0
|
||||
},
|
||||
"summary": "连接通过,启动、协议返回、会话目录与进程结束均已核对。",
|
||||
"contractArtifactId": "82e76a6f-2e7b-44f7-b7ce-3b099983fc05",
|
||||
"contractSha256": "3be40aef72d5735d68d58891ac1b6617b2a05ef9d8e3acd5e9be92854d5ec784",
|
||||
"eventId": "d94fad3c-4cd0-46a1-ac76-f64dcf93013e",
|
||||
"pid": 40464,
|
||||
"connectionId": "58630340-a2dd-4e4b-ae2f-c1537f49442d",
|
||||
"readiness": {
|
||||
"schemaVersion": 1,
|
||||
"nonce": "c7bed65a-7e27-4995-963b-d35cfdedfbfe",
|
||||
"pid": 40464,
|
||||
"signal": "appReady",
|
||||
"readyAt": "2026-10-29T23:20:54.795Z",
|
||||
"artifact": {
|
||||
"path": "C:\\Users\\wangy\\AppData\\Local\\Temp\\AgentWorkbench-Engines\\d008decd-555c-431e-98b4-fe62f128dcb0\\ready.json",
|
||||
"bytes": 135,
|
||||
"sha256": "3be2cc12a9c1364286967dc75f5bd229a157e6ea24c9b83e396cd593afc78c5a"
|
||||
}
|
||||
},
|
||||
"serverInfo": {
|
||||
"name": "deepseek-harness-sdk-runtime",
|
||||
"version": "0.0.1"
|
||||
},
|
||||
"reportArtifactId": "8ddb137c-9cbc-436b-a0de-56cce5082192",
|
||||
"reportSha256": "f90e05512a3ffe5d3067d4aad0c6dc044f33fbd0f87cbec95890d57d15cfd822",
|
||||
"reportSummary": {
|
||||
"status": "verified",
|
||||
"modelRequests": 0,
|
||||
"providerRequests": 0,
|
||||
"observedResponses": 6,
|
||||
"rootExited": true
|
||||
}
|
||||
},
|
||||
"actualSdk": {
|
||||
"version": "0.2.1-rc.2",
|
||||
"identitySha256": "a60f7733d6eaf91bcd31ce5d1da38d6d267a16ad29bc03bba548f314fddec22a",
|
||||
"nativeMethods": 6,
|
||||
"modelRequests": 0,
|
||||
"rootExited": true
|
||||
},
|
||||
"stopScope": "declared private SDK pending-initialize fixture",
|
||||
"scope": "Independent service and data. Original 4318 Provider, tasks and credentials were not accessed."
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.9.0",
|
||||
"testedAt": "2026-10-29T23:18:21.183Z",
|
||||
"browser": "156.0.4314.42",
|
||||
"passed": [
|
||||
"model-selected checks wait for approval and display actual counted results",
|
||||
"verified artifact preview shows the real check log and hash",
|
||||
"changed source invalidates old checks and manual confirmation runs the new plan",
|
||||
"390px task drawer, log preview, close controls and fixed composer remain operable",
|
||||
"reconnection synchronizes missed session changes in other projects",
|
||||
"budget controls pause before tools and preserve the goal across recorded runs",
|
||||
"applied proposals continue the original task into actual engineering verification"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"projectRoot": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\execution-ui-a93d929c-aa59-43ed-98bb-9b45a03ab686\\project",
|
||||
"model": "controlled local HTTP fixture"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"checkedAt": "2026-10-29T23:19:02.619Z",
|
||||
"version": "1.9.0",
|
||||
"passed": [
|
||||
"工程索引可独立于任务使用,实际覆盖范围与损坏文件显示明确",
|
||||
"真实AST查询打开原文件第181行并仅滚动代码容器,输入区和顶部保持可见",
|
||||
"查询词保留;过期SHA不高亮旧位置,增量刷新后正确定位第184行",
|
||||
"切换项目时延迟返回的旧索引不覆盖新项目结果",
|
||||
"Python候选、字符串误报排除和局部导入文件候选保留真实证据标签",
|
||||
"两处唯一锚点成为待审核提案,真实界面应用后BOM/CRLF和未选择原字节保留",
|
||||
"390px索引查询、范围和完整指纹可读且无横向溢出,实际文件行定位通过",
|
||||
"索引刷新失败保留归属和解释,旧结果禁用并可重试恢复"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\index-ui-80306774-f4aa-4ef2-8c64-817ad687c55c",
|
||||
"primaryProjectId": "c22d3310-0dbc-459d-9db7-acb670271a7d",
|
||||
"otherProjectId": "fc36df6e-79a2-4e60-b3b7-c829325ae2dc"
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.9.0",
|
||||
"at": "2026-10-29T23:20:04.452Z",
|
||||
"browser": "156.0.4314.42",
|
||||
"passed": [
|
||||
"mixed projects retain npm defaults and explicitly seal the selected Python checks",
|
||||
"the confirmation shows the actual interpreter and cancellation executes no checks",
|
||||
"actual unittest failures and the separately passed compilation display their counted results",
|
||||
"the log and original structured result are independently viewable and hash-bound",
|
||||
"a reviewed three-file repair runs new checks while retaining the original failed job and protected files",
|
||||
"390px checks, interpreter paths, original result dialog and composer remain operable without page overflow",
|
||||
"Git confirmation and the Python execution report deliver only the three reviewed sources and preserve owner changes"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"checks": {
|
||||
"before": {
|
||||
"total": 6,
|
||||
"passed": 1,
|
||||
"failed": 5,
|
||||
"skipped": 0,
|
||||
"cancelled": 0
|
||||
},
|
||||
"after": {
|
||||
"total": 6,
|
||||
"passed": 6,
|
||||
"failed": 0,
|
||||
"skipped": 0,
|
||||
"cancelled": 0
|
||||
}
|
||||
},
|
||||
"commit": "1564a32c1a0f53921c3c1b16e61004f05a808930",
|
||||
"scope": "Independent host and owned fixture. Real Python processes, reviewed API repairs and actual local Git. No configured model requests or production credentials."
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.9.0",
|
||||
"at": "2026-10-29T23:20:25.940Z",
|
||||
"browser": "156.0.4314.42",
|
||||
"passed": [
|
||||
"the sealed React TypeScript project builds but its real domain tests first expose the functional failures",
|
||||
"a real browser separately observes that the broken pending filter wrongly shows all three tasks",
|
||||
"the four-file reviewed repair passes all nine domain tests, actual TypeScript checking and the Vite production build",
|
||||
"the production React app passes real filtering, search, single-task toggling and updated statistics",
|
||||
"the same built React app remains operable at 390px without horizontal overflow",
|
||||
"Workbench Git commits only the four reviewed files and binds the actual checks while preserving tests, configuration and owner changes"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"originalTests": {
|
||||
"total": 9,
|
||||
"passed": 2,
|
||||
"failed": 7,
|
||||
"cancelled": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"repairedTests": {
|
||||
"total": 9,
|
||||
"passed": 9,
|
||||
"failed": 0,
|
||||
"cancelled": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"beforePending": 3,
|
||||
"checks": [
|
||||
{
|
||||
"name": "test",
|
||||
"status": "passed",
|
||||
"exitCode": 0,
|
||||
"tests": {
|
||||
"total": 9,
|
||||
"passed": 9,
|
||||
"failed": 0,
|
||||
"cancelled": 0,
|
||||
"skipped": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "typecheck",
|
||||
"status": "passed",
|
||||
"exitCode": 0,
|
||||
"tests": null
|
||||
},
|
||||
{
|
||||
"name": "build",
|
||||
"status": "passed",
|
||||
"exitCode": 0,
|
||||
"tests": null
|
||||
}
|
||||
],
|
||||
"commit": "e8737c360a406f0af9286084a641671c6d0235be",
|
||||
"changes": [
|
||||
"src/App.tsx",
|
||||
"src/query.ts",
|
||||
"src/summary.ts",
|
||||
"src/transition.ts"
|
||||
],
|
||||
"protectedFiles": {
|
||||
"package.json": "db3c6bfd79d1ebb1f5692727715e2b48d3f09e0314d9f1d455d335774f5e7db8",
|
||||
"package-lock.json": "48c138a05408667bbd332000731598415c9ae281d5072daa18544025ad89f7ff",
|
||||
"tsconfig.json": "9dcf064d622cb31ae94ef348655f4f7af84076241601148929232314ef1b0c8a",
|
||||
"vite.config.mjs": "0ea84b4e2909b04e4c1cb1b92392a9f85bcb46605472763b15935d3498ba8ed3",
|
||||
"index.html": "37e9fd3172422ecca3902378c567331363dc1277ac749dd9f6bdf74f04540787",
|
||||
"test/domain.test.mjs": "3fbd155cfc4919f3d0570a7ee26ff5ff4243e3e94250f3d0dbebe93c2b925ec0",
|
||||
"src/types.ts": "d2bbcac2cb175e7bcafe087915f02c3cf2e0ea4b65235d6231bbcd4c3a682246",
|
||||
"src/main.tsx": "c9a5787f5544788757ab654e1dfd83b5bc51495144e17aa078c2ee2f4412a302",
|
||||
"src/styles.css": "60bcb8f7f73f4328274096132a3d73b7ef1fc9e6fbf6a3a3477fb9d519f2c25c"
|
||||
},
|
||||
"scope": "Owned frozen React TypeScript project with offline-installed fixed dependencies, real npm/typecheck/build/browser and Workbench review/Git/report. API fixtures supply repairs; configured-model success is separate."
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.9.0",
|
||||
"at": "2026-10-29T23:20:47.494Z",
|
||||
"browser": "156.0.4314.42",
|
||||
"passed": [
|
||||
"independent desktop research entry detects the installed fixed REA version",
|
||||
"UI registration seals the artifact identity in the current project and creates no model request",
|
||||
"actual REA ASAR analysis renders the verified source chain and downloads the exact original Bundle",
|
||||
"original field selection, paging and limitations retain exact bytes; Escape closes only the top dialog",
|
||||
"raw responses and connection records are readable; repeat analysis reuses the verified original without dispatch",
|
||||
"UI PE operation selection performs actual import and resource analysis with independently verified target hashes",
|
||||
"changed artifact versions refuse dispatch, retain the stale record and require a separately registered version",
|
||||
"390px research, long identities and original evidence dialogs fit the viewport and retain usable close controls",
|
||||
"a real host restart preserves exact target/job identities and serves sealed Evidence without producer replay",
|
||||
"a delayed evidence response cannot reopen a closed research panel or change another task",
|
||||
"declared owned stdio fault fixture stops its root process and explicit retry adds a new record without changing history"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"expectedRequestFailures": [],
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\research-ui-6aedf77e-3ca6-4179-a357-05dc79551c18",
|
||||
"actualRea": {
|
||||
"version": "6.8.0",
|
||||
"operations": [
|
||||
"javascript",
|
||||
"pe-imports",
|
||||
"pe-resources"
|
||||
],
|
||||
"jobs": [
|
||||
{
|
||||
"id": "87ba3f96-3f73-44da-9f6b-ace4c6aeb1ea",
|
||||
"status": "completed",
|
||||
"evidenceId": "ev_221055824799f96dc9d117e755f1e8f860d431789fb7130062ec07f20c7779a7"
|
||||
},
|
||||
{
|
||||
"id": "55e231a0-a38b-45ab-9906-b4ec4e475740",
|
||||
"status": "completed",
|
||||
"evidenceId": "ev_221055824799f96dc9d117e755f1e8f860d431789fb7130062ec07f20c7779a7"
|
||||
},
|
||||
{
|
||||
"id": "5c3f3f9e-2789-405c-873b-48be75750f1c",
|
||||
"status": "completed",
|
||||
"evidenceId": "ev_cce8125d37a0a12b20b8cb4fbb4a11e668da2cf236c881c0172a76254c4ef0ab"
|
||||
},
|
||||
{
|
||||
"id": "4b1afe7f-0123-4b0c-afd4-86319d784461",
|
||||
"status": "completed",
|
||||
"evidenceId": "ev_02a8a840d4e21557e7279f05f8ae8a9b1e512344ddcda9b98e5bc801bb974cd7"
|
||||
},
|
||||
{
|
||||
"id": "de932928-7790-40b8-b85b-ede15b55e0aa",
|
||||
"status": "stale"
|
||||
},
|
||||
{
|
||||
"id": "f7ce5d2e-d523-4c7f-857e-ed08e6c85ebc",
|
||||
"status": "completed",
|
||||
"evidenceId": "ev_b9cfad9b2a75ed25ac029b8ad7a45bf26ad2a4f94f8a2e3c34a553df362f1bd9"
|
||||
}
|
||||
],
|
||||
"targetExecution": false,
|
||||
"modelRequests": 0
|
||||
},
|
||||
"stopScope": "explicitly declared private stdio handshake fault fixture",
|
||||
"screenshots": [
|
||||
".qa/screenshots/external-engines-research-desktop.png",
|
||||
".qa/screenshots/external-engines-research-mobile.png",
|
||||
".qa/screenshots/external-engines-research-evidence-mobile.png",
|
||||
".qa/screenshots/external-engines-research-stop-desktop.png"
|
||||
],
|
||||
"analysisRequests": [
|
||||
{
|
||||
"url": "http://127.0.0.1:49533/api/sessions/10e24b3b-d8e2-4ebc-ab0d-662b4051be06/research/jobs",
|
||||
"input": {
|
||||
"targetId": "2ee33a8d-e8dc-4906-be32-514029113972",
|
||||
"operation": "javascript",
|
||||
"refresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"url": "http://127.0.0.1:49533/api/sessions/10e24b3b-d8e2-4ebc-ab0d-662b4051be06/research/jobs",
|
||||
"input": {
|
||||
"targetId": "2ee33a8d-e8dc-4906-be32-514029113972",
|
||||
"operation": "javascript",
|
||||
"refresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"url": "http://127.0.0.1:49533/api/sessions/10e24b3b-d8e2-4ebc-ab0d-662b4051be06/research/jobs",
|
||||
"input": {
|
||||
"targetId": "b8024d37-5ca0-4eb5-994c-38d2882afd29",
|
||||
"operation": "pe-imports",
|
||||
"refresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"url": "http://127.0.0.1:49533/api/sessions/10e24b3b-d8e2-4ebc-ab0d-662b4051be06/research/jobs",
|
||||
"input": {
|
||||
"targetId": "b8024d37-5ca0-4eb5-994c-38d2882afd29",
|
||||
"operation": "pe-resources",
|
||||
"refresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"url": "http://127.0.0.1:49533/api/sessions/10e24b3b-d8e2-4ebc-ab0d-662b4051be06/research/jobs",
|
||||
"input": {
|
||||
"targetId": "2ee33a8d-e8dc-4906-be32-514029113972",
|
||||
"operation": "javascript",
|
||||
"refresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"url": "http://127.0.0.1:49533/api/sessions/10e24b3b-d8e2-4ebc-ab0d-662b4051be06/research/jobs",
|
||||
"input": {
|
||||
"targetId": "6da73726-065f-48d2-8b6e-548496e5702b",
|
||||
"operation": "javascript",
|
||||
"refresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"url": "http://127.0.0.1:50227/api/sessions/5b24f67c-6de1-41c1-9fc7-536e6c94f5b8/research/jobs",
|
||||
"input": {
|
||||
"targetId": "9927ab89-409d-4658-9287-46b3b0151405",
|
||||
"operation": "javascript",
|
||||
"refresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"url": "http://127.0.0.1:50227/api/sessions/5b24f67c-6de1-41c1-9fc7-536e6c94f5b8/research/jobs",
|
||||
"input": {
|
||||
"targetId": "9927ab89-409d-4658-9287-46b3b0151405",
|
||||
"operation": "javascript",
|
||||
"refresh": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"scope": "Independent ports/data and self-owned inert artifacts. No production service, configured-model request or real key read/copied."
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.9.0",
|
||||
"at": "2026-10-29T23:19:48.140Z",
|
||||
"browser": "156.0.4314.42",
|
||||
"passed": [
|
||||
"desktop preview seals the committed version and shows existing staged/unstaged/untracked source changes",
|
||||
"repeated create clicks execute once and preserve the exact source index and owner files",
|
||||
"opening the child, returning to the source and reloading retain stable project/session identity",
|
||||
"a record owned by another session navigates to that saved owner instead of accepting its actions",
|
||||
"explicit recovery preserves outside content and acknowledgement does not report successful creation",
|
||||
"390×844 preview/create/open/return stays within viewport and preserves source ownership",
|
||||
"late-failure stays with the original session after project switching",
|
||||
"late-success stays with the original session after project switching",
|
||||
"a delayed bootstrap cannot navigate after the task panel has unmounted"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"screenshots": [
|
||||
".qa/screenshots/external-engines-workspaces-review-desktop.png",
|
||||
".qa/screenshots/external-engines-workspaces-ready-desktop.png",
|
||||
".qa/screenshots/external-engines-workspaces-recovery-desktop.png",
|
||||
".qa/screenshots/external-engines-workspaces-review-mobile.png",
|
||||
".qa/screenshots/external-engines-workspaces-child-mobile.png"
|
||||
],
|
||||
"projectRoot": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\workspace-ui-c8f2fae8-184b-4bef-a1cc-4fe297abeba0",
|
||||
"scope": "Independent synthetic Git projects and real browser flows. Desktop/390×844, actual worktree creation, source preservation, explicit external recovery, ownership navigation, delayed success/error/navigation. No production service or real model credential used."
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.9.0",
|
||||
"testedAt": "2026-10-29T22:48:00.950Z",
|
||||
"directory": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\native-engine-e98cc331-7746-4ca5-8a64-da93ad121f65",
|
||||
"evidenceKind": "actual-native-DeepSeek-Harness-SDK; no protocol fixture",
|
||||
"scope": "deepseek-sdk-connection-probe",
|
||||
"owner": {
|
||||
"sessionId": "3de0f935-54f4-497c-942f-bad646923f48",
|
||||
"projectId": "d2288a17-01f0-467d-b87d-5738f66eca59",
|
||||
"taskId": "93defd4c-9d9a-40de-bc13-9e42fc32c0be",
|
||||
"runId": "93867710-1876-416d-9169-31ebdb6ec856",
|
||||
"jobId": "d1bd1314-e20b-476e-814b-9998811a957c"
|
||||
},
|
||||
"installation": {
|
||||
"root": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness",
|
||||
"version": "0.2.1-rc.2",
|
||||
"profile": "sdk-minimal",
|
||||
"identitySha256": "a60f7733d6eaf91bcd31ce5d1da38d6d267a16ad29bc03bba548f314fddec22a",
|
||||
"inputs": [
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\apps\\cli\\package.json",
|
||||
"bytes": 8138,
|
||||
"sha256": "d42efe9f3ff424f602f11598af8805ad25039953ebbbd3c163d67875f7e8658b",
|
||||
"relative": "apps/cli/package.json"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\apps\\cli\\lib\\bin.js",
|
||||
"bytes": 11772,
|
||||
"sha256": "80112efe368efb1a39720c7ada0af00442e5131fb2744edaaff8a3e8bb499e6f",
|
||||
"relative": "apps/cli/lib/bin.js"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\boot\\cmdline\\lib\\index.js",
|
||||
"bytes": 6973,
|
||||
"sha256": "7253190611566485f8b6f836fae6e0f2a7abbc59bb807c42e874844016e6d3a0",
|
||||
"relative": "packages/boot/cmdline/lib/index.js"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\bundle\\sdk-app\\lib\\index.js",
|
||||
"bytes": 1921,
|
||||
"sha256": "cc7e6c38b0b38c0e92a0dffb45210c1dac6ef518547436e805e84b772f91a475",
|
||||
"relative": "packages/bundle/sdk-app/lib/index.js"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\bundle\\sdk-minimal\\package.json",
|
||||
"bytes": 2920,
|
||||
"sha256": "0e177cbca85148207343db5afd7f12829723cf3f2afedfa8e85a5c5dcd58f604",
|
||||
"relative": "packages/bundle/sdk-minimal/package.json"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\bundle\\sdk-minimal\\cordis.patch.yml",
|
||||
"bytes": 5636,
|
||||
"sha256": "464ea07c03d3639c2c387fa3a684f5d4001e7ca39f8257b361c604f19487af66",
|
||||
"relative": "packages/bundle/sdk-minimal/cordis.patch.yml"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\sdk\\server\\package.json",
|
||||
"bytes": 2155,
|
||||
"sha256": "2690f99763c3e1e7bd57f680f26e53010c2a3d7c4dffe06ff64a07ae3928cb17",
|
||||
"relative": "packages/sdk/server/package.json"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\sdk\\server\\lib\\index.js",
|
||||
"bytes": 16454,
|
||||
"sha256": "55412923f9f7c279f7e0b2a1e2853eaf238f390b3d84046cb9c94dc5f22a1e4a",
|
||||
"relative": "packages/sdk/server/lib/index.js"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\sdk\\protocol\\package.json",
|
||||
"bytes": 1237,
|
||||
"sha256": "b030b0431d69723b5424dc2519cd4b381ec91acd22b73e0b30d6b8a19f1f2f94",
|
||||
"relative": "packages/sdk/protocol/package.json"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\sdk\\protocol\\lib\\index.js",
|
||||
"bytes": 7336,
|
||||
"sha256": "371c38ca3514797d86df5f4bb78a56c40a2637294b83aababe8145bec6a20253",
|
||||
"relative": "packages/sdk/protocol/lib/index.js"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\packages\\sdk\\client\\package.json",
|
||||
"bytes": 1325,
|
||||
"sha256": "ff33f2ecec2d48bb8a24397cc664fc2dd50ba49d5288eb11fea1cb12931e5d5f",
|
||||
"relative": "packages/sdk/client/package.json"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\pnpm-lock.yaml",
|
||||
"bytes": 1090222,
|
||||
"sha256": "4637cca3b89c4c8d5a147321710e597aa62ec2444a3772ab542be5690893dfe4",
|
||||
"relative": "pnpm-lock.yaml"
|
||||
},
|
||||
{
|
||||
"path": "D:\\Ai-project\\DeepSeek-Harness-Desktop\\deepseek-harness\\vendor\\cordis\\lib\\index.js",
|
||||
"bytes": 60361,
|
||||
"sha256": "6a9394c0877ff45218818c6e815edd038f8057e1a1deb390a8d43ec81c57691e",
|
||||
"relative": "vendor/cordis/lib/index.js"
|
||||
}
|
||||
],
|
||||
"node": {
|
||||
"path": "C:\\Program Files\\nodejs\\node.exe",
|
||||
"bytes": 93915464,
|
||||
"sha256": "d702daa815eabbff763c7d3808e235cf031cf2ca70211b56847bc72f51e240e5",
|
||||
"version": "24.22.1"
|
||||
}
|
||||
},
|
||||
"process": {
|
||||
"pid": 6408,
|
||||
"connectionId": "2f094e81-d638-40af-9741-ae618dba3371",
|
||||
"startedAt": "2026-10-29T22:48:00.176Z",
|
||||
"ownership": "one-process-per-engine-check"
|
||||
},
|
||||
"readiness": {
|
||||
"schemaVersion": 1,
|
||||
"nonce": "15af047f-1cbd-4306-879e-7f2b666dd44e",
|
||||
"pid": 6408,
|
||||
"signal": "appReady",
|
||||
"readyAt": "2026-10-29T22:48:00.762Z",
|
||||
"artifact": {
|
||||
"path": "C:\\Users\\wangy\\AppData\\Local\\Temp\\AgentWorkbench-Engines\\d1bd1314-e20b-476e-814b-9998811a957c\\ready.json",
|
||||
"bytes": 134,
|
||||
"sha256": "32ba601cda13d244821a8250dc12429f8ad1dc24a34a32111775a3d92f40d96f"
|
||||
}
|
||||
},
|
||||
"responses": [
|
||||
{
|
||||
"method": "initialize",
|
||||
"id": 1,
|
||||
"parameters": {
|
||||
"cwd": "C:\\Users\\wangy\\AppData\\Local\\Temp\\AgentWorkbench-Engines\\d1bd1314-e20b-476e-814b-9998811a957c\\project",
|
||||
"provider": "deepseek-official",
|
||||
"model": "deepseek-flash",
|
||||
"reasoningEffort": "off",
|
||||
"maxTokens": 256
|
||||
},
|
||||
"parametersSha256": "6e6bde40332dd9927511aedce9acf1ade5f620dfa87a824020f14a68464447b6",
|
||||
"result": {
|
||||
"serverInfo": {
|
||||
"name": "deepseek-harness-sdk-runtime",
|
||||
"version": "0.0.1"
|
||||
}
|
||||
},
|
||||
"startedAt": "2026-10-29T22:48:00.808Z",
|
||||
"finishedAt": "2026-10-29T22:48:00.810Z"
|
||||
},
|
||||
{
|
||||
"method": "session/working-directory/get",
|
||||
"id": 2,
|
||||
"parameters": {
|
||||
"sessionId": "4b874e2f-79ec-4842-a997-4832ed8a2549"
|
||||
},
|
||||
"parametersSha256": "3aecbbb4a0da2ab9547ba994130b00bf2286bb61d84735fadd8b9c2e7d2e002e",
|
||||
"result": {
|
||||
"cwd": "C:\\Users\\wangy\\AppData\\Local\\Temp\\AgentWorkbench-Engines\\d1bd1314-e20b-476e-814b-9998811a957c\\project"
|
||||
},
|
||||
"startedAt": "2026-10-29T22:48:00.832Z",
|
||||
"finishedAt": "2026-10-29T22:48:00.836Z"
|
||||
},
|
||||
{
|
||||
"method": "session/wait",
|
||||
"id": 3,
|
||||
"parameters": {
|
||||
"sessionId": "e3838442-e6ac-4058-be4c-f4743ce83021"
|
||||
},
|
||||
"parametersSha256": "13ec04db96a7789d13483abdf9f5faf87ad78f179d1ad416568a810aaaaf2c89",
|
||||
"error": {
|
||||
"code": -32603,
|
||||
"message": "unknown SDK session: e3838442-e6ac-4058-be4c-f4743ce83021"
|
||||
},
|
||||
"startedAt": "2026-10-29T22:48:00.837Z",
|
||||
"finishedAt": "2026-10-29T22:48:00.837Z"
|
||||
},
|
||||
{
|
||||
"method": "session/resume",
|
||||
"id": 4,
|
||||
"parameters": {
|
||||
"sessionId": "e3838442-e6ac-4058-be4c-f4743ce83021"
|
||||
},
|
||||
"parametersSha256": "13ec04db96a7789d13483abdf9f5faf87ad78f179d1ad416568a810aaaaf2c89",
|
||||
"error": {
|
||||
"code": -32603,
|
||||
"message": "session \"e3838442-e6ac-4058-be4c-f4743ce83021\" not found"
|
||||
},
|
||||
"startedAt": "2026-10-29T22:48:00.837Z",
|
||||
"finishedAt": "2026-10-29T22:48:00.838Z"
|
||||
},
|
||||
{
|
||||
"method": "session/cancel",
|
||||
"id": 5,
|
||||
"parameters": {
|
||||
"sessionId": "e3838442-e6ac-4058-be4c-f4743ce83021"
|
||||
},
|
||||
"parametersSha256": "13ec04db96a7789d13483abdf9f5faf87ad78f179d1ad416568a810aaaaf2c89",
|
||||
"error": {
|
||||
"code": -32603,
|
||||
"message": "unknown DeepSeek Harness SDK runtime method: session/cancel"
|
||||
},
|
||||
"startedAt": "2026-10-29T22:48:00.838Z",
|
||||
"finishedAt": "2026-10-29T22:48:00.839Z"
|
||||
},
|
||||
{
|
||||
"method": "shutdown",
|
||||
"id": 6,
|
||||
"parameters": {},
|
||||
"parametersSha256": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
|
||||
"result": {},
|
||||
"startedAt": "2026-10-29T22:48:00.839Z",
|
||||
"finishedAt": "2026-10-29T22:48:00.840Z"
|
||||
}
|
||||
],
|
||||
"cleanup": {
|
||||
"connectionId": "2f094e81-d638-40af-9741-ae618dba3371",
|
||||
"pid": 6408,
|
||||
"rootExited": true,
|
||||
"forced": false,
|
||||
"killError": null,
|
||||
"exit": {
|
||||
"code": 0,
|
||||
"signal": null
|
||||
},
|
||||
"scope": "owned-stdio-process",
|
||||
"finishedAt": "2026-10-29T22:48:00.893Z"
|
||||
},
|
||||
"workspace": {
|
||||
"root": "C:\\Users\\wangy\\AppData\\Local\\Temp\\AgentWorkbench-Engines\\d1bd1314-e20b-476e-814b-9998811a957c\\project",
|
||||
"before": {
|
||||
"path": "C:\\Users\\wangy\\AppData\\Local\\Temp\\AgentWorkbench-Engines\\d1bd1314-e20b-476e-814b-9998811a957c\\project\\README.md",
|
||||
"bytes": 48,
|
||||
"sha256": "3c05b20b87984be6350b7d8ce46bf216494ebad069aceb5d8bcdcb1d949b2050"
|
||||
},
|
||||
"after": {
|
||||
"path": "C:\\Users\\wangy\\AppData\\Local\\Temp\\AgentWorkbench-Engines\\d1bd1314-e20b-476e-814b-9998811a957c\\project\\README.md",
|
||||
"bytes": 48,
|
||||
"sha256": "3c05b20b87984be6350b7d8ce46bf216494ebad069aceb5d8bcdcb1d949b2050"
|
||||
},
|
||||
"unchanged": true
|
||||
},
|
||||
"reportSha256": "ce7d148da0b679cf9cb919ff24aa9fdc2771c25dd1ad6e563506b55ebf9a8f59",
|
||||
"modelRequests": 0,
|
||||
"providerRequests": 0,
|
||||
"projectChanges": 0,
|
||||
"executionBoundary": "Connection validation only; session/prompt was not sent. Original user service and credentials were not used."
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 173 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
+15
@@ -1,5 +1,14 @@
|
||||
# 汇总发现
|
||||
|
||||
## 2026-10-30 引擎接入再次恢复
|
||||
|
||||
- 新适配器已使用本机原SDK 0.2.1-rc.2完成一次真实核验:appReady/PID、initialize及六方法原响应、安装前后SHA256、独立目录不变和所属进程正常退出全部通过,模型请求为0。原报告和完整结果保存在.qa/native-engine-e98cc331-7746-4ca5-8a64-da93ad121f65;这是连接成果,尚不代表工程任务执行。
|
||||
- 12项引擎契约和首版引擎面板构建通过;HTTP归属、持久/恢复与桌面/390px操作验收进行中。界面选择的安装SHA256在启动前再次核对,变化时拒绝沿用刚才检测结果。
|
||||
- 正式1.8.0的真实模型四模块/14项测试/构建/Git成果已封存;本轮不重放。当前未提交EngineManager、DeepSeekAdapter、SDK安装身份、API和12项契约草稿需要完整验收。
|
||||
- 现有适配只执行无prompt连接核验:独立探针目录/进程、原appReady信号和六项协议返回。缺少产品界面、HTTP验收及实际原SDK接入报告,不能视为外部引擎工程执行已完成。
|
||||
- 产品界面沿用paper/teal及现有Task导航;引擎版本、实际检查、原记录和停止状态必须可读。桌面与390px使用独立验收宿主。
|
||||
- 接续计划的首个多文件补丁因progress标题锚点不匹配整体拒绝;按各文件真实标题分别更新,未当作已应用。
|
||||
|
||||
## M1开发核对:2026-10-29
|
||||
|
||||
- 当前main=b047665且工作区干净。已读运行/Store/API/升级入口;开发仍使用Node24.22.1,计划采用内置node:sqlite减少额外依赖。
|
||||
@@ -248,6 +257,12 @@ Claude Code 报告已验证工具输入校验、权限决定、队列并发屏
|
||||
- DeepSeek SDK原入口0.2.1-rc.2在1500ms延后初始化成功,独立appReady overlay在不延后、不改写原CLI或Cordis原型的情况下也成功。原首次立即initialize的超时仍保留;当前证据支持使用真实启动完成边界,尚未证明具体内部等待环。
|
||||
- appReady由CLI在boot及主宿主初始化完成后commit,onReady可移除;SDK serverInfo.version为0.0.1而不是发行包版本。SDK没有单会话cancel/close或有效版本协商,必须分别固定包/入口/profile,关闭所属进程并保留结果;root idle不能直接判项目完成。
|
||||
|
||||
## 2026-10-30 1.9.0执行调度发现
|
||||
|
||||
- 原UI数据库证明四轮离线回复与前三项工具均已持久保存,最后审批在23:08:56才进入等待;失败截图在此之前仍未收到执行流更新。源码中的已解决Promise链持续执行,HTTP/SSE及停止回调不能取得事件循环。
|
||||
- 独立自有失败用例复现:首轮回复安排停止,实际却完成7轮回复和6项工具,Task为completed。原失败TAP保存在.qa/runtime-fairness-baseline.tap。
|
||||
- 在首次执行及每项工具结果持久保存后让出事件循环,停止前已完成结果保留、剩余批次调用按原协议补齐为interrupted。修复和多调用组验证进入最终源码回归。
|
||||
|
||||
## 2026-10-30 REA 1.8.0交付接续
|
||||
|
||||
- 正式4318服务为1.7.0/PID23080,当前源码版本1.8.0,继续保留原Provider连接。
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "local-agent-workbench",
|
||||
"version": "1.8.0",
|
||||
"version": "1.9.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "local-agent-workbench",
|
||||
"version": "1.8.0",
|
||||
"version": "1.9.0",
|
||||
"dependencies": {
|
||||
"@babel/parser": "7.29.11",
|
||||
"diff": "^8.0.2",
|
||||
|
||||
+3
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "local-agent-workbench",
|
||||
"version": "1.8.0",
|
||||
"version": "1.9.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"description": "A local coding workbench with explicit tool execution, reviewable changes and recoverable sessions.",
|
||||
@@ -14,6 +14,8 @@
|
||||
"verify:python": "node scripts/verify-python-ui.mjs",
|
||||
"verify:react": "node scripts/verify-react-delivery.mjs",
|
||||
"verify:rea": "node scripts/verify-rea.mjs",
|
||||
"verify:engines": "node scripts/verify-engines.mjs",
|
||||
"verify:engines-ui": "node scripts/verify-engines-ui.mjs",
|
||||
"verify:all-ui": "node scripts/verify-all-ui.mjs",
|
||||
"package": "node scripts/package.mjs"
|
||||
},
|
||||
|
||||
+23
@@ -1,5 +1,19 @@
|
||||
# 统一执行进度
|
||||
|
||||
## 2026-10-30 引擎UI与实际SDK接续
|
||||
|
||||
- 新增“解释原引擎失败”的真实工具反馈用例:首轮验证器误把Runtime.start返回会话当运行Promise,提前断言状态导致失败;按现有Runtime.active所属Promise等待并注册停止清理后复验。该用例核对当前Task原错误/报告,防止回复脱离实际操作。
|
||||
- 引擎UI最终10/10通过,0页面/请求异常;实际安装、独立停止/重试、SHA256下载/原文分页、390px和迟到错误/宿主重启均核对。桌面来源链和390px原记录截图已目视检查。
|
||||
- 本机sdk-minimal仍提供filesystem/pwsh等原生工具,并缺少可验证的逐调用审批;外部工程执行需要受控工具桥和独立模型通道,不能因连接通过直接开放原profile写入。本轮先完成连接发行与扩大React/Python真实模型工程样本。
|
||||
- 发行验证器的多文件补丁一次因变更集长行锚点错误整体拒绝,修正实际旧行后应用;1.9证据采用external-engines前缀,保留1.8旧结论与失败。
|
||||
- 第二轮UI仍8组通过,迟到响应夹具在unroute后尝试fulfill已处理的Route失败;这是验证器生命周期错误,原记录另存engines-ui-second-failure.json。改为保留有界延迟响应,切换任务后再释放并等待真实HTTP500,随后卸载路由。
|
||||
- 首轮引擎UI完成8组(含真实SDK和390px),第9组切换任务时项目栏仍保持窄屏收起状态,验证器点击隐藏按钮超时;没有页面/请求异常。原报告保存docs/engines-ui-initial-failure.json;后续按实际可见状态展开项目栏,不强制点击或扩大超时。新截图按独立验收目录保存。
|
||||
- HTTP/引擎/stdio/旧进程与重复升级相关22/22通过。Python默认和已配置的Bundled Python均没有Playwright模块;浏览器验证沿用仓库已安装Node Playwright,以独立脚本执行原生浏览器API,不新建全局依赖。一次SDK tools路径误用已改为实际packages/core/tools。
|
||||
- 新DeepSeek适配12/12专项通过,本机原SDK六方法真实核验通过、0模型请求、原进程正常退出;独立原报告已保留。已补首版引擎UI、检测身份预检和原报告分页/下载,构建通过,准备实际HTTP与交互验收。
|
||||
- 沿用planning-with-files、frontend-design与webapp-testing;正式1.8.0和原Provider连接保持。未提交引擎草稿完整保留,先验收契约/真实SDK再补产品UI、HTTP持久和不可变发行。
|
||||
- 已核对1.8原真实模型工程交付和244项独立回归;不重复已经完成的任务。当前Node24.22.1,父目录非Git错误和批量输出截断已改为具体产品目录及短段摘要。
|
||||
- 首次组合计划补丁因为progress标题错误整体拒绝,按实际标题拆分后保存。
|
||||
|
||||
## 2026-10-29 M1可靠内核开发
|
||||
|
||||
- 用户批准下一步开发;从规划提交b047665开始,核对Store/Runtime/API/升级机制与Node版本,启动可靠任务状态和首个工程交付切片。
|
||||
@@ -253,6 +267,15 @@
|
||||
- DeepSeek原入口采用1500ms延后也能initialize成功;进一步用独立绝对路径overlay的appReady标记,在没有定时延后的情况下完成同一六方法探针、0模型请求及原进程退出。具体内部等待环仍未知;产品连接采用所属PID/nonce绑定的真实启动完成信号,不将固定延时作为就绪证明。
|
||||
- 1.8.0真实配置模型原Task续接成功:新增16个已报告响应/158159tokens,约127.5秒,模型修复四模块,整批应用后14/14测试、构建和实际CLI输出通过,工作台本地提交a8293546c5b51907680caad4ee8a9c7e15ad1a0b及JSON/Markdown报告完成。来源HEAD/index/用户暂存/文件、子工作区测试声明与原消息前缀核对不变,确认后模型请求为零。原1.7和更早失败未覆盖。
|
||||
|
||||
## 2026-10-30 1.9.0验收接续
|
||||
|
||||
- 正式4318实测1.8.0/PID23080,原Provider保留;沿用上一轮未提交的引擎内核、API、UI和验收草稿,不重做已完成1.8.0。
|
||||
- 引擎22项专项和10组UI已有原记录;PID30912完整回归正在运行,冻结输入为.qa/tests-1.9.0-38d45bd2-d200-486e-aa7c-4e43c1bd9f99/inputs.json。
|
||||
- 全量UI首项离线流程等待审批10秒失败,原DOM仍显示执行中。原数据库和报告保留;先核对任务记录与同时运行的真实进程,不扩超时或直接判产品通过。
|
||||
- 只读数据库确认实际工具持续执行,但请求和SSE无法及时刷新;独立失败用例为7轮回复/6工具全部完成后才处理停止。首次执行与每项结果保存后让出事件循环,2/2停止/完整批次协议回归通过;原全量进程树已明确核对归属后主动终止,153项已返回不能作为完整验收。
|
||||
- 修复后的Runtime/真实旧进程升级11/11、十二类完整界面108组全部通过;0页面/请求异常,实际SDK再次通过且没有模型请求。桌面与390px三份来源/表单/原JSON截图已目视核对并封存。接续独立不可变发行与完整源码验收,再部署和运行新的真实React/Python样本。
|
||||
- 接续读取大输出改为按具体文件与段落;组合规划补丁因progress标题不符全部拒绝,分开以已核对短锚点修正。Windows源码存储路径按rg实际state-database.mjs定位。
|
||||
|
||||
## 2026-10-30 全量开发再次接续
|
||||
|
||||
- 恢复到6a1ef12:1.8.0不可变发行20261029212137336已生成,正式4318实测仍为1.7.0/PID23080。只接续未完成的源码、归档、便携与升级验收,不重跑已封存的98组界面。
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
// A declared wire fixture. It does not load the third-party SDK or call a model.
|
||||
export function createEngineFixture(directory, options = {}) {
|
||||
fs.mkdirSync(directory, { recursive: true });
|
||||
const version = '0.2.1-rc.2';
|
||||
const manifests = [
|
||||
['apps/cli/package.json', '@deepseek-ai/dsh'],
|
||||
['packages/bundle/sdk-minimal/package.json', '@deepseek-ai/dsh-sdk-minimal'],
|
||||
['packages/sdk/server/package.json', '@deepseek-ai/dsh-sdk-jsonrpc-server'],
|
||||
['packages/sdk/protocol/package.json', '@deepseek-ai/dsh-sdk-protocol'],
|
||||
['packages/sdk/client/package.json', '@deepseek-ai/dsh-sdk-client'],
|
||||
];
|
||||
const write = (relative, content) => { const filename = path.join(directory, relative); fs.mkdirSync(path.dirname(filename), { recursive: true }); fs.writeFileSync(filename, content); };
|
||||
for (const [relative, name] of manifests) write(relative, JSON.stringify({ name, version, type: 'module', fixture: true }));
|
||||
for (const relative of ['packages/boot/cmdline/lib/index.js', 'packages/bundle/sdk-app/lib/index.js', 'packages/sdk/server/lib/index.js', 'packages/sdk/protocol/lib/index.js']) write(relative, '// Owned protocol fixture; not the actual SDK.\n');
|
||||
write('packages/bundle/sdk-minimal/cordis.patch.yml', '# Owned wire-fixture profile\n');
|
||||
write('pnpm-lock.yaml', '# Owned deterministic fixture identity\n');
|
||||
write('apps/cli/node_modules/@deepseek-ai/cordis/package.json', JSON.stringify({ name: '@deepseek-ai/cordis', type: 'module', exports: './index.mjs', fixture: true }));
|
||||
write('apps/cli/node_modules/@deepseek-ai/cordis/index.mjs', '// Owned Cordis identity fixture; never imported.\n');
|
||||
write('fixture-options.json', JSON.stringify(options));
|
||||
write('apps/cli/lib/bin.js', `import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { createInterface } from 'node:readline';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../..');
|
||||
const options = JSON.parse(fs.readFileSync(path.join(root, 'fixture-options.json'), 'utf8'));
|
||||
const patch = JSON.parse(fs.readFileSync(process.argv[process.argv.indexOf('--patch') + 1], 'utf8'));
|
||||
const config = patch[0].insert[0].config;
|
||||
const audit = value => fs.appendFileSync(path.join(root, 'wire.jsonl'), JSON.stringify(value) + '\\n');
|
||||
const send = value => process.stdout.write(JSON.stringify(value) + '\\n');
|
||||
audit({ type: 'launch', cwd: process.cwd(), nodeOptionsInherited: !!process.env.NODE_OPTIONS,
|
||||
secretInherited: !!process.env.OWNED_ENGINE_TEST_SECRET, profile: process.argv[process.argv.indexOf('--profile') + 1] });
|
||||
if (options.mode !== 'no-ready') setTimeout(() => {
|
||||
fs.writeFileSync(config.marker, JSON.stringify({ schemaVersion: 1, nonce: options.mode === 'bad-ready' ? 'wrong' : config.nonce,
|
||||
pid: process.pid, signal: 'appReady', readyAt: new Date().toISOString() }), { flag: 'wx' });
|
||||
}, options.readyDelayMs ?? 0);
|
||||
const reader = createInterface({ input: process.stdin });
|
||||
reader.on('line', async line => {
|
||||
const value = JSON.parse(line); audit({ type: 'wire', value });
|
||||
if (!value.method) return;
|
||||
const params = value.params ?? {};
|
||||
let result = {};
|
||||
if (value.method === 'initialize') {
|
||||
if (!fs.existsSync(config.marker)) { send({ jsonrpc: '2.0', id: value.id, error: { code: -32603, message: 'initialize before appReady' } }); return; }
|
||||
if (options.mode === 'hang-init') return;
|
||||
if (options.mode === 'malformed') { process.stdout.write('{broken-json}\\n'); return; }
|
||||
if (options.mode === 'reverse-request') send({ jsonrpc: '2.0', id: 'reverse-control', method: 'approve-command', params: { command: 'fixture-never-executed' } });
|
||||
if (options.mode === 'unowned-event') send({ jsonrpc: '2.0', method: 'session.status', params: { sessionId: randomUUID(), status: 'idle' } });
|
||||
if (options.mode === 'model-request') await fetch(process.env.DEEPSEEK_BASE_URL + '/chat/completions', { method: 'POST', body: '{}' });
|
||||
result = { serverInfo: { name: 'deepseek-harness-sdk-runtime', version: options.mode === 'wrong-version' ? '9.9' : '0.0.1' } };
|
||||
} else if (value.method === 'session/working-directory/get') {
|
||||
if (options.mode === 'change-input') fs.appendFileSync(path.join(root, 'packages/boot/cmdline/lib/index.js'), '// changed\\n');
|
||||
if (options.mode === 'change-workspace') fs.writeFileSync(path.join(process.cwd(), 'README.md'), 'fixture mutated');
|
||||
result = { cwd: options.mode === 'wrong-cwd' ? root : process.cwd() };
|
||||
} else if (['session/wait', 'session/resume', 'session/cancel'].includes(value.method)) {
|
||||
send({ jsonrpc: '2.0', id: value.id, error: { code: -32603, message: value.method === 'session/cancel'
|
||||
? 'unknown DeepSeek Harness SDK runtime method: session/cancel' : 'unknown SDK session: ' + params.sessionId } }); return;
|
||||
} else if (value.method !== 'shutdown') {
|
||||
send({ jsonrpc: '2.0', id: value.id, error: { code: -32601, message: 'unknown fixture method' } }); return;
|
||||
}
|
||||
send({ jsonrpc: '2.0', id: value.id, result });
|
||||
if (value.method === 'shutdown') setImmediate(() => process.exit(0));
|
||||
});
|
||||
process.stdin.on('end', () => process.exit(0));
|
||||
`);
|
||||
return directory;
|
||||
}
|
||||
@@ -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'].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'].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 = [];
|
||||
|
||||
@@ -6,17 +6,18 @@ import { gitEnvironment } from '../src/core/git-process.mjs';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
|
||||
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'].includes(version), 'Review evidence paths when introducing the next release.');
|
||||
const prefix = version === '1.6.0' ? 'workspaces' : version === '1.6.1' ? 'working-context' : version === '1.6.2' ? 'working-retention' : version === '1.7.0' ? 'python-engine' : 'rea-engine', resultFile = `.qa/${prefix}-all-ui-validation.json`, results = [];
|
||||
assert.ok(['1.6.0', '1.6.1', '1.6.2', '1.7.0', '1.8.0', '1.9.0'].includes(version), 'Review evidence paths when introducing the next release.');
|
||||
const prefix = version === '1.6.0' ? 'workspaces' : version === '1.6.1' ? 'working-context' : version === '1.6.2' ? 'working-retention' : version === '1.7.0' ? 'python-engine' : version === '1.9.0' ? 'external-engines' : 'rea-engine', resultFile = `.qa/${prefix}-all-ui-validation.json`, results = [];
|
||||
const cases = [
|
||||
['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'].includes(version) ? [['verify-python-ui.mjs', `docs/${prefix}-python-ui-validation.json`]] : []),
|
||||
...(['1.7.0', '1.8.0'].includes(version) ? [['verify-react-delivery.mjs', version === '1.7.0' ? 'docs/react-engine-delivery-validation.json' : 'docs/rea-engine-react-delivery-validation.json']] : []),
|
||||
...(version === '1.8.0' ? [['verify-research-ui.mjs', 'docs/rea-engine-research-ui-validation.json']] : []),
|
||||
...(['1.7.0', '1.8.0', '1.9.0'].includes(version) ? [['verify-python-ui.mjs', `docs/${prefix}-python-ui-validation.json`]] : []),
|
||||
...(['1.7.0', '1.8.0', '1.9.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'].includes(version) ? [['verify-research-ui.mjs', `docs/${prefix}-research-ui-validation.json`]] : []),
|
||||
...(version === '1.9.0' ? [['verify-engines-ui.mjs', 'docs/engines-ui-validation.json']] : []),
|
||||
];
|
||||
fs.mkdirSync('.qa', { recursive: true });
|
||||
const externalHost = new Set(['verify-ui.mjs', 'verify-diagnostics-ui.mjs', 'verify-execution-ui.mjs', 'verify-index-ui.mjs']);
|
||||
|
||||
@@ -33,8 +33,8 @@ child.stdout.on('data', value => { output += value; for (const line of output.sp
|
||||
child.stderr.on('data', value => { errors += value; });
|
||||
const wait = async predicate => { const deadline = Date.now() + 15000; while (!await predicate()) { if (Date.now() > deadline) throw new Error('UI fixture timed out: ' + errors); await new Promise(resolve => setTimeout(resolve, 40)); } };
|
||||
await wait(() => url); const bootstrap = await (await fetch(url + '/api/bootstrap')).json();
|
||||
assert.ok(['1.4.0', '1.5.0', '1.5.1', '1.6.0', '1.6.1', '1.6.2', '1.7.0', '1.8.0'].includes(bootstrap.version)); assert.equal(bootstrap.config.mode, 'demo'); assert.equal(bootstrap.config.hasKey, false);
|
||||
const proofPrefix = bootstrap.version === '1.4.0' ? 'm2-batch' : bootstrap.version === '1.5.0' ? 'context-batch' : bootstrap.version === '1.5.1' ? 'context-fix-batch' : bootstrap.version === '1.6.0' ? 'workspaces-batch' : bootstrap.version === '1.6.1' ? 'working-context-batch' : bootstrap.version === '1.6.2' ? 'working-retention-batch' : bootstrap.version === '1.7.0' ? 'python-engine-batch' : 'rea-engine-batch';
|
||||
assert.ok(['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'].includes(bootstrap.version)); assert.equal(bootstrap.config.mode, 'demo'); assert.equal(bootstrap.config.hasKey, false);
|
||||
const proofPrefix = bootstrap.version === '1.4.0' ? 'm2-batch' : bootstrap.version === '1.5.0' ? 'context-batch' : bootstrap.version === '1.5.1' ? 'context-fix-batch' : bootstrap.version === '1.6.0' ? 'workspaces-batch' : bootstrap.version === '1.6.1' ? 'working-context-batch' : bootstrap.version === '1.6.2' ? 'working-retention-batch' : bootstrap.version === '1.7.0' ? 'python-engine-batch' : bootstrap.version === '1.9.0' ? 'external-engines-batch' : 'rea-engine-batch';
|
||||
const screenshotPrefix = bootstrap.version === '1.4.0' ? '1.4-batch' : proofPrefix;
|
||||
const api = async (route, input) => { const response = await fetch(url + '/api' + route, { method: input === undefined ? 'GET' : 'POST', headers: { 'Content-Type': 'application/json', 'X-Workbench-Token': bootstrap.token, Connection: 'close' },
|
||||
...(input === undefined ? {} : { body: JSON.stringify(input) }) }); const value = await response.json(); assert.ok(response.ok, value.error); return value; };
|
||||
|
||||
@@ -76,9 +76,9 @@ child.stderr.on('data', bytes => { errors += bytes.toString('utf8'); });
|
||||
const until = async predicate => { const deadline = Date.now() + 20000; while (!await predicate()) { if (Date.now() > deadline) throw new Error('Context UI fixture timeout: ' + errors); await new Promise(resolve => setTimeout(resolve, 40)); } };
|
||||
await until(() => url || child.exitCode !== null); assert.ok(url, errors);
|
||||
const bootstrap = await (await fetch(url + '/api/bootstrap', { headers: { Connection: 'close' } })).json();
|
||||
assert.ok(['1.5.0', '1.5.1', '1.6.0', '1.6.1', '1.6.2', '1.7.0', '1.8.0'].includes(bootstrap.version)); assert.equal(bootstrap.config.mode, 'demo'); assert.equal(bootstrap.config.hasKey, false);
|
||||
assert.ok(['1.5.0', '1.5.1', '1.6.0', '1.6.1', '1.6.2', '1.7.0', '1.8.0', '1.9.0'].includes(bootstrap.version)); assert.equal(bootstrap.config.mode, 'demo'); assert.equal(bootstrap.config.hasKey, false);
|
||||
const api = async route => { const response = await fetch(url + '/api' + route, { headers: { 'X-Workbench-Token': bootstrap.token, Connection: 'close' } }); const value = await response.json(); assert.ok(response.ok, value.error); return value; };
|
||||
const proofPrefix = bootstrap.version === '1.5.0' ? 'context' : bootstrap.version === '1.5.1' ? 'context-fix' : bootstrap.version === '1.6.0' ? 'workspaces-context' : bootstrap.version === '1.6.1' ? 'working-context' : bootstrap.version === '1.6.2' ? 'working-retention' : bootstrap.version === '1.7.0' ? 'python-engine' : 'rea-engine';
|
||||
const proofPrefix = bootstrap.version === '1.5.0' ? 'context' : bootstrap.version === '1.5.1' ? 'context-fix' : bootstrap.version === '1.6.0' ? 'workspaces-context' : bootstrap.version === '1.6.1' ? 'working-context' : bootstrap.version === '1.6.2' ? 'working-retention' : bootstrap.version === '1.7.0' ? 'python-engine' : bootstrap.version === '1.9.0' ? 'external-engines' : 'rea-engine';
|
||||
const browser = await chromium.launch({ channel: 'msedge', headless: true }), page = await browser.newPage({ viewport: { width: 1440, height: 1000 } });
|
||||
const passed = [], pageErrors = [], requestFailures = [], screenshots = [];
|
||||
page.on('pageerror', error => pageErrors.push(error.message));
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { randomUUID, createHash } from 'node:crypto';
|
||||
import { chromium } from 'playwright';
|
||||
import { Store } from '../src/server/store.mjs';
|
||||
import { launchWorkbench, until } from '../tests/helpers.mjs';
|
||||
import { createEngineFixture } from './engine-fixtures.mjs';
|
||||
import { resolveDeepSeekInstallation } from '../src/core/engines/deepseek-installation.mjs';
|
||||
|
||||
if (process.argv.includes('--help')) { console.log('node scripts/verify-engines-ui.mjs — isolated browser flows, declared stop fixture and actual installed SDK'); process.exit(0); }
|
||||
const root = path.resolve('.qa', 'engines-ui-' + randomUUID()), data = path.join(root, 'data'), projectRoot = path.join(root, 'project');
|
||||
fs.mkdirSync(projectRoot, { recursive: true }); fs.mkdirSync('.qa/screenshots', { recursive: true });
|
||||
const projectBytes = Buffer.from('# Owned engine UI validation project\n'); fs.writeFileSync(path.join(projectRoot, 'README.md'), projectBytes);
|
||||
const store = new Store(data), project = store.addProject(projectRoot), session = store.createSession(project.id), other = store.createSession(project.id);
|
||||
session.title = '引擎连接与原记录验收'; other.title = '引擎归属对照'; store.save(session); store.save(other); store.close();
|
||||
const fixtureRoot = createEngineFixture(path.join(root, '本地 SDK #')), native = resolveDeepSeekInstallation();
|
||||
const disposers = [], t = { after: fn => disposers.push(fn) };
|
||||
let host = await launchWorkbench(t, data, { AGENT_WORKBENCH_DEEPSEEK_ROOT: fixtureRoot }), selectedRoute = '/sessions/' + session.id, deliberateNavigation = false;
|
||||
const browser = await chromium.launch({ channel: 'msedge', headless: true }), page = await browser.newPage({ viewport: { width: 1440, height: 1050 } });
|
||||
const passed = [], pageErrors = [], requestFailures = [], expectedRequestFailures = [], screenshots = [], starts = [];
|
||||
const sha = value => createHash('sha256').update(value).digest('hex'), state = () => host.api(selectedRoute);
|
||||
const panel = () => page.getByRole('dialog', { name: '本地代理引擎', exact: true });
|
||||
const view = () => page.getByRole('dialog', { name: '引擎原检查记录', exact: true });
|
||||
const card = job => panel().locator('[data-engine-job="' + job.id + '"]');
|
||||
const textContains = async (locator, text) => { await locator.waitFor({ state: 'visible' }); await until(async () => (await locator.innerText()).includes(text)); };
|
||||
const enabled = async locator => { await locator.waitFor({ state: 'visible' }); await until(() => locator.isEnabled()); };
|
||||
const mark = text => { passed.push(text); console.log('PASS ' + text); };
|
||||
page.on('pageerror', error => pageErrors.push(error.message));
|
||||
page.on('requestfailed', request => { const failure = { url: request.url(), error: request.failure()?.errorText };
|
||||
(deliberateNavigation && failure.error?.includes('ERR_ABORTED') ? expectedRequestFailures : requestFailures).push(failure); });
|
||||
page.on('request', request => { if (request.method() === 'POST' && request.url().endsWith('/engines/jobs')) starts.push(request.postDataJSON()); });
|
||||
async function screenshot(name) { const directory = path.join(root, 'screenshots'); fs.mkdirSync(directory, { recursive: true }); const filename = path.join(directory, 'engines-' + name + '.png'); await page.screenshot({ path: filename, scale: 'css' }); screenshots.push(filename); }
|
||||
async function open(title = session.title) {
|
||||
deliberateNavigation = true; await page.goto(host.url); await page.waitForLoadState('networkidle'); deliberateNavigation = false;
|
||||
if (!await page.getByLabel('当前项目').isVisible()) await page.getByRole('button', { name: '展开项目栏', exact: true }).click();
|
||||
await page.getByLabel('当前项目').selectOption(project.id); await page.locator('.session-list button').filter({ hasText: title }).click();
|
||||
await page.getByRole('button', { name: '本地代理引擎', exact: true }).click(); await panel().waitFor({ state: 'visible' });
|
||||
await textContains(panel(), '已找到 0.2.1-rc.2');
|
||||
}
|
||||
async function detect(installationRoot) {
|
||||
await panel().getByLabel('DeepSeek安装目录').fill(installationRoot); await textContains(panel(), '目录已改变');
|
||||
assert.equal(await panel().getByRole('button', { name: '核验连接', exact: true }).isEnabled(), false);
|
||||
await panel().getByRole('button', { name: '检测安装', exact: true }).click();
|
||||
await enabled(panel().getByRole('button', { name: '核验连接', exact: true }));
|
||||
}
|
||||
async function waitJob(before) {
|
||||
await until(async () => (await state()).execution.engineJobs.length === before + 1);
|
||||
await until(async () => (await state()).execution.engineJobs.at(-1).reportArtifactId, 20000);
|
||||
const job = (await state()).execution.engineJobs.at(-1); await textContains(card(job), job.status === 'completed' ? '连接通过' : '已停止'); return job;
|
||||
}
|
||||
let result;
|
||||
try {
|
||||
assert.notEqual(new URL(host.url).port, '4318'); assert.equal(host.bootstrap.config.hasKey, false);
|
||||
await open(); assert.equal((await state()).execution.task, null); await textContains(panel(), '本次检查不发送模型任务');
|
||||
mark('independent desktop engine entry detects the declared installation and clearly separates connection from project execution');
|
||||
await panel().getByLabel('DeepSeek安装目录').fill(path.join(root, '不存在的安装')); await panel().getByRole('button', { name: '检测安装', exact: true }).click();
|
||||
await textContains(panel(), '本地引擎关键输入不完整'); assert.equal(await panel().getByRole('button', { name: '核验连接', exact: true }).isEnabled(), false);
|
||||
assert.equal((await state()).execution.engineJobs.length, 0); await detect(fixtureRoot);
|
||||
mark('missing installations and edited directories cannot launch a check until detection succeeds');
|
||||
await panel().getByRole('button', { name: '核验连接', exact: true }).click(); const first = await waitJob(0);
|
||||
assert.equal(first.taskId, (await state()).execution.task.id); assert.equal(first.reportSummary.modelRequests, 0); assert.equal(first.reportSummary.rootExited, true);
|
||||
await textContains(card(first).getByLabel('引擎实际检查依据'), first.installation.identitySha256.slice(0, 12));
|
||||
assert.ok(starts[0].identitySha256); assert.equal(starts[0].identitySha256, first.installation.identitySha256);
|
||||
mark('UI launch seals the selected installation into the current Task/Run and renders actual startup and process-close facts');
|
||||
await card(first).getByRole('button', { name: '查看原记录', exact: true }).click(); await view().waitFor({ state: 'visible' });
|
||||
const firstPage = await host.api(selectedRoute + '/engines/jobs/' + first.id + '/report?limit=4000');
|
||||
await until(async () => (await view().getByLabel('引擎原记录内容').innerText()) === firstPage.content);
|
||||
assert.equal(firstPage.truncated, true); await view().getByRole('button', { name: '下一页', exact: true }).click();
|
||||
const secondPage = await host.api(selectedRoute + '/engines/jobs/' + first.id + '/report?offset=4000&limit=4000');
|
||||
await until(async () => (await view().getByLabel('引擎原记录内容').innerText()) === secondPage.content);
|
||||
await view().getByRole('button', { name: '回到首页', exact: true }).click(); await textContains(view(), first.reportSha256);
|
||||
const pendingDownload = page.waitForEvent('download'); await view().getByRole('button', { name: '下载完整记录', exact: true }).click();
|
||||
const download = await pendingDownload, filename = path.join(root, 'downloaded-report.json'); await download.saveAs(filename);
|
||||
assert.equal(sha(fs.readFileSync(filename)), first.reportSha256); assert.equal(JSON.parse(fs.readFileSync(filename, 'utf8')).report.responses.length, 6);
|
||||
await page.keyboard.press('Escape'); await view().waitFor({ state: 'hidden' }); assert.equal(await panel().isVisible(), true);
|
||||
mark('original record paging, full download SHA256 and nested-dialog keyboard close preserve the exact evidence');
|
||||
await card(first).getByRole('button', { name: '重新核验', exact: true }).click();
|
||||
const retry = page.getByRole('dialog', { name: '重新核验引擎连接', exact: true }); await retry.waitFor({ state: 'visible' });
|
||||
assert.equal((await state()).execution.engineJobs.length, 1); await retry.getByRole('button', { name: '开始新的核验', exact: true }).click();
|
||||
const second = await waitJob(1); assert.notEqual(second.pid, first.pid); assert.notEqual(second.id, first.id);
|
||||
assert.equal((await state()).execution.engineJobs.find(job => job.id === first.id).reportSha256, first.reportSha256);
|
||||
mark('an explicit new check creates a different process and record while retaining the original check unchanged');
|
||||
fs.writeFileSync(path.join(fixtureRoot, 'fixture-options.json'), JSON.stringify({ mode: 'hang-init' }));
|
||||
await panel().getByRole('button', { name: '核验连接', exact: true }).click();
|
||||
await until(async () => (await state()).execution.engineJobs.at(-1).status === 'initializing');
|
||||
await enabled(panel().getByRole('button', { name: '停止检查', exact: true })); await panel().getByRole('button', { name: '停止检查', exact: true }).click();
|
||||
const stopped = await waitJob(2); assert.equal(stopped.status, 'cancelled'); assert.equal(stopped.reportSummary.rootExited, true);
|
||||
assert.equal(fs.readFileSync(path.join(fixtureRoot, 'wire.jsonl'), 'utf8').includes('notifications/cancelled'), false);
|
||||
fs.writeFileSync(path.join(fixtureRoot, 'fixture-options.json'), '{}');
|
||||
await card(stopped).getByRole('button', { name: '重新核验', exact: true }).click();
|
||||
await page.getByRole('dialog', { name: '重新核验引擎连接', exact: true }).getByRole('button', { name: '开始新的核验', exact: true }).click();
|
||||
const resumed = await waitJob(3); assert.equal(resumed.status, 'completed');
|
||||
mark('declared pending-initialize fixture stops its owned process and explicit retry preserves the stopped result');
|
||||
assert.equal(native.status, 'available', native.message); await detect(native.root);
|
||||
await panel().getByRole('button', { name: '核验连接', exact: true }).click(); const nativeJob = await waitJob(4);
|
||||
assert.equal(nativeJob.status, 'completed'); assert.equal(nativeJob.installation.root, native.root); assert.equal(nativeJob.reportSummary.observedResponses, 6);
|
||||
assert.equal(nativeJob.reportSummary.modelRequests, 0); assert.equal(nativeJob.reportSummary.rootExited, true); await screenshot('native-desktop');
|
||||
mark('the same product UI verifies the actual installed DeepSeek SDK without a prompt or configured-model call');
|
||||
await page.setViewportSize({ width: 390, height: 844 }); await textContains(card(nativeJob), '连接通过');
|
||||
assert.equal(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), true);
|
||||
await card(nativeJob).getByRole('button', { name: '查看原记录', exact: true }).click(); await view().waitFor({ state: 'visible' });
|
||||
await textContains(view(), nativeJob.reportSha256); assert.equal(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), true);
|
||||
await screenshot('record-mobile'); await page.keyboard.press('Escape'); await view().waitFor({ state: 'hidden' });
|
||||
await panel().getByLabel('DeepSeek安装目录').scrollIntoViewIfNeeded(); await screenshot('native-mobile');
|
||||
mark('390px installation paths, source chain, original record, paging and keyboard close remain readable without page overflow');
|
||||
await page.setViewportSize({ width: 1440, height: 1050 });
|
||||
let held = false, release;
|
||||
const delay = new Promise(resolve => { release = resolve; });
|
||||
const pattern = '**/api/engines/deepseek/availability*'; await page.route(pattern, async route => {
|
||||
held = true; await delay; await route.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ error: 'owned-late-engine-error-must-stay-in-original-view' }) });
|
||||
});
|
||||
await panel().getByRole('button', { name: '检测安装', exact: true }).click(); await until(() => held);
|
||||
await panel().getByRole('button', { name: '关闭窗口', exact: true }).click(); await panel().waitFor({ state: 'hidden' });
|
||||
if (!await page.locator('.session-list').isVisible()) await page.getByRole('button', { name: '展开项目栏', exact: true }).click();
|
||||
await page.locator('.session-list button').filter({ hasText: other.title }).click(); selectedRoute = '/sessions/' + other.id;
|
||||
const lateResponse = page.waitForResponse(response => response.url().includes('/engines/deepseek/availability') && response.status() === 500);
|
||||
release(); await lateResponse; await page.unroute(pattern);
|
||||
await page.getByRole('button', { name: '本地代理引擎', exact: true }).click(); await panel().waitFor({ state: 'visible' });
|
||||
await textContains(panel(), '已找到 0.2.1-rc.2'); await textContains(panel(), '先验证这个安装能否连接');
|
||||
assert.equal((await state()).execution.engineJobs.length, 0); assert.equal(await page.getByText('owned-late-engine-error-must-stay-in-original-view').count(), 0);
|
||||
mark('late detection failure from a closed panel cannot appear in a different task or reveal its prior engine records');
|
||||
const wireBefore = fs.readFileSync(path.join(fixtureRoot, 'wire.jsonl')), saved = await host.api('/sessions/' + session.id);
|
||||
deliberateNavigation = true; await host.close(); host = await launchWorkbench(t, data, { AGENT_WORKBENCH_DEEPSEEK_ROOT: fixtureRoot });
|
||||
selectedRoute = '/sessions/' + session.id; await open();
|
||||
assert.deepEqual((await state()).execution.engineJobs, saved.execution.engineJobs); assert.deepEqual(fs.readFileSync(path.join(fixtureRoot, 'wire.jsonl')), wireBefore);
|
||||
await card(nativeJob).getByRole('button', { name: '查看原记录', exact: true }).click(); await view().waitFor({ state: 'visible' }); await textContains(view(), nativeJob.reportSha256);
|
||||
assert.deepEqual(fs.readFileSync(path.join(projectRoot, 'README.md')), projectBytes); assert.equal((await state()).execution.task.usage.requests, 0);
|
||||
mark('actual host restart preserves all native and declared-fixture records with no protocol replay or project modification');
|
||||
assert.equal(pageErrors.length, 0); assert.equal(requestFailures.length, 0);
|
||||
result = { success: true, version: host.bootstrap.version, testedAt: new Date().toISOString(), root, browser: browser.version(), passed, pageErrors,
|
||||
requestFailures, expectedRequestFailures, screenshots, starts, nativeJob,
|
||||
actualSdk: { version: native.version, identitySha256: nativeJob.installation.identitySha256, nativeMethods: 6, modelRequests: 0, rootExited: true },
|
||||
stopScope: 'declared private SDK pending-initialize fixture', scope: 'Independent service and data. Original 4318 Provider, tasks and credentials were not accessed.' };
|
||||
} catch (error) {
|
||||
await screenshot('initial-failure').catch(() => {}); fs.writeFileSync(path.join(root, 'failure-dom.html'), await page.content().catch(() => ''));
|
||||
result = { success: false, version: host.bootstrap.version, testedAt: new Date().toISOString(), root, passed, pageErrors, requestFailures, expectedRequestFailures, screenshots, error: error.stack }; process.exitCode = 1;
|
||||
} finally { deliberateNavigation = true; await browser.close(); for (const dispose of disposers.reverse()) await dispose(); }
|
||||
fs.writeFileSync(path.join(root, 'result.json'), JSON.stringify(result, null, 2) + '\n');
|
||||
fs.writeFileSync('docs/engines-ui-validation.json', JSON.stringify(result, null, 2) + '\n');
|
||||
console.log(JSON.stringify({ success: result.success, version: result.version, groups: passed.length, root, pageErrors, requestFailures, error: result.error }));
|
||||
@@ -0,0 +1,52 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { randomUUID, createHash } from 'node:crypto';
|
||||
import { EngineManager } from '../src/core/engine-manager.mjs';
|
||||
import { Store } from '../src/server/store.mjs';
|
||||
import { APP_VERSION } from '../src/server/diagnostics.mjs';
|
||||
|
||||
if (process.argv.includes('--help')) {
|
||||
console.log('node scripts/verify-engines.mjs [--root <installed-DeepSeek-Harness-root>] — native SDK connection, no prompt or configured model'); process.exit(0);
|
||||
}
|
||||
const rootIndex = process.argv.indexOf('--root'), requestedRoot = rootIndex >= 0 ? process.argv[rootIndex + 1] : undefined;
|
||||
if (rootIndex >= 0 && !requestedRoot) throw new Error('--root needs an installation directory');
|
||||
const directory = path.resolve('.qa', 'native-engine-' + randomUUID()), projectRoot = path.join(directory, 'project');
|
||||
fs.mkdirSync(projectRoot, { recursive: true });
|
||||
const projectBytes = Buffer.from('# Owned native SDK connection validation\n'); fs.writeFileSync(path.join(projectRoot, 'README.md'), projectBytes);
|
||||
const store = new Store(path.join(directory, 'data')), manager = new EngineManager(store), project = store.addProject(projectRoot), session = store.createSession(project.id);
|
||||
const sha = bytes => createHash('sha256').update(bytes).digest('hex');
|
||||
let result;
|
||||
try {
|
||||
const installation = manager.availability(requestedRoot);
|
||||
assert.equal(installation.status, 'available', installation.message);
|
||||
const started = manager.start(session, { root: installation.root, identitySha256: installation.identitySha256 }), job = await started.promise;
|
||||
assert.equal(job.status, 'completed', job.summary); assert.equal(job.verification?.verified, true);
|
||||
const reportText = manager.originalReport(session, job), original = JSON.parse(reportText);
|
||||
assert.equal(sha(reportText), job.reportSha256);
|
||||
assert.deepEqual(original.owner, { sessionId: session.id, projectId: project.id, taskId: session.taskId, runId: session.runId, jobId: job.id });
|
||||
assert.equal(original.report.readiness.signal, 'appReady'); assert.equal(original.report.readiness.pid, job.pid);
|
||||
assert.equal(original.report.before.identitySha256, original.report.after.identitySha256);
|
||||
assert.equal(original.report.before.identitySha256, installation.identitySha256);
|
||||
assert.deepEqual(original.report.responses.map(value => value.method), ['initialize', 'session/working-directory/get', 'session/wait', 'session/resume', 'session/cancel', 'shutdown']);
|
||||
assert.equal(original.report.process.pid, original.report.cleanup.pid); assert.equal(original.report.cleanup.rootExited, true); assert.equal(original.report.cleanup.exit.code, 0);
|
||||
assert.equal(original.report.modelRequests, 0); assert.equal(original.report.providerRequests, 0);
|
||||
assert.equal(store.core.task.get(session.taskId).usage.requests, 0); assert.equal(session.changes.length, 0);
|
||||
assert.equal(original.report.workspace.unchanged, true); assert.deepEqual(fs.readFileSync(path.join(projectRoot, 'README.md')), projectBytes);
|
||||
fs.writeFileSync(path.join(directory, 'original-report.json'), reportText);
|
||||
result = { success: true, version: APP_VERSION, testedAt: new Date().toISOString(), directory,
|
||||
evidenceKind: 'actual-native-DeepSeek-Harness-SDK; no protocol fixture', scope: job.scope,
|
||||
owner: original.owner, installation: { root: installation.root, version: installation.version, profile: installation.profile,
|
||||
identitySha256: installation.identitySha256, inputs: installation.inputs, node: installation.node },
|
||||
process: original.report.process, readiness: original.report.readiness, responses: original.report.responses,
|
||||
cleanup: original.report.cleanup, workspace: original.report.workspace, reportSha256: job.reportSha256,
|
||||
modelRequests: 0, providerRequests: 0, projectChanges: 0,
|
||||
executionBoundary: 'Connection validation only; session/prompt was not sent. Original user service and credentials were not used.' };
|
||||
} catch (error) {
|
||||
result = { success: false, version: APP_VERSION, testedAt: new Date().toISOString(), directory,
|
||||
error: error.stack, jobs: manager.jobs(session).map(job => manager.summary(session, job)) }; process.exitCode = 1;
|
||||
} finally { await manager.stopAll(); store.close(); }
|
||||
fs.writeFileSync(path.join(directory, 'result.json'), JSON.stringify(result, null, 2) + '\n');
|
||||
fs.writeFileSync(path.resolve('.qa', 'native-engine-validation.json'), JSON.stringify(result, null, 2) + '\n');
|
||||
console.log(JSON.stringify({ success: result.success, version: result.version, directory, sdkVersion: result.installation?.version,
|
||||
nativeMethods: result.responses?.map(value => value.method), modelRequests: result.modelRequests, rootExited: result.cleanup?.rootExited, error: result.error }));
|
||||
@@ -12,7 +12,7 @@ const protectedFiles = createPythonDeliveryProject(f), source = captureWorkspace
|
||||
f.session.title = 'Python工程检查与交付'; f.store.core.task.get(f.session.taskId).goal = '修复三个Python模块,保护测试与声明,核对实际检查并交付本地Git报告。';
|
||||
f.store.save(f.session); f.store.close();
|
||||
const host = await launchWorkbench(t, f.data, process.env.AGENT_WORKBENCH_TEST_PYTHON ? { AGENT_WORKBENCH_PYTHON_PATH: process.env.AGENT_WORKBENCH_TEST_PYTHON } : {});
|
||||
const proofPrefix = host.bootstrap.version === '1.8.0' ? 'rea-engine' : 'python-engine';
|
||||
const proofPrefix = host.bootstrap.version === '1.8.0' ? 'rea-engine' : host.bootstrap.version === '1.9.0' ? 'external-engines' : 'python-engine';
|
||||
assert.notEqual(new URL(host.url).port, '4318'); assert.equal(host.bootstrap.config.hasKey, false);
|
||||
fs.mkdirSync('.qa/screenshots', { recursive: true });
|
||||
const browser = await chromium.launch({ channel: 'msedge', headless: true }), page = await browser.newPage({ viewport: { width: 1440, height: 1000 } });
|
||||
|
||||
@@ -117,7 +117,7 @@ try {
|
||||
checks: actual.results.map(result => ({ name: result.name, status: result.status, exitCode: result.exitCode, tests: result.tests })),
|
||||
commit: job.commit, changes: job.paths, protectedFiles: Object.fromEntries(Object.entries(protectedBytes).map(([relative, bytes]) => [relative, sha(bytes)])),
|
||||
scope: 'Owned frozen React TypeScript project with offline-installed fixed dependencies, real npm/typecheck/build/browser and Workbench review/Git/report. API fixtures supply repairs; configured-model success is separate.' };
|
||||
fs.writeFileSync(host.bootstrap.version === '1.8.0' ? 'docs/rea-engine-react-delivery-validation.json' : 'docs/react-engine-delivery-validation.json', JSON.stringify(result, null, 2) + '\n'); console.log(JSON.stringify(result, null, 2));
|
||||
fs.writeFileSync(host.bootstrap.version === '1.8.0' ? 'docs/rea-engine-react-delivery-validation.json' : host.bootstrap.version === '1.9.0' ? 'docs/external-engines-react-delivery-validation.json' : 'docs/react-engine-delivery-validation.json', JSON.stringify(result, null, 2) + '\n'); console.log(JSON.stringify(result, null, 2));
|
||||
} catch (error) {
|
||||
await snapshot('failure').catch(() => {});
|
||||
fs.writeFileSync('.qa/react-engine-delivery-failure.json', JSON.stringify({ error: error.message, passed, pageErrors, requestFailures, session }, null, 2)); throw error;
|
||||
|
||||
@@ -91,7 +91,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 (manifest.version === '1.8.0') {
|
||||
if (['1.8.0', '1.9.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')));
|
||||
@@ -122,13 +122,31 @@ try {
|
||||
assert.equal((await api(researchRoute)).execution.task.usage.requests, 0); assert.equal(fs.existsSync(samples.marker), false);
|
||||
console.log('PASS actual contained REA: ASAR, PE imports and PE resources; zero target execution/model requests');
|
||||
}
|
||||
let actualEngine = null;
|
||||
if (manifest.version === '1.9.0' && 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');
|
||||
const project = await api('/projects', { root: engineRoot }), engineSession = await api('/sessions', { projectId: project.id }), route = '/sessions/' + engineSession.id;
|
||||
const started = await api(route + '/engines/jobs', { root: installation.root, identitySha256: installation.identitySha256 });
|
||||
let job; await until(async () => { job = await api(route + '/engines/jobs/' + started.job.id); return !!job.reportArtifactId; }, 30000);
|
||||
assert.equal(job.status, 'completed', job.summary); assert.equal(job.reportSummary.rootExited, true); assert.equal(job.reportSummary.modelRequests, 0);
|
||||
const response = await fetch(url + '/api' + route + '/engines/jobs/' + job.id + '/download', { headers: { 'X-Workbench-Token': bootstrap.token, Connection: 'close' } });
|
||||
assert.equal(response.status, 200); const bytes = Buffer.from(await response.arrayBuffer());
|
||||
assert.equal(createHash('sha256').update(bytes).digest('hex'), job.reportSha256);
|
||||
const original = JSON.parse(bytes.toString('utf8')); assert.equal(original.owner.taskId, job.taskId); assert.equal(original.report.responses.length, 6);
|
||||
assert.equal(original.report.providerRequests, 0); assert.equal(original.report.cleanup.exit.code, 0);
|
||||
actualEngine = { packageVersion: installation.version, profile: installation.profile, installationSha256: installation.identitySha256,
|
||||
reportSha256: job.reportSha256, rootExited: true, modelRequests: 0, nativeMethods: original.report.responses.map(value => value.method), node: installation.node };
|
||||
console.log('PASS compiled portable engine adapter: actual local SDK, contained Node, six native methods and sealed original report');
|
||||
}
|
||||
assert.equal((await api('/research')).length, 4);
|
||||
const page = await fetch(url); assert.equal(page.status, 200);
|
||||
assert.match(await page.text(), /Agent Workbench/);
|
||||
console.log((await stop()).trim()); started = false;
|
||||
await until(async () => { try { await fetch(url + '/api/health'); return false; } catch { return true; } });
|
||||
const result = { success: true, date: new Date().toISOString(), appRoot, version: manifest.version, nodeVersion: manifest.nodeVersion,
|
||||
verifiedFiles: manifest.files.length, url, reusedPid: firstInfo.pid, checks: { jobId, status: checked.status, tests: checked.results[0].tests }, actualRea,
|
||||
verifiedFiles: manifest.files.length, url, reusedPid: firstInfo.pid, checks: { jobId, status: checked.status, tests: checked.results[0].tests }, actualRea, actualEngine,
|
||||
steps: ['manifest hashes', 'bundled Node launch', 'same-service reuse', 'packaged example and static page', 'explicit command consent', 'actual bundled Node version', 'actual bundled npm check without system Node/npm', 'check log artifact', ...(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'], realModel: false };
|
||||
fs.writeFileSync('.qa/release-validation.json', JSON.stringify(result, null, 2));
|
||||
console.log(JSON.stringify(result, null, 2));
|
||||
|
||||
@@ -7,6 +7,8 @@ import { Store } from '../src/server/store.mjs';
|
||||
import { launchWorkbench } from '../tests/helpers.mjs';
|
||||
import { createResearchSamples, ownedAsar } from './research-fixtures.mjs';
|
||||
|
||||
const proofPrefix = JSON.parse(fs.readFileSync('package.json', 'utf8')).version === '1.9.0' ? 'external-engines' : 'rea-engine';
|
||||
|
||||
if (process.argv.includes('--help')) { console.log('node scripts/verify-research-ui.mjs — independent owned projects, real REA static operations and a declared stdio stop fixture'); process.exit(0); }
|
||||
const root = path.resolve('.qa', 'research-ui-' + randomUUID()), data = path.join(root, 'data'), projectRoot = path.join(root, 'project');
|
||||
fs.mkdirSync(projectRoot, { recursive: true }); fs.mkdirSync('.qa/screenshots', { recursive: true });
|
||||
@@ -28,7 +30,7 @@ page.on('requestfailed', request => {
|
||||
(deliberateNavigation && failure.error?.includes('ERR_ABORTED') ? expectedRequestFailures : requestFailures).push(failure);
|
||||
});
|
||||
page.on('request', request => { if (request.method() === 'POST' && request.url().endsWith('/research/jobs')) analysisRequests.push({ url: request.url(), input: request.postDataJSON() }); });
|
||||
async function screenshot(name) { const filename = '.qa/screenshots/rea-engine-' + name + '.png'; await page.screenshot({ path: filename, scale: 'css' }); screenshots.push(filename); }
|
||||
async function screenshot(name) { const filename = '.qa/screenshots/' + proofPrefix + '-' + name + '.png'; await page.screenshot({ path: filename, scale: 'css' }); screenshots.push(filename); }
|
||||
async function openProject(projectId = project.id, title = original.title) {
|
||||
await page.goto(host.url); await page.waitForLoadState('networkidle');
|
||||
await page.getByLabel('当前项目').selectOption(projectId); await page.locator('.session-list button').filter({ hasText: title }).click();
|
||||
@@ -176,5 +178,5 @@ try {
|
||||
deliberateNavigation = true; await browser.close(); for (const dispose of disposers.reverse()) await dispose();
|
||||
}
|
||||
fs.writeFileSync(path.join(root, 'result.json'), JSON.stringify(result, null, 2) + '\n');
|
||||
fs.writeFileSync('docs/rea-engine-research-ui-validation.json', JSON.stringify(result, null, 2) + '\n');
|
||||
fs.writeFileSync('docs/' + proofPrefix + '-research-ui-validation.json', JSON.stringify(result, null, 2) + '\n');
|
||||
console.log(JSON.stringify({ success: result.success, version: result.version, groups: passed.length, root, pageErrors, requestFailures, error: result.error }, null, 2));
|
||||
|
||||
@@ -42,19 +42,27 @@ 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 (evidence.version === '1.8.0') {
|
||||
if (['1.8.0', '1.9.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));
|
||||
assert.equal(actualRea.success, true); assert.equal(actualRea.version, evidence.version); assert.equal(actualRea.results.length, 3);
|
||||
assert.ok(actualRea.results.every(item => item.rootExited === true));
|
||||
}
|
||||
let actualEngine = null;
|
||||
if (evidence.version === '1.9.0' && 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));
|
||||
assert.equal(actualEngine.success, true); assert.equal(actualEngine.version, evidence.version);
|
||||
assert.equal(actualEngine.modelRequests, 0); assert.equal(actualEngine.rootExited, true); assert.equal(actualEngine.nativeMethods.length, 6);
|
||||
}
|
||||
stage = 'tests';
|
||||
const output = await run(['--test', '--test-concurrency=2', '--test-reporter=tap', ...files(path.join(sourceRoot, 'tests')).filter(file => !file.includes(path.sep) && file.endsWith('.test.mjs')).map(file => path.join('tests', file))], 'tests.tap');
|
||||
const stats = Object.fromEntries([...output.matchAll(/^# (tests|pass|fail|cancelled|skipped|todo) (\d+)\s*$/gm)].map(match => [match[1], Number(match[2])]));
|
||||
assert.ok(stats.tests > 0); assert.equal(stats.pass, stats.tests); for (const key of ['fail', 'cancelled', 'skipped', 'todo']) assert.equal(stats[key], 0);
|
||||
const result = { success: true, version: evidence.version, testedAt: new Date().toISOString(), sourceRoot, offlineInstall: true,
|
||||
buildMatchedFiles: Object.keys(expected).length, tests: stats, actualRea, credentialsHandling: 'Only build/runtime environment paths are inherited; no model configuration or credentials are used.' };
|
||||
buildMatchedFiles: Object.keys(expected).length, tests: stats, actualRea, actualEngine, credentialsHandling: 'Only build/runtime environment paths are inherited; no model configuration or credentials are used.' };
|
||||
fs.writeFileSync(resultFile, JSON.stringify(result, null, 2)); console.log(JSON.stringify(result, null, 2));
|
||||
} catch (error) {
|
||||
fs.writeFileSync(resultFile, JSON.stringify({ success: false, version: evidence.version, stage, error: error.message, sourceRoot }, null, 2));
|
||||
|
||||
@@ -43,4 +43,5 @@ try {
|
||||
}
|
||||
fs.writeFileSync(path.join(directory, 'result.json'), JSON.stringify(result, null, 2) + '\n'); fs.writeFileSync('.qa/tests-validation.json', JSON.stringify(result, null, 2) + '\n');
|
||||
if (version === '1.8.0') fs.writeFileSync('docs/rea-engine-tests-validation.json', JSON.stringify(result, null, 2) + '\n');
|
||||
if (version === '1.9.0') fs.writeFileSync('docs/external-engines-tests-validation.json', JSON.stringify(result, null, 2) + '\n');
|
||||
console.log(JSON.stringify({ success: result.success, version, tests: result.tests, inputFiles: result.inputFiles, directory, error: result.error, tail: result.tail }, null, 2));
|
||||
|
||||
@@ -12,7 +12,7 @@ import { captureWorkspaceSource, assertWorkspaceSource } from '../tests/fixtures
|
||||
// Every host/project is synthetic and independently owned. Never uses 4318.
|
||||
const root = path.resolve('.qa', 'workspace-ui-' + randomUUID()), data = path.join(root, 'data');
|
||||
const version = JSON.parse(fs.readFileSync('package.json', 'utf8')).version;
|
||||
const proofPrefix = version === '1.6.0' ? 'workspaces' : version === '1.6.1' ? 'working-context-workspaces' : version === '1.6.2' ? 'working-retention-workspaces' : version === '1.7.0' ? 'python-engine-workspaces' : 'rea-engine-workspaces';
|
||||
const proofPrefix = version === '1.6.0' ? 'workspaces' : version === '1.6.1' ? 'working-context-workspaces' : version === '1.6.2' ? 'working-retention-workspaces' : version === '1.7.0' ? 'python-engine-workspaces' : version === '1.9.0' ? 'external-engines-workspaces' : 'rea-engine-workspaces';
|
||||
fs.mkdirSync(root, { recursive: true }); fs.mkdirSync('.qa/screenshots', { recursive: true });
|
||||
const store = new Store(data), cases = {}, passed = [], pageErrors = [], requestFailures = [], screenshots = [], createPosts = [];
|
||||
for (const name of ['normal', 'mobile', 'recovery', 'late-success', 'late-failure']) {
|
||||
|
||||
+8
-3
@@ -8,13 +8,14 @@ import { TaskPanel } from './TaskPanel';
|
||||
import { CodeIndexPanel } from './CodeIndexPanel';
|
||||
import { ChangesInspector } from './ChangesInspector';
|
||||
import { ResearchPanel } from './ResearchPanel';
|
||||
import { EnginePanel } from './EnginePanel';
|
||||
|
||||
const activeStates = ['running', 'awaiting_approval', 'stopping'];
|
||||
const defaultConfig: Config = { mode: 'demo', baseUrl: 'http://127.0.0.1:11434/v1', model: '', contextLimit: 16000, maxSteps: 12, maxOutputTokens: 2048, hasKey: false, maxRunDurationMs: 600000, maxRunTokens: 200000, maxTaskTokens: 1000000 };
|
||||
|
||||
export default function App() {
|
||||
const [token, setAccess] = useState('');
|
||||
const [version, setVersion] = useState('1.7.0');
|
||||
const [version, setVersion] = useState('1.9.0');
|
||||
const [diagnosticsOpen, setDiagnosticsOpen] = useState(false);
|
||||
const [diagnostics, setDiagnostics] = useState<RuntimeDiagnostics | null>(null);
|
||||
const [diagnosticsBusy, setDiagnosticsBusy] = useState(false);
|
||||
@@ -62,6 +63,7 @@ export default function App() {
|
||||
const [toast, setToast] = useState('');
|
||||
const [researchOpen, setResearchOpen] = useState(false);
|
||||
const [reaOpen, setReaOpen] = useState(false);
|
||||
const [engineOpen, setEngineOpen] = useState(false);
|
||||
const [researchDocs, setResearchDocs] = useState<ResearchDoc[]>([]);
|
||||
const [report, setReport] = useState<{ title: string; content: string } | null>(null);
|
||||
const chatEnd = useRef<HTMLDivElement>(null);
|
||||
@@ -84,7 +86,8 @@ export default function App() {
|
||||
|| session.execution?.deliveries?.some(job => ['queued', 'preparing', 'prepared', 'publishing', 'committed', 'reporting'].includes(job.status)) === true
|
||||
|| session.execution?.changeSets?.some(set => ['applying', 'rolling_back'].includes(set.status)) === true
|
||||
|| session.execution?.workspaces?.some(value => ['creating', 'verifying', 'registering'].includes(value.status)) === true
|
||||
|| session.execution?.researchJobs?.some(value => ['queued', 'connecting', 'analyzing', 'stopping'].includes(value.status)) === true);
|
||||
|| session.execution?.researchJobs?.some(value => ['queued', 'connecting', 'analyzing', 'stopping'].includes(value.status)) === true
|
||||
|| session.execution?.engineJobs?.some(value => ['queued', 'starting', 'initializing', 'checking', 'stopping'].includes(value.status)) === true);
|
||||
const anyRunning = isRunning || briefs.some(item => activeStates.includes(item.status));
|
||||
const pending = session?.changes.filter(change => ['pending', 'conflict'].includes(change.status)) || [];
|
||||
const reviewedRun = session?.execution?.run;
|
||||
@@ -122,7 +125,7 @@ export default function App() {
|
||||
function failure(error: unknown) { notify(error instanceof Error ? error.message : String(error)); }
|
||||
function selectSession(id: string) {
|
||||
if (selectedSessionRef.current === id) return;
|
||||
workspaceRequest.current++; selectedSessionRef.current = id; setSessionId(id); setSession(null); setToast(''); setReaOpen(false);
|
||||
workspaceRequest.current++; selectedSessionRef.current = id; setSessionId(id); setSession(null); setToast(''); setReaOpen(false); setEngineOpen(false);
|
||||
localStorage.setItem('awb-session', id); setChangeId(''); setEventId('');
|
||||
}
|
||||
function acceptSession(updated: Session) {
|
||||
@@ -495,6 +498,7 @@ export default function App() {
|
||||
<div className="task-toolbar"><span className="task-local"><GitBranch size={13} />本地项目</span>{session ? <Status value={session.status} /> : <span className="subtle">等待新任务</span>}<div className="toolbar-actions">
|
||||
<IconButton label="运行诊断" onClick={() => openDiagnostics()}><Activity size={15} /></IconButton>
|
||||
<IconButton label="查看任务记录" onClick={() => showInspector('task')}><ClipboardCheck size={15} /></IconButton>
|
||||
<IconButton label="本地代理引擎" onClick={() => setEngineOpen(true)} disabled={!session}><Link2 size={15} /></IconButton>
|
||||
<IconButton label="REA 工件研究" onClick={() => void openRea()} disabled={!selectedProject || creatingSession}><BookOpenText size={15} /></IconButton>
|
||||
{narrow && <><IconButton label="查看文件" onClick={() => showInspector('file')}><FileCode2 size={16} /></IconButton><IconButton label="查看改动" onClick={() => showInspector('changes')}><GitBranch size={16} /></IconButton><IconButton label="查看执行轨迹" onClick={() => showInspector('trace')}><SquareTerminal size={16} /></IconButton></>}
|
||||
{pending.length > 0 && <button className="text-button review-toolbar" onClick={() => { setChangeId(pending[0].id); showInspector('changes'); }}><FileCode2 size={13} />审核 {pending.length} 项</button>}
|
||||
@@ -534,6 +538,7 @@ export default function App() {
|
||||
<details className="budget-settings"><summary>上下文与任务预算<ChevronDown size={13} /></summary><div className="budget-fields"><label>上下文预算<input type="number" min={1000} max={200000} value={settings.contextLimit} onChange={event => setSettings(previous => ({ ...previous, contextLimit: Number(event.target.value) }))} /></label><label>最大工具轮次<input type="number" min={1} max={30} value={settings.maxSteps} onChange={event => setSettings(previous => ({ ...previous, maxSteps: Number(event.target.value) }))} /></label><label>输出上限<input type="number" min={256} max={16000} value={settings.maxOutputTokens} onChange={event => setSettings(previous => ({ ...previous, maxOutputTokens: Number(event.target.value) }))} /></label><label>运行时间(分钟)<input aria-label="运行时间预算" type="number" min={1} max={60} value={settings.maxRunDurationMs / 60000} onChange={event => setSettings(previous => ({ ...previous, maxRunDurationMs: Number(event.target.value) * 60000 }))} /></label><label>单次运行 tokens<input aria-label="单次运行token预算" type="number" min={1000} max={2000000} value={settings.maxRunTokens} onChange={event => setSettings(previous => ({ ...previous, maxRunTokens: Number(event.target.value) }))} /></label><label>任务累计 tokens<input aria-label="任务累计token预算" type="number" min={1000} max={10000000} value={settings.maxTaskTokens} onChange={event => setSettings(previous => ({ ...previous, maxTaskTokens: Number(event.target.value) }))} /></label></div><p>上下文使用本地估算;实际用量与未知用量分开保存。达到预算会暂停,已完成的工具结果保留。</p></details>{anyRunning && <p className="form-warning">有任务在执行,请先停止任务再改变连接。</p>}<div className="modal-actions"><button type="button" className="button secondary" onClick={() => setSettingsOpen(false)}>取消</button><button type="submit" className="button primary" disabled={settingsBusy || anyRunning}><Check size={15} />保存连接</button></div></form></Modal>}
|
||||
{diagnosticsOpen && <Modal title="运行诊断" description="查看工作台的模型连接、终端环境、最近错误和文件实际状态。" wide onClose={() => setDiagnosticsOpen(false)}><DiagnosticsPanel value={diagnostics} busy={diagnosticsBusy} onRefresh={() => openDiagnostics()} /></Modal>}
|
||||
{reaOpen && session && selectedProject && <Modal title="REA 工件研究" description="原分析与同一项目、任务和运行绑定。" wide onClose={() => setReaOpen(false)}><ResearchPanel key={session.id} project={selectedProject} session={session} onSession={acceptSession} onError={failure} busy={isRunning} /></Modal>}
|
||||
{engineOpen && session && selectedProject && <Modal title="本地代理引擎" description="本地安装、实际连接与原检查记录。" wide onClose={() => setEngineOpen(false)}><EnginePanel key={session.id} project={selectedProject} session={session} onSession={acceptSession} onError={failure} busy={isRunning} /></Modal>}
|
||||
{researchOpen && <Modal title="机制研究与独立设计" description="从分发客户端的静态证据提炼产品机制。运行时与远端服务的未知部分在报告中说明。" wide onClose={() => setResearchOpen(false)}><div className="research-layout"><nav>{researchDocs.map(document => <button className={report?.title === document.title ? 'selected' : ''} key={document.id} onClick={() => loadReport(document.id)}><BookOpenText size={15} /><span><strong>{document.title}</strong><small>{document.description}</small></span></button>)}</nav><article className="research-document">{report && <ResearchContent content={report.content} />}</article></div></Modal>}
|
||||
{toast && <div className="toast" role="status"><span>{toast}</span><IconButton label="关闭提示" onClick={() => setToast('')}><X size={14} /></IconButton></div>}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
.engine-panel { color: var(--ink); min-width: 0; }
|
||||
.engine-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 23px; }
|
||||
.engine-eyebrow { color: var(--teal); font-size: 11px; letter-spacing: .04em; }
|
||||
.engine-heading h3 { font-size: 23px; font-weight: 650; letter-spacing: -.035em; line-height: 1.4; margin: 5px 0 8px; }
|
||||
.engine-heading p { color: var(--muted); font-size: 12px; line-height: 1.8; max-width: 570px; }
|
||||
.engine-install-state { color: #8b5734; font-size: 11px; border: 1px solid #e8dccc; border-radius: 5px; padding: 6px 9px; flex-shrink: 0; margin-top: 7px; }
|
||||
.engine-install-state.found { color: var(--teal); background: #eff7f3; border-color: #c6ded4; }
|
||||
.engine-layout { display: grid; grid-template-columns: minmax(240px, .82fr) minmax(0, 1.45fr); gap: 24px; }
|
||||
.engine-connection, .engine-results { min-width: 0; }
|
||||
.engine-panel h4 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; margin-bottom: 14px; }
|
||||
.engine-connection form { border: 1px solid var(--line); border-radius: 7px; background: var(--paper); padding: 18px; }
|
||||
.engine-connection .form-field { margin-bottom: 13px; }
|
||||
.engine-detection-note { font-size: 12px; line-height: 1.8; color: #8b5734; margin: 13px 0; overflow-wrap: anywhere; }
|
||||
.engine-detection-note.available { color: var(--teal); }
|
||||
.engine-install-details { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; font-size: 11px; margin: 16px 0; }
|
||||
.engine-install-details dt { color: var(--muted); }
|
||||
.engine-install-details dd { margin: 0; line-height: 1.7; overflow-wrap: anywhere; }
|
||||
.engine-start { margin-top: 14px; }
|
||||
.engine-scope { padding: 23px 2px 0; }
|
||||
.engine-scope > p { display: flex; align-items: center; gap: 7px; color: var(--teal); font-size: 12px; margin-bottom: 12px; }
|
||||
.engine-scope-next { border-top: 1px solid var(--line); margin-top: 19px; padding-top: 15px; }
|
||||
.engine-scope-next > span { font-size: 11px; color: #59706b; }
|
||||
.engine-scope-next p, .engine-scope details p { font-size: 12px; color: var(--muted); line-height: 1.85; margin-top: 8px; }
|
||||
.engine-scope details { margin-top: 17px; font-size: 11px; color: var(--muted); }
|
||||
.engine-scope summary { cursor: pointer; }
|
||||
.engine-results-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
|
||||
.engine-results-heading h4 span { color: var(--muted); font-size: 11px; font-weight: 400; }
|
||||
.engine-empty { border: 1px dashed #cbdcd3; border-radius: 7px; padding: 41px 24px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; color: var(--muted); }
|
||||
.engine-empty strong { font-size: 15px; font-weight: 550; color: var(--ink); }
|
||||
.engine-empty p { font-size: 12px; line-height: 1.85; max-width: 380px; }
|
||||
.engine-job { border: 1px solid var(--line); background: var(--paper); padding: 17px; margin-bottom: 13px; border-radius: 7px; min-width: 0; }
|
||||
.engine-job.verified { border-left: 3px solid #5b9886; padding-left: 15px; }
|
||||
.engine-job-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
|
||||
.engine-job-heading strong { font-size: 13px; display: block; }
|
||||
.engine-job-heading small { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
|
||||
.engine-job-state { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: #766449; padding-top: 2px; flex-shrink: 0; }
|
||||
.engine-job-state.completed { color: var(--teal); }
|
||||
.engine-job-state.failed, .engine-job-state.unknown { color: #a34d35; }
|
||||
.engine-job-summary { color: var(--muted); font-size: 12px; line-height: 1.85; margin: 13px 0; overflow-wrap: anywhere; }
|
||||
.engine-proof { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 13px 0; margin-bottom: 13px; border-block: 1px solid #e3ece7; color: #859892; }
|
||||
.engine-proof > div { display: flex; align-items: center; gap: 7px; min-width: 0; }
|
||||
.engine-proof > div.observed { color: var(--teal); }
|
||||
.engine-proof span { font-size: 9px; }
|
||||
.engine-proof code { display: block; font-size: 10px; margin-top: 5px; overflow-wrap: anywhere; }
|
||||
.engine-job-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 12px; }
|
||||
.engine-job-actions .button { padding: 7px 9px; font-size: 11px; }
|
||||
.engine-job-actions .text-button { font-size: 11px; }
|
||||
.engine-origin { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 15px; font-size: 10px; color: var(--muted); }
|
||||
.engine-origin summary { cursor: pointer; }
|
||||
.engine-origin dl { display: grid; grid-template-columns: 87px minmax(0, 1fr); gap: 9px; margin-top: 14px; }
|
||||
.engine-origin dt, .engine-origin dd { margin: 0; line-height: 1.7; min-width: 0; overflow-wrap: anywhere; }
|
||||
.engine-retry-note { overflow-wrap: anywhere; margin-bottom: 14px; color: var(--teal); font-size: 12px; }
|
||||
.engine-record-meta { font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 13px; margin-bottom: 16px; }
|
||||
.engine-record-meta code { display: block; overflow-wrap: anywhere; margin-top: 7px; font-size: 10px; }
|
||||
.engine-original { margin: 0; padding: 17px; background: #f1f5f2; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; line-height: 1.8; max-height: 44vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
|
||||
.engine-page-controls { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 14px; font-size: 11px; color: var(--muted); }
|
||||
.engine-page-controls > span { margin-right: auto; }
|
||||
@media (max-width: 800px) { .engine-layout { grid-template-columns: minmax(0, 1fr); gap: 26px; } }
|
||||
@media (max-width: 620px) {
|
||||
.engine-heading { display: block; margin-bottom: 20px; }
|
||||
.engine-heading h3 { font-size: 21px; }
|
||||
.engine-install-state { display: inline-block; margin-top: 14px; }
|
||||
.engine-connection form { padding: 15px; }
|
||||
.engine-job { padding: 13px; }
|
||||
.engine-job.verified { padding-left: 11px; }
|
||||
.engine-job-heading { flex-wrap: wrap; gap: 8px; }
|
||||
.engine-proof { gap: 4px; }
|
||||
.engine-proof > div { gap: 4px; }
|
||||
.engine-proof > div > svg { display: none; }
|
||||
.engine-proof code { font-size: 9px; }
|
||||
.engine-original { padding: 12px; max-height: 42vh; }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) { .engine-panel .spin { animation: none; } }
|
||||
@@ -0,0 +1,123 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { ArrowRight, Check, Download, Fingerprint, Link2, LoaderCircle, Play, RefreshCw, Square, Unplug } from 'lucide-react';
|
||||
import { api, downloadEngineReport } from './api';
|
||||
import { Modal } from './components';
|
||||
import type { ArtifactPreview, EngineAvailability, EngineJob, Project, Session } from './types';
|
||||
import './EnginePanel.css';
|
||||
|
||||
const active = ['queued', 'starting', 'initializing', 'checking', 'stopping'];
|
||||
const states: Record<string, string> = { queued: '等待启动', starting: '原程序启动中', initializing: '正在连接', checking: '正在核验',
|
||||
stopping: '正在停止', completed: '连接通过', failed: '连接未通过', cancelled: '已停止', unknown: '结果待核对' };
|
||||
const date = (value: string) => new Date(value).toLocaleString('zh-CN', { month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' });
|
||||
type Preview = { job: EngineJob; page: ArtifactPreview };
|
||||
|
||||
export function EnginePanel({ project, session, busy, onSession, onError }: {
|
||||
project: Project; session: Session; busy: boolean; onSession: (value: Session) => void; onError: (error: unknown) => void;
|
||||
}) {
|
||||
const [root, setRoot] = useState(''), [installation, setInstallation] = useState<EngineAvailability | null>(null);
|
||||
const [checking, setChecking] = useState(false), [pending, setPending] = useState(false);
|
||||
const [retry, setRetry] = useState<EngineJob | null>(null), [preview, setPreview] = useState<Preview | null>(null);
|
||||
const [viewBusy, setViewBusy] = useState(false), [notice, setNotice] = useState('');
|
||||
const mounted = useRef(true), detection = useRef(0), scope = useRef(0), viewRequest = useRef(0);
|
||||
const taskId = session.execution?.task?.id ?? null;
|
||||
const jobs = (session.execution?.engineJobs ?? []).slice().reverse();
|
||||
const running = jobs.some(job => active.includes(job.status)), disabled = busy || running || pending;
|
||||
useEffect(() => { mounted.current = true; return () => { mounted.current = false; detection.current++; scope.current++; viewRequest.current++; }; }, []);
|
||||
useEffect(() => { scope.current++; viewRequest.current++; setPreview(null); setRetry(null); setViewBusy(false); setPending(false); setNotice(''); }, [taskId]);
|
||||
useEffect(() => { void detect(); }, []);
|
||||
async function detect(candidate = root) {
|
||||
const current = ++detection.current; setChecking(true); setNotice('');
|
||||
try {
|
||||
const value = await api<EngineAvailability>('/engines/deepseek/availability' + (candidate.trim() ? '?root=' + encodeURIComponent(candidate.trim()) : ''));
|
||||
if (mounted.current && current === detection.current) { setInstallation(value); if (!candidate.trim() && value.root) setRoot(value.root); }
|
||||
} catch (error) { if (mounted.current && current === detection.current) onError(error); }
|
||||
finally { if (mounted.current && current === detection.current) setChecking(false); }
|
||||
}
|
||||
function editRoot(value: string) { detection.current++; setRoot(value); setInstallation(null); setChecking(false); setNotice('目录已改变,请先检测这个安装。'); }
|
||||
async function start(previous?: EngineJob) {
|
||||
const current = scope.current; setPending(true); setNotice('');
|
||||
try {
|
||||
const value = await api<{ job: EngineJob; session: Session }>('/sessions/' + session.id + '/engines/jobs', {
|
||||
root: previous?.installation.root ?? installation?.root ?? root.trim(),
|
||||
...(previous ? { retry: true } : { identitySha256: installation?.identitySha256 }),
|
||||
});
|
||||
if (mounted.current && current === scope.current) { onSession(value.session); setRetry(null); }
|
||||
} catch (error) { if (mounted.current && current === scope.current) onError(error); }
|
||||
finally { if (mounted.current && current === scope.current) setPending(false); }
|
||||
}
|
||||
async function stop() {
|
||||
const current = scope.current; setPending(true);
|
||||
try { const value = await api<Session>('/sessions/' + session.id + '/engines/stop', {}); if (mounted.current && current === scope.current) onSession(value); }
|
||||
catch (error) { if (mounted.current && current === scope.current) onError(error); }
|
||||
finally { if (mounted.current && current === scope.current) setPending(false); }
|
||||
}
|
||||
async function openRecord(job: EngineJob, offset = 0) {
|
||||
const current = ++viewRequest.current, currentScope = scope.current; setViewBusy(true);
|
||||
try {
|
||||
const page = await api<ArtifactPreview>('/sessions/' + session.id + '/engines/jobs/' + job.id + '/report?offset=' + offset + '&limit=4000');
|
||||
if (mounted.current && currentScope === scope.current && current === viewRequest.current) setPreview({ job, page });
|
||||
} catch (error) { if (mounted.current && currentScope === scope.current && current === viewRequest.current) onError(error); }
|
||||
finally { if (mounted.current && currentScope === scope.current && current === viewRequest.current) setViewBusy(false); }
|
||||
}
|
||||
async function download(job: EngineJob) {
|
||||
const current = scope.current;
|
||||
try { await downloadEngineReport(session.id, job.id); }
|
||||
catch (error) { if (mounted.current && current === scope.current) onError(error); }
|
||||
}
|
||||
return <div className="engine-panel">
|
||||
<header className="engine-heading"><div><span className="engine-eyebrow">{project.name} · 当前任务</span><h3>连接本地代理引擎</h3>
|
||||
<p>核对本机的 DeepSeek Harness,并将实际检查记录保存到这个任务。</p></div>
|
||||
<span className={'engine-install-state ' + (installation?.status === 'available' ? 'found' : '')} aria-live="polite">
|
||||
{checking ? '正在检测安装' : installation?.status === 'available' ? '已找到 ' + installation.version : '等待检测'}</span></header>
|
||||
<div className="engine-layout"><section className="engine-connection">
|
||||
<form onSubmit={event => { event.preventDefault(); void detect(); }}>
|
||||
<h4><Link2 size={16} />DeepSeek Harness</h4>
|
||||
<label className="form-field">本地安装目录<input aria-label="DeepSeek安装目录" value={root} onChange={event => editRoot(event.target.value)}
|
||||
placeholder="D:\Ai-project\DeepSeek-Harness-Desktop\deepseek-harness" disabled={disabled} /></label>
|
||||
<button type="submit" className="button secondary" disabled={checking || disabled}><RefreshCw size={14} className={checking ? 'spin' : ''} />检测安装</button>
|
||||
{installation && <p className={'engine-detection-note ' + installation.status} role="status">{installation.message}</p>}
|
||||
{notice && <p className="engine-detection-note" role="status">{notice}</p>}
|
||||
{installation?.status === 'available' && <dl className="engine-install-details"><dt>发行版本</dt><dd>{installation.version}</dd><dt>连接范围</dt><dd>启动、协议、会话目录与停止</dd>
|
||||
<dt>运行环境</dt><dd>Node.js {installation.node?.version}</dd></dl>}
|
||||
<button type="button" className="button primary engine-start" onClick={() => void start()} disabled={disabled || checking || installation?.status !== 'available'}>
|
||||
{pending ? <LoaderCircle size={14} className="spin" /> : <Play size={14} />}核验连接</button>
|
||||
</form>
|
||||
<div className="engine-scope"><h4>当前可用能力</h4><p><Check size={14} />原程序连接与独立进程停止</p><p><Check size={14} />同任务保存原记录与来源</p>
|
||||
<div className="engine-scope-next"><span>工程执行接入中</span><p>本次检查不发送模型任务。完成连接核验后,继续接入工程工具与交付流程。</p></div>
|
||||
<details><summary>连接与执行范围</summary><p>每次检查启动一个独立进程。停止只作用于这个检查;SDK 会话目录、协议版本与完整错误保存在原记录。当前版本没有开放外部引擎修改工程。</p></details></div>
|
||||
</section><section className="engine-results"><div className="engine-results-heading"><h4>本任务连接记录 <span>{jobs.length}</span></h4>
|
||||
{running && <button type="button" className="button secondary" onClick={() => void stop()} disabled={pending}><Square size={13} />停止检查</button>}</div>
|
||||
{!jobs.length && <div className="engine-empty"><Unplug size={25} /><strong>先验证这个安装能否连接</strong><p>检查完成后,可以查看实际启动、协议返回和进程结束记录;检查不会调用已配置的模型。</p></div>}
|
||||
{jobs.map(job => { const verified = job.status === 'completed' && job.verification?.verified === true;
|
||||
return <article key={job.id} data-engine-job={job.id} className={'engine-job ' + (verified ? 'verified' : '')}>
|
||||
<div className="engine-job-heading"><div><strong>DeepSeek Harness {job.installation.version}</strong><small>{date(job.startedAt)}</small></div>
|
||||
<span className={'engine-job-state ' + job.status}>{active.includes(job.status) && <LoaderCircle size={12} className="spin" />}{states[job.status] ?? job.status}</span></div>
|
||||
<p className="engine-job-summary">{job.summary}</p>
|
||||
<div className="engine-proof" aria-label="引擎实际检查依据">
|
||||
<div className={job.installation.identitySha256 ? 'observed' : ''}><Fingerprint size={15} /><span>安装身份<code>{job.installation.identitySha256?.slice(0, 12) ?? '等待核对'}</code></span></div>
|
||||
<ArrowRight size={12} /><div className={job.readiness ? 'observed' : ''}><span>启动完成<code>{job.readiness ? 'PID ' + job.readiness.pid : '尚无信号'}</code></span></div>
|
||||
<ArrowRight size={12} /><div className={job.serverInfo ? 'observed' : ''}><span>协议返回<code>{job.serverInfo?.version ?? '尚无返回'}</code></span></div>
|
||||
<ArrowRight size={12} /><div className={job.reportSummary?.rootExited ? 'observed' : ''}><span>进程结束<code>{job.reportSummary?.rootExited ? '已核对' : job.finishedAt ? '待核对' : '检查中'}</code></span></div>
|
||||
</div>
|
||||
<div className="engine-job-actions"><button className="button secondary" onClick={() => void openRecord(job)} disabled={!job.reportArtifactId || viewBusy}><Fingerprint size={13} />查看原记录</button>
|
||||
<button className="text-button" onClick={() => void download(job)} disabled={!job.reportArtifactId}><Download size={13} />下载完整记录</button>
|
||||
{!active.includes(job.status) && <button className="text-button" onClick={() => setRetry(job)} disabled={disabled}><RefreshCw size={13} />重新核验</button>}</div>
|
||||
<details className="engine-origin"><summary>任务与安装来源</summary><dl><dt>项目</dt><dd>{project.name}</dd><dt>Task</dt><dd>{job.taskId}</dd><dt>Run</dt><dd>{job.runId}</dd>
|
||||
<dt>SDK 会话</dt><dd>{job.sdkSessionId}</dd><dt>安装目录</dt><dd>{job.installation.root}</dd><dt>安装 SHA256</dt><dd>{job.installation.identitySha256}</dd>
|
||||
<dt>原记录 SHA256</dt><dd>{job.reportSha256 ?? '尚未封存'}</dd><dt>模型请求</dt><dd>{job.reportSummary?.modelRequests ?? '尚未核对'}</dd></dl></details>
|
||||
</article>;
|
||||
})}
|
||||
</section></div>
|
||||
{retry && <Modal title="重新核验引擎连接" description="启动一个新的独立检查;原检查记录继续保留。" onClose={() => setRetry(null)}>
|
||||
<p className="engine-retry-note">{retry.installation.root}</p><p>将重新核对当前安装、启动完成、SDK 返回和进程关闭。本次不会发送模型任务。</p>
|
||||
<div className="modal-actions"><button className="button secondary" onClick={() => setRetry(null)}>返回记录</button><button className="button primary" disabled={disabled} onClick={() => void start(retry)}><RefreshCw size={14} />开始新的核验</button></div></Modal>}
|
||||
{preview && <Modal title="引擎原检查记录" description="核对封存的安装、任务身份和原记录 SHA256 后读取。" wide onClose={() => { viewRequest.current++; setPreview(null); setViewBusy(false); }}>
|
||||
<div className="engine-record-meta"><span>原记录 SHA256</span><code>{preview.page.sha256}</code></div>
|
||||
<pre className="engine-original" aria-label="引擎原记录内容">{preview.page.content}</pre>
|
||||
<div className="engine-page-controls"><span>{preview.page.offset.toLocaleString()}–{(preview.page.offset + preview.page.content.length).toLocaleString()} / {preview.page.totalCharacters.toLocaleString()} 字符</span>
|
||||
<button className="button secondary" onClick={() => void openRecord(preview.job, 0)} disabled={viewBusy || preview.page.offset === 0}>回到首页</button>
|
||||
<button className="button secondary" onClick={() => void openRecord(preview.job, preview.page.offset + preview.page.content.length)} disabled={viewBusy || !preview.page.truncated}><ArrowRight size={13} />下一页</button></div>
|
||||
<div className="modal-actions"><button className="button secondary" onClick={() => void download(preview.job)}><Download size={14} />下载完整记录</button></div>
|
||||
</Modal>}
|
||||
</div>;
|
||||
}
|
||||
@@ -34,3 +34,9 @@ export function downloadBlob(blob: Blob, name: string) {
|
||||
const link = document.createElement('a'); link.href = url; link.download = name; link.click();
|
||||
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
||||
}
|
||||
|
||||
export async function downloadEngineReport(sessionId: string, jobId: string) {
|
||||
const response = await fetch('/api/sessions/' + sessionId + '/engines/jobs/' + jobId + '/download', { headers: { 'X-Workbench-Token': accessToken } });
|
||||
if (!response.ok) { const value = await response.json().catch(() => ({})); throw new Error(value.error || '引擎检查记录下载失败。'); }
|
||||
downloadBlob(await response.blob(), 'agent-workbench-engine-' + jobId + '.json');
|
||||
}
|
||||
|
||||
+16
-1
@@ -130,7 +130,22 @@ export interface ChangeSet {
|
||||
snapshotArtifactId: string; sourceRunId: string; restoreError?: string }[];
|
||||
observations?: { path: string; state: string; exists: boolean | null; actualSha256: string | null; problem?: string }[];
|
||||
}
|
||||
export interface ExecutionSnapshot { schemaVersion: number; task: Task | null; run: Run | null; runs: RunBrief[]; progress: { totalTools: number; completedTools: number; requiresVerification: { id: string; tool: string; state: string; callId: string }[] }; artifacts: Artifact[]; checks: CheckJob[]; plans?: CheckPlan[]; deliveries?: DeliveryJob[]; deliveryPlans?: DeliveryPlan[]; changeSets?: ChangeSet[]; contextPlans?: ContextPlan[]; workspaces?: WorkspaceRecord[]; researchTargets?: ResearchTarget[]; researchJobs?: ResearchJob[]; workspaceIdentity?: WorkspaceIdentity; accountedTaskTokens: number }
|
||||
export interface ExecutionSnapshot { schemaVersion: number; task: Task | null; run: Run | null; runs: RunBrief[]; progress: { totalTools: number; completedTools: number; requiresVerification: { id: string; tool: string; state: string; callId: string }[] }; artifacts: Artifact[]; checks: CheckJob[]; plans?: CheckPlan[]; deliveries?: DeliveryJob[]; deliveryPlans?: DeliveryPlan[]; changeSets?: ChangeSet[]; contextPlans?: ContextPlan[]; workspaces?: WorkspaceRecord[]; researchTargets?: ResearchTarget[]; researchJobs?: ResearchJob[]; engineJobs?: EngineJob[]; workspaceIdentity?: WorkspaceIdentity; accountedTaskTokens: number }
|
||||
export interface EngineAvailability {
|
||||
engineId: string; name: string; status: string; root: string | null; profile: string; expectedVersion: string; version?: string; message: string;
|
||||
identitySha256?: string; node?: { path: string; version: string; sha256: string };
|
||||
serverInfo?: { name: string; version: string }; limitations: string[];
|
||||
capabilities: { connectionProbe: boolean; projectExecution: boolean; prompt: boolean; singleSessionCancel: boolean; cancellationUnit: string; tokenStreaming: boolean };
|
||||
}
|
||||
export interface EngineJob {
|
||||
id: string; sessionId: string; projectId: string; taskId: string; runId: string; engineId: string; scope: string;
|
||||
installation: EngineAvailability; sdkSessionId: string; status: string; summary: string; requiresVerification: boolean;
|
||||
startedAt: string; finishedAt: string | null; pid?: number; connectionId?: string;
|
||||
readiness?: { pid: number; signal: string; readyAt: string }; serverInfo?: { name: string; version: string };
|
||||
verification?: { verified: boolean; rootExited: boolean; modelRequests: number } | null;
|
||||
reportArtifactId?: string; reportSha256?: string; contractSha256: string;
|
||||
reportSummary?: { status: string; modelRequests: number | null; observedResponses: number; rootExited: boolean | null } | null;
|
||||
}
|
||||
export interface ReaAvailability { status: string; version?: string; declaredVersion?: string; message?: string; packageRoot?: string; protocolVersion?: string; operations?: { id: string; name: string; extensions: string[]; label: string }[] }
|
||||
export interface ResearchTarget { id: string; taskId: string; runId: string; projectId: string; sessionId: string; path: string; sha256: string; bytes: number; extension: string; label: string; source: string; registeredAt: string }
|
||||
export interface ResearchJob {
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import os from 'node:os';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { DeepSeekAdapter } from './engines/deepseek-adapter.mjs';
|
||||
import { resolveDeepSeekInstallation } from './engines/deepseek-installation.mjs';
|
||||
import { ENGINE_ACTIVE, ENGINE_SCOPE, ENGINE_LIMITS, engineInput, engineReportContract, engineError } from '../shared/contracts/engines.mjs';
|
||||
|
||||
const at = () => new Date().toISOString();
|
||||
|
||||
export class EngineManager {
|
||||
constructor(store, { appDirectory = process.cwd(), adapterFactory = installation => new DeepSeekAdapter(installation),
|
||||
projectBusy = () => false, redact = value => String(value), directoryRoot = null } = {}) {
|
||||
this.store = store; this.appDirectory = appDirectory; this.adapterFactory = adapterFactory;
|
||||
this.projectBusy = projectBusy; this.redact = redact; this.directoryRoot = directoryRoot;
|
||||
this.active = new Map(); this.projects = new Map();
|
||||
}
|
||||
availability(root) { return resolveDeepSeekInstallation(this.appDirectory, root); }
|
||||
isActive(sessionId) { return [...this.active.values()].some(value => value.sessionId === sessionId); }
|
||||
projectActive(projectId) { return this.projects.has(projectId); }
|
||||
jobs(session) { return [...this.store.core.engine_job.values()].filter(value => value.sessionId === session.id).slice(-20); }
|
||||
inputFor(session, job) {
|
||||
this.store.owned('engine_job', job.id, session.id);
|
||||
const input = this.store.owned('artifact', job.contractArtifactId, session.id);
|
||||
if (input.kind !== 'engine-input' || input.taskId !== job.taskId || input.runId !== job.runId || input.sha256 !== job.contractSha256
|
||||
|| this.store.artifactStore.read(input) !== JSON.stringify(engineInput(job))) throw engineError('引擎检查与封存的任务、安装或会话身份不一致。');
|
||||
return input;
|
||||
}
|
||||
originalReport(session, job) {
|
||||
this.inputFor(session, job);
|
||||
const artifact = this.store.owned('artifact', job.reportArtifactId, session.id);
|
||||
if (artifact.kind !== 'engine-report' || artifact.sha256 !== job.reportSha256 || artifact.taskId !== job.taskId || artifact.runId !== job.runId) throw engineError('引擎原记录不属于这次检查。');
|
||||
const text = this.store.artifactStore.read(artifact);
|
||||
if (text !== JSON.stringify(engineReportContract(job))) throw engineError('引擎原记录与当前封存状态不一致。');
|
||||
return text;
|
||||
}
|
||||
summary(session, job) {
|
||||
let verified = false, message = job.summary;
|
||||
try {
|
||||
if (job.reportArtifactId) { this.originalReport(session, job); verified = job.status === 'completed' && job.report?.status === 'verified' && job.verification?.verified === true; }
|
||||
else this.inputFor(session, job);
|
||||
} catch (error) { message = this.redact(error.message); }
|
||||
return { engine_job_id: job.id, engine_id: job.engineId, task_id: job.taskId, run_id: job.runId,
|
||||
engine_status: job.status === 'completed' && !verified ? 'unknown' : job.status, evidence_verified: verified,
|
||||
installation_sha256: job.installation.identitySha256, package_version: job.installation.version, profile: job.installation.profile,
|
||||
sdk_session_id: job.sdkSessionId, pid: job.pid ?? null, connection_id: job.connectionId ?? null,
|
||||
report_artifact_id: job.reportArtifactId ?? null, report_sha256: job.reportSha256 ?? null,
|
||||
model_requests: job.report?.modelRequests ?? null, provider_requests: 0,
|
||||
requires_verification: job.requiresVerification || job.status === 'completed' && !verified,
|
||||
message, scope: job.scope, limitations: ENGINE_LIMITS };
|
||||
}
|
||||
start(session, input = {}) {
|
||||
if (!input || typeof input !== 'object' || Array.isArray(input) || Object.keys(input).some(key => !['root', 'retry', 'identitySha256'].includes(key))
|
||||
|| input.retry !== undefined && typeof input.retry !== 'boolean'
|
||||
|| input.identitySha256 !== undefined && (typeof input.identitySha256 !== 'string' || !/^[a-f0-9]{64}$/.test(input.identitySha256))) throw engineError('连接核验只接受本地安装目录、检测身份和明确的重新验证选项。', 400);
|
||||
if (session.archived || this.projectActive(session.projectId) || this.projectBusy(session.projectId)) throw engineError('当前项目有任务、审批或检查在执行,请等待结束。');
|
||||
const installation = this.availability(input.root);
|
||||
if (installation.status !== 'available') throw engineError(installation.message, 409, 'ENGINE_UNAVAILABLE');
|
||||
if (input.identitySha256 !== undefined && input.identitySha256 !== installation.identitySha256) throw engineError('引擎安装与刚才的检测结果不一致,请重新检测后再核验连接。', 409, 'ENGINE_INPUT_CHANGED');
|
||||
const previous = this.jobs(session).filter(job => job.taskId === session.taskId && job.installation.root === installation.root).at(-1);
|
||||
if (previous && previous.status !== 'completed' && !input.retry) throw engineError('此前连接检查没有完成,请查看原记录后明确选择重新验证。');
|
||||
const id = randomUUID(), controller = new AbortController(), active = { sessionId: session.id, projectId: session.projectId, controller };
|
||||
this.active.set(id, active); this.projects.set(session.projectId, id);
|
||||
try {
|
||||
if (!this.store.core.task.get(session.taskId)) {
|
||||
const goal = '核对本地DeepSeek Harness的启动、SDK连接、会话目录与进程结束,保存原检查记录。';
|
||||
const run = this.store.beginRun(session, goal, false, this.store.config);
|
||||
run.engine = 'deepseek-sdk-probe'; run.origin = 'user-engine-check';
|
||||
this.store.message(session, 'user', goal); session.providerMessages.push({ role: 'user', content: goal });
|
||||
session.status = 'paused'; this.store.finishRun(session, run, 'engine_probe_ready');
|
||||
if (session.title === '新任务') session.title = '外部引擎连接';
|
||||
}
|
||||
const run = this.store.owned('run', session.runId, session.id);
|
||||
const base = path.resolve(this.directoryRoot ?? path.join(os.tmpdir(), 'AgentWorkbench-Engines'));
|
||||
fs.mkdirSync(base, { recursive: true });
|
||||
if (fs.lstatSync(base).isSymbolicLink()) throw engineError('所属引擎探针目录不能是链接。');
|
||||
const directory = path.join(base, id);
|
||||
if (fs.existsSync(directory)) throw engineError('引擎探针目录已存在,不能复用或覆盖。');
|
||||
const job = { schemaVersion: 1, id, sessionId: session.id, projectId: session.projectId, taskId: run.taskId, runId: run.id,
|
||||
engineId: 'deepseek-harness', scope: ENGINE_SCOPE, source: 'user', installation, sdkSessionId: randomUUID(), directory,
|
||||
status: 'queued', startedAt: at(), finishedAt: null, requiresVerification: false, verification: null,
|
||||
summary: '已登记本地安装和检查范围,尚未启动原程序。', report: null };
|
||||
active.job = job;
|
||||
const artifact = this.store.artifactStore.write(session, run, engineInput(job), { kind: 'engine-input' });
|
||||
this.store.core.artifact.set(artifact.id, artifact); job.contractArtifactId = artifact.id; job.contractSha256 = artifact.sha256;
|
||||
const event = this.store.event(session, { kind: 'engine', tool: 'deepseek-sdk-probe', label: '核验外部引擎连接', phase: 'queued',
|
||||
input: { engineId: job.engineId, root: installation.root, version: installation.version, profile: installation.profile, modelRequestsAllowed: 0 } });
|
||||
job.eventId = event.id; this.store.putRecord('engine_job', session, job, 'engine.queued');
|
||||
active.promise = this.execute(session, run, job, active).finally(() => {
|
||||
this.active.delete(id); if (this.projects.get(session.projectId) === id) this.projects.delete(session.projectId);
|
||||
});
|
||||
active.promise.catch(() => {}); return { job, promise: active.promise };
|
||||
} catch (error) { this.active.delete(id); this.projects.delete(session.projectId); throw error; }
|
||||
}
|
||||
async execute(session, run, job, active) {
|
||||
let report;
|
||||
try {
|
||||
this.inputFor(session, job);
|
||||
active.adapter = this.adapterFactory(job.installation);
|
||||
report = await active.adapter.probe({ directory: job.directory, sdkSessionId: job.sdkSessionId, signal: active.controller.signal,
|
||||
onState: (status, detail) => {
|
||||
if (active.controller.signal.aborted) return;
|
||||
if (!['starting', 'initializing', 'checking'].includes(status)) throw engineError('引擎状态不符合检查契约。');
|
||||
this.inputFor(session, job); job.status = status;
|
||||
for (const field of ['pid', 'connectionId', 'readiness', 'serverInfo']) if (detail?.[field] !== undefined) job[field] = detail[field];
|
||||
job.summary = status === 'starting' ? '原程序已启动,正在等待所属启动完成信号。' : status === 'initializing' ? '启动已完成,正在核对一次SDK初始化。' : 'SDK身份已返回,正在核对会话目录、错误与关闭。';
|
||||
this.store.putRecord('engine_job', session, job, 'engine.' + status);
|
||||
} });
|
||||
this.inputFor(session, job);
|
||||
if (report.status !== 'verified' || report.scope !== job.scope || report.sdkSessionId !== job.sdkSessionId
|
||||
|| report.before?.identitySha256 !== job.installation.identitySha256 || report.after?.identitySha256 !== job.installation.identitySha256
|
||||
|| report.process?.pid !== report.readiness?.pid || !report.cleanup?.rootExited || report.cleanup.exit?.code !== 0
|
||||
|| report.modelRequests !== 0 || report.providerRequests !== 0 || report.responses?.length !== 6 || !report.workspace?.unchanged) throw engineError('引擎返回缺少完整的身份、原协议或关闭依据。');
|
||||
job.status = 'completed'; job.summary = '连接通过,启动、协议返回、会话目录与进程结束均已核对。';
|
||||
job.verification = { verified: true, installationSha256: job.installation.identitySha256, readySignal: 'appReady',
|
||||
sdkSessionId: job.sdkSessionId, connectionId: report.process.connectionId, rootExited: true, modelRequests: 0 };
|
||||
} catch (error) {
|
||||
report = error.report ?? report ?? { schemaVersion: 1, scope: job.scope, sdkSessionId: job.sdkSessionId,
|
||||
status: active.controller.signal.aborted ? 'cancelled' : 'failed', error: { code: error.code ?? 'ENGINE_CHECK_FAILED', message: this.redact(error.message) },
|
||||
modelRequests: null, providerRequests: 0, responses: [], cleanup: null };
|
||||
job.status = report.status === 'unknown' ? 'unknown' : active.controller.signal.aborted ? 'cancelled' : 'failed';
|
||||
job.requiresVerification = job.status === 'unknown'; job.verification = null;
|
||||
job.summary = this.redact(report.error?.message ?? error.message); job.error = { code: report.error?.code ?? error.code ?? 'ENGINE_CHECK_FAILED', message: job.summary };
|
||||
}
|
||||
job.report = report; job.finishedAt = at();
|
||||
try {
|
||||
const artifact = this.store.artifactStore.write(session, run, engineReportContract(job), { kind: 'engine-report' });
|
||||
this.store.core.artifact.set(artifact.id, artifact); job.reportArtifactId = artifact.id; job.reportSha256 = artifact.sha256;
|
||||
const event = session.events.find(value => value.id === job.eventId);
|
||||
if (event) { event.phase = job.status; event.finishedAt = job.finishedAt; event.output = job.summary; }
|
||||
this.store.putRecord('engine_job', session, job, 'engine.finished');
|
||||
} catch (error) {
|
||||
job.status = 'unknown'; job.verification = null; job.requiresVerification = true; job.summary = '引擎原结果没有完成封存,请核对所属原记录:' + this.redact(error.message);
|
||||
this.store.putRecord('engine_job', session, job, 'engine.seal_failed');
|
||||
}
|
||||
return job;
|
||||
}
|
||||
async stop(sessionId) {
|
||||
const active = [...this.active.values()].filter(value => value.sessionId === sessionId);
|
||||
for (const value of active) {
|
||||
if (ENGINE_ACTIVE.has(value.job.status)) value.job.status = 'stopping';
|
||||
value.controller.abort(new Error('用户停止了所属外部引擎连接检查。'));
|
||||
this.store.putRecord('engine_job', this.store.session(sessionId), value.job, 'engine.stopping');
|
||||
}
|
||||
await Promise.allSettled(active.map(value => value.promise));
|
||||
}
|
||||
async stopAll() { await Promise.all([...new Set([...this.active.values()].map(value => value.sessionId))].map(sessionId => this.stop(sessionId))); }
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import http from 'node:http';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { McpStdio } from '../tools/mcp-stdio.mjs';
|
||||
import { engineDigest, engineError, ENGINE_SCOPE } from '../../shared/contracts/engines.mjs';
|
||||
import { assertDeepSeekInstallation, engineFileIdentity } from './deepseek-installation.mjs';
|
||||
|
||||
export const DEEPSEEK_READY_PLUGIN = `import fs from 'node:fs';
|
||||
export const name = 'agent-workbench-sdk-ready';
|
||||
export const inject = ['appReady'];
|
||||
export function apply(ctx, config) {
|
||||
const ready = ctx.get('appReady');
|
||||
if (!ready || typeof ready.onReady !== 'function') throw new Error('The fixed SDK launcher has no appReady service.');
|
||||
const stop = ready.onReady(() => {
|
||||
const value = { schemaVersion: 1, nonce: config.nonce, pid: process.pid, signal: 'appReady', readyAt: new Date().toISOString() };
|
||||
const temporary = config.marker + '.writing';
|
||||
fs.writeFileSync(temporary, JSON.stringify(value), { flag: 'wx' });
|
||||
fs.renameSync(temporary, config.marker);
|
||||
});
|
||||
ctx.effect(() => stop, 'workbench.sdk-ready');
|
||||
}
|
||||
`;
|
||||
|
||||
const allowedEnvironment = /^(path|pathext|systemroot|systemdrive|windir|comspec|temp|tmp|userprofile|appdata|localappdata|programfiles(?:\(x86\))?|homedrive|homepath)$/i;
|
||||
const at = () => new Date().toISOString();
|
||||
const fail = (message, code = 'ENGINE_PROTOCOL') => engineError(message, 409, code);
|
||||
|
||||
export class DeepSeekAdapter {
|
||||
constructor(installation, { timeoutMs = 15000, clientFactory = (launch, options) => new McpStdio(launch, options) } = {}) {
|
||||
this.installation = installation; this.timeoutMs = timeoutMs; this.clientFactory = clientFactory;
|
||||
}
|
||||
async waitReady(marker, nonce, signal) {
|
||||
const deadline = Date.now() + this.timeoutMs;
|
||||
while (true) {
|
||||
signal?.throwIfAborted();
|
||||
if (fs.existsSync(marker)) {
|
||||
const readiness = JSON.parse(fs.readFileSync(marker, 'utf8'));
|
||||
if (readiness.schemaVersion !== 1 || readiness.nonce !== nonce || readiness.pid !== this.client.pid
|
||||
|| readiness.signal !== 'appReady' || !Number.isFinite(Date.parse(readiness.readyAt))) throw fail('启动完成信号与所属进程不一致。');
|
||||
return { ...readiness, artifact: engineFileIdentity(marker) };
|
||||
}
|
||||
if (this.client.exited || this.client.protocolError) throw fail('原程序在启动完成前关闭或返回无效协议。');
|
||||
if (Date.now() >= deadline) throw fail('原程序未在等待范围内报告启动完成,尚未发送initialize。', 'ENGINE_START_TIMEOUT');
|
||||
await new Promise(resolve => setTimeout(resolve, 15));
|
||||
}
|
||||
}
|
||||
async probe({ directory, sdkSessionId, signal, onState = () => {} }) {
|
||||
const report = { schemaVersion: 1, scope: ENGINE_SCOPE, sdkSessionId, startedAt: at(), finishedAt: null,
|
||||
responses: [], notifications: [], unownedNotifications: [], rejectedServerRequests: [], networkRequests: [], networkRequestCount: 0,
|
||||
modelRequests: 0, providerRequests: 0, process: null, cleanup: null, readiness: null };
|
||||
let guard, problem = null;
|
||||
const cwd = path.join(directory, 'project'), home = path.join(directory, 'home'), agents = path.join(directory, 'agents');
|
||||
try {
|
||||
signal?.throwIfAborted(); report.before = assertDeepSeekInstallation(this.installation);
|
||||
fs.mkdirSync(directory, { recursive: false });
|
||||
for (const folder of [cwd, home, agents]) fs.mkdirSync(folder);
|
||||
const readme = path.join(cwd, 'README.md'), bytes = Buffer.from('# Agent Workbench owned engine connection probe\n');
|
||||
fs.writeFileSync(readme, bytes, { flag: 'wx' });
|
||||
report.workspace = { root: cwd, before: engineFileIdentity(readme) };
|
||||
const nonce = randomUUID(), marker = path.join(directory, 'ready.json'), plugin = path.join(directory, 'ready.mjs'), patch = path.join(directory, 'ready.patch.json');
|
||||
fs.writeFileSync(plugin, DEEPSEEK_READY_PLUGIN, { flag: 'wx' });
|
||||
fs.writeFileSync(patch, JSON.stringify([{ insert: [{ id: 'agent-workbench-sdk-ready', name: plugin, config: { marker, nonce } }] }]), { flag: 'wx' });
|
||||
report.launchInputs = { plugin: engineFileIdentity(plugin), patch: engineFileIdentity(patch), profile: this.installation.profile };
|
||||
guard = http.createServer((request, response) => {
|
||||
report.networkRequestCount++;
|
||||
if (report.networkRequests.length < 128) report.networkRequests.push({ method: request.method, path: request.url.slice(0, 2000), receivedAt: at() });
|
||||
response.writeHead(409, { Connection: 'close' }); response.end('This owned connection probe accepts no model requests.');
|
||||
});
|
||||
await new Promise((resolve, reject) => { guard.once('error', reject); guard.listen(0, '127.0.0.1', resolve); });
|
||||
const env = Object.fromEntries(Object.entries(process.env).filter(([name]) => allowedEnvironment.test(name)));
|
||||
Object.assign(env, { DSH_HOME: home, DSH_AGENTS_HOME: agents, DSH_TELEMETRY_DISABLED: 'true',
|
||||
DEEPSEEK_API_KEY: 'agent-workbench-owned-protocol-fixture', DEEPSEEK_BASE_URL: 'http://127.0.0.1:' + guard.address().port });
|
||||
signal?.throwIfAborted(); assertDeepSeekInstallation(this.installation);
|
||||
this.client = this.clientFactory({ executable: this.installation.node.path,
|
||||
args: [this.installation.entry, '--profile', this.installation.profile, '--patch', patch], cwd, env },
|
||||
{ timeoutMs: this.timeoutMs, maximumFrameBytes: 4 * 1024 * 1024, cancellationMethod: null });
|
||||
report.process = { pid: this.client.pid, connectionId: this.client.id, startedAt: this.client.startedAt, ownership: 'one-process-per-engine-check' };
|
||||
onState('starting', { pid: this.client.pid, connectionId: this.client.id });
|
||||
let notificationBytes = 0;
|
||||
this.client.on('server-request', value => {
|
||||
if (report.rejectedServerRequests.length >= 32) { this.client.fail(fail('引擎反向请求超过连接核验范围。')); return; }
|
||||
report.rejectedServerRequests.push({ id: value.id, method: value.method, parametersSha256: engineDigest(value.params ?? {}) });
|
||||
});
|
||||
this.client.on('notification', value => {
|
||||
notificationBytes += Buffer.byteLength(JSON.stringify(value), 'utf8');
|
||||
if (notificationBytes > 1024 * 1024 || report.notifications.length + report.unownedNotifications.length >= 128) {
|
||||
this.client.fail(fail('引擎事件超过连接核验的接收范围。')); return;
|
||||
}
|
||||
const owned = value.params?.sessionId === sdkSessionId;
|
||||
(owned ? report.notifications : report.unownedNotifications).push(value);
|
||||
});
|
||||
report.readiness = await this.waitReady(marker, nonce, signal);
|
||||
if (engineFileIdentity(plugin).sha256 !== report.launchInputs.plugin.sha256 || engineFileIdentity(patch).sha256 !== report.launchInputs.patch.sha256) throw fail('启动期间所属就绪插件或profile叠加输入发生变化。');
|
||||
onState('initializing', { readiness: report.readiness });
|
||||
const request = async (method, params = {}, expectError = false) => {
|
||||
let result, error;
|
||||
try { result = await this.client.request(method, params, { signal }); }
|
||||
catch (failure) {
|
||||
if (!expectError || failure.code !== 'MCP_REMOTE_ERROR') throw failure;
|
||||
try { error = JSON.parse(failure.message); } catch { throw fail('原程序错误返回不是可核对的协议错误。'); }
|
||||
}
|
||||
const trace = this.client.trace.at(-1);
|
||||
const observation = { method, id: trace.id, parameters: params, parametersSha256: trace.parametersSha256,
|
||||
...(error ? { error } : { result }), startedAt: trace.startedAt, finishedAt: trace.finishedAt };
|
||||
report.responses.push(observation);
|
||||
if (expectError && (!error || typeof error.code !== 'number' || typeof error.message !== 'string')) throw fail('原程序没有按协议拒绝这个未存在的会话操作。');
|
||||
return error ?? result;
|
||||
};
|
||||
const initialized = await request('initialize', { cwd, provider: 'deepseek-official', model: 'deepseek-flash', reasoningEffort: 'off', maxTokens: 256 });
|
||||
if (initialized?.serverInfo?.name !== this.installation.serverInfo.name || initialized?.serverInfo?.version !== this.installation.serverInfo.version) throw fail('SDK返回身份不符合固定发行契约。');
|
||||
onState('checking', { serverInfo: initialized.serverInfo });
|
||||
const workingDirectory = await request('session/working-directory/get', { sessionId: sdkSessionId });
|
||||
if (typeof workingDirectory?.cwd !== 'string' || fs.realpathSync.native(workingDirectory.cwd) !== fs.realpathSync.native(cwd)) throw fail('SDK会话目录与所属探针目录不一致。');
|
||||
const missing = randomUUID();
|
||||
for (const method of ['session/wait', 'session/resume', 'session/cancel']) {
|
||||
const error = await request(method, { sessionId: missing }, true);
|
||||
if (method === 'session/cancel' && !error.message.includes('unknown DeepSeek Harness SDK runtime method: session/cancel')) throw fail('SDK取消能力与已锁定协议不一致。');
|
||||
if (method !== 'session/cancel' && !error.message.includes(missing)) throw fail('SDK错误没有保留所核对的会话身份。');
|
||||
}
|
||||
const shutdown = await request('shutdown');
|
||||
if (!shutdown || typeof shutdown !== 'object' || Array.isArray(shutdown) || Object.keys(shutdown).length) throw fail('SDK关闭响应不符合固定契约。');
|
||||
report.workspace.after = engineFileIdentity(readme);
|
||||
report.workspace.unchanged = fs.readFileSync(readme).equals(bytes) && fs.readdirSync(cwd).length === 1;
|
||||
if (!report.workspace.unchanged) throw fail('原程序修改了连接探针输入,不能记为核验通过。');
|
||||
report.after = assertDeepSeekInstallation(this.installation);
|
||||
} catch (error) { problem = error; }
|
||||
finally {
|
||||
if (this.client) {
|
||||
try { report.cleanup = await this.client.close({ force: !!problem || signal?.aborted === true }); }
|
||||
catch (error) { problem ??= error; }
|
||||
report.trace = this.client.trace; report.stderr = this.client.stderr;
|
||||
}
|
||||
if (guard) { guard.closeAllConnections(); await new Promise(resolve => guard.close(resolve)); }
|
||||
report.modelRequests = report.networkRequestCount; report.finishedAt = at();
|
||||
}
|
||||
if (!problem && (!report.cleanup?.rootExited || report.cleanup.exit?.code !== 0)) problem = fail('所属引擎进程没有可核对的正常关闭结果。');
|
||||
if (!problem && report.modelRequests) problem = fail('原程序发起了核验范围之外的模型请求,连接检查失败。');
|
||||
if (problem) {
|
||||
report.status = report.process && !report.cleanup?.rootExited ? 'unknown' : signal?.aborted ? 'cancelled' : 'failed';
|
||||
report.error = { code: problem.code ?? (signal?.aborted ? 'ENGINE_CANCELLED' : 'ENGINE_CHECK_FAILED'), message: problem.message };
|
||||
throw Object.assign(problem, { report });
|
||||
}
|
||||
report.status = 'verified'; return report;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { createHash } from 'node:crypto';
|
||||
import { createRequire } from 'node:module';
|
||||
import { engineDigest, engineError, ENGINE_LIMITS } from '../../shared/contracts/engines.mjs';
|
||||
|
||||
export const DEEPSEEK_VERSION = '0.2.1-rc.2';
|
||||
export const DEEPSEEK_PROFILE = 'sdk-minimal';
|
||||
const criticalFiles = [
|
||||
'apps/cli/package.json', 'apps/cli/lib/bin.js', 'packages/boot/cmdline/lib/index.js',
|
||||
'packages/bundle/sdk-app/lib/index.js', 'packages/bundle/sdk-minimal/package.json',
|
||||
'packages/bundle/sdk-minimal/cordis.patch.yml', 'packages/sdk/server/package.json',
|
||||
'packages/sdk/server/lib/index.js', 'packages/sdk/protocol/package.json',
|
||||
'packages/sdk/protocol/lib/index.js', 'packages/sdk/client/package.json', 'pnpm-lock.yaml',
|
||||
];
|
||||
|
||||
export function engineFileIdentity(filename, maximumBytes = 32 * 1024 * 1024) {
|
||||
const absolute = fs.realpathSync.native(filename), before = fs.statSync(absolute);
|
||||
if (!before.isFile() || before.size > maximumBytes) throw engineError('引擎输入不是范围内的普通文件。');
|
||||
const hash = createHash('sha256'), chunk = Buffer.allocUnsafe(128 * 1024), fd = fs.openSync(absolute, 'r');
|
||||
try { let count; while ((count = fs.readSync(fd, chunk, 0, chunk.length, null)) > 0) hash.update(chunk.subarray(0, count)); }
|
||||
finally { fs.closeSync(fd); }
|
||||
const after = fs.statSync(absolute);
|
||||
if (before.size !== after.size || before.mtimeMs !== after.mtimeMs || before.ino !== after.ino) throw engineError('读取期间引擎输入发生变化。');
|
||||
return { path: absolute, bytes: after.size, sha256: hash.digest('hex') };
|
||||
}
|
||||
|
||||
function candidates(appDirectory) {
|
||||
const roots = [];
|
||||
if (process.env.AGENT_WORKBENCH_DEEPSEEK_ROOT) roots.push(process.env.AGENT_WORKBENCH_DEEPSEEK_ROOT);
|
||||
let parent = path.resolve(appDirectory);
|
||||
for (let level = 0; level < 7; level++) {
|
||||
roots.push(path.join(parent, 'DeepSeek-Harness-Desktop', 'deepseek-harness'));
|
||||
const next = path.dirname(parent); if (next === parent) break; parent = next;
|
||||
}
|
||||
return [...new Set(roots)];
|
||||
}
|
||||
|
||||
export function resolveDeepSeekInstallation(appDirectory = process.cwd(), requestedRoot = undefined) {
|
||||
if (requestedRoot !== undefined && (typeof requestedRoot !== 'string' || !requestedRoot.trim() || !path.isAbsolute(requestedRoot))) {
|
||||
throw engineError('请输入DeepSeek Harness安装的绝对目录。', 400);
|
||||
}
|
||||
const supplied = requestedRoot?.trim(), candidate = supplied ?? candidates(appDirectory).find(root => fs.existsSync(path.join(root, 'apps/cli/package.json')));
|
||||
const base = { engineId: 'deepseek-harness', name: 'DeepSeek Harness', profile: DEEPSEEK_PROFILE,
|
||||
expectedVersion: DEEPSEEK_VERSION, root: candidate ? path.resolve(candidate) : null,
|
||||
capabilities: { connectionProbe: true, projectExecution: false, prompt: false, singleSessionCancel: false,
|
||||
protocolVersionNegotiation: false, cancellationUnit: 'owned-process', tokenStreaming: false }, limitations: ENGINE_LIMITS };
|
||||
if (!candidate) return { ...base, status: 'unavailable', message: '请填写已经安装的DeepSeek Harness源码目录,再检测本地引擎。' };
|
||||
try {
|
||||
const root = fs.realpathSync.native(candidate), cli = JSON.parse(fs.readFileSync(path.join(root, 'apps/cli/package.json'), 'utf8'));
|
||||
if (cli.name !== '@deepseek-ai/dsh' || cli.version !== DEEPSEEK_VERSION) return { ...base, root, status: 'unsupported',
|
||||
version: typeof cli.version === 'string' ? cli.version : null, message: '当前连接契约支持DeepSeek Harness ' + DEEPSEEK_VERSION + '。' };
|
||||
for (const relative of ['packages/bundle/sdk-minimal/package.json', 'packages/sdk/server/package.json', 'packages/sdk/protocol/package.json', 'packages/sdk/client/package.json']) {
|
||||
const metadata = JSON.parse(fs.readFileSync(path.join(root, relative), 'utf8'));
|
||||
if (metadata.version !== cli.version) return { ...base, root, status: 'unsupported', version: cli.version, message: 'CLI、SDK与profile版本不一致,请核对本地安装。' };
|
||||
}
|
||||
const require = createRequire(path.join(root, 'apps/cli/package.json'));
|
||||
const cordis = require.resolve('@deepseek-ai/cordis');
|
||||
const filenames = [...criticalFiles.map(relative => path.join(root, relative)), cordis];
|
||||
const inputs = filenames.map(filename => {
|
||||
const file = engineFileIdentity(filename);
|
||||
if (!file.path.startsWith(root + path.sep)) throw engineError('引擎关键输入不属于这个安装目录。');
|
||||
return { ...file, relative: path.relative(root, file.path).replaceAll('\\', '/') };
|
||||
});
|
||||
const node = { ...engineFileIdentity(process.execPath, 256 * 1024 * 1024), version: process.versions.node };
|
||||
if (!/^24\./.test(node.version)) return { ...base, root, status: 'unsupported', version: cli.version, message: '当前连接契约使用Node.js 24。' };
|
||||
const identitySha256 = engineDigest({ root, version: cli.version, profile: DEEPSEEK_PROFILE, inputs, node });
|
||||
return { ...base, root, status: 'available', version: cli.version, entry: path.join(root, 'apps/cli/lib/bin.js'), inputs, node,
|
||||
identitySha256, serverInfo: { name: 'deepseek-harness-sdk-runtime', version: '0.0.1' },
|
||||
message: '已找到匹配版本,可验证原程序的连接与停止。' };
|
||||
} catch (error) {
|
||||
return { ...base, status: 'unavailable', message: '本地引擎关键输入不完整或无法核对:' + error.message };
|
||||
}
|
||||
}
|
||||
|
||||
export function assertDeepSeekInstallation(installation) {
|
||||
if (installation.status !== 'available' || !installation.identitySha256) throw engineError(installation.message || '本地引擎尚未就绪。');
|
||||
const current = resolveDeepSeekInstallation(process.cwd(), installation.root);
|
||||
if (current.status !== 'available' || current.identitySha256 !== installation.identitySha256) throw engineError('引擎入口、SDK、profile或运行器已变化,请重新检测并由用户发起新检查。', 409, 'ENGINE_INPUT_CHANGED');
|
||||
return current;
|
||||
}
|
||||
@@ -11,9 +11,9 @@ const failure = (code, message, dispatched = false) => Object.assign(new Error(m
|
||||
// One owned stdio connection. The caller chooses a fixed executable/profile;
|
||||
// target content never becomes a shell command or a server-request approval.
|
||||
export class McpStdio extends EventEmitter {
|
||||
constructor(launch, { timeoutMs = 45000, maximumFrameBytes = 8 * 1024 * 1024 } = {}) {
|
||||
constructor(launch, { timeoutMs = 45000, maximumFrameBytes = 8 * 1024 * 1024, cancellationMethod = 'notifications/cancelled' } = {}) {
|
||||
super(); this.id = randomUUID(); this.pending = new Map(); this.sequence = 0; this.trace = [];
|
||||
this.timeoutMs = timeoutMs; this.maximumFrameBytes = maximumFrameBytes; this.stderr = ''; this.buffer = '';
|
||||
this.timeoutMs = timeoutMs; this.maximumFrameBytes = maximumFrameBytes; this.cancellationMethod = cancellationMethod; this.stderr = ''; this.buffer = '';
|
||||
this.child = spawn(launch.executable, launch.args, { cwd: launch.cwd, env: launch.env,
|
||||
shell: false, windowsHide: true, detached: process.platform !== 'win32', stdio: ['pipe', 'pipe', 'pipe'] });
|
||||
this.pid = this.child.pid; this.startedAt = new Date().toISOString(); this.exited = false;
|
||||
@@ -47,8 +47,10 @@ export class McpStdio extends EventEmitter {
|
||||
try { message = JSON.parse(line); } catch { return this.fail(failure('MCP_INVALID_FRAME', 'MCP返回了无效JSON帧。', true)); }
|
||||
if (!message || message.jsonrpc !== '2.0') return this.fail(failure('MCP_INVALID_FRAME', 'MCP返回了无效协议帧。', true));
|
||||
if (message.method) {
|
||||
if (message.id !== undefined) this.write({ jsonrpc: '2.0', id: message.id,
|
||||
error: { code: -32601, message: 'This profile does not grant server-initiated operations.' } });
|
||||
if (message.id !== undefined) {
|
||||
this.emit('server-request', message);
|
||||
this.write({ jsonrpc: '2.0', id: message.id, error: { code: -32601, message: 'This profile does not grant server-initiated operations.' } });
|
||||
}
|
||||
else this.emit('notification', message);
|
||||
continue;
|
||||
}
|
||||
@@ -82,11 +84,11 @@ export class McpStdio extends EventEmitter {
|
||||
startedAt: new Date().toISOString(), finishedAt: null, status: 'requesting', dispatched: true };
|
||||
this.trace.push(record);
|
||||
const abort = () => {
|
||||
this.notify('notifications/cancelled', { requestId: id, reason: 'Owned Workbench operation stopped.' });
|
||||
if (this.cancellationMethod) this.notify(this.cancellationMethod, { requestId: id, reason: 'Owned Workbench operation stopped.' });
|
||||
this.settle(id, failure('MCP_CANCELLED', '分析已请求停止,尚未返回的结果不算完成。', true));
|
||||
};
|
||||
const timer = setTimeout(() => {
|
||||
this.notify('notifications/cancelled', { requestId: id, reason: 'Owned Workbench request deadline.' });
|
||||
if (this.cancellationMethod) this.notify(this.cancellationMethod, { requestId: id, reason: 'Owned Workbench request deadline.' });
|
||||
this.settle(id, failure('MCP_TIMEOUT', 'MCP请求到达等待上限,没有自动重试。', true));
|
||||
}, timeoutMs);
|
||||
this.pending.set(id, { resolve, reject, timer, abort, signal, record }); signal?.addEventListener('abort', abort, { once: true });
|
||||
|
||||
@@ -6,6 +6,7 @@ import { inspectProject } from '../core/project-inspector.mjs';
|
||||
import { assertProposalUnsealed } from '../shared/contracts/change-sets.mjs';
|
||||
import { assertWorkspacesResolved } from '../shared/contracts/workspaces.mjs';
|
||||
import { verifyWorkspaceProject } from '../core/workspaces/git-workspaces.mjs';
|
||||
import { publicEngineJob } from '../shared/contracts/engines.mjs';
|
||||
|
||||
export function createSessionPublisher(clients) {
|
||||
return session => {
|
||||
@@ -87,6 +88,7 @@ return async (request, response) => {
|
||||
});
|
||||
}
|
||||
if (method === 'GET' && route === '/api/research/availability') return json(response, runtime.researchManager().availability());
|
||||
if (method === 'GET' && route === '/api/engines/deepseek/availability') return json(response, runtime.engineManager().availability(url.searchParams.has('root') ? url.searchParams.get('root') : undefined));
|
||||
if (method === 'GET' && route === '/api/events') {
|
||||
const cursor = Math.max(cursorNumber(url.searchParams.get('after')), cursorNumber(request.headers['last-event-id']));
|
||||
if (cursor > store.eventCursor) throw Object.assign(new Error('事件游标超出当前历史,请重新加载工作台。'), { status: 409 });
|
||||
@@ -147,6 +149,35 @@ return async (request, response) => {
|
||||
const session = store.session(id);
|
||||
if (method === 'GET' && !action) return json(response, store.publicSession(session));
|
||||
if (method === 'GET' && action === 'execution') return json(response, store.executionSnapshot(session));
|
||||
if (method === 'GET' && action === 'engines') {
|
||||
const manager = runtime.engineManager();
|
||||
return json(response, { availability: manager.availability(), jobs: manager.jobs(session).map(publicEngineJob) });
|
||||
}
|
||||
if (method === 'POST' && action === 'engines/jobs') {
|
||||
const started = runtime.engineManager().start(session, await body(request));
|
||||
return json(response, { job: publicEngineJob(started.job), session: store.publicSession(session) }, 202);
|
||||
}
|
||||
if (method === 'POST' && action === 'engines/stop') { await runtime.engineManager().stop(id); return json(response, store.publicSession(session)); }
|
||||
const engineJob = action.match(/^engines\/jobs\/([a-f0-9-]+)(?:\/(report|download))?$/);
|
||||
if (method === 'GET' && engineJob) {
|
||||
const manager = runtime.engineManager(), job = store.owned('engine_job', engineJob[1], id);
|
||||
if (engineJob[2]) {
|
||||
if (!job.reportArtifactId) throw Object.assign(new Error('这次引擎检查尚未封存原记录,请等待检查结束。'), { status: 409 });
|
||||
const text = manager.originalReport(session, job), artifact = store.owned('artifact', job.reportArtifactId, id);
|
||||
if (engineJob[2] === 'download') {
|
||||
response.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'no-store',
|
||||
'X-Content-Type-Options': 'nosniff', 'Content-Disposition': 'attachment; filename="agent-workbench-engine-' + job.id + '.json"' });
|
||||
response.end(text); return;
|
||||
}
|
||||
const offset = cursorNumber(url.searchParams.get('offset'));
|
||||
const limit = Math.min(16000, url.searchParams.has('limit') ? cursorNumber(url.searchParams.get('limit')) : 4000);
|
||||
if (!limit || offset > text.length) throw Object.assign(new Error('原记录的读取位置或页长超出范围。'), { status: 400 });
|
||||
return json(response, { ...artifact, content: text.slice(offset, offset + limit), offset,
|
||||
totalCharacters: text.length, truncated: offset + limit < text.length });
|
||||
}
|
||||
if (job.reportArtifactId) manager.originalReport(session, job); else manager.inputFor(session, job);
|
||||
return json(response, publicEngineJob(job));
|
||||
}
|
||||
if (method === 'GET' && action === 'research') {
|
||||
const manager = runtime.researchManager(); return json(response, { availability: manager.availability(), targets: manager.targets(session), jobs: manager.jobs(session) });
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { randomUUID, createHash } from 'node:crypto';
|
||||
|
||||
export const APP_VERSION = '1.8.0';
|
||||
export const APP_VERSION = '1.9.0';
|
||||
|
||||
export function executionEnvironment() {
|
||||
const windows = process.platform === 'win32';
|
||||
|
||||
@@ -11,13 +11,13 @@ import { APP_VERSION } from './diagnostics.mjs';
|
||||
export function installUpgrade(context, { appDirectory, updateServiceInfo = true }) {
|
||||
const { server, store, provider, runtime, token, clients, started, exampleProject, shutdown } = context;
|
||||
if (!server?.listening || !store || !provider || !runtime || !clients || !token) throw new Error('The existing Workbench context is incomplete.');
|
||||
if (runtime.active.size || runtime.waiters.size || runtime.checks?.active.size || runtime.deliveries?.active.size || runtime.changeSets?.projects.size || runtime.workspaces?.projects.size || runtime.workspaces?.pending.size || runtime.research?.active.size) throw new Error('Wait for active tasks, checks, Git deliveries, file batches, workspaces, research and approvals to finish before upgrading.');
|
||||
if (runtime.active.size || runtime.waiters.size || runtime.checks?.active.size || runtime.deliveries?.active.size || runtime.changeSets?.projects.size || runtime.workspaces?.projects.size || runtime.workspaces?.pending.size || runtime.research?.active.size || runtime.engines?.active.size) throw new Error('Wait for active tasks, checks, Git deliveries, file batches, workspaces, research, engines and approvals to finish before upgrading.');
|
||||
const root = fs.realpathSync.native(path.resolve(appDirectory));
|
||||
if (!fs.existsSync(path.join(root, 'dist-client', 'index.html'))) throw new Error('The new client bundle is missing.');
|
||||
const oldHandlers = server.listeners('request');
|
||||
const oldPrototypes = [Object.getPrototypeOf(store), Object.getPrototypeOf(provider), Object.getPrototypeOf(runtime)];
|
||||
const oldStoreProperties = { ...store };
|
||||
const oldRuntimeProperties = { appDirectory: runtime.appDirectory, checks: runtime.checks, deliveries: runtime.deliveries, codeIndex: runtime.codeIndex, changeSets: runtime.changeSets, contextPlans: runtime.contextPlans, workspaces: runtime.workspaces, research: runtime.research };
|
||||
const oldRuntimeProperties = { appDirectory: runtime.appDirectory, checks: runtime.checks, deliveries: runtime.deliveries, codeIndex: runtime.codeIndex, changeSets: runtime.changeSets, contextPlans: runtime.contextPlans, workspaces: runtime.workspaces, research: runtime.research, engines: runtime.engines };
|
||||
const oldUpdates = store.listeners('update');
|
||||
const closeStorage = () => store.close();
|
||||
if (oldUpdates.length > 1) throw new Error('Unexpected Store observers; preserve their ownership before upgrading.');
|
||||
@@ -27,7 +27,7 @@ export function installUpgrade(context, { appDirectory, updateServiceInfo = true
|
||||
Object.setPrototypeOf(store, Store.prototype);
|
||||
Object.setPrototypeOf(provider, Provider.prototype);
|
||||
Object.setPrototypeOf(runtime, Runtime.prototype);
|
||||
runtime.appDirectory = root; runtime.checks = null; runtime.deliveries = null; runtime.codeIndex = null; runtime.changeSets = null; runtime.contextPlans = null; runtime.workspaces = null; runtime.research = null;
|
||||
runtime.appDirectory = root; runtime.checks = null; runtime.deliveries = null; runtime.codeIndex = null; runtime.changeSets = null; runtime.contextPlans = null; runtime.workspaces = null; runtime.research = null; runtime.engines = null;
|
||||
store.ensureStorage(); store.claimRuntime();
|
||||
store.removeAllListeners('update'); store.on('update', createSessionPublisher(clients));
|
||||
server.removeAllListeners('request'); server.on('request', handler);
|
||||
|
||||
@@ -4,6 +4,10 @@ import { setTimeout as delay } from 'node:timers/promises';
|
||||
import { executionEnvironment, ModelRequestError, connectionFailure, httpFailure } from './diagnostics.mjs';
|
||||
import { completionBody, assertPlannedRequest } from '../shared/contracts/model-request.mjs';
|
||||
|
||||
export const engineToolDefinitions = [
|
||||
{ type: 'function', function: { name: 'inspect_engine_checks', description: '读取当前Task已经保存的外部引擎连接核验:真实安装版本、启动完成信号、SDK会话、进程关闭、原报告工件和能力限制。不会启动引擎或发送prompt;完整原记录通过已有read_artifact读取。', parameters: { type: 'object', properties: {}, additionalProperties: false } } },
|
||||
];
|
||||
|
||||
export const toolDefinitions = [
|
||||
{ type: 'function', function: { name: 'prepare_change_set', description: '把当前Task的1到32份待审查文件提案按change_ids封存为统一审查批次。原/新字节快照和Git基线持久保存;不写盘。用户在改动面板确认后才应用;不能自动应用或重放未知批次。', parameters: { type: 'object', properties: { change_ids: { type: 'array', minItems: 1, maxItems: 32, uniqueItems: true, items: { type: 'string' } } }, required: ['change_ids'] } } },
|
||||
{ type: 'function', function: { name: 'index_project', description: '为当前项目建立有文件SHA256的增量符号/导入索引。JS/TS/React来自静态AST,Python是声明候选;返回范围、摘要和完整工件,不执行项目代码。动态绑定和路径别名未核对。', parameters: { type: 'object', properties: {} } } },
|
||||
|
||||
+30
-12
@@ -2,8 +2,9 @@ import { spawn, execFile } from 'node:child_process';
|
||||
import path from 'node:path';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { StringDecoder } from 'node:string_decoder';
|
||||
import { setImmediate as yieldExecution } from 'node:timers/promises';
|
||||
import { safePath, listFiles, readLines, searchFiles, proposeFile, proposePatch } from './files.mjs';
|
||||
import { projectContext, toolDefinitions, researchToolDefinitions } from './provider.mjs';
|
||||
import { projectContext, toolDefinitions, researchToolDefinitions, engineToolDefinitions } from './provider.mjs';
|
||||
import { now, repairToolPairs } from './store.mjs';
|
||||
import { executionEnvironment, sessionContext, sessionSnapshot } from './diagnostics.mjs';
|
||||
import { BudgetExceeded, checkBudget } from '../shared/contracts/execution.mjs';
|
||||
@@ -19,6 +20,7 @@ import { pendingDeliveryReview } from '../shared/contracts/delivery-review.mjs';
|
||||
import { WorkspaceManager, verifyWorkspaceProject } from '../core/workspaces/git-workspaces.mjs';
|
||||
import { assertWorkspacesResolved, projectWorkspaceIdentity } from '../shared/contracts/workspaces.mjs';
|
||||
import { ResearchManager } from '../core/research-manager.mjs';
|
||||
import { EngineManager } from '../core/engine-manager.mjs';
|
||||
|
||||
const labels = { inspect_session: '核对工作台运行记录', inspect_project: '识别工程与Git基线', index_project: '建立工程符号索引', query_code: '定位工程符号与导入', propose_patch: '准备精确补丁', plan_checks: '准备工程检查计划', run_checks: '执行工程检查', plan_delivery: '准备Git交付预览', delivery_report: '生成工程证据报告', read_artifact: '读取执行日志工件', list_files: '查看项目文件', read_file: '读取文件', search_files: '搜索项目', propose_file: '准备文件改动', run_command: '运行终端命令' };
|
||||
|
||||
@@ -26,10 +28,15 @@ labels.prepare_change_set = '准备多文件变更集';
|
||||
labels.list_research_targets = '查看本任务登记工件';
|
||||
labels.analyze_research_target = 'REA静态分析登记工件';
|
||||
labels.read_research_evidence = '读取原REA Evidence字段';
|
||||
labels.inspect_engine_checks = '查看本任务外部引擎核验';
|
||||
|
||||
export function validateToolArgs(tool, args) {
|
||||
if (!Object.hasOwn(labels, tool)) throw new Error('当前能力表没有工具:' + tool);
|
||||
if (!args || typeof args !== 'object' || Array.isArray(args)) throw new Error('工具参数必须是 JSON 对象。');
|
||||
if (tool === 'inspect_engine_checks') {
|
||||
if (Object.keys(args).length) throw new Error('引擎核验查询只读取当前任务的已保存结果。');
|
||||
return;
|
||||
}
|
||||
if (['list_research_targets', 'analyze_research_target', 'read_research_evidence'].includes(tool)) {
|
||||
if (tool === 'analyze_research_target' && (typeof args.target_id !== 'string' || !['javascript', 'pe-imports', 'pe-resources'].includes(args.operation))) throw new Error('REA分析需要登记target_id和实际支持的静态分析方式。');
|
||||
if (tool === 'read_research_evidence' && (typeof args.research_job_id !== 'string' || args.pointer !== undefined && typeof args.pointer !== 'string')) throw new Error('Evidence读取需要research_job_id及有效字段。');
|
||||
@@ -62,36 +69,40 @@ export class Runtime {
|
||||
this.appDirectory = appDirectory;
|
||||
this.active = new Map(); this.waiters = new Map();
|
||||
}
|
||||
isActive(id) { return this.active.has(id) || !!this.checks?.isActive(id) || !!this.deliveries?.isActive(id) || !!this.changeSets?.isActive(id) || !!this.workspaces?.isActive(id) || !!this.research?.isActive(id); }
|
||||
hasActivity() { return this.active.size > 0 || (this.checks?.active.size ?? 0) > 0 || (this.deliveries?.active.size ?? 0) > 0 || (this.changeSets?.projects.size ?? 0) > 0 || (this.workspaces?.projects.size ?? 0) > 0 || (this.workspaces?.pending.size ?? 0) > 0 || (this.research?.active.size ?? 0) > 0; }
|
||||
isActive(id) { return this.active.has(id) || !!this.checks?.isActive(id) || !!this.deliveries?.isActive(id) || !!this.changeSets?.isActive(id) || !!this.workspaces?.isActive(id) || !!this.research?.isActive(id) || !!this.engines?.isActive(id); }
|
||||
hasActivity() { return this.active.size > 0 || (this.checks?.active.size ?? 0) > 0 || (this.deliveries?.active.size ?? 0) > 0 || (this.changeSets?.projects.size ?? 0) > 0 || (this.workspaces?.projects.size ?? 0) > 0 || (this.workspaces?.pending.size ?? 0) > 0 || (this.research?.active.size ?? 0) > 0 || (this.engines?.active.size ?? 0) > 0; }
|
||||
projectIndexer() { return this.codeIndex ??= new ProjectIndex(); }
|
||||
engineManager() {
|
||||
return this.engines ??= new EngineManager(this.store, { appDirectory: this.appDirectory,
|
||||
redact: value => this.provider.redact(value), projectBusy: projectId => this.projectHasActivity(projectId) });
|
||||
}
|
||||
requestPlanner() { return this.contextPlans ??= new RequestPlanner(this.store); }
|
||||
researchManager() {
|
||||
return this.research ??= new ResearchManager(this.store, { appDirectory: this.appDirectory,
|
||||
redact: value => this.provider.redact(value), projectBusy: (projectId, exceptId) => this.projectHasActivity(projectId, exceptId) });
|
||||
}
|
||||
projectHasActivity(projectId, exceptSessionId = null) {
|
||||
return [...this.active.entries()].some(([id, run]) => id !== exceptSessionId && run.project.id === projectId) || !!this.checks?.projectActive(projectId) || !!this.deliveries?.projectActive(projectId) || !!this.changeSets?.projectActive(projectId) || !!this.workspaces?.projectActive(projectId) || !!this.research?.projectActive(projectId);
|
||||
return [...this.active.entries()].some(([id, run]) => id !== exceptSessionId && run.project.id === projectId) || !!this.checks?.projectActive(projectId) || !!this.deliveries?.projectActive(projectId) || !!this.changeSets?.projectActive(projectId) || !!this.workspaces?.projectActive(projectId) || !!this.research?.projectActive(projectId) || !!this.engines?.projectActive(projectId);
|
||||
}
|
||||
workspaceManager() {
|
||||
return this.workspaces ??= new WorkspaceManager(this.store, { initialize: this.store.core.workspace.size === 0,
|
||||
redact: value => this.provider.redact(value), projectBusy: projectId =>
|
||||
[...this.active.values()].some(run => run.project.id === projectId) || !!this.checks?.projectActive(projectId)
|
||||
|| !!this.deliveries?.projectActive(projectId) || !!this.changeSets?.projectActive(projectId) || !!this.research?.projectActive(projectId) });
|
||||
|| !!this.deliveries?.projectActive(projectId) || !!this.changeSets?.projectActive(projectId) || !!this.research?.projectActive(projectId) || !!this.engines?.projectActive(projectId) });
|
||||
}
|
||||
changeSetManager() {
|
||||
return this.changeSets ??= new ChangeSetManager(this.store, { projectBusy: (projectId, exceptId) =>
|
||||
[...this.active.entries()].some(([id, run]) => id !== exceptId && run.project.id === projectId)
|
||||
|| !!this.checks?.projectActive(projectId) || !!this.deliveries?.projectActive(projectId) || !!this.workspaces?.projectActive(projectId) || !!this.research?.projectActive(projectId) });
|
||||
|| !!this.checks?.projectActive(projectId) || !!this.deliveries?.projectActive(projectId) || !!this.workspaces?.projectActive(projectId) || !!this.research?.projectActive(projectId) || !!this.engines?.projectActive(projectId) });
|
||||
}
|
||||
checkRunner() {
|
||||
return this.checks ??= new CheckRunner(this.store, { redact: value => this.provider.redact(value), runtimeDirectory: this.appDirectory ? path.join(this.appDirectory, 'runtime') : null,
|
||||
pythonRunnerPath: path.join(this.appDirectory ?? process.cwd(), 'scripts', 'python-check-runner.py'),
|
||||
projectBusy: (projectId, exceptId) => [...this.active.entries()].some(([id, run]) => id !== exceptId && run.project.id === projectId) || !!this.deliveries?.projectActive(projectId) || !!this.changeSets?.projectActive(projectId) || !!this.workspaces?.projectActive(projectId) || !!this.research?.projectActive(projectId) });
|
||||
projectBusy: (projectId, exceptId) => [...this.active.entries()].some(([id, run]) => id !== exceptId && run.project.id === projectId) || !!this.deliveries?.projectActive(projectId) || !!this.changeSets?.projectActive(projectId) || !!this.workspaces?.projectActive(projectId) || !!this.research?.projectActive(projectId) || !!this.engines?.projectActive(projectId) });
|
||||
}
|
||||
gitDelivery() {
|
||||
return this.deliveries ??= new GitDelivery(this.store, { redact: value => this.provider.redact(value),
|
||||
projectBusy: (projectId, exceptId) => [...this.active.entries()].some(([id, run]) => id !== exceptId && run.project.id === projectId) || !!this.checks?.projectActive(projectId) || !!this.changeSets?.projectActive(projectId) || !!this.workspaces?.projectActive(projectId) || !!this.research?.projectActive(projectId) });
|
||||
projectBusy: (projectId, exceptId) => [...this.active.entries()].some(([id, run]) => id !== exceptId && run.project.id === projectId) || !!this.checks?.projectActive(projectId) || !!this.changeSets?.projectActive(projectId) || !!this.workspaces?.projectActive(projectId) || !!this.research?.projectActive(projectId) || !!this.engines?.projectActive(projectId) });
|
||||
}
|
||||
start(id, content, resume = false, { instructionSource = null } = {}) {
|
||||
const session = this.store.session(id);
|
||||
@@ -148,6 +159,9 @@ export class Runtime {
|
||||
const signal = run.controller.signal;
|
||||
let projectionLogged = false;
|
||||
try {
|
||||
// Immediate providers and local tools still need to deliver UI events and
|
||||
// process stop/deadline input between completed, persisted operations.
|
||||
await yieldExecution(undefined, { signal });
|
||||
await verifyWorkspaceProject(this.store, run.project);
|
||||
for (let step = 0; step < config.maxSteps; step++) {
|
||||
signal.throwIfAborted();
|
||||
@@ -165,8 +179,9 @@ export class Runtime {
|
||||
}) + '\n结果未知的调用,不得假定成功或重放:' + JSON.stringify(unknown)
|
||||
+ '\n' + sessionContext(session, run.project, config, value => this.provider.redact(value))
|
||||
+ (task.readProgress?.warning ? '\n当前读取进展:' + task.readProgress.warning : ''));
|
||||
const tools = [...this.store.core.research_target.values()].some(target => target.sessionId === session.id && target.taskId === run.taskId)
|
||||
? [...toolDefinitions, ...researchToolDefinitions] : toolDefinitions;
|
||||
const tools = [...toolDefinitions,
|
||||
...([...this.store.core.research_target.values()].some(target => target.sessionId === session.id && target.taskId === run.taskId) ? researchToolDefinitions : []),
|
||||
...([...this.store.core.engine_job.values()].some(job => job.sessionId === session.id && job.taskId === run.taskId) ? engineToolDefinitions : [])];
|
||||
const planned = this.requestPlanner().prepare(session, run.record, config, { system: context, tools, stepId: stepRecord.id });
|
||||
if (planned.record.archivedGroups && !projectionLogged) {
|
||||
projectionLogged = true; session.compactions++;
|
||||
@@ -238,6 +253,7 @@ export class Runtime {
|
||||
run.record.review = { kind: 'git_delivery', planId: deliveryReview.id, status: 'pending', preparedAt: now() };
|
||||
}
|
||||
this.store.save(session);
|
||||
await yieldExecution(undefined, { signal });
|
||||
signal.throwIfAborted();
|
||||
}
|
||||
this.store.finishStep(session, stepRecord);
|
||||
@@ -292,6 +308,8 @@ export class Runtime {
|
||||
if (!['run_command', 'run_checks'].includes(tool)) this.store.invocationState(session, event, 'running');
|
||||
else this.store.save(session);
|
||||
if (tool === 'inspect_session') result = { ...sessionSnapshot(session, run.project, run.config, value => this.provider.redact(value)), execution: this.store.executionSnapshot(session) };
|
||||
else if (tool === 'inspect_engine_checks') result = { status: 'completed', engine_checks: this.engineManager().jobs(session)
|
||||
.filter(job => job.taskId === run.taskId).map(job => this.engineManager().summary(session, job)), note: '已保存的引擎连接核验;完整原记录使用report_artifact_id读取,查询不会启动引擎。' };
|
||||
else if (tool === 'list_research_targets') result = { targets: this.researchManager().targets(session), jobs: this.researchManager().jobs(session).filter(job => job.taskId === run.taskId).map(job => this.researchManager().result(job)) };
|
||||
else if (tool === 'analyze_research_target') {
|
||||
const manager = this.researchManager(), started = manager.start(session, args.target_id, args.operation, { source: 'agent', signal: run.controller.signal });
|
||||
@@ -460,11 +478,11 @@ export class Runtime {
|
||||
}
|
||||
async stop(sessionId) {
|
||||
const run = this.active.get(sessionId);
|
||||
if (!run) { await this.checks?.stop(sessionId); await this.deliveries?.stop(sessionId); await this.changeSets?.stop(sessionId); await this.workspaces?.stop(sessionId); await this.research?.stop(sessionId); return; }
|
||||
if (!run) { await this.checks?.stop(sessionId); await this.deliveries?.stop(sessionId); await this.changeSets?.stop(sessionId); await this.workspaces?.stop(sessionId); await this.research?.stop(sessionId); await this.engines?.stop(sessionId); return; }
|
||||
const session = this.store.session(sessionId);
|
||||
session.status = 'stopping'; this.store.save(session);
|
||||
run.controller.abort(new Error('用户停止任务'));
|
||||
await run.promise;
|
||||
}
|
||||
async stopAll() { await Promise.all([...this.active.keys()].map(id => this.stop(id))); await this.checks?.stopAll(); await this.deliveries?.stopAll(); await this.changeSets?.stopAll(); await this.workspaces?.stopAll(); await this.research?.stopAll(); }
|
||||
async stopAll() { await Promise.all([...this.active.keys()].map(id => this.stop(id))); await this.checks?.stopAll(); await this.deliveries?.stopAll(); await this.changeSets?.stopAll(); await this.workspaces?.stopAll(); await this.research?.stopAll(); await this.engines?.stopAll(); }
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import { collectLegacy, cleanConfig } from '../core/storage/legacy-import.mjs';
|
||||
import { ACTIVE_STATES, CORE_KINDS, createTask, createRun, ownedRecord, emptyUsage, accumulateUsage, accountedTokens, isId } from '../shared/contracts/execution.mjs';
|
||||
import { WORKSPACE_ACTIVE, projectWorkspaceIdentity, assertWorkspacePath } from '../shared/contracts/workspaces.mjs';
|
||||
import { RESEARCH_ACTIVE } from '../shared/contracts/research.mjs';
|
||||
import { ENGINE_ACTIVE, publicEngineJob } from '../shared/contracts/engines.mjs';
|
||||
|
||||
export const now = () => new Date().toISOString();
|
||||
|
||||
@@ -224,6 +225,13 @@ export class Store extends EventEmitter {
|
||||
if (event) { event.phase = job.status; event.finishedAt = job.finishedAt; event.output = job.summary; }
|
||||
changed = true;
|
||||
}
|
||||
for (const job of this.core.engine_job.values()) if (job.sessionId === session.id && ENGINE_ACTIVE.has(job.status)) {
|
||||
job.status = 'unknown'; job.requiresVerification = true; job.verification = null; job.finishedAt = now();
|
||||
job.summary = '外部引擎连接检查中断,原进程关闭状态未知。不会根据历史PID停止进程或重放请求,请查看所属原记录。';
|
||||
const event = session.events.find(value => value.id === job.eventId);
|
||||
if (event) { event.phase = 'unknown'; event.finishedAt = job.finishedAt; event.output = job.summary; }
|
||||
changed = true;
|
||||
}
|
||||
for (const event of session.events ?? []) {
|
||||
if (['running', 'waiting', 'retrying'].includes(event.phase)) {
|
||||
const invocation = [...this.core.tool.values()].find(item => item.sessionId === session.id && item.callId === event.toolCallId);
|
||||
@@ -522,6 +530,7 @@ export class Store extends EventEmitter {
|
||||
artifacts, checks: jobs,
|
||||
researchTargets: [...this.core.research_target.values()].filter(value => value.sessionId === session.id && value.taskId === task?.id).slice(-32),
|
||||
researchJobs: [...this.core.research_job.values()].filter(value => value.sessionId === session.id && (value.taskId === task?.id || value.requiresVerification)).slice(-20),
|
||||
engineJobs: [...this.core.engine_job.values()].filter(value => value.sessionId === session.id && (value.taskId === task?.id || value.requiresVerification)).slice(-20).map(publicEngineJob),
|
||||
contextPlans: [...this.core.context_plan.values()].filter(value => value.sessionId === session.id && value.taskId === task?.id).slice(-30),
|
||||
changeSets: [...this.core.change_set.values()].filter(value => value.sessionId === session.id && (value.taskId === task?.id || value.requiresVerification)).slice(-12),
|
||||
plans: [...this.core.check_plan.values()].filter(value => value.sessionId === session.id && value.taskId === task?.id).slice(-5),
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import { createHash } from 'node:crypto';
|
||||
|
||||
export const ENGINE_ACTIVE = new Set(['queued', 'starting', 'initializing', 'checking', 'stopping']);
|
||||
export const ENGINE_SCOPE = 'deepseek-sdk-connection-probe';
|
||||
export const ENGINE_LIMITS = Object.freeze([
|
||||
'当前接入核验启动、会话目录、协议错误和关闭;工程执行接入开发中。',
|
||||
'SDK没有单会话cancel或close;停止以所属独立进程为单位。',
|
||||
'SDK serverInfo.version与发行包版本分别核对,没有有效协议版本协商。',
|
||||
'SDK事件覆盖运行时会话树,idle事件不能直接判项目交付完成。',
|
||||
]);
|
||||
export const engineError = (message, status = 409, code = 'ENGINE_CONTRACT') => Object.assign(new Error(message), { status, code });
|
||||
export const engineDigest = value => createHash('sha256').update(typeof value === 'string' ? value : JSON.stringify(value), 'utf8').digest('hex');
|
||||
|
||||
export function engineInput(job) {
|
||||
return { schemaVersion: 1, jobId: job.id, sessionId: job.sessionId, projectId: job.projectId,
|
||||
taskId: job.taskId, runId: job.runId, engineId: job.engineId, scope: job.scope,
|
||||
installation: job.installation, sdkSessionId: job.sdkSessionId, directory: job.directory,
|
||||
protocolMethods: ['initialize', 'session/working-directory/get', 'session/wait', 'session/resume', 'session/cancel', 'shutdown'],
|
||||
modelRequestsAllowed: 0, externalProjectToolsAllowed: false };
|
||||
}
|
||||
|
||||
export function engineReportContract(job) {
|
||||
return { schemaVersion: 1, inputSha256: job.contractSha256, owner: { sessionId: job.sessionId,
|
||||
projectId: job.projectId, taskId: job.taskId, runId: job.runId, jobId: job.id },
|
||||
engineId: job.engineId, scope: job.scope, installationSha256: job.installation.identitySha256,
|
||||
sdkSessionId: job.sdkSessionId, outcome: { status: job.status, error: job.error ?? null, verification: job.verification }, report: job.report };
|
||||
}
|
||||
|
||||
export function publicEngineJob(job) {
|
||||
const { report, ...value } = job;
|
||||
return { ...value, reportSummary: report ? { status: report.status, modelRequests: report.modelRequests,
|
||||
providerRequests: report.providerRequests, observedResponses: report.responses?.length ?? 0,
|
||||
rootExited: report.cleanup?.rootExited ?? null } : null };
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import { randomUUID } from 'node:crypto';
|
||||
|
||||
export const EXECUTION_SCHEMA = 1;
|
||||
export const ACTIVE_STATES = new Set(['running', 'awaiting_approval', 'stopping']);
|
||||
export const CORE_KINDS = ['task', 'run', 'step', 'tool', 'artifact', 'check_plan', 'check_job', 'delivery_plan', 'delivery_job', 'change_set', 'context_plan', 'workspace', 'research_target', 'research_job'];
|
||||
export const CORE_KINDS = ['task', 'run', 'step', 'tool', 'artifact', 'check_plan', 'check_job', 'delivery_plan', 'delivery_job', 'change_set', 'context_plan', 'workspace', 'research_target', 'research_job', 'engine_job'];
|
||||
export const timestamp = () => new Date().toISOString();
|
||||
export const isId = value => typeof value === 'string' && /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(value);
|
||||
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# Agent Workbench:核心代理能力研究与产品计划
|
||||
|
||||
## 当前执行:1.9 引擎接入与实际流程(2026-10-30)
|
||||
|
||||
用户要求继续全量推进,接续既有1.8.0与未提交引擎实现。正式服务与真实模型连接保持;当前开发使用独立宿主、数据目录和本地Git小步提交。
|
||||
|
||||
1. [complete] 未提交DeepSeek引擎契约、实际0.2.1-rc.2 SDK、22项专项与原协议记录已经完成;接续审核并在独立发行中验证。
|
||||
2. [complete] 引擎面板10组桌面/390px验收通过,含原记录下载、归属、停止和实际重启;保留前两轮失败原记录。
|
||||
3. [pending] 审查实际SDK的受控执行入口,按真实工具与权限契约推进工程执行;连接通过和工程交付分别判定,不以idle通知判断完成。
|
||||
4. [in_progress] 接续PID30912的1.9.0完整源码回归;首轮全量界面在离线演示等待审批时超时,保存原DOM/数据库/报告,先查实际任务与负载。完成后提交实现、生成不可变发行、独立源码/便携验收和保留原Provider升级。
|
||||
5. [pending] 继续真实工程样本、桌面宿主与手机伴随端切片;每个实际成果独立验证和提交,计划不记为已实现。
|
||||
|
||||
恢复核对:Agent-Workbench为独立Git仓库;正式1.8.0已有244项独立源码、98组界面和真实四模块工程交付证据,不重复既有任务。新增核心/适配/API草稿未提交,前一轮尚无产品引擎UI或实际SDK适配验收。Node实测24.22.1。首次父目录Git错误与大输出截断已改为明确工作目录和限定读取。
|
||||
|
||||
## 用户授权与目标
|
||||
- 本项目专注编程代理能力研究与工作台开发,其他项目不纳入本项目计划和版本管理。
|
||||
- 本对话已获确认:研究 Claude Code,形成机制报告并提炼自己的本地代理设计。
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { createHash } from 'node:crypto';
|
||||
import { fixture, launchWorkbench, until } from './helpers.mjs';
|
||||
import { createEngineFixture } from '../scripts/engine-fixtures.mjs';
|
||||
|
||||
test('engine HTTP checks bind the detected installation and current task, page original bytes and preserve them across host restart', async t => {
|
||||
const f = fixture(t), root = createEngineFixture(path.join(f.root, 'sdk 源码 #'));
|
||||
f.store.close(); let host = await launchWorkbench(t, f.data, { AGENT_WORKBENCH_DEEPSEEK_ROOT: root });
|
||||
const route = '/sessions/' + f.session.id, installation = await host.api('/engines/deepseek/availability');
|
||||
assert.equal(installation.status, 'available'); assert.equal(installation.capabilities.projectExecution, false);
|
||||
await assert.rejects(host.api(route + '/engines/jobs', { root, identitySha256: '0'.repeat(64) }), /检测结果不一致/);
|
||||
assert.equal((await host.api(route)).execution.engineJobs.length, 0);
|
||||
const started = await host.api(route + '/engines/jobs', { root, identitySha256: installation.identitySha256 });
|
||||
const jobRoute = route + '/engines/jobs/' + started.job.id;
|
||||
await until(async () => (await host.api(route)).execution.engineJobs.at(-1).reportArtifactId, 15000);
|
||||
const job = await host.api(jobRoute), session = await host.api(route);
|
||||
assert.equal(job.status, 'completed'); assert.equal(job.report, undefined); assert.equal(job.reportSummary.modelRequests, 0);
|
||||
assert.equal(job.taskId, session.execution.task.id); assert.equal(job.runId, session.execution.run.id);
|
||||
assert.equal((await host.api(route + '/engines')).jobs[0].id, job.id);
|
||||
const response = await fetch(host.url + '/api' + jobRoute + '/download', { headers: { 'X-Workbench-Token': host.bootstrap.token } });
|
||||
assert.equal(response.status, 200); assert.match(response.headers.get('content-disposition'), /attachment/);
|
||||
const text = await response.text(), original = JSON.parse(text);
|
||||
assert.equal(createHash('sha256').update(text).digest('hex'), job.reportSha256); assert.equal(original.owner.sessionId, f.session.id);
|
||||
assert.equal(original.report.responses.length, 6); assert.equal(original.report.cleanup.rootExited, true);
|
||||
let content = '', offset = 0, page;
|
||||
do {
|
||||
page = await host.api(jobRoute + '/report?offset=' + offset + '&limit=1700'); assert.equal(page.sha256, job.reportSha256);
|
||||
content += page.content; offset += page.content.length;
|
||||
} while (page.truncated);
|
||||
assert.equal(content, text); await assert.rejects(host.api(jobRoute + '/report?limit=0'), /读取位置或页长/);
|
||||
const other = await host.api('/sessions', { projectId: f.project.id });
|
||||
await assert.rejects(host.api('/sessions/' + other.id + '/engines/jobs/' + job.id + '/report'), /不属于/);
|
||||
const wire = path.join(root, 'wire.jsonl'), before = fs.readFileSync(wire);
|
||||
await host.close(); host = await launchWorkbench(t, f.data, { AGENT_WORKBENCH_DEEPSEEK_ROOT: root });
|
||||
const reopened = await host.api(jobRoute); assert.equal(reopened.status, 'completed'); assert.equal(reopened.reportSha256, job.reportSha256);
|
||||
assert.equal((await host.api(jobRoute + '/report?limit=1700')).content, text.slice(0, 1700));
|
||||
assert.deepEqual(fs.readFileSync(wire), before); assert.equal((await host.api(route)).execution.task.usage.requests, 0);
|
||||
});
|
||||
|
||||
test('HTTP stop seals a pending SDK call, rejects automatic replay and keeps failures attached to the original session', async t => {
|
||||
const f = fixture(t), root = createEngineFixture(path.join(f.root, 'sdk'), { mode: 'hang-init' }); f.store.close();
|
||||
const host = await launchWorkbench(t, f.data, { AGENT_WORKBENCH_DEEPSEEK_ROOT: root }), route = '/sessions/' + f.session.id;
|
||||
const started = await host.api(route + '/engines/jobs', { root });
|
||||
await until(async () => (await host.api(route)).execution.engineJobs.at(-1).status === 'initializing', 15000);
|
||||
const other = await host.api('/sessions', { projectId: f.project.id });
|
||||
await assert.rejects(host.api('/sessions/' + other.id + '/messages', { content: 'owned request' }), /在执行/);
|
||||
await host.api(route + '/engines/stop', {});
|
||||
const job = await host.api(route + '/engines/jobs/' + started.job.id);
|
||||
assert.equal(job.status, 'cancelled'); assert.equal(job.reportSummary.rootExited, true); assert.equal(job.taskId, started.job.taskId);
|
||||
await assert.rejects(host.api(route + '/engines/jobs', { root }), /重新验证/);
|
||||
const text = fs.readFileSync(path.join(root, 'wire.jsonl'), 'utf8'); assert.equal(text.includes('notifications/cancelled'), false);
|
||||
fs.writeFileSync(path.join(root, 'fixture-options.json'), '{}');
|
||||
const retry = await host.api(route + '/engines/jobs', { root, retry: true });
|
||||
await until(async () => (await host.api(route)).execution.engineJobs.at(-1).reportArtifactId, 15000);
|
||||
assert.equal((await host.api(route + '/engines/jobs/' + retry.job.id)).status, 'completed');
|
||||
assert.notEqual(retry.job.id, job.id); assert.equal((await host.api(route)).execution.engineJobs.length, 2);
|
||||
});
|
||||
@@ -0,0 +1,181 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import os from 'node:os';
|
||||
import { EngineManager } from '../src/core/engine-manager.mjs';
|
||||
import { DeepSeekAdapter } from '../src/core/engines/deepseek-adapter.mjs';
|
||||
import { resolveDeepSeekInstallation } from '../src/core/engines/deepseek-installation.mjs';
|
||||
import { Store } from '../src/server/store.mjs';
|
||||
import { Runtime, validateToolArgs } from '../src/server/runtime.mjs';
|
||||
import { Provider } from '../src/server/provider.mjs';
|
||||
import { createEngineFixture } from '../scripts/engine-fixtures.mjs';
|
||||
import { fixture, until } from './helpers.mjs';
|
||||
|
||||
function setup(t, options = {}) {
|
||||
const f = fixture(t), root = createEngineFixture(path.join(f.root, 'harness 源码 #'), options);
|
||||
const manager = new EngineManager(f.store, { adapterFactory: installation => new DeepSeekAdapter(installation, { timeoutMs: 3000 }) });
|
||||
f.onCleanup(async () => {
|
||||
await manager.stopAll();
|
||||
for (const job of manager.jobs(f.session)) {
|
||||
const directory = path.resolve(job.directory), base = path.resolve(os.tmpdir(), 'AgentWorkbench-Engines');
|
||||
assert.equal(path.dirname(directory), base); assert.equal(path.basename(directory), job.id);
|
||||
fs.rmSync(directory, { recursive: true, force: true, maxRetries: 3 });
|
||||
}
|
||||
});
|
||||
const audit = () => fs.existsSync(path.join(root, 'wire.jsonl')) ? fs.readFileSync(path.join(root, 'wire.jsonl'), 'utf8').trim().split('\n').map(line => JSON.parse(line)) : [];
|
||||
return { ...f, root, manager, audit };
|
||||
}
|
||||
|
||||
test('engine detection seals the actual CLI, SDK, profile and Node and rejects mixed versions without launch', t => {
|
||||
const f = setup(t), current = resolveDeepSeekInstallation(process.cwd(), f.root);
|
||||
assert.equal(current.status, 'available'); assert.equal(current.version, '0.2.1-rc.2'); assert.equal(current.inputs.length, 13);
|
||||
const pkg = path.join(f.root, 'packages/sdk/server/package.json');
|
||||
fs.writeFileSync(pkg, JSON.stringify({ version: 'another-version' }));
|
||||
assert.equal(f.manager.availability(f.root).status, 'unsupported'); assert.throws(() => f.manager.start(f.session, { root: f.root }), /版本不一致/);
|
||||
assert.equal(f.audit().length, 0); assert.equal(f.store.core.engine_job.size, 0);
|
||||
fs.writeFileSync(pkg, JSON.stringify({ version: '0.2.1-rc.2' }));
|
||||
const detected = f.manager.availability(f.root); fs.appendFileSync(path.join(f.root, 'apps/cli/lib/bin.js'), '\n// changed after detection\n');
|
||||
assert.throws(() => f.manager.start(f.session, { root: f.root, identitySha256: detected.identitySha256 }), /检测结果不一致/);
|
||||
assert.equal(f.audit().length, 0); assert.equal(f.store.core.engine_job.size, 0);
|
||||
});
|
||||
|
||||
test('owned engine probe waits for real ready identity, verifies six native responses and saves immutable task evidence', async t => {
|
||||
const f = setup(t, { readyDelayMs: 150 });
|
||||
const originalBytes = fs.readFileSync(path.join(f.projectRoot, 'README.md'));
|
||||
const started = f.manager.start(f.session, { root: f.root });
|
||||
assert.throws(() => f.manager.start(f.session, { root: f.root }), /在执行/);
|
||||
const job = await started.promise;
|
||||
assert.equal(job.status, 'completed'); assert.equal(job.verification.verified, true); assert.equal(job.report.responses.length, 6);
|
||||
assert.equal(job.report.modelRequests, 0); assert.equal(job.report.cleanup.rootExited, true); assert.equal(job.report.cleanup.exit.code, 0);
|
||||
assert.equal(job.report.readiness.pid, job.pid); assert.equal(job.sdkSessionId, job.report.sdkSessionId);
|
||||
assert.equal(f.store.executionSnapshot(f.session).engineJobs[0].report, undefined);
|
||||
assert.equal(f.store.executionSnapshot(f.session).engineJobs[0].reportSummary.observedResponses, 6);
|
||||
const original = JSON.parse(f.manager.originalReport(f.session, job));
|
||||
assert.equal(original.owner.taskId, f.session.taskId); assert.equal(original.inputSha256, job.contractSha256);
|
||||
assert.ok(original.report.responses[2].error.message.includes(original.report.responses[2].parameters.sessionId));
|
||||
assert.deepEqual(fs.readFileSync(path.join(f.projectRoot, 'README.md')), originalBytes);
|
||||
assert.equal(f.store.core.task.get(f.session.taskId).usage.requests, 0); assert.equal(f.session.status, 'paused');
|
||||
assert.equal(f.audit().filter(value => value.type === 'wire' && value.value.method === 'session/prompt').length, 0);
|
||||
});
|
||||
|
||||
test('an invalid startup nonce is rejected before initialize and preserves the process close and partial report', async t => {
|
||||
const f = setup(t, { mode: 'bad-ready' }), job = await f.manager.start(f.session, { root: f.root }).promise;
|
||||
assert.equal(job.status, 'failed'); assert.match(job.summary, /启动完成信号/); assert.equal(job.report.trace.length, 0);
|
||||
assert.equal(job.report.cleanup.rootExited, true); assert.equal(f.audit().filter(value => value.type === 'wire').length, 0);
|
||||
assert.equal(f.manager.summary(f.session, job).evidence_verified, false);
|
||||
});
|
||||
|
||||
test('SDK identity and session directory mismatches retain raw responses and never become verified', async t => {
|
||||
for (const mode of ['wrong-version', 'wrong-cwd', 'malformed']) {
|
||||
const f = setup(t, { mode }), job = await f.manager.start(f.session, { root: f.root }).promise;
|
||||
assert.equal(job.status, 'failed', mode); assert.equal(job.verification, null); assert.ok(job.reportArtifactId);
|
||||
assert.equal(job.report.cleanup.rootExited, true); assert.equal(f.manager.summary(f.session, job).evidence_verified, false);
|
||||
if (mode !== 'malformed') assert.ok(job.report.responses.length);
|
||||
}
|
||||
});
|
||||
|
||||
test('cancel during a pending initialize closes only the owned process without sending an unsupported MCP cancellation', async t => {
|
||||
const f = setup(t, { mode: 'hang-init' }), started = f.manager.start(f.session, { root: f.root });
|
||||
await until(() => started.job.status === 'initializing' && f.audit().some(value => value.value?.method === 'initialize'));
|
||||
await f.manager.stop(f.session.id);
|
||||
const job = await started.promise;
|
||||
assert.equal(job.status, 'cancelled'); assert.equal(job.report.cleanup.rootExited, true);
|
||||
assert.equal(job.report.cleanup.pid, job.pid); assert.equal(job.requiresVerification, false);
|
||||
assert.equal(f.audit().filter(value => value.value?.method === 'notifications/cancelled').length, 0);
|
||||
assert.throws(() => f.manager.start(f.session, { root: f.root }), /重新验证/);
|
||||
});
|
||||
|
||||
test('cancel before readiness sends no protocol request and a user retry creates a different process and record', async t => {
|
||||
const f = setup(t, { mode: 'no-ready' }), started = f.manager.start(f.session, { root: f.root });
|
||||
await until(() => started.job.pid && f.audit().length);
|
||||
await f.manager.stop(f.session.id); assert.equal((await started.promise).status, 'cancelled');
|
||||
assert.equal(f.audit().filter(value => value.type === 'wire').length, 0);
|
||||
fs.writeFileSync(path.join(f.root, 'fixture-options.json'), '{}');
|
||||
const retry = await f.manager.start(f.session, { root: f.root, retry: true }).promise;
|
||||
assert.equal(retry.status, 'completed'); assert.notEqual(retry.id, started.job.id); assert.notEqual(retry.pid, started.job.pid);
|
||||
});
|
||||
|
||||
test('source or scratch changes and unexpected model traffic fail after preserving the actual observed result', async t => {
|
||||
for (const mode of ['change-input', 'change-workspace', 'model-request']) {
|
||||
const f = setup(t, { mode }), job = await f.manager.start(f.session, { root: f.root }).promise;
|
||||
assert.equal(job.status, 'failed', mode); assert.equal(job.report.cleanup.rootExited, true); assert.equal(job.verification, null);
|
||||
if (mode === 'model-request') { assert.equal(job.report.modelRequests, 1); assert.equal(job.report.providerRequests, 0); }
|
||||
assert.equal(f.session.changes.length, 0);
|
||||
}
|
||||
});
|
||||
|
||||
test('unowned idle notifications stay quarantined and server requests receive a rejection without granting operations', async t => {
|
||||
const f = setup(t, { mode: 'unowned-event' }), job = await f.manager.start(f.session, { root: f.root }).promise;
|
||||
assert.equal(job.status, 'completed'); assert.equal(job.report.notifications.length, 0); assert.equal(job.report.unownedNotifications.length, 1);
|
||||
assert.equal(f.store.core.task.get(f.session.taskId).status, 'paused');
|
||||
const reverse = setup(t, { mode: 'reverse-request' }), response = await reverse.manager.start(reverse.session, { root: reverse.root }).promise;
|
||||
assert.equal(response.status, 'completed'); assert.equal(response.report.rejectedServerRequests.length, 1);
|
||||
assert.ok(reverse.audit().some(value => value.value?.id === 'reverse-control' && value.value?.error?.code === -32601));
|
||||
assert.equal(reverse.session.approvals.length, 0); assert.equal(reverse.session.changes.length, 0);
|
||||
});
|
||||
|
||||
test('engine probe environment excludes parent secrets and NODE_OPTIONS while preserving operating system paths', async t => {
|
||||
const f = setup(t), previousSecret = process.env.OWNED_ENGINE_TEST_SECRET, previousOptions = process.env.NODE_OPTIONS;
|
||||
process.env.OWNED_ENGINE_TEST_SECRET = 'owned-non-credential-test'; process.env.NODE_OPTIONS = '--no-warnings';
|
||||
try {
|
||||
const job = await f.manager.start(f.session, { root: f.root }).promise; assert.equal(job.status, 'completed');
|
||||
const launch = f.audit()[0]; assert.equal(launch.secretInherited, false); assert.equal(launch.nodeOptionsInherited, false);
|
||||
} finally {
|
||||
if (previousSecret === undefined) delete process.env.OWNED_ENGINE_TEST_SECRET; else process.env.OWNED_ENGINE_TEST_SECRET = previousSecret;
|
||||
if (previousOptions === undefined) delete process.env.NODE_OPTIONS; else process.env.NODE_OPTIONS = previousOptions;
|
||||
}
|
||||
});
|
||||
|
||||
test('foreign sessions and altered reports or task bindings cannot reuse verified engine evidence', async t => {
|
||||
const f = setup(t), job = await f.manager.start(f.session, { root: f.root }).promise, other = f.store.createSession(f.project.id);
|
||||
assert.throws(() => f.manager.originalReport(other, job), /不属于/);
|
||||
const original = job.sdkSessionId; job.sdkSessionId = other.id;
|
||||
assert.equal(f.manager.summary(f.session, job).evidence_verified, false); assert.throws(() => f.manager.originalReport(f.session, job), /不一致/); job.sdkSessionId = original;
|
||||
const artifact = f.store.core.artifact.get(job.reportArtifactId), filename = path.join(f.store.artifactStore.root, artifact.relative);
|
||||
fs.appendFileSync(filename, 'tampered'); assert.equal(f.manager.summary(f.session, job).evidence_verified, false);
|
||||
assert.throws(() => f.manager.originalReport(f.session, job), /校验失败/);
|
||||
});
|
||||
|
||||
test('restart never replays an active engine check or stops a historical PID, and keeps prior task state', async t => {
|
||||
const f = setup(t), job = await f.manager.start(f.session, { root: f.root }).promise;
|
||||
const calls = f.audit().length; job.status = 'starting'; job.pid = process.pid; job.verification = null;
|
||||
f.store.putRecord('engine_job', f.session, job, 'fixture.crash_window'); f.store.close();
|
||||
const reopened = new Store(f.data); f.onCleanup(() => reopened.close());
|
||||
const saved = reopened.core.engine_job.get(job.id);
|
||||
assert.equal(saved.status, 'unknown'); assert.equal(saved.requiresVerification, true); assert.equal(saved.pid, process.pid);
|
||||
assert.equal(f.audit().length, calls); assert.equal(reopened.session(f.session.id).taskId, f.session.taskId);
|
||||
});
|
||||
|
||||
test('model argument validation and runtime activity do not grant external engine prompt or project execution', t => {
|
||||
const f = setup(t), runtime = new Runtime(f.store, new Provider());
|
||||
assert.doesNotThrow(() => validateToolArgs('inspect_engine_checks', {}));
|
||||
assert.throws(() => validateToolArgs('inspect_engine_checks', { root: f.root }), /当前任务/);
|
||||
assert.throws(() => validateToolArgs('engine_prompt', {}), /没有工具/);
|
||||
assert.throws(() => f.manager.start(f.session, { root: f.root, prompt: 'not accepted' }), /只接受/);
|
||||
runtime.engines = { active: new Map([[f.session.id, {}]]), isActive: id => id === f.session.id, projectActive: id => id === f.project.id };
|
||||
assert.equal(runtime.hasActivity(), true); assert.equal(runtime.isActive(f.session.id), true); assert.equal(runtime.projectHasActivity(f.project.id), true);
|
||||
assert.throws(() => runtime.start(f.session.id, 'fixture request'), /在执行/);
|
||||
});
|
||||
|
||||
test('a follow-up question receives the actual failed engine check from its original Task and keeps its report unchanged', async t => {
|
||||
const f = setup(t, { mode: 'bad-ready' }), job = await f.manager.start(f.session, { root: f.root }).promise;
|
||||
assert.equal(job.status, 'failed'); const originalReport = f.manager.originalReport(f.session, job), taskId = job.taskId;
|
||||
const provider = new Provider(); let requests = 0;
|
||||
provider.complete = async (_config, messages, _project, _signal, _progress, _plan, tools) => {
|
||||
requests++;
|
||||
assert.ok(tools.some(tool => tool.function.name === 'inspect_engine_checks'));
|
||||
if (requests === 1) return { message: { role: 'assistant', content: '', tool_calls: [
|
||||
{ id: 'owned-engine-question', type: 'function', function: { name: 'inspect_engine_checks', arguments: '{}' } },
|
||||
] }, usage: null };
|
||||
const result = JSON.parse(messages.filter(message => message.role === 'tool').at(-1).content), check = result.engine_checks[0];
|
||||
assert.equal(check.engine_job_id, job.id); assert.equal(check.task_id, taskId); assert.equal(check.engine_status, 'failed');
|
||||
assert.match(check.message, /启动完成信号/); assert.equal(check.report_sha256, job.reportSha256);
|
||||
return { message: { role: 'assistant', content: '当前任务的引擎启动完成信号与所属进程不一致,检查未通过;原进程已经关闭,原记录仍保留。' }, usage: null };
|
||||
};
|
||||
const runtime = new Runtime(f.store, provider); runtime.engines = f.manager;
|
||||
f.onCleanup(() => runtime.stopAll());
|
||||
runtime.start(f.session.id, '刚才的引擎连接检查为什么报错?'); await runtime.active.get(f.session.id).promise;
|
||||
assert.equal(f.session.taskId, taskId); assert.equal(f.session.status, 'completed'); assert.equal(requests, 2);
|
||||
assert.equal(f.manager.originalReport(f.session, job), originalReport); assert.match(f.session.messages.at(-1).content, /当前任务/);
|
||||
});
|
||||
@@ -19,6 +19,49 @@ function commandProvider(command) {
|
||||
return provider;
|
||||
}
|
||||
|
||||
test('a stop from the event loop interrupts immediate model replies before later tools', async t => {
|
||||
const f = fixture(t), provider = new Provider();
|
||||
let replies = 0, stopped;
|
||||
const runtime = new Runtime(f.store, provider); f.onCleanup(() => runtime.stopAll());
|
||||
provider.complete = async () => {
|
||||
replies++;
|
||||
if (replies === 1) setImmediate(() => { stopped = runtime.stop(f.session.id); });
|
||||
return { message: { role: 'assistant', content: 'Controlled immediate reply.',
|
||||
...(replies <= 6 ? { tool_calls: [call('immediate-' + replies, 'list_files', { path: '', depth: 1 })] } : {}) }, usage: null };
|
||||
};
|
||||
runtime.start(f.session.id, 'Inspect this owned fixture; allow an incoming stop to take effect.');
|
||||
await runtime.active.get(f.session.id).promise;
|
||||
await new Promise(resolve => setImmediate(resolve)); await stopped;
|
||||
assert.equal(f.session.status, 'paused', 'The event loop must process the stop before the task finishes.');
|
||||
assert.equal(replies, 1, 'A completed tool must be persisted before stop prevents the next model reply.');
|
||||
const tools = [...f.store.core.tool.values()].filter(value => value.sessionId === f.session.id);
|
||||
assert.equal(tools.length, 1); assert.equal(tools[0].state, 'completed');
|
||||
assert.equal(f.store.core.run.get(f.session.runId).stopReason, 'cancelled');
|
||||
assertToolPairs(f.session.providerMessages);
|
||||
});
|
||||
|
||||
test('a stop after the first tool preserves a complete interrupted multi-call protocol group', async t => {
|
||||
const f = fixture(t), provider = new Provider(), runtime = new Runtime(f.store, provider);
|
||||
f.onCleanup(() => runtime.stopAll());
|
||||
let scheduled = false, stopped;
|
||||
f.store.on('update', () => {
|
||||
if (!scheduled && f.session.events.some(value => value.toolCallId === 'fair-batch-0' && value.phase === 'completed')) {
|
||||
scheduled = true; setImmediate(() => { stopped = runtime.stop(f.session.id); });
|
||||
}
|
||||
});
|
||||
provider.complete = async () => ({ message: { role: 'assistant', content: 'Controlled immediate multi-tool reply.',
|
||||
tool_calls: Array.from({ length: 6 }, (_, index) => call('fair-batch-' + index, 'list_files', { path: '', depth: 1 })) }, usage: null });
|
||||
runtime.start(f.session.id, 'Inspect this fixture and accept a stop before later batched calls.');
|
||||
await runtime.active.get(f.session.id).promise;
|
||||
await new Promise(resolve => setImmediate(resolve)); await stopped;
|
||||
assert.equal(f.session.status, 'paused');
|
||||
const tools = [...f.store.core.tool.values()].filter(value => value.sessionId === f.session.id);
|
||||
assert.equal(tools.length, 6); assert.equal(tools[0].state, 'completed');
|
||||
assert.ok(tools.slice(1).every(value => value.state === 'interrupted' && !value.requiresVerification));
|
||||
assertToolPairs(f.session.providerMessages);
|
||||
assert.equal(f.session.providerMessages.filter(value => value.role === 'tool').length, 6);
|
||||
});
|
||||
|
||||
test('the compatible HTTP loop preserves call IDs, validates errors and waits before executing commands', async t => {
|
||||
const f = fixture(t);
|
||||
const command = 'node -e "require(\'node:fs\').writeFileSync(\'approved.txt\',\'ok\'); console.log(\'fixture-command\')"';
|
||||
|
||||
Reference in New Issue
Block a user