diff --git a/.gitattributes b/.gitattributes index 174aa448..2e6847e4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,6 +4,12 @@ *.png binary *.jpg binary *.ico binary +docs/vision-inputs-ae-evidence/** -text +docs/vision-inputs-ae-evidence/*.log binary +docs/vision-inputs-ae-evidence/**/*.log binary +docs/vision-inputs-*.json -text whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol +docs/vision-inputs-*.tap binary +docs/vision-inputs-*.txt binary docs/model-protocols-*.txt -text docs/companion-a-b-evidence/*.tap binary docs/companion-c-e-evidence/**/*.tap binary diff --git a/docs/INPUT-ATTACHMENTS.md b/docs/INPUT-ATTACHMENTS.md new file mode 100644 index 00000000..d99159f6 --- /dev/null +++ b/docs/INPUT-ATTACHMENTS.md @@ -0,0 +1,9 @@ +# 工程截图输入契约 + +1.18开发中。每个Task先支持一张PNG/JPEG,单图2MiB、解码上限16Mi像素。只接受用户主动选择的文件内容,不接受本机路径或远程URL。图片完整解码、PNG CRC/结束结构与尺寸通过,JPEG按EXIF方向归正;拒绝动态PNG和尾随负载。原字节/SHA与去元数据、最长边1024像素/768KiB的PNG发送副本分别保存。界面明确显示副本尺寸,原文件可下载。草稿属于会话/项目,发送时创建新的Task/Run引用,保留原draft与工件所属;同事务保存。移除仅作用于草稿,已发送的历史不会改写。 + +实际请求在当前Task注入一次发送副本,历史只存原附件引用;后续同Task请求保持同一图像身份。Chat使用image_url,Responses使用input_image,detail为high。所需vision能力从实际图像块推导,声明不替代验证;不兼容成员不能取得租约。图片不进入项目记忆和PWA壳缓存。 + +图像预留采用固定有界本地策略,并与文字估算、原请求字节及上游实际usage分列,不声称适用于所有品牌的精确计费。原参考:[OpenAI图片输入](https://developers.openai.com/api/docs/guides/images-vision),已实际读取;未知模型容量由用户按上游资料声明,不从名称自动提高。 + +中文工作台延续现有布局。在输入区上方放附件条,点击查看原图/发送副本,移除草稿后可刷新核对;执行历史显示绑定附件。预算暂停采用请求分解与同Task核对续接入口。独立页面或另开附件库会切断任务关系,本阶段不采用。手机权限与真实设备结论分别验收。 diff --git a/docs/QA-1.18.md b/docs/QA-1.18.md new file mode 100644 index 00000000..70eb3206 --- /dev/null +++ b/docs/QA-1.18.md @@ -0,0 +1,27 @@ +# 1.18 工程截图、视觉路由与同Task续接 + +开发基线0d1ab74,分支feat/vision-attachments-1.18。正式1.17/PID36552保持,所有新请求仅使用自有loopback固定响应服务。当前仍在验收,完整回归、独立发行、保留状态正式部署分别记录,不能用前置专项代替。 + +## A–C:附件输入与实际协议 + +PNG/JPEG原图完整解码,PNG逐块结束/CRC核对、JPEG扫描结构与EXIF方向归正;拒绝动态PNG、尾随负载、伪装、截断、超大编码或像素。原图2MiB/16Mi像素,发送副本去元数据并限制1024像素/768KiB,界面显示实际副本大小。每Task一张图,每会话最多8张草稿。草稿、撤回及已消费记录保留原所属;发送时创建新的Task/Run引用与工件记录,同SQLite事务保存,原文件不重写归属。 + +Chat image_url/Responses input_image实际HTTP每请求恰有一次图像,原providerMessages只有文字,原请求工件保留完整字节。模型池在租约前按vision需求排除未知/不支持成员,默认演示和未知legacy线路不能绕过。四色随机像素probe只验证一次合成图像识别,结论绑定连接/凭据修订,与工程推理效果分开。原图/副本在发送及核验时分别核对SHA和任务归属,热升级继续采用已有core新容器初始化及失败回滚。 + +首次专项24/30(含历史兼容),失败原件vision-core-first.log保留。产品问题是原实现试图改变持久draft工件归属,现改为新ID引用并保持数据库禁止移动约束;2MiB余数边界修正为413。测试另修正completion调用形状及中文拒绝断言。第二轮附件12/12通过。 + +## D:预算诊断及可核对续接 + +新Run预算暂停保存必需输入、请求格式/图像说明、目标与工程上下文、工具定义、历史依据、图像预留、响应/安全余量及Run/Task剩余。图片使用本地预留,不是厂商计费或任何品牌容量的硬保证。文字估算保持旧规则;原请求SHA仍涵盖完整Base64字节。 + +预览绑定原Task、Run、会话修订、配置/注册表/凭据身份、历史SHA和全部附件/实际工具。预览不调用模型;确认后在同Task新建Run,仅本次Run选择模型/预算,累计Task额度只能保留或明确增加。过期、篡改、容量被静默截小、修订变化和重复确认均拒绝;完成工具保留、未知结果仍须核对。五项专项最终5/5,原预算测试首次调用不存在的测试方法、第二轮封存比较误漏status的失败保留;后者修正后没有放宽封存校验。最终A–D合计17/17通过。 + +只读正式样本得到旧estimatedTokens=36771、旧记录未有新预算分解,且原公开样本没有可用的本次context-plan。不能把旧估算直接当必需输入,更不能补造旧暂停成因。新功能用独立含实际工具结果的Task复现并保存;未启动正式原任务。正式仍1.17/PID36552、17项目,连接和数据未修改。 + +## E:任务界面与手机观察 + +延续现有中文React工作台,在原输入上方添加截图、选择/撤回、预览和路由说明;原任务消息保留附件核对/下载,失败后任务文字及草稿保留。预算诊断在原会话内,通过预览和明确确认续接。手机仅按原项目观察权限查看当前Task截图、核对原字节和下载原图;不通过observe权限新增任务、上传或调整预算。 + +实际Edge桌面1440×1000、390×844及真实自有TLS网关的5组流程通过;首次UI失败源于QA修改全局配置会切回legacy、以及固定响应夹具误用旧Task工具结果,已按实际选路与最后用户消息修正。原失败与截图保留。回看发现预览曾显示被排除的池首成员,改为显示符合当前任务能力的成员,运行时间以分钟显示,窄屏移除/选择触控区域补强;修正后的结果单独记录。 + +构建通过。回看修正后第三轮5组完整UI再次通过,零pageerror;原失败未覆盖。相关兼容62/64原轮其余均通过,剩余2项为上述预算封存status问题,修正后5/5;完整整轮尚待F。新手机截图流程的Edge/TLS结果不当成iPhone实机,真实模型视觉工程与Purge收益继续按用户选择另行待验。A–E原件与字节身份见vision-inputs-ae-evidence/manifest.json。 diff --git a/docs/RETROSPECTIVE-1.18.md b/docs/RETROSPECTIVE-1.18.md new file mode 100644 index 00000000..29d5d685 --- /dev/null +++ b/docs/RETROSPECTIVE-1.18.md @@ -0,0 +1,17 @@ +# 1.18 阶段回顾 + +## A–D:维持原身份,再增加能力 + +附件输入首先是Task所属工程数据。数据库对持久记录归属不可移动的守卫阻止了初始实现,这是需要保持的约束;最终以新Task引用连接原字节,草稿和原工件身份均保持。真解码、方向、原图/发送副本SHA、视觉前选池和两协议实际HTTP一起验证;仅支持文件选择不能算工程视觉链路完成。 + +图像预算与普通文字估算分开,但实际请求仍封存全部字节。预算暂停必须解释限制来源,不能静默增大模型窗口或舍弃用户要求;同Task续接通过冻结预览、修订/容量核对和一次确认完成,旧结果和未知操作不自动重放。新专项17/17,原失败保留。 + +## E:回看内容,而不只看测试绿色 + +第一次成功流程的截图暴露预算预览显示了实际被排除的文字池成员;这会影响用户对发送对象的判断,因此改为列出符合本次任务能力的成员。保留原中文产品布局,不新增独立附件管理页面。手机沿用明确的观察/审批/停止权限,这次只添加观察数据,不让观察权限暗中变成上传或执行授权。 + +新Edge/窄屏/自有TLS流程与iPhone实机是不同证据;固定模型只检验协议和工程执行,不检验视觉推理水平。正式原任务只读复核,没有启动、改写或补造旧预算分解。 + +## F:尚待完成 + +完整历史回归、含附件工程交付、独立源码/便携/同载荷安装、原PID与所有数据保持升级、原生回看及证据封存仍是发行门槛。下一阶段计划应依据本阶段实际结果书写,不能把未完成项标成已交付。 diff --git a/docs/vision-inputs-ae-evidence/manifest.json b/docs/vision-inputs-ae-evidence/manifest.json new file mode 100644 index 00000000..e434b57f --- /dev/null +++ b/docs/vision-inputs-ae-evidence/manifest.json @@ -0,0 +1,246 @@ +{ + "stage": "1.18 A-E", + "realModelRequests": 0, + "entries": [ + { + "source": ".qa/vision-core-first.log", + "file": "vision-core-first.log", + "bytes": 12956, + "sha256": "aed4ba5d7809f9a4a977007fa0c8c9319e67b19a65f9afff7a96b4c9e4d4ba54" + }, + { + "source": ".qa/vision-core-second.log", + "file": "vision-core-second.log", + "bytes": 1593, + "sha256": "42c14555f38e05263a1491c2b276973de290db3272e8dc4d49e557a388664152" + }, + { + "source": ".qa/vision-budget-first.log", + "file": "vision-budget-first.log", + "bytes": 5962, + "sha256": "b48a9390baa1bcee64da60feb79ec73277e96073ebedd26294930740a0bbcd0b" + }, + { + "source": ".qa/vision-budget-third.log", + "file": "vision-budget-third.log", + "bytes": 818, + "sha256": "74d6fd0b1638c47aa371c40b1cf515709b14823662ec2ec2ccfdf5ccd80ed5f3" + }, + { + "source": ".qa/vision-compat-second.log", + "file": "vision-compat-second.log", + "bytes": 9266, + "sha256": "ccd33dc28ff6d99d32928ce7be31a6bbaff41e7d5f77974284b77b4a3fc1e90e" + }, + { + "source": ".qa/vision-ad-final.log", + "file": "vision-ad-final.log", + "bytes": 2295, + "sha256": "98bc56787e12cfe76f0ab2595dfcf3fb811183b40f4aad6f5fbe1a44a3795e0d" + }, + { + "source": ".qa/vision-ui-first.log", + "file": "vision-ui-first.log", + "bytes": 730, + "sha256": "29f931948910fee21fd81f43645b5202f567f0177b2c983cb9c384ec8a4b9793" + }, + { + "source": ".qa/vision-ui-second.log", + "file": "vision-ui-second.log", + "bytes": 624, + "sha256": "c71b644facc20cac3c38d6fdeababb2aae5475e38a1870ce7d1f8cb2b3dc33da" + }, + { + "source": ".qa/vision-ui-third.log", + "file": "vision-ui-third.log", + "bytes": 624, + "sha256": "e56ca23da0fc18a1a64ed7c52cbfa28be83381413b6602d78a8355ba5c47c1d4" + }, + { + "source": ".qa/vision-e-build.log", + "file": "vision-e-build.log", + "bytes": 978, + "sha256": "c31aadf039f42c9d0b0e592d77e16a05df5d19f78cedc1f84d675a276f0bd82d" + }, + { + "source": ".qa/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54/desktop-attached.png", + "file": "vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--desktop-attached.png", + "bytes": 88839, + "sha256": "e6fd08ee3360452e9240234ae720477fea0adf16be9dfb36c93afa96158540c9" + }, + { + "source": ".qa/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54/desktop-draft.png", + "file": "vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--desktop-draft.png", + "bytes": 101507, + "sha256": "8a8ebe249ad4d8f36c328f0b4fd7240d3cb1b5c0d710584d2c63d9d472245c1c" + }, + { + "source": ".qa/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54/downloaded-original.png", + "file": "vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--downloaded-original.png", + "bytes": 4864, + "sha256": "0f103ba6a48431e86d9257f0e147c1c36f68694038db2e22138c23dc3a90379b" + }, + { + "source": ".qa/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54/engineering-screenshot.png", + "file": "vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--engineering-screenshot.png", + "bytes": 4864, + "sha256": "0f103ba6a48431e86d9257f0e147c1c36f68694038db2e22138c23dc3a90379b" + }, + { + "source": ".qa/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54/failure-desktop.png", + "file": "vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--failure-desktop.png", + "bytes": 101204, + "sha256": "ac55b02ec54a6b53bc732f33005ace702136415a06dceae9adaa2a8577b97eb8" + }, + { + "source": ".qa/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54/forged.png", + "file": "vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--forged.png", + "bytes": 14, + "sha256": "c803805acb8f3a172061fddfe2cbba43f373f715b4ddf7f1d9a09fa683b1106f" + }, + { + "source": ".qa/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54/narrow-attached.png", + "file": "vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--narrow-attached.png", + "bytes": 41092, + "sha256": "9d6c4f37f0a0005622ddc7c7206449110307848c1fe0548ad30e964f94978213" + }, + { + "source": ".qa/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54/result.json", + "file": "vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--result.json", + "bytes": 1126, + "sha256": "8e52939cf6077d9c9a91029279f3b9c81375d716261c9dabaa74fba666aae811" + }, + { + "source": ".qa/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f/companion-image.png", + "file": "vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--companion-image.png", + "bytes": 28813, + "sha256": "62e7fe98ab6fb546a1ce26f4963d31f2ded3e4deab39c85fb82e2071dc4b8d7f" + }, + { + "source": ".qa/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f/desktop-attached.png", + "file": "vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-attached.png", + "bytes": 88762, + "sha256": "a6fb6598c81be53415789ea464557a02e4439662e84feae0835b4e1570eca8f4" + }, + { + "source": ".qa/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f/desktop-budget-preview.png", + "file": "vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-budget-preview.png", + "bytes": 153015, + "sha256": "71d22e2cfb2bd22c0d86e61a44cee92a02fef84fcb791332f9f269bb7650fccf" + }, + { + "source": ".qa/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f/desktop-draft.png", + "file": "vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-draft.png", + "bytes": 101507, + "sha256": "8a8ebe249ad4d8f36c328f0b4fd7240d3cb1b5c0d710584d2c63d9d472245c1c" + }, + { + "source": ".qa/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f/desktop-image-stopped.png", + "file": "vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-image-stopped.png", + "bytes": 97607, + "sha256": "4cb67e4873df723d3517554ac5b619ba1089b3d06a5d3d07e8fb53da254f9bde" + }, + { + "source": ".qa/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f/downloaded-original.png", + "file": "vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--downloaded-original.png", + "bytes": 4864, + "sha256": "0f103ba6a48431e86d9257f0e147c1c36f68694038db2e22138c23dc3a90379b" + }, + { + "source": ".qa/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f/engineering-screenshot.png", + "file": "vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--engineering-screenshot.png", + "bytes": 4864, + "sha256": "0f103ba6a48431e86d9257f0e147c1c36f68694038db2e22138c23dc3a90379b" + }, + { + "source": ".qa/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f/forged.png", + "file": "vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--forged.png", + "bytes": 14, + "sha256": "c803805acb8f3a172061fddfe2cbba43f373f715b4ddf7f1d9a09fa683b1106f" + }, + { + "source": ".qa/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f/narrow-attached.png", + "file": "vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--narrow-attached.png", + "bytes": 41045, + "sha256": "665ab6c42b3cb677ec276671b233043ae740ab96b4b85b9e808913f02578fb8c" + }, + { + "source": ".qa/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f/narrow-budget-preview.png", + "file": "vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--narrow-budget-preview.png", + "bytes": 56986, + "sha256": "47b1c815bd2ccb4f09b36e839daeb7050979b919e20ff1301168e1c0743ebb3b" + }, + { + "source": ".qa/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f/result.json", + "file": "vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--result.json", + "bytes": 2353, + "sha256": "5d661e71b905f08810c6d23f6dfa059631951154296fc8208490358196e46fb8" + }, + { + "source": ".qa/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb/companion-image.png", + "file": "vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--companion-image.png", + "bytes": 28857, + "sha256": "7e6f6b96356d5ce645753768c24ded4461bbe91886f333d6f93855a92a8910b9" + }, + { + "source": ".qa/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb/desktop-attached.png", + "file": "vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-attached.png", + "bytes": 88861, + "sha256": "5a68af81c3d5840b70734d7ac0d70d1fcf4c7fa9f140dbc5c8e1b9bae57fd93c" + }, + { + "source": ".qa/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb/desktop-budget-preview.png", + "file": "vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-budget-preview.png", + "bytes": 153635, + "sha256": "9dcafa4c334f96e937a1be354a14f764b4f4be39afbf3f7aad513ba2992aceb2" + }, + { + "source": ".qa/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb/desktop-draft.png", + "file": "vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-draft.png", + "bytes": 101507, + "sha256": "8a8ebe249ad4d8f36c328f0b4fd7240d3cb1b5c0d710584d2c63d9d472245c1c" + }, + { + "source": ".qa/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb/desktop-image-stopped.png", + "file": "vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-image-stopped.png", + "bytes": 97752, + "sha256": "808ffa499eedfd1652caa320ac52d2f7810502f2220a45dd5abe04437fc9d6cf" + }, + { + "source": ".qa/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb/downloaded-original.png", + "file": "vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--downloaded-original.png", + "bytes": 4864, + "sha256": "0f103ba6a48431e86d9257f0e147c1c36f68694038db2e22138c23dc3a90379b" + }, + { + "source": ".qa/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb/engineering-screenshot.png", + "file": "vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--engineering-screenshot.png", + "bytes": 4864, + "sha256": "0f103ba6a48431e86d9257f0e147c1c36f68694038db2e22138c23dc3a90379b" + }, + { + "source": ".qa/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb/forged.png", + "file": "vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--forged.png", + "bytes": 14, + "sha256": "c803805acb8f3a172061fddfe2cbba43f373f715b4ddf7f1d9a09fa683b1106f" + }, + { + "source": ".qa/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb/narrow-attached.png", + "file": "vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--narrow-attached.png", + "bytes": 41125, + "sha256": "566a9c9cc865fb823691ea642b9c91e4f8deb4568d92d920efaf9e641bf504b2" + }, + { + "source": ".qa/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb/narrow-budget-preview.png", + "file": "vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--narrow-budget-preview.png", + "bytes": 56640, + "sha256": "07415fab6f3423a16236467a00a6d999bccb87932a629717d03969b3f9ce64ea" + }, + { + "source": ".qa/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb/result.json", + "file": "vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--result.json", + "bytes": 2353, + "sha256": "6f15b489a0a0f8f2f2ee8e734ea3480e6e188da5c45f68e62cc195650330904b" + } + ] +} \ No newline at end of file diff --git a/docs/vision-inputs-ae-evidence/vision-ad-final.log b/docs/vision-inputs-ae-evidence/vision-ad-final.log new file mode 100644 index 00000000..a3ff5527 --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-ad-final.log @@ -0,0 +1,25 @@ +✔ a budget pause persists concrete text/tool/history/image breakdown and never dispatches an oversized request (3199.9803ms) +✔ explicit frozen preview resumes the same Task in a new Run, preserves completed tools and does not change global config or selected model (4197.9668ms) +✔ insufficient budgets, silently clamped capacity and arbitrary config fields reject without a physical request or mutating task budget (2584.9962ms) +✔ changed session, changed registry, expiry and altered frozen preview all require a new explicit preview (3142.2672ms) +✔ preview preserves unknown invocation status and increasing Task allowance is committed only with confirmed new Run (3974.6054ms) +✔ PNG bytes are fully decoded, metadata-free and bounded; JPEG EXIF orientation is applied to the sent PNG (103.3543ms) +✔ forged type, short headers, CRC damage, incomplete chunks, trailing payloads, animation and dimension bombs reject (23.9248ms) +✔ draft image ownership, withdrawal, reload and atomic Task binding retain original SHA and original bytes (1592.5941ms) +✔ a failed session transaction restores draft status and cannot leave a Run consuming the attachment (1137.8139ms) +✔ draft limits, duplicate selection, source changes and cross-Task association reject before dispatch (2041.3517ms) +✔ demo and legacy paths refuse image dispatch without creating a Task or consuming the draft (887.0133ms) +✔ chat-completions sends one owned image per actual request, pairs original tools and verifies exact sealed bytes (3034.6431ms) +✔ responses sends one owned image per actual request, pairs original tools and verifies exact sealed bytes (2892.3659ms) +✔ mixed pool excludes unknown vision before lease and sends zero HTTP to the incompatible member (2345.6865ms) +✔ vision probe requires correct randomized pixel order and evidence expires when the connection revision changes (1253.9727ms) +✔ HTTP upload/read/withdraw uses session authorization, returns byte SHA and refuses unknown ownership (1103.0949ms) +✔ image accounting excludes Base64 as text but seals every original request byte and reserves image input separately (2.3442ms) +ℹ tests 17 +ℹ suites 0 +ℹ pass 17 +ℹ fail 0 +ℹ cancelled 0 +ℹ skipped 0 +ℹ todo 0 +ℹ duration_ms 17227.4962 diff --git a/docs/vision-inputs-ae-evidence/vision-budget-first.log b/docs/vision-inputs-ae-evidence/vision-budget-first.log new file mode 100644 index 00000000..4f0cb9d8 --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-budget-first.log @@ -0,0 +1,72 @@ +✖ a budget pause persists concrete text/tool/history/image breakdown and never dispatches an oversized request (942.5897ms) +✖ explicit frozen preview resumes the same Task in a new Run, preserves completed tools and does not change global config or selected model (961.5493ms) +✖ insufficient budgets, silently clamped capacity and arbitrary config fields reject without a physical request or mutating task budget (1207.5803ms) +✖ changed session, changed registry, expiry and altered frozen preview all require a new explicit preview (1071.5479ms) +✖ preview preserves unknown invocation status and increasing Task allowance is committed only with confirmed new Run (1018.3573ms) +✔ PNG bytes are fully decoded, metadata-free and bounded; JPEG EXIF orientation is applied to the sent PNG (103.2372ms) +✔ forged type, short headers, CRC damage, incomplete chunks, trailing payloads, animation and dimension bombs reject (23.8496ms) +✔ draft image ownership, withdrawal, reload and atomic Task binding retain original SHA and original bytes (1743.7451ms) +✔ a failed session transaction restores draft status and cannot leave a Run consuming the attachment (1205.6103ms) +✔ draft limits, duplicate selection, source changes and cross-Task association reject before dispatch (2101.2044ms) +✔ demo and legacy paths refuse image dispatch without creating a Task or consuming the draft (687.6118ms) +✔ chat-completions sends one owned image per actual request, pairs original tools and verifies exact sealed bytes (2167.6013ms) +✔ responses sends one owned image per actual request, pairs original tools and verifies exact sealed bytes (1945.9025ms) +✔ mixed pool excludes unknown vision before lease and sends zero HTTP to the incompatible member (1614.9053ms) +✔ vision probe requires correct randomized pixel order and evidence expires when the connection revision changes (836.9181ms) +✔ HTTP upload/read/withdraw uses session authorization, returns byte SHA and refuses unknown ownership (703.0134ms) +✔ image accounting excludes Base64 as text but seals every original request byte and reserves image input separately (2.942ms) +ℹ tests 17 +ℹ suites 0 +ℹ pass 12 +ℹ fail 5 +ℹ cancelled 0 +ℹ skipped 0 +ℹ todo 0 +ℹ duration_ms 13384.0766 + +✖ failing tests: + +test at tests\budget-resume.test.mjs:19:1 +✖ a budget pause persists concrete text/tool/history/image breakdown and never dispatches an oversized request (942.5897ms) + TypeError [Error]: f.store.updateConfig is not a function + at paused (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/budget-resume.test.mjs:10:60) + at process.processTicksAndRejections (node:internal/process/task_queues:104:5) + at async TestContext. (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/budget-resume.test.mjs:20:11) + at async Test.run (node:internal/test_runner/test:1409:7) + at async startSubtestAfterBootstrap (node:internal/test_runner/harness:387:3) + +test at tests\budget-resume.test.mjs:27:1 +✖ explicit frozen preview resumes the same Task in a new Run, preserves completed tools and does not change global config or selected model (961.5493ms) + TypeError [Error]: f.store.updateConfig is not a function + at paused (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/budget-resume.test.mjs:10:60) + at process.processTicksAndRejections (node:internal/process/task_queues:104:5) + at async TestContext. (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/budget-resume.test.mjs:28:11) + at async Test.run (node:internal/test_runner/test:1409:7) + at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) + +test at tests\budget-resume.test.mjs:38:1 +✖ insufficient budgets, silently clamped capacity and arbitrary config fields reject without a physical request or mutating task budget (1207.5803ms) + TypeError [Error]: f.store.updateConfig is not a function + at paused (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/budget-resume.test.mjs:10:60) + at process.processTicksAndRejections (node:internal/process/task_queues:104:5) + at async TestContext. (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/budget-resume.test.mjs:39:11) + at async Test.run (node:internal/test_runner/test:1409:7) + at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) + +test at tests\budget-resume.test.mjs:44:1 +✖ changed session, changed registry, expiry and altered frozen preview all require a new explicit preview (1071.5479ms) + TypeError [Error]: f.store.updateConfig is not a function + at paused (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/budget-resume.test.mjs:10:60) + at process.processTicksAndRejections (node:internal/process/task_queues:104:5) + at async TestContext. (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/budget-resume.test.mjs:45:11) + at async Test.run (node:internal/test_runner/test:1409:7) + at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) + +test at tests\budget-resume.test.mjs:56:1 +✖ preview preserves unknown invocation status and increasing Task allowance is committed only with confirmed new Run (1018.3573ms) + TypeError [Error]: f.store.updateConfig is not a function + at paused (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/budget-resume.test.mjs:10:60) + at process.processTicksAndRejections (node:internal/process/task_queues:104:5) + at async TestContext. (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/budget-resume.test.mjs:57:11) + at async Test.run (node:internal/test_runner/test:1409:7) + at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) diff --git a/docs/vision-inputs-ae-evidence/vision-budget-third.log b/docs/vision-inputs-ae-evidence/vision-budget-third.log new file mode 100644 index 00000000..94ae95b2 --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-budget-third.log @@ -0,0 +1,13 @@ +✔ a budget pause persists concrete text/tool/history/image breakdown and never dispatches an oversized request (1877.4029ms) +✔ explicit frozen preview resumes the same Task in a new Run, preserves completed tools and does not change global config or selected model (2631.6384ms) +✔ insufficient budgets, silently clamped capacity and arbitrary config fields reject without a physical request or mutating task budget (1691.6229ms) +✔ changed session, changed registry, expiry and altered frozen preview all require a new explicit preview (2369.3845ms) +✔ preview preserves unknown invocation status and increasing Task allowance is committed only with confirmed new Run (2533.6439ms) +ℹ tests 5 +ℹ suites 0 +ℹ pass 5 +ℹ fail 0 +ℹ cancelled 0 +ℹ skipped 0 +ℹ todo 0 +ℹ duration_ms 11274.7023 diff --git a/docs/vision-inputs-ae-evidence/vision-compat-second.log b/docs/vision-inputs-ae-evidence/vision-compat-second.log new file mode 100644 index 00000000..0ac9f2cd --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-compat-second.log @@ -0,0 +1,101 @@ +✔ a budget pause persists concrete text/tool/history/image breakdown and never dispatches an oversized request (2997.0554ms) +✖ explicit frozen preview resumes the same Task in a new Run, preserves completed tools and does not change global config or selected model (3513.8586ms) +✔ insufficient budgets, silently clamped capacity and arbitrary config fields reject without a physical request or mutating task budget (3520.4991ms) +✔ changed session, changed registry, expiry and altered frozen preview all require a new explicit preview (3275.0687ms) +✖ preview preserves unknown invocation status and increasing Task allowance is committed only with confirmed new Run (3247.2136ms) +✔ pairing is short lived, single-use, generation-bound and validates exact permissions (965.5924ms) +✔ device transaction failure neither consumes the ticket nor leaves a credential (789.0047ms) +✔ devices have project and action boundaries; rotation, expiration, revocation and host changes reject old authority (1114.822ms) +✔ persistent registry stores hashes and a bounded audit, never raw credentials (1040.811ms) +✔ real TLS verifies IP SAN, CA chain, encrypted restart and public fingerprint (1273.6199ms) +✔ TLS sealing failure leaves listener closed and no plaintext or successful TLS registration (742.8388ms) +✔ HTTP pairing is concurrent single-use; secure cookie and strict origin/host checks (1093.9074ms) +✔ gateway never exposes management routes, arbitrary assets or unpaired project data (1121.7398ms) +✔ authorized project events paginate from original seq without leaking other project events or payloads (2176.9958ms) +✔ remote task projection excludes raw model history, host configuration, tool input and credentials (1064.2894ms) +✔ permission checks apply to direct remote mutation, not only UI controls (1064.1012ms) +✔ approval fingerprint and exact task/revision are bound; duplicate requests never execute twice (977.3428ms) +✔ unknown original operation is recorded and never replayed after response failure (1294.444ms) +✔ revocation and gateway closure reject old access without invoking runtime stop (1194.679ms) +✔ rate limits reject pairing brute force and do not persist candidate secrets (988.1917ms) +✔ real Windows CurrentUser DPAPI persists only a sealed CA and reopens it (2135.293ms) +✔ mobile approval executes the original Runtime command exactly once and rejects the later desktop decision (3246.1573ms) +✔ desktop rejection wins a concurrent mobile request and original command remains unexecuted (2258.763ms) +✔ phone stop waits for the original process exit and prevents later heartbeats and command replay (3645.9035ms) +✔ Run replacement during parent-stop wait is rejected rather than stopping the new Run (937.9841ms) +✔ diff pages preserve source SHA; report reads verify blobs and exclude unrelated artifact kinds (1484.4431ms) +✔ hot upgrade refuses an active gateway and restores closed gateway ownership on failure (923.7663ms) +✔ damaged device permissions or expiry fail closed and never overwrite the original registry (1138.4868ms) +✔ device revocation destroys its actual authenticated TLS connection (1193.174ms) +✔ companion observes only current Task screenshots, verifies original PNG bytes and loses access immediately on revoke (1513.6405ms) +✔ schema1 connections remain readable without inventing observed capabilities or migrating original state (1054.5251ms) +✔ protocol, unsupported capabilities and stream choice persist; client claims cannot forge verified evidence (794.7377ms) +✔ ability evidence belongs to exact connection and credential revision; unknown and unsupported reject required routing (0.2757ms) +✔ invalid declarations and inconsistent stream settings reject before registry, revision and credentials mutate (610.7537ms) +✔ saved engine budgets verify all Chat/Responses route variants and reject a mismatched output allowance (1215.7279ms) +✔ owned CC Switch SQLite imports the selected TOML Responses wire_api and leaves unknown clients untouched (1072.1526ms) +✔ Responses executes one original tool through Runtime, carries encrypted Items, reports raw usage and seals exact wire bytes (3025.5661ms) +✔ mixed-protocol pool keeps both actual variants and changes route on 429 without re-executing completed tools (3517.0097ms) +▶ Responses incomplete, failed, missing call identity and unsupported hosted outputs never dispatch a tool + ✔ Reject {"body":{"id":"resp_owned","status":"incomplete","output":[{"type":"function_call","id":"fc_partial" (2101.2162ms) + ✔ Reject {"body":{"id":"resp_owned","status":"failed","output":[{"type":"function_call","id":"fc_failed","cal (2247.4826ms) + ✔ Reject {"body":{"id":"resp_owned","status":"completed","output":[{"type":"function_call","id":"fc_bad","cal (2081.4415ms) + ✔ Reject {"body":{"id":"resp_owned","status":"completed","output":[{"type":"computer_call","id":"not-supporte (1807.2339ms) +✔ Responses incomplete, failed, missing call identity and unsupported hosted outputs never dispatch a tool (8238.5498ms) +▶ invalid JSON in a nonstream Chat or Responses tool group prevents every tool and pool replay + ✔ chat-completions (1856.2509ms) + ✔ responses (1984.9552ms) +✔ invalid JSON in a nonstream Chat or Responses tool group prevents every tool and pool replay (3841.6985ms) +✔ wire adapter preserves tool IDs but never passes Responses-private Items to Chat or another endpoint (0.1784ms) +✔ connection JSON import accepts explicit Responses protocol and continues to reject unknown protocols without reading client sessions (698.2482ms) +✔ HTTP download preserves original malformed SSE bytes and artifact SHA instead of decoding invalid UTF8 (2671.5639ms) +✔ real Chat SSE carries UTF8 and split tool JSON; Runtime executes only after DONE, stores partial progress and original usage (3549.964ms) +✔ Responses typed SSE validates original item identity, terminal data, raw usage and tool result pair (2055.8266ms) +✔ incomplete network stream retains unknown attempt and never automatically switches pool or dispatches fragment tools (1591.9915ms) +✔ stopping an active HTTP stream closes only original request and keeps partial text without executing tools (1387.9026ms) +✔ explicit streaming probe uses actual SSE despite unknown declaration and binds its own original attempt (634.4211ms) +✔ coalesced initial SSE events publish the latest partial state even when the upstream stays idle (1562.436ms) +✔ stream timeout closes the original HTTP response, preserves redacted capture and never retries (1006.5371ms) +✔ SSE accepts CR-only final event boundaries and retains exact invalid UTF8 bytes without dispatch (1.5802ms) +▶ stream parser rejects truncation, finish length, malformed JSON, duplicate sequence, changed final item and oversized data + ✔ reject 0 (0.4007ms) + ✔ reject 1 (0.2435ms) + ✔ reject 2 (0.2688ms) + ✔ reject 3 (5.7145ms) + ✔ reject 4 (0.1532ms) + ✔ reject 5 (0.1481ms) +✔ stream parser rejects truncation, finish length, malformed JSON, duplicate sequence, changed final item and oversized data (7.7568ms) +ℹ tests 64 +ℹ suites 0 +ℹ pass 62 +ℹ fail 2 +ℹ cancelled 0 +ℹ skipped 0 +ℹ todo 0 +ℹ duration_ms 50232.4162 + +✖ failing tests: + +test at tests\budget-resume.test.mjs:27:1 +✖ explicit frozen preview resumes the same Task in a new Run, preserves completed tools and does not change global config or selected model (3513.8586ms) + Error: 原任务、连接或预算预览已变化,请重新准备后确认。 + at fail (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/context/budget-resume.mjs:6:48) + at BudgetResume.verify (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/context/budget-resume.mjs:57:198) + at Runtime.resumeBudget (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/server/runtime.mjs:126:89) + at TestContext. (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/budget-resume.test.mjs:30:13) + at async Test.run (node:internal/test_runner/test:1409:7) + at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) { + status: 409 + } + +test at tests\budget-resume.test.mjs:56:1 +✖ preview preserves unknown invocation status and increasing Task allowance is committed only with confirmed new Run (3247.2136ms) + Error: 原任务、连接或预算预览已变化,请重新准备后确认。 + at fail (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/context/budget-resume.mjs:6:48) + at BudgetResume.verify (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/context/budget-resume.mjs:57:198) + at Runtime.resumeBudget (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/server/runtime.mjs:126:89) + at TestContext. (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/budget-resume.test.mjs:61:13) + at async Test.run (node:internal/test_runner/test:1409:7) + at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) { + status: 409 + } diff --git a/docs/vision-inputs-ae-evidence/vision-core-first.log b/docs/vision-inputs-ae-evidence/vision-core-first.log new file mode 100644 index 00000000..8e8d847c --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-core-first.log @@ -0,0 +1,158 @@ +✔ PNG bytes are fully decoded, metadata-free and bounded; JPEG EXIF orientation is applied to the sent PNG (104.6542ms) +✖ forged type, short headers, CRC damage, incomplete chunks, trailing payloads, animation and dimension bombs reject (23.5584ms) +✖ draft image ownership, withdrawal, reload and atomic Task binding retain original SHA and original bytes (1095.482ms) +✔ a failed session transaction restores draft status and cannot leave a Run consuming the attachment (1074.7241ms) +✔ draft limits, duplicate selection, source changes and cross-Task association reject before dispatch (2223.6267ms) +✔ demo and legacy paths refuse image dispatch without creating a Task or consuming the draft (1187.2725ms) +✖ chat-completions sends one owned image per actual request, pairs original tools and verifies exact sealed bytes (1283.0097ms) +✖ responses sends one owned image per actual request, pairs original tools and verifies exact sealed bytes (1008.3599ms) +✖ mixed pool excludes unknown vision before lease and sends zero HTTP to the incompatible member (1287.0283ms) +✖ vision probe requires correct randomized pixel order and evidence expires when the connection revision changes (1014.5866ms) +✔ HTTP upload/read/withdraw uses session authorization, returns byte SHA and refuses unknown ownership (1169.7763ms) +✔ image accounting excludes Base64 as text but seals every original request byte and reserves image input separately (2.2418ms) +✔ schema1 connections remain readable without inventing observed capabilities or migrating original state (855.9471ms) +✔ protocol, unsupported capabilities and stream choice persist; client claims cannot forge verified evidence (1193.9145ms) +✔ ability evidence belongs to exact connection and credential revision; unknown and unsupported reject required routing (0.7101ms) +✔ invalid declarations and inconsistent stream settings reject before registry, revision and credentials mutate (1018.1341ms) +✔ saved engine budgets verify all Chat/Responses route variants and reject a mismatched output allowance (1371.9733ms) +✔ owned CC Switch SQLite imports the selected TOML Responses wire_api and leaves unknown clients untouched (1416.8663ms) +✔ Responses executes one original tool through Runtime, carries encrypted Items, reports raw usage and seals exact wire bytes (3365.0207ms) +✔ mixed-protocol pool keeps both actual variants and changes route on 429 without re-executing completed tools (3263.2217ms) +▶ Responses incomplete, failed, missing call identity and unsupported hosted outputs never dispatch a tool + ✔ Reject {"body":{"id":"resp_owned","status":"incomplete","output":[{"type":"function_call","id":"fc_partial" (1190.0446ms) + ✔ Reject {"body":{"id":"resp_owned","status":"failed","output":[{"type":"function_call","id":"fc_failed","cal (1248.8223ms) + ✔ Reject {"body":{"id":"resp_owned","status":"completed","output":[{"type":"function_call","id":"fc_bad","cal (1388.761ms) + ✔ Reject {"body":{"id":"resp_owned","status":"completed","output":[{"type":"computer_call","id":"not-supporte (1198.4518ms) +✔ Responses incomplete, failed, missing call identity and unsupported hosted outputs never dispatch a tool (5027.5271ms) +▶ invalid JSON in a nonstream Chat or Responses tool group prevents every tool and pool replay + ✔ chat-completions (1340.444ms) + ✔ responses (1234.363ms) +✔ invalid JSON in a nonstream Chat or Responses tool group prevents every tool and pool replay (2575.3827ms) +✔ wire adapter preserves tool IDs but never passes Responses-private Items to Chat or another endpoint (0.1751ms) +✔ connection JSON import accepts explicit Responses protocol and continues to reject unknown protocols without reading client sessions (589.5139ms) +ℹ tests 30 +ℹ suites 0 +ℹ pass 24 +ℹ fail 6 +ℹ cancelled 0 +ℹ skipped 0 +ℹ todo 0 +ℹ duration_ms 20907.3335 + +✖ failing tests: + +test at tests\input-attachments.test.mjs:38:1 +✖ forged type, short headers, CRC damage, incomplete chunks, trailing payloads, animation and dimension bombs reject (23.5584ms) + AssertionError [ERR_ASSERTION]: The validation function is expected to return "true". Received false + + Caught error: + + Error: 图片编码或大小无效。 + at TestContext. (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/input-attachments.test.mjs:48:10) + at Test.runInAsyncScope (node:async_hooks:227:14) + at Test.run (node:internal/test_runner/test:1402:25) + at Test.processPendingSubtests (node:internal/test_runner/test:974:18) + at Test.postRun (node:internal/test_runner/test:1542:19) + at Test.run (node:internal/test_runner/test:1467:12) + at async startSubtestAfterBootstrap (node:internal/test_runner/harness:387:3) { + generatedMessage: true, + code: 'ERR_ASSERTION', + actual: Error: 图片编码或大小无效。 + at reject (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/context/input-attachments.mjs:6:57) + at validateImage (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/context/input-attachments.mjs:87:110) + at file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/input-attachments.test.mjs:48:21 + at getActual (node:assert:611:5) + at strict.throws (node:assert:759:24) + at TestContext. (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/input-attachments.test.mjs:48:10) + at Test.runInAsyncScope (node:async_hooks:227:14) + at Test.run (node:internal/test_runner/test:1402:25) + at Test.processPendingSubtests (node:internal/test_runner/test:974:18) + at Test.postRun (node:internal/test_runner/test:1542:19), + operator: 'throws', + diff: 'simple' + } + +test at tests\input-attachments.test.mjs:51:1 +✖ draft image ownership, withdrawal, reload and atomic Task binding retain original SHA and original bytes (1095.482ms) + AssertionError [ERR_ASSERTION]: The input did not match the regular expression /归属|所属|不存在/. Input: + + 'Error: 执行记录不属于当前会话。' + + at TestContext. (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/input-attachments.test.mjs:55:58) + at Test.runInAsyncScope (node:async_hooks:227:14) + at Test.run (node:internal/test_runner/test:1402:25) + at Test.processPendingSubtests (node:internal/test_runner/test:974:18) + at Test.postRun (node:internal/test_runner/test:1542:19) + at Test.run (node:internal/test_runner/test:1467:12) + at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) { + generatedMessage: true, + code: 'ERR_ASSERTION', + actual: Error: 执行记录不属于当前会话。 + at Store.owned (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/server/store.mjs:602:130) + at InputAttachments.get (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/context/input-attachments.mjs:115:39) + at InputAttachments.read (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/context/input-attachments.mjs:126:20) + at file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/input-attachments.test.mjs:55:77 + at getActual (node:assert:611:5) + at strict.throws (node:assert:759:24) + at TestContext. (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/input-attachments.test.mjs:55:58) + at Test.runInAsyncScope (node:async_hooks:227:14) + at Test.run (node:internal/test_runner/test:1402:25) + at Test.processPendingSubtests (node:internal/test_runner/test:974:18), + expected: /归属|所属|不存在/, + operator: 'throws', + diff: 'simple' + } + +test at tests\input-attachments.test.mjs:88:56 +✖ chat-completions sends one owned image per actual request, pairs original tools and verifies exact sealed bytes (1283.0097ms) + Error: 持久执行记录不能移动到其他任务或项目。 + at StateDatabase.writeRecords (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/storage/state-database.mjs:67:15) + at file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/storage/state-database.mjs:98:40 + at StateDatabase.transaction (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/storage/state-database.mjs:37:26) + at StateDatabase.save (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/storage/state-database.mjs:97:17) + at Store.save (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/server/store.mjs:363:36) + at Store.beginRun (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/server/store.mjs:483:10) + at Runtime.start (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/server/runtime.mjs:188:31) + at TestContext. (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/input-attachments.test.mjs:97:77) + at process.processTicksAndRejections (node:internal/process/task_queues:104:5) + at async Test.run (node:internal/test_runner/test:1409:7) + +test at tests\input-attachments.test.mjs:88:56 +✖ responses sends one owned image per actual request, pairs original tools and verifies exact sealed bytes (1008.3599ms) + Error: 持久执行记录不能移动到其他任务或项目。 + at StateDatabase.writeRecords (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/storage/state-database.mjs:67:15) + at file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/storage/state-database.mjs:98:40 + at StateDatabase.transaction (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/storage/state-database.mjs:37:26) + at StateDatabase.save (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/storage/state-database.mjs:97:17) + at Store.save (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/server/store.mjs:363:36) + at Store.beginRun (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/server/store.mjs:483:10) + at Runtime.start (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/server/runtime.mjs:188:31) + at TestContext. (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/input-attachments.test.mjs:97:77) + at process.processTicksAndRejections (node:internal/process/task_queues:104:5) + at async Test.run (node:internal/test_runner/test:1409:7) + +test at tests\input-attachments.test.mjs:106:1 +✖ mixed pool excludes unknown vision before lease and sends zero HTTP to the incompatible member (1287.0283ms) + Error: 持久执行记录不能移动到其他任务或项目。 + at StateDatabase.writeRecords (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/storage/state-database.mjs:67:15) + at file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/storage/state-database.mjs:98:40 + at StateDatabase.transaction (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/storage/state-database.mjs:37:26) + at StateDatabase.save (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/storage/state-database.mjs:97:17) + at Store.save (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/server/store.mjs:363:36) + at Store.beginRun (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/server/store.mjs:483:10) + at Runtime.start (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/server/runtime.mjs:188:31) + at TestContext. (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/input-attachments.test.mjs:112:11) + at process.processTicksAndRejections (node:internal/process/task_queues:104:5) + at async Test.run (node:internal/test_runner/test:1409:7) + +test at tests\input-attachments.test.mjs:117:1 +✖ vision probe requires correct randomized pixel order and evidence expires when the connection revision changes (1014.5866ms) + Error: 服务没有返回纯文本响应;未标为已验证。 + at error (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/models/model-hub.mjs:11:56) + at ModelHub.probe (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/src/core/models/model-hub.mjs:143:91) + at process.processTicksAndRejections (node:internal/process/task_queues:104:5) + at async TestContext. (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/input-attachments.test.mjs:125:3) + at async Test.run (node:internal/test_runner/test:1409:7) + at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) { + status: 400 + } diff --git a/docs/vision-inputs-ae-evidence/vision-core-second.log b/docs/vision-inputs-ae-evidence/vision-core-second.log new file mode 100644 index 00000000..7daf7d12 --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-core-second.log @@ -0,0 +1,20 @@ +✔ PNG bytes are fully decoded, metadata-free and bounded; JPEG EXIF orientation is applied to the sent PNG (103.3022ms) +✔ forged type, short headers, CRC damage, incomplete chunks, trailing payloads, animation and dimension bombs reject (23.319ms) +✔ draft image ownership, withdrawal, reload and atomic Task binding retain original SHA and original bytes (921.1045ms) +✔ a failed session transaction restores draft status and cannot leave a Run consuming the attachment (674.857ms) +✔ draft limits, duplicate selection, source changes and cross-Task association reject before dispatch (1182.5494ms) +✔ demo and legacy paths refuse image dispatch without creating a Task or consuming the draft (705.6051ms) +✔ chat-completions sends one owned image per actual request, pairs original tools and verifies exact sealed bytes (1862.306ms) +✔ responses sends one owned image per actual request, pairs original tools and verifies exact sealed bytes (2011.1684ms) +✔ mixed pool excludes unknown vision before lease and sends zero HTTP to the incompatible member (1429.9673ms) +✔ vision probe requires correct randomized pixel order and evidence expires when the connection revision changes (883.0318ms) +✔ HTTP upload/read/withdraw uses session authorization, returns byte SHA and refuses unknown ownership (724.9261ms) +✔ image accounting excludes Base64 as text but seals every original request byte and reserves image input separately (3.0494ms) +ℹ tests 12 +ℹ suites 0 +ℹ pass 12 +ℹ fail 0 +ℹ cancelled 0 +ℹ skipped 0 +ℹ todo 0 +ℹ duration_ms 10766.1508 diff --git a/docs/vision-inputs-ae-evidence/vision-e-build.log b/docs/vision-inputs-ae-evidence/vision-e-build.log new file mode 100644 index 00000000..4f6a8f8a --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-e-build.log @@ -0,0 +1,20 @@ + +> local-agent-workbench@1.17.0 build +> tsc --noEmit && vite build && node scripts/build-mobile.mjs && node scripts/build-server.mjs + +vite v7.3.7 building client environment for production... +transforming... +✓ 1729 modules transformed. +rendering chunks... +computing gzip size... +dist-client/.vite/manifest.json 0.55 kB │ gzip: 0.22 kB +dist-client/index.html 0.58 kB │ gzip: 0.40 kB +dist-client/mobile.html 0.82 kB │ gzip: 0.46 kB +dist-client/assets/mobile-CNDnI_ru.css 11.92 kB │ gzip: 3.12 kB +dist-client/assets/desktop-XQhtWX-k.css 138.56 kB │ gzip: 26.53 kB +dist-client/assets/mobile-DVWh54VU.js 24.31 kB │ gzip: 8.65 kB +dist-client/assets/x-Cc3T3VuL.js 225.51 kB │ gzip: 70.77 kB +dist-client/assets/desktop-DxyJCC9F.js 294.22 kB │ gzip: 83.36 kB +✓ built in 1.17s +Mobile shell built: 3 allowed assets; API and project data are never cached. +Server bundle built. diff --git a/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--companion-image.png b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--companion-image.png new file mode 100644 index 00000000..a2dc9461 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--companion-image.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-attached.png b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-attached.png new file mode 100644 index 00000000..4410cd2c Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-attached.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-budget-preview.png b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-budget-preview.png new file mode 100644 index 00000000..a031a6a5 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-budget-preview.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-draft.png b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-draft.png new file mode 100644 index 00000000..1b7771c8 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-draft.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-image-stopped.png b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-image-stopped.png new file mode 100644 index 00000000..30a41d14 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--desktop-image-stopped.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--downloaded-original.png b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--downloaded-original.png new file mode 100644 index 00000000..c6c0b539 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--downloaded-original.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--engineering-screenshot.png b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--engineering-screenshot.png new file mode 100644 index 00000000..c6c0b539 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--engineering-screenshot.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--forged.png b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--forged.png new file mode 100644 index 00000000..f8a3417e --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--forged.png @@ -0,0 +1 @@ +not a real PNG \ No newline at end of file diff --git a/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--narrow-attached.png b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--narrow-attached.png new file mode 100644 index 00000000..9517b902 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--narrow-attached.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--narrow-budget-preview.png b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--narrow-budget-preview.png new file mode 100644 index 00000000..03941980 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--narrow-budget-preview.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--result.json b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--result.json new file mode 100644 index 00000000..fb509cae --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb--result.json @@ -0,0 +1,49 @@ +{ + "success": true, + "version": "1.17.0", + "appRoot": "D:\\Ai-project\\REA逆向\\Agent-Workbench", + "passed": [ + "desktop upload, explicit route, refreshed draft, original download SHA, one paired tool and narrow task history", + "forged image rejects without losing task text or sending a model request", + "explicit budget preview and confirmation retain Task, attachment and completed tool while global capacity stays unchanged", + "paired TLS companion verifies same screenshot, refresh restores it and revoke clears project/image content", + "stopping screenshot SSE closes original HTTP and dispatches zero partial tools" + ], + "screenshots": [ + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb\\desktop-draft.png", + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb\\desktop-attached.png", + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb\\narrow-attached.png", + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb\\desktop-budget-preview.png", + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb\\narrow-budget-preview.png", + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb\\companion-image.png", + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb\\desktop-image-stopped.png" + ], + "requests": [ + { + "route": "/v1/responses", + "sha256": "53d125c9a125d4b4687dae6d7bb2a06ca4445b1dbfb15d933b0919c779f1dbcc", + "imageCount": 1 + }, + { + "route": "/v1/responses", + "sha256": "00ebfc2a3bebaeaab200e8d561f0f76ad01e69508437370450530ceb5f2b896c", + "imageCount": 1 + }, + { + "route": "/v1/responses", + "sha256": "762394eb8811ed1ca354fd99c46e980cbce18a0851923ba75d3e472a778d6cb2", + "imageCount": 1 + }, + { + "route": "/v1/responses", + "sha256": "7d358a6140bcb5d3684b1aec71606704c05e9e2e77d64f1c8e7a16fcb20a4a15", + "imageCount": 1 + }, + { + "route": "/v1/responses", + "sha256": "f364f9ba35c6f573a0b105b8ab984ceae02ab7f5b14d4195041a7ea8978c59e7", + "imageCount": 1 + } + ], + "pageErrors": [] +} \ No newline at end of file diff --git a/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--desktop-attached.png b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--desktop-attached.png new file mode 100644 index 00000000..77c9333d Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--desktop-attached.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--desktop-draft.png b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--desktop-draft.png new file mode 100644 index 00000000..1b7771c8 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--desktop-draft.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--downloaded-original.png b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--downloaded-original.png new file mode 100644 index 00000000..c6c0b539 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--downloaded-original.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--engineering-screenshot.png b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--engineering-screenshot.png new file mode 100644 index 00000000..c6c0b539 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--engineering-screenshot.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--failure-desktop.png b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--failure-desktop.png new file mode 100644 index 00000000..ec7fecbe Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--failure-desktop.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--forged.png b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--forged.png new file mode 100644 index 00000000..f8a3417e --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--forged.png @@ -0,0 +1 @@ +not a real PNG \ No newline at end of file diff --git a/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--narrow-attached.png b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--narrow-attached.png new file mode 100644 index 00000000..8da8dfc4 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--narrow-attached.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--result.json b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--result.json new file mode 100644 index 00000000..727497de --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54--result.json @@ -0,0 +1,15 @@ +{ + "success": false, + "error": "Error: Timed out waiting for test state.\n at until (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/helpers.mjs:39:38)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/scripts/verify-vision-ui.mjs:68:291", + "passed": [ + "desktop upload, explicit route, refreshed draft, original download SHA, one paired tool and narrow task history", + "forged image rejects without losing task text or sending a model request" + ], + "screenshots": [ + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54\\desktop-draft.png", + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54\\desktop-attached.png", + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54\\narrow-attached.png", + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54\\failure-desktop.png" + ], + "pageErrors": [] +} \ No newline at end of file diff --git a/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--companion-image.png b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--companion-image.png new file mode 100644 index 00000000..89f7ad1c Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--companion-image.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-attached.png b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-attached.png new file mode 100644 index 00000000..f1a9bb1c Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-attached.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-budget-preview.png b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-budget-preview.png new file mode 100644 index 00000000..1a83cd3c Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-budget-preview.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-draft.png b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-draft.png new file mode 100644 index 00000000..1b7771c8 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-draft.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-image-stopped.png b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-image-stopped.png new file mode 100644 index 00000000..1a2675e7 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--desktop-image-stopped.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--downloaded-original.png b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--downloaded-original.png new file mode 100644 index 00000000..c6c0b539 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--downloaded-original.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--engineering-screenshot.png b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--engineering-screenshot.png new file mode 100644 index 00000000..c6c0b539 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--engineering-screenshot.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--forged.png b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--forged.png new file mode 100644 index 00000000..f8a3417e --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--forged.png @@ -0,0 +1 @@ +not a real PNG \ No newline at end of file diff --git a/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--narrow-attached.png b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--narrow-attached.png new file mode 100644 index 00000000..df8dec48 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--narrow-attached.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--narrow-budget-preview.png b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--narrow-budget-preview.png new file mode 100644 index 00000000..61038442 Binary files /dev/null and b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--narrow-budget-preview.png differ diff --git a/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--result.json b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--result.json new file mode 100644 index 00000000..bf1fe6e6 --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f--result.json @@ -0,0 +1,49 @@ +{ + "success": true, + "version": "1.17.0", + "appRoot": "D:\\Ai-project\\REA逆向\\Agent-Workbench", + "passed": [ + "desktop upload, explicit route, refreshed draft, original download SHA, one paired tool and narrow task history", + "forged image rejects without losing task text or sending a model request", + "explicit budget preview and confirmation retain Task, attachment and completed tool while global capacity stays unchanged", + "paired TLS companion verifies same screenshot, refresh restores it and revoke clears project/image content", + "stopping screenshot SSE closes original HTTP and dispatches zero partial tools" + ], + "screenshots": [ + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f\\desktop-draft.png", + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f\\desktop-attached.png", + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f\\narrow-attached.png", + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f\\desktop-budget-preview.png", + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f\\narrow-budget-preview.png", + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f\\companion-image.png", + "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f\\desktop-image-stopped.png" + ], + "requests": [ + { + "route": "/v1/responses", + "sha256": "78d6e369fedfba0b639a1186c553461f6020cf3d4d36ab0fd2e86993d1660ec1", + "imageCount": 1 + }, + { + "route": "/v1/responses", + "sha256": "6aa8d7007e6c5a9f09c035338da8525bf7fada9e51b8e996534382389a49b0da", + "imageCount": 1 + }, + { + "route": "/v1/responses", + "sha256": "65839702be1224f7cbf72336d3144bdf777e8e842bcc025273a3377624658ba9", + "imageCount": 1 + }, + { + "route": "/v1/responses", + "sha256": "2409e8e8885dae045496f918a8b35ac1d3b8aecd40e525dd16102a468c9e2c34", + "imageCount": 1 + }, + { + "route": "/v1/responses", + "sha256": "aaa78d531d2f8bac75ee9be8889c46276a3f8da36fd0069e5bbcf99aeb5461cf", + "imageCount": 1 + } + ], + "pageErrors": [] +} \ No newline at end of file diff --git a/docs/vision-inputs-ae-evidence/vision-ui-first.log b/docs/vision-inputs-ae-evidence/vision-ui-first.log new file mode 100644 index 00000000..a5ba13a0 --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-ui-first.log @@ -0,0 +1,13 @@ +PASS desktop upload, explicit route, refreshed draft, original download SHA, one paired tool and narrow task history +PASS forged image rejects without losing task text or sending a model request +EVIDENCE D:\Ai-project\REA逆向\Agent-Workbench\.qa\vision-ui-69df73a3-f93c-47fe-af3a-aa7f336d0e54 +node:internal/modules/run_main:107 + triggerUncaughtException( + ^ + +Error: Timed out waiting for test state. + at until (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/helpers.mjs:39:38) + at process.processTicksAndRejections (node:internal/process/task_queues:104:5) + at async file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/scripts/verify-vision-ui.mjs:68:291 + +Node.js v24.22.1 diff --git a/docs/vision-inputs-ae-evidence/vision-ui-second.log b/docs/vision-inputs-ae-evidence/vision-ui-second.log new file mode 100644 index 00000000..5340a5ae --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-ui-second.log @@ -0,0 +1,6 @@ +PASS desktop upload, explicit route, refreshed draft, original download SHA, one paired tool and narrow task history +PASS forged image rejects without losing task text or sending a model request +PASS explicit budget preview and confirmation retain Task, attachment and completed tool while global capacity stays unchanged +PASS paired TLS companion verifies same screenshot, refresh restores it and revoke clears project/image content +PASS stopping screenshot SSE closes original HTTP and dispatches zero partial tools +EVIDENCE D:\Ai-project\REA逆向\Agent-Workbench\.qa\vision-ui-b2426469-35ac-4e5a-83ef-2f8c0260276f diff --git a/docs/vision-inputs-ae-evidence/vision-ui-third.log b/docs/vision-inputs-ae-evidence/vision-ui-third.log new file mode 100644 index 00000000..3a8ea8fc --- /dev/null +++ b/docs/vision-inputs-ae-evidence/vision-ui-third.log @@ -0,0 +1,6 @@ +PASS desktop upload, explicit route, refreshed draft, original download SHA, one paired tool and narrow task history +PASS forged image rejects without losing task text or sending a model request +PASS explicit budget preview and confirmation retain Task, attachment and completed tool while global capacity stays unchanged +PASS paired TLS companion verifies same screenshot, refresh restores it and revoke clears project/image content +PASS stopping screenshot SSE closes original HTTP and dispatches zero partial tools +EVIDENCE D:\Ai-project\REA逆向\Agent-Workbench\.qa\vision-ui-0354cc03-2cb2-4456-ac32-f87cd11b63cb diff --git a/findings.md b/findings.md index b1cd2790..bacd3cd7 100644 --- a/findings.md +++ b/findings.md @@ -721,3 +721,10 @@ Responses已采用typed Items、call_id原配对和同线路加密reasoning续 1.17.0完整本地交付:Chat/Responses实际协议、有界SSE、完整工具组核验、能力选池、显式检测与原请求证据已实现。独立源码558/558、25类191组历史UI、随包原生窗口7项/原生流程9组/桌面三工程16节点、Responses三工程13节点及两套父Node8/8、React9/9、Python10/10通过;源码与便携各7组伴随端/5组新协议界面、同载荷隔离安装/重启/卸载7组、正式20页通过。正式PID36552/Provider保持,17项目/30全部会话/2590记录/4653事件,全部表每行/会话导出/工件原字节保持;1455条工件及1366个去重文件核对通过,9229关闭。公开模型中心仅增加逐项核对的默认能力字段,原存储不迁移。正式手机网关继续关闭、无设备/证书,未迁入QA身份。真实模型工程/Purge收益继续按用户选择单列待验,本轮真实模型请求0;1.17没有新增iPhone实机流式结论。 新协议不能只改Provider;实际请求预算、引擎完成核验、导入、能力筛选、原字节下载及主窗口选路必须共用同一契约。模型声明不替代实际检测,增量片段不替代终结结果。下一步按PLAN-1.18先用原证据审查任务上下文暂停,再接工程附件/视觉。 + + +## 1.18起步 + +1.17已完成;当前完整请求预算按实际JSON字节估算,图片base64不能直接当文字token。采用所属附件引用存历史,仅在请求计划中解析原字节为Chat/Responses图像块,SHA仍封存完整实际正文;预算另列图像保守预留与真实usage。原暂停表明输入估算36,771高于16,000声明容量,需具体分解及同Task显式调整,不盲目提高配置。OpenAI官方images-vision已实际读取,data URL图像块与detail以原文为依据。 + +1.18恢复审查:Store.ensureStorage已按新core kind创建新容器,旧core保留可回滚,不需要历史写入迁移。输入附件绑定改为与run.started同一会话事务。恢复时多文件大批读取两次截断和一次猜测budgets路径失败;后续限定真实路径/小段。一次补丁因hot-upgrade长行锚点不匹配整批拒绝,已确认无部分写入并用准确短锚点修正。PNG/JPEG初始实现尚未通过验收。 diff --git a/package-lock.json b/package-lock.json index 9e933827..075a4d25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,8 +11,10 @@ "@babel/parser": "7.29.11", "@peculiar/x509": "3.1.0", "diff": "^8.0.2", + "jpeg-js": "0.4.4", "lucide-react": "^0.548.0", "playwright": "1.64.1", + "pngjs": "7.0.0", "qrcode": "1.5.4", "react": "^19.2.0", "react-dom": "^19.2.0", @@ -1976,6 +1978,12 @@ "node": ">=8" } }, + "node_modules/jpeg-js": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", + "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==", + "license": "BSD-3-Clause" + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -2169,12 +2177,12 @@ } }, "node_modules/pngjs": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", - "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-7.0.0.tgz", + "integrity": "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==", "license": "MIT", "engines": { - "node": ">=10.13.0" + "node": ">=14.19.0" } }, "node_modules/postcss": { @@ -2233,6 +2241,15 @@ "node": ">=10.13.0" } }, + "node_modules/qrcode/node_modules/pngjs": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", + "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/react": { "version": "19.3.1", "resolved": "https://registry.npmjs.org/react/-/react-19.3.1.tgz", diff --git a/package.json b/package.json index 11e00d20..a0100c00 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,10 @@ "@babel/parser": "7.29.11", "@peculiar/x509": "3.1.0", "diff": "^8.0.2", + "jpeg-js": "0.4.4", "lucide-react": "^0.548.0", "playwright": "1.64.1", + "pngjs": "7.0.0", "qrcode": "1.5.4", "react": "^19.2.0", "react-dom": "^19.2.0", diff --git a/progress.md b/progress.md index dbd1f7a4..5a405b2c 100644 --- a/progress.md +++ b/progress.md @@ -841,3 +841,13 @@ F冻结前:Responses三工程13节点和父8/8/9/9/10/10、25类191组历史UI 最终不可变Agent-Workbench-1.17.0-win-x64-20261031150548103,来源a72dc0fbc1f3430f46b12ba0b1dbbe2c457056d8;封存659份原件/119368154字节。所有冻结输入/构建/原基准保持,文档/回顾/能力矩阵与下一1.18方案已同步。正式安装只stage/upgrade/activate各一次,后续为只读核对与原生回看。准备最终本地Git提交及独立ACCEPTANCE说明,不推送远端。 最终收尾复核:659份原件/119368154字节与Git暂存原字节严格一致,170份证据JSON、15份文档的342个本地链接、23份执行器语法及387输入/22构建/40基准全部通过。正式原生1.17窗口与模型中心已实际回看,窗口保留开启,原用户任务/空输入/既有预算暂停保持;未触发模型请求。封存首轮目录筛选失败在写入前停止,原失败/脚本保持,seal-retry成功及终结日志另有收据;产品验收与升级未重跑。最终文档、回顾、能力矩阵和1.18方案准备本地提交,之后生成绑定最终commit的独立ACCEPTANCE说明。 + + +## 2026-11-01 1.18启动 + +干净基线0d1ab74,分支feat/vision-attachments-1.18。沿用planning-with-files/product-ui-ux/frontend-design并核对官方视觉协议。session-catchup无额外记录。首次只读猜测src/ui、src/mobile、server/server及model-protocols路径失败,已用rg定位client/mobile、app和core/models/protocols;大输出截断后改限定段。一次计划补丁因progress标题猜测被整批拒绝,无部分写入,改为已知task_plan锚点与追加日志。正式配置未动。 + +1.18 A–C首次专项24/30,原失败保存在.qa/vision-core-first.log:发现实际数据库禁止将已保存draft工件移到Task,因此采用新ID的Task绑定记录/原工件引用、原draft标consumed,同事务提交并保留原身份,不放宽数据库约束。2MB余数边界的HTTP状态已修正;三个fixture错误调用completion与中文归属断言已修正。第二轮附件12/12全部通过,两协议各2真实loopback请求/1实际工具、原请求SHA、vision前选池、四色合成probe均通过。仍不是实际模型视觉效果结论。 +初次构建npm子脚本拾取系统Node16失败,已使用进程局部PATH指向固定Node24.22.1;第二轮构建通过。全局Node和正式PID未更改。后续预算/手机/UI专项与发行仍待验。 + +1.18 A–E回顾完成:附件12/12、预算5/5及最新联合17/17通过,桌面/390px/自有TLS新UI第三轮5组通过。原core/预算/UI失败及最终原件封存docs/vision-inputs-ae-evidence,原持久归属/预算status/QA选路/旧Task夹具原因分别记录。实际回看补正被排除池首模型的预览文案、分钟单位与窄屏触控区域;全部构建通过。正式只读确认1.17/PID36552/17项目,真实模型0请求。A–E本地Git保存后继续F工程/完整回归及发行,不将待验项称交付。 diff --git a/scripts/verify-vision-ui.mjs b/scripts/verify-vision-ui.mjs new file mode 100644 index 00000000..fa63aee8 --- /dev/null +++ b/scripts/verify-vision-ui.mjs @@ -0,0 +1,89 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import http from 'node:http'; +import https from 'node:https'; +import assert from 'node:assert/strict'; +import { createHash,randomUUID,X509Certificate } from 'node:crypto'; +import { chromium,expect } from 'playwright/test'; +import { fixture,launchWorkbench,until } from '../tests/helpers.mjs'; +import { requestImages } from '../src/shared/contracts/model-request.mjs'; +import { PNG } from 'pngjs'; + +if(process.argv.includes('--help')){console.log('node scripts/verify-vision-ui.mjs [--app-root ] — owned image HTTP, desktop/390px upload/history/download, exact Task budget resume, TLS companion read/revoke and original SSE stop. No configured model calls or iPhone claim.');process.exit(0);} +const args=process.argv.slice(2);assert.ok(!args.length||args.length===2&&args[0]==='--app-root'&&path.isAbsolute(args[1])); +const appRoot=fs.realpathSync.native(args[1]??process.cwd()),directory=path.resolve('.qa','vision-ui-'+randomUUID());fs.mkdirSync(directory,{recursive:true}); +const disposers=[],t={after:fn=>disposers.push(fn)},f=fixture(t);f.store.close(); +const requests=[],sockets=new Set(),held=new Set();let mode='success',closed=0; +const message=text=>({type:'message',role:'assistant',content:[{type:'output_text',text}]}),result=output=>({status:'completed',output,usage:{input_tokens:200,output_tokens:30,total_tokens:230}}); +const model=http.createServer(async(req,res)=>{try{ + const chunks=[];for await(const chunk of req)chunks.push(chunk);const body=JSON.parse(Buffer.concat(chunks));requests.push({route:req.url,body}); + assert.ok(requestImages(body).length===1,'one screenshot per request'); + assert.notEqual(body.model,'text-only','text member must never dispatch'); + if(mode==='hold'){ + assert.equal(body.stream,true);res.writeHead(200,{'Content-Type':'text/event-stream'}); + res.write('data: '+JSON.stringify({type:'response.output_text.delta',sequence_number:0,delta:'截图正在核对;参数尚未完整。'})+'\n\n'); + held.add(res);res.on('close',()=>{held.delete(res);closed++;});return; + } + const latestUser=body.input.findLastIndex(value=>value.role==='user'&&typeof value.content==='string'); + const output=body.input.slice(latestUser+1).some(value=>value.type==='function_call_output')?[message('原截图与实际工程读取结果已经核对。')] + :[{type:'function_call',call_id:'image-files-'+requests.length,name:'list_files',arguments:'{"path":"","depth":1}'}]; + res.writeHead(200,{'Content-Type':'application/json'});res.end(JSON.stringify(result(output))); +}catch(error){res.writeHead(500,{'Content-Type':'application/json'});res.end(JSON.stringify({error:{message:error.message}}));}}); +model.on('connection',socket=>{sockets.add(socket);socket.on('close',()=>sockets.delete(socket));});await new Promise(resolve=>model.listen(0,'127.0.0.1',resolve)); +const host=await launchWorkbench(t,f.data,{}, {appRoot,nodePath:args.length?path.join(appRoot,'runtime/node.exe'):process.execPath});assert.notEqual(new URL(host.url).port,'4318'); +const browser=await chromium.launch({channel:'msedge',headless:true}),page=await browser.newPage({viewport:{width:1440,height:1000}}),passed=[],screenshots=[],errors=[]; +page.on('pageerror',error=>errors.push(error.message));const get=()=>host.api('/sessions/'+f.session.id),mark=value=>{passed.push(value);console.log('PASS '+value);}; +const sha=bytes=>createHash('sha256').update(bytes).digest('hex'); +async function shot(target,name){const file=path.join(directory,name+'.png');await target.screenshot({path:file});screenshots.push(file);assert.ok(await target.locator('body').evaluate(node=>node.scrollWidth<=innerWidth),'page overflow '+name);} +let gateway,relay,cookie='',mobile; +try{ + const raw=new PNG({width:1280,height:720});for(let y=0;y<720;y++)for(let x=0;x<1280;x++)raw.data.set(x>900?[190,60,50,255]:[28,76,74,255],(y*1280+x)*4); + const imageFile=path.join(directory,'engineering-screenshot.png');fs.writeFileSync(imageFile,PNG.sync.write(raw)); + const baseUrl='http://127.0.0.1:'+model.address().port+'/v1'; + const vision=await host.api('/model-center/connections',{name:'截图验收 Responses',model:'owned-vision',protocol:'responses',baseUrl,requiresKey:false,contextLimit:64000,capabilityDeclarations:{vision:'supported'}}); + const center=await host.api('/model-center'),visionId=vision.id??center.connections.find(row=>row.name==='截图验收 Responses').id; + await host.api('/model-center/connections',{name:'纯文本排除样本',model:'text-only',baseUrl,requiresKey:false,contextLimit:64000}); + const textId=(await host.api('/model-center')).connections.find(row=>row.model==='text-only').id; + const pool=await host.api('/model-center/pools',{name:'视觉验收池',members:[{connectionId:textId},{connectionId:visionId}]}); + const poolId=pool.id??(await host.api('/model-center')).pools.find(row=>row.name==='视觉验收池').id; + await host.api('/model-center/select',{type:'pool',id:poolId}); + await page.addInitScript(({projectId,sessionId})=>{localStorage.setItem('awb-project',projectId);localStorage.setItem('awb-session',sessionId);},{projectId:f.project.id,sessionId:f.session.id}); + await page.goto(host.url);await page.waitForLoadState('networkidle'); + await page.getByLabel('任务内容',{exact:true}).fill('根据这张截图核对当前工程,保留原工具结果。'); + await page.getByLabel('选择工程截图',{exact:true}).setInputFiles(imageFile);await expect(page.locator('.input-draft')).toContainText('SHA-256 已核对'); + await expect(page.locator('.input-route')).toContainText('视觉验收池');await shot(page,'desktop-draft'); + await page.getByRole('button',{name:'查看截图 engineering-screenshot.png',exact:true}).click();const dialog=page.getByRole('dialog');await expect(dialog).toContainText('1280 × 720'); + const downloadPromise=page.waitForEvent('download');await dialog.getByRole('button',{name:'下载原图',exact:true}).click();const download=await downloadPromise,file=path.join(directory,'downloaded-original.png');await download.saveAs(file);assert.equal(sha(fs.readFileSync(file)),sha(fs.readFileSync(imageFile)));await page.keyboard.press('Escape'); + await page.reload();await expect(page.locator('.input-draft')).toContainText('SHA-256 已核对');await page.locator('.input-draft input[type=checkbox]').check(); + await page.getByLabel('任务内容',{exact:true}).fill('根据截图核对工程。');await page.getByRole('button',{name:'发送任务',exact:true}).click();await until(async()=>(await get()).status==='completed',15000); + let session=await get();assert.equal(requests.length,2);assert.equal(session.execution.progress.completedTools,1);assert.equal(session.inputAttachments.filter(row=>row.status==='attached').length,1); + await expect(page.locator('.message-user .input-receipt')).toContainText('SHA-256 已核对');await shot(page,'desktop-attached');await page.setViewportSize({width:390,height:844});await shot(page,'narrow-attached');await page.setViewportSize({width:1440,height:1000}); + mark('desktop upload, explicit route, refreshed draft, original download SHA, one paired tool and narrow task history'); + const invalid=path.join(directory,'forged.png');fs.writeFileSync(invalid,'not a real PNG');await page.getByLabel('任务内容',{exact:true}).fill('失败后保留输入');await page.getByLabel('选择工程截图',{exact:true}).setInputFiles(invalid);await expect(page.locator('.toast')).toContainText('类型不符');await expect(page.getByLabel('任务内容',{exact:true})).toHaveValue('失败后保留输入');assert.equal(requests.length,2);mark('forged image rejects without losing task text or sending a model request'); + // Reuse the actual completed tool group in the same Task after a deliberate + // insufficient context resume; no completed tool is requested again. + // Completed Tasks are immutable history. Start a new screenshot Task, stop at + // one tool round, then exercise budget continuation within that Task. + await host.api('/config',{...host.bootstrap.config,mode:'compatible',model:'unused',baseUrl,contextLimit:16000,maxSteps:1}); + await host.api('/model-center/select',{type:'pool',id:poolId}); + await page.reload();await page.getByLabel('选择工程截图',{exact:true}).setInputFiles(imageFile);await expect(page.locator('.input-draft')).toContainText('SHA-256 已核对');await page.getByLabel('任务内容',{exact:true}).fill('截图任务预算续接验收');await page.getByRole('button',{name:'发送任务',exact:true}).click();await until(async()=>(await get()).status==='paused',15000); + const original=await get(),taskId=original.execution.task.id,count=requests.length; + await host.api('/config',{...(await host.api('/bootstrap')).config,contextLimit:1000});await host.api('/model-center/select',{type:'pool',id:poolId});await host.api('/sessions/'+f.session.id+'/resume',{});await until(async()=>(await get()).execution.run.budgetPause,15000); + await page.reload();await expect(page.getByLabel('任务预算诊断')).toContainText('图像本地预留');await page.getByRole('button',{name:'核对预算并续接原任务',exact:true}).click(); + await dialog.getByLabel('上下文窗口',{exact:true}).fill('64000');await dialog.getByLabel('新Run工具轮次',{exact:true}).fill('3');await dialog.getByRole('button',{name:'准备续接预览',exact:true}).click();await expect(dialog.locator('.budget-preview')).toContainText('保留 1 项完成工具、1 张附件');assert.equal(requests.length,count);await shot(page,'desktop-budget-preview'); + await page.setViewportSize({width:390,height:844});await shot(page,'narrow-budget-preview');await dialog.getByRole('button',{name:'确认预算并续接',exact:true}).click();await until(async()=>(await get()).status==='completed',15000); + session=await get();assert.equal(session.execution.task.id,taskId);assert.equal(session.execution.progress.completedTools,1);assert.equal(requests.length,count+1);assert.equal((await host.api('/bootstrap')).config.contextLimit,1000);await page.setViewportSize({width:1440,height:1000});mark('explicit budget preview and confirmation retain Task, attachment and completed tool while global capacity stays unchanged'); + const initial=await host.api('/companion'),reservation=http.createServer();assert.ok(initial.addresses.length);await new Promise(resolve=>reservation.listen(0,initial.addresses[0].address,resolve));const port=reservation.address().port;await new Promise(resolve=>reservation.close(resolve)); + await host.api('/companion/start',{address:initial.addresses[0].address,port});gateway=await host.api('/companion');const certificate=await fetch(host.url+'/api/companion/certificate',{headers:{'X-Workbench-Token':host.bootstrap.token}}),ca=new X509Certificate(Buffer.from(await certificate.arrayBuffer())).toString(),target=new URL(gateway.origin); + const ticket=await host.api('/companion/pair',{projectIds:[f.project.id],permissions:{observe:true,approve:false,stop:false},expiresInHours:1}); + relay=http.createServer((request,response)=>{const forwarded=https.request(new URL(request.url,target),{method:request.method,ca,servername:'',headers:{Host:target.host,Origin:target.origin,Connection:'close',...(cookie?{Cookie:cookie}:{}),...(request.headers['content-type']?{'Content-Type':request.headers['content-type']}:{})}},incoming=>{if(incoming.headers['set-cookie']?.length)cookie=incoming.headers['set-cookie'][0].split(';')[0];const headers={...incoming.headers};delete headers['set-cookie'];response.writeHead(incoming.statusCode,headers);incoming.pipe(response);});forwarded.on('error',()=>response.destroy());request.pipe(forwarded);});await new Promise(resolve=>relay.listen(0,'127.0.0.1',resolve)); + mobile=await browser.newPage({viewport:{width:390,height:844},isMobile:true,hasTouch:true});mobile.on('pageerror',error=>errors.push(error.message));await mobile.goto('http://127.0.0.1:'+relay.address().port+'/#pair='+new URLSearchParams(new URL(ticket.url).hash.slice(1)).get('pair'));await mobile.getByRole('button',{name:'连接这台电脑',exact:true}).click();await mobile.locator('.mobile-task-row').first().click(); + await expect(mobile.locator('.mobile-input-image')).toContainText('SHA-256 已核对');await mobile.locator('.mobile-input-image summary').click();await shot(mobile,'companion-image');await mobile.reload();await expect(mobile.locator('.mobile-task-row').first()).toBeVisible();await mobile.locator('.mobile-task-row').first().click();await expect(mobile.locator('.mobile-input-image')).toContainText('SHA-256 已核对'); + const device=(await host.api('/companion')).devices.find(row=>row.status==='active');await host.api('/companion/devices/'+device.id+'/revoke',{revision:device.revision});await mobile.getByRole('button',{name:'刷新任务',exact:true}).click();await expect(mobile.locator('.mobile-input-image')).toHaveCount(0);await expect(mobile.getByRole('button',{name:'连接这台电脑',exact:true})).toBeVisible();mark('paired TLS companion verifies same screenshot, refresh restores it and revoke clears project/image content'); + await host.api('/companion/close',{});gateway=null; + await host.api('/config',{...(await host.api('/bootstrap')).config,contextLimit:16000,maxSteps:3}); + const connection=(await host.api('/model-center')).connections.find(row=>row.id===visionId);await host.api('/model-center/connections',{...connection,streaming:true,capabilityDeclarations:{...connection.capabilityDeclarations,streaming:'supported'}});await host.api('/model-center/select',{type:'connection',id:visionId});mode='hold'; + await page.reload();await page.getByLabel('选择工程截图',{exact:true}).setInputFiles(imageFile);await expect(page.locator('.input-draft')).toContainText('SHA-256 已核对');await page.getByLabel('任务内容',{exact:true}).fill('截图流式停止验收');await page.getByRole('button',{name:'发送任务',exact:true}).click();await expect(page.getByLabel('模型输出片段',{exact:true}).last()).toContainText('截图正在核对');const stopping=await get();await page.getByRole('button',{name:'停止',exact:true}).click();await until(async()=>(await get()).status==='paused'&&closed===1,15000);session=await get();assert.equal(session.events.filter(row=>row.kind==='tool'&&row.runId===stopping.runId).length,0);await shot(page,'desktop-image-stopped');mark('stopping screenshot SSE closes original HTTP and dispatches zero partial tools'); + assert.deepEqual(errors,[]);fs.writeFileSync(path.join(directory,'result.json'),JSON.stringify({success:true,version:host.bootstrap.version,appRoot,passed,screenshots,requests:requests.map(value=>({route:value.route,sha256:sha(JSON.stringify(value.body)),imageCount:requestImages(value.body).length})),pageErrors:errors},null,2)); +}catch(error){await shot(page,'failure-desktop').catch(()=>{});if(mobile)await shot(mobile,'failure-mobile').catch(()=>{});fs.writeFileSync(path.join(directory,'result.json'),JSON.stringify({success:false,error:error.stack,passed,screenshots,pageErrors:errors},null,2));throw error; +}finally{console.log('EVIDENCE '+directory);await browser.close();if(relay)await new Promise(resolve=>{relay.closeAllConnections();relay.close(resolve);});if(gateway)await host.api('/companion/close',{});for(const response of held)response.destroy();for(const socket of sockets)socket.destroy();await new Promise(resolve=>model.close(resolve));for(const dispose of disposers.reverse())await dispose();} diff --git a/src/client/App.tsx b/src/client/App.tsx index 5fc7d0c9..92710dc7 100644 --- a/src/client/App.tsx +++ b/src/client/App.tsx @@ -17,6 +17,8 @@ import { WorkerPanel } from './WorkerPanel'; import { DesktopPanel } from './DesktopPanel'; import { CompanionPanel } from './CompanionPanel'; import { desktop } from './desktop'; +import { AttachmentComposer,InputImage } from './InputAttachments'; +import { BudgetPausePanel } from './BudgetPausePanel'; const activeStates = ['running', 'awaiting_approval', 'stopping']; const activeMcpStates = ['queued', 'connecting', 'discovering', 'calling', 'closing', 'stopping']; @@ -53,6 +55,7 @@ export default function App() { const [draft, setDraft] = useState(''); const [composer, setComposer] = useState(''); const [sending, setSending] = useState(false); + const [imageSelection,setImageSelection]=useState<{sessionId:string;ids:string[]}>({sessionId:'',ids:[]}); const [creatingSession, setCreatingSession] = useState(false); const [tab, setTab] = useState<'file' | 'changes' | 'trace' | 'task' | 'index'>('file'); const [changeId, setChangeId] = useState(''); @@ -249,9 +252,9 @@ export default function App() { try { const target = session || await newSession(); if (!target) return; - acceptSession(await api('/sessions/' + target.id + '/messages', { content })); + acceptSession(await api('/sessions/' + target.id + '/messages', { content,attachmentIds:imageSelection.sessionId===target.id?imageSelection.ids:[] })); if (selectedSessionRef.current === target.id) { - setComposer(previous => previous.trim() === content ? '' : previous); composerRef.current?.focus(); + setComposer(previous => previous.trim() === content ? '' : previous); setImageSelection({sessionId:target.id,ids:[]}); composerRef.current?.focus(); } } catch (error) { failure(error); } finally { setSending(false); } @@ -557,9 +560,10 @@ export default function App() { {session?.recoveryNotice &&
已恢复会话记录

{session.recoveryNotice}

} {entries.map(entry => 'message' in entry && entry.message ?
{entry.message.role === 'user' ? '你' : entry.message.role === 'assistant' ? 'AW' : '·'}
{entry.message.role === 'user' ? '你的任务' : entry.message.role === 'assistant' ? session?.executionMode === 'demo' ? '演示执行器' : '编程助手' : '工作台'}
{entry.message.role === 'system' && failureForMessage(entry.message) ? openDiagnostics()} onRetry={session?.status === 'failed' && session?.failure?.messageId === entry.message.id ? () => resumeSession() : undefined} busy={resuming || isRunning} /> - : entry.message.role === 'assistant' ? : entry.message.content}
: 'event' in entry && entry.event ?
{['tool', 'model'].includes(entry.event.kind) ? <> { setEventId(entry.event!.id); showInspector('trace'); }} /> :
{entry.event.label}{entry.event.output &&

{entry.event.output}

}
}
: null)} + : entry.message.role === 'assistant' ? : entry.message.content}{entry.message.attachmentIds?.map(id=>{const image=session?.inputAttachments?.find(value=>value.id===id);return image&&session?:null;})} : 'event' in entry && entry.event ?
{['tool', 'model'].includes(entry.event.kind) ? <> { setEventId(entry.event!.id); showInspector('trace'); }} /> :
{entry.event.label}{entry.event.output &&

{entry.event.output}

}
}
: null)} {isRunning && !approval &&
{session?.executionMode === 'demo' ? '正在执行演示流程' : '正在处理任务'}
} } + {session&&} {approval &&
{approval.browserPlanId ? '确认实际页面检查' : approval.checkPlanId ? '确认工程检查' : '确认这次终端执行'}

{approval.reason}

{approval.command}
{approval.checkScripts?.filter(check => check.python).map(check =>

Python {check.python!.runtime.version || '执行时核对版本'} · {check.python!.runtime.logicalExecutable || check.python!.runtime.executable || '解释器缺失'}

)}
{approval.cwd}

{approval.shell || '项目终端'} · UTF-8

{approval.browserPlanId ? '按封存步骤操作当前构建,保存页面原结果。' : '确认后以你的系统权限执行。'}

} @@ -567,7 +571,7 @@ export default function App() { {canContinueReview && }
-