feat: add project index and exact patch review
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Agent Workbench 能力目标与验收矩阵
|
||||
|
||||
日期:2026-10-29。1.0.0为基础里程碑,1.1.0实现M1,1.2.0实现首个内置Git交付切片。下表保留1.0.0缺口与完整产品目标;每项完成范围以实际验证记录为准。
|
||||
日期:2026-10-29。1.0.0为基础里程碑,1.1.0实现M1,1.2.0实现首个内置Git交付切片,1.3.0增加工程索引和精确补丁。下表保留1.0.0缺口与完整产品目标;每项完成范围以实际验证记录为准。
|
||||
|
||||
总体方案见 [PRODUCT-PLAN.md](PRODUCT-PLAN.md),研究问题与来源见 [RESEARCH-ROADMAP.md](RESEARCH-ROADMAP.md)。
|
||||
|
||||
@@ -28,6 +28,13 @@
|
||||
- C11/C24:源码与Git基线分别验证,检查日志完整性和测试数量仍须满足;92项完整行为检查、9组桌面/390px交付界面通过。
|
||||
- C08、多类工程与完整M2/M6成功率仍待后续实施。范围见[QA-1.2](QA-1.2.md)与[Git交付契约](GIT-DELIVERY.md)。
|
||||
|
||||
### 1.3.0 M2工程定位与精确补丁切片
|
||||
|
||||
- C03/C04:JS/TS/React静态AST声明与导入、Python声明候选、逐文件SHA256增量复用、依赖候选重算与当前项目绑定;工具工件有Task/Run归属。暂不提供编译器级引用、路径别名或动态模块解析。
|
||||
- C08:唯一锚点/原SHA256的局部补丁、BOM和LF/CRLF保留、旧基线与重叠/重复锚点拒绝;继续由逐文件审查/备份流程应用,完整多文件ChangeSet仍待实现。
|
||||
- C07/C23:只读Git检查禁用配置过滤脚本,统一清单排除依赖/凭据/链接;索引范围、格式、Unicode、项目切换、原文件行定位、工件恢复和API契约有实际检查。
|
||||
- 完整112项行为/API/实际退出检查通过,新索引UI8组通过;源码/发行与真实模型工程验收以[验收记录](VALIDATION.md)为准。详见[索引与补丁契约](CODE-INDEX-AND-PATCHES.md)。React/Python真实工程交付、worktree和完整M2/M6仍继续实施。
|
||||
|
||||
| ID / 能力 | 当前1.0.0基础与缺口 | 后续产品目标 | 参考问题 / 模块 / 阶段 | 必须看到的验收证据 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| C01 需求与任务规划 | 有对话和有限步数工具循环,没有任务依赖图 | 固定目标、约束和完成标准;拆任务、判断依赖、接收追加要求与重规划 | CX-1、WB-1 / tasks / M1–M2 | 追加要求后仍保留原目标;任务完成由验收条件决定 |
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# 工程索引与精确补丁契约 · 1.3.0
|
||||
|
||||
本切片将工程声明定位与局部编辑接入工作台已有的任务、审核、实际检查和Git交付。来源机制映射到C03/C04/C08;自有实现、契约检查与真实模型结果分别保存。
|
||||
|
||||
## 索引范围与依据
|
||||
|
||||
`ProjectIndex`为当前项目重新核对有界文件快照,并按每个文件SHA256复用或更新分析结果。导入目标候选每次重算,新增/删除文件也会改变结果。缓存最多8个项目,项目ID和真实根目录共同隔离;目前每次仍核对文件内容,没有后台文件监听或语义向量检索。
|
||||
|
||||
JS/TS/JSX/TSX/MTS/CTS采用MIT许可的`@babel/parser 7.29.11`,登记函数、类、方法、顶层变量、TS类型/接口/枚举与静态导出;导入、重导出、字面动态导入、字面require调用和TS import-equals来自语法节点。相对路径只比较当前范围的文件候选,包含JS→TS和MJS/CJS→MTS/CTS;有实际文件时优先该文件。候选附目标SHA256和`runtimeResolution: not_verified`,路径别名、调用绑定和动态参数仍需进一步分析。
|
||||
|
||||
Python采用移除注释/字符串体并识别缩进及声明的有界候选定位。结果明确显示`python-declaration-candidate`,保留行、名称、文件SHA256,使用前读取实际源码。没有执行Python代码,也没有进行Python编译器、完整引用或类型分析。
|
||||
|
||||
快照最多1000个候选文件/16MB;常规读取单文件最多1MB,声明分析最多256000字节,每文件300个符号/80000个AST节点,结果最多6000个符号与6000个导入。损坏文本、解析错误、读取/分析超限、无法确定静态目标的导入和不完整快照都显示范围。无匹配只表示当前查询范围;Go/Rust/Vue等暂保留文件指纹。
|
||||
|
||||
Git工程遵循ignore,常见依赖/生成目录、常见凭据、链接和子模块工作区排除。Git status可能运行配置的clean/process脚本,因此先只读取配置键名并在本次状态查询禁用这些脚本;未能确认配置时不声称基线完整。运行命令仍走原有独立确认流程。
|
||||
|
||||
## 使用与工件
|
||||
|
||||
- `index_project`:摘要、覆盖范围、增量计数和有限示例;完整索引成为当前Task/Run的SHA256工件。
|
||||
- `query_code`:按名称/路径查找all/symbols/imports/files,查询最多200字,结果1–60条,附实际文件、行、SHA256和依据。
|
||||
- 项目只读API:`GET /api/projects/:id/code-index`、`GET /api/projects/:id/code-query`。单独浏览索引无需创建Task;模型执行保存任务工件。
|
||||
- 右侧「索引」可查找并打开原文件行。打开时重新读取文件;SHA256已变化时显示当前内容和刷新提示,清除旧行高亮。滚动限于代码容器,切换项目忽略旧请求返回。
|
||||
|
||||
## 精确编辑
|
||||
|
||||
`propose_patch`及`POST /api/sessions/:id/patch-proposals`要求现有文件路径、读取时64位SHA256、说明和1–32个`old_text`/`new_text`替换。非空锚点须在同一原文中恰好出现一次,全部范围不得重叠;输入顺序不会改变匹配基线。重叠、重复、未找到、过期SHA256、NUL和无效Unicode拒绝,空改动不产生提案。
|
||||
|
||||
统一LF/CRLF按原文件格式匹配与生成替换;混合换行按原文严格匹配。UTF-8 BOM单独保留。提案记录基线和结果SHA256、格式、替换数、原行范围及锚点/替换SHA256,保留未选中内容。新文件继续使用完整文本提案。
|
||||
|
||||
提案只保存到工作台,不写入工程;用户查看差异后应用。应用前再次核对实际文件基线,备份原字节并写入建议内容,冲突保留外部修改。精确补丁沿用逐文件状态,不提供多文件原子应用、改名/删除或worktree合并。长文件差异可定位首处实际改动,应用后的检查/提交仍由已有Task契约负责。
|
||||
|
||||
## 验证与剩余工作
|
||||
|
||||
源码检查覆盖实际AST行与导出、Python候选/多行签名、项目隔离、增量更新/删除与目标重算、MTS/CTS候选、过滤脚本不执行、损坏/大文件范围、BOM/CRLF/混合格式、唯一/重叠锚点、Unicode、冲突、Task工件/API与恢复。完整112项通过,见[m2-index-tests-validation.json](m2-index-tests-validation.json)。
|
||||
|
||||
界面验收包含独立浏览、长文件行定位、旧SHA、延迟项目请求、Python/导入依据、实际审查应用、390px及失败重试。真实模型使用四模块封存验收,源码增加420行受保护说明,其中两个模块有BOM/CRLF,要求仅定位正文并提交精确补丁;结果随[VALIDATION](VALIDATION.md)保存。完整多类工程、ChangeSet/worktree、引擎适配、桌面端/手机配对继续按产品计划开发。
|
||||
@@ -144,8 +144,8 @@ Purge的包声明Apache-2.0,另有商业许可联系说明;Harness声明MIT
|
||||
|
||||
## 9. 下一轮最先执行的三个开发切片
|
||||
|
||||
1. 定义Task/Run/Step/Event/Tool/Artifact契约,将现有模型循环的状态从UI会话表述中拆出;先保留兼容层。
|
||||
2. 抽象Storage,给JSON→SQLite迁移和崩溃/重放边界建立可验证样本;同时生成首批真实工程任务基准。
|
||||
3. 实现工程识别、TestRunner检查计划/planId/jobId/结果及Git基线,完成一个“跨文件修改→实际测试→修复→diff→提交”的最小工程交付。
|
||||
1. 1.1.0的Task/Run/工件/SQLite及1.2.0的检查/Git/report切片已交付;1.3.0继续完成工程索引和精确补丁,按独立包与长文件真实模型验收发布。
|
||||
2. 下一批实现多文件ChangeSet与可恢复应用、任务工作区/worktree隔离,再完成React/TypeScript及Python专用检查与封存任务;当前单Node样本不计为三类工程完成。
|
||||
3. 在写入/取消/事件归属边界稳定后按M3接入REA及Codex/DeepSeek EngineAdapter的契约探针,分别固定Harness/Purge/profile版本,再比较真实同题工程收益。桌面Electron与手机配对网关复用同一执行宿主,按M5推进。
|
||||
|
||||
这些切片优先复用已验证的文件范围、基线备份、UTF-8、取消与诊断能力。研究结论每次至少绑定一个实现模块、一个契约检查和一个用户场景,按实际失败分类持续调整顺序。
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# 1.3.0工程索引与精确补丁验收
|
||||
|
||||
本轮交付当前项目的JS/TS/React静态声明与导入索引、Python声明候选、原SHA256与唯一锚点的精确补丁,接入实际工程检查、审核、Git和报告。完整多文件ChangeSet、React/Python专用检查器、隔离worktree与引擎/桌面/手机配对继续按产品计划实施。
|
||||
|
||||
| 用户可见行为 | 实际检查 | 已验证结果 |
|
||||
| --- | --- | --- |
|
||||
| 工程声明与导入能定位真实源码 | AST行/导出、Python候选、MTS/CTS、动态目标范围 | 112项完整行为/API/进程恢复全部通过 |
|
||||
| 索引增量更新且项目隔离 | 原SHA256复用、增加/删除目标重算、缓存隔离 | 文件变化返回新符号与目标,不污染旧证据 |
|
||||
| 只读工程检查保持只读范围 | Git过滤脚本探针、ignore/依赖/凭据/链接 | 未执行配置的clean脚本,Git索引字节保留 |
|
||||
| 精确补丁先审核再写入 | BOM/LF/CRLF/混合格式、Unicode、唯一/重叠锚点 | 提案不写入;冲突保留owner字节,应用备份原字节 |
|
||||
| 结果打开实际文件行 | 181→184行、旧SHA不高亮、容器内滚动 | 输入和顶部保持可见 |
|
||||
| 切换项目及失败处理 | 延迟旧响应、部分覆盖、失败重试 | 旧响应忽略,旧结果禁用并可恢复 |
|
||||
| 长文件审查与手机宽度 | 首处实际修改、五标签、指纹换行、390px | 新索引8组及原有35组界面通过 |
|
||||
|
||||
基础10/诊断9/任务7/Git交付9/索引8共43组界面全部通过,页面/请求异常为零。结构化结果分别为[m2-index-tests-validation.json](m2-index-tests-validation.json)、[基础](m2-index-basic-ui-validation.json)、[诊断](m2-index-diagnostics-ui-validation.json)、[任务](m2-index-execution-ui-validation.json)、[Git交付](m2-index-delivery-ui-validation.json)和[索引](m2-index-index-ui-validation.json)。
|
||||
|
||||
桌面及390px的索引、文件行与精确差异截图已目视核对,见[screenshots](screenshots/1.3-index-desktop.png)。初始两项Windows Node HTTP连接重置已独立复验并采用有限QA请求独立连接,完整112项最终回归全部通过;没有自动重试副作用请求。
|
||||
|
||||
便携包、独立源码安装/构建、原进程升级与真实模型长文件精确交付的最终结果汇总到[VALIDATION](VALIDATION.md)。真实模型样本增加420行受保护说明及两种BOM/换行格式,要求用索引定位正文、仅读取必要源码并提出精确补丁,沿原Task完成14项测试、Git和报告;不由单个样本推断完整M2/M6成功率。
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"success": true,
|
||||
"url": "http://127.0.0.1:52944",
|
||||
"browser": "Microsoft Edge 156.0.4314.42",
|
||||
"date": "2026-10-29T09:53:02.565Z",
|
||||
"projectRoot": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\ui-79c795e4-ec52-40a9-aebf-aee109426e81\\ui-project",
|
||||
"viewports": [
|
||||
1440,
|
||||
780,
|
||||
390
|
||||
],
|
||||
"passed": [
|
||||
"project selection and real file preview",
|
||||
"real command consent, execution and stale snapshot rejection",
|
||||
"diff review and verified file application",
|
||||
"manual editor creates a reviewable proposal",
|
||||
"file responses stay with the current selection",
|
||||
"denial, session selection, reload, stale response rejection and export",
|
||||
"project inventory responses cannot replace another project",
|
||||
"780 and 390 px: project drawer, file, diff and trace controls, no page overflow",
|
||||
"unified and detailed research reports render",
|
||||
"model list, ephemeral key, compatible fixture tool loop and return to offline mode"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"modelValidation": "controlled local HTTP fixture; no real model",
|
||||
"version": "1.3.0"
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.3.0",
|
||||
"testedAt": "2026-10-29T09:54:11.002Z",
|
||||
"browser": "156.0.4314.42",
|
||||
"passed": [
|
||||
"actual failing tests and four source proposals retain the original project and task",
|
||||
"reviewed changes continue the same Task through 14 real tests and model-prepared Git review",
|
||||
"review shows actual paths, diffs, tests, author and policy; cancelling leaves Git unchanged",
|
||||
"an index change after confirmation preview refuses the stale job and preserves both staged owners",
|
||||
"390px confirmation keeps file hashes, diffs and actions inside the modal",
|
||||
"double confirmation creates one four-file commit, retains owner bytes and publishes report with completion",
|
||||
"report viewing and Markdown/JSON downloads preserve verified artifact bytes and truthful acceptance limits",
|
||||
"mobile report preview closes cleanly and keeps the task input fixed",
|
||||
"unknown Git results block new submission and the explicit reconcile action restores the existing commit"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"projectRoot": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\delivery-ui-5786ccd4-434a-41d2-939f-ce6269a39070\\四模块交付工程",
|
||||
"projectId": "dd123252-c383-4f92-a26d-4c2a599cc0e8",
|
||||
"sessionId": "a64178fc-1939-4a40-ab52-a76492deff11",
|
||||
"taskId": "9c146230-85e9-47e9-a496-bb9d184db3a6",
|
||||
"commit": "ad61b9ee20b163c8ed706d9b6dc7b86b7b45500f",
|
||||
"recoveryCommit": "ab1afdcb8f17774d1a20246e24a48ea1fbba054d",
|
||||
"testCounts": {
|
||||
"baselineFailed": 13,
|
||||
"passed": 14
|
||||
},
|
||||
"model": "controlled local HTTP fixture",
|
||||
"confirmations": 2
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.3.0",
|
||||
"url": "http://127.0.0.1:52944",
|
||||
"date": "2026-10-29T09:53:18.523Z",
|
||||
"passed": [
|
||||
"model response validation checks the tentative connection before saving",
|
||||
"a model failure after successful tools shows source, attempts and local runtime diagnosis",
|
||||
"explicit retry preserves the completed tool result without replaying the task",
|
||||
"an error question receives the actual session diagnosis and formatted answer",
|
||||
"review state exposes the review action and prevents application during a running request",
|
||||
"approved Unicode commands execute in the declared shell and retain Chinese output",
|
||||
"authentication errors do not retry and error/diagnostic controls fit a 390 px viewport",
|
||||
"stop cancels pending retry and clears running model state",
|
||||
"a transient service failure recovers within the bounded retry policy"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"modelValidation": "controlled local HTTP fixture; actual configured model is verified separately"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"success": true,
|
||||
"version": "1.3.0",
|
||||
"testedAt": "2026-10-29T09:53:39.177Z",
|
||||
"browser": "156.0.4314.42",
|
||||
"passed": [
|
||||
"model-selected checks wait for approval and display actual counted results",
|
||||
"verified artifact preview shows the real check log and hash",
|
||||
"changed source invalidates old checks and manual confirmation runs the new plan",
|
||||
"390px task drawer, log preview, close controls and fixed composer remain operable",
|
||||
"reconnection synchronizes missed session changes in other projects",
|
||||
"budget controls pause before tools and preserve the goal across recorded runs",
|
||||
"applied proposals continue the original task into actual engineering verification"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"projectRoot": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\execution-ui-f35e1e33-7a89-4726-8752-7c490d6f50d8\\project",
|
||||
"model": "controlled local HTTP fixture"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"checkedAt": "2026-10-29T09:54:16.255Z",
|
||||
"version": "1.3.0",
|
||||
"passed": [
|
||||
"工程索引可独立于任务使用,实际覆盖范围与损坏文件显示明确",
|
||||
"真实AST查询打开原文件第181行并仅滚动代码容器,输入区和顶部保持可见",
|
||||
"查询词保留;过期SHA不高亮旧位置,增量刷新后正确定位第184行",
|
||||
"切换项目时延迟返回的旧索引不覆盖新项目结果",
|
||||
"Python候选、字符串误报排除和局部导入文件候选保留真实证据标签",
|
||||
"两处唯一锚点成为待审核提案,真实界面应用后BOM/CRLF和未选择原字节保留",
|
||||
"390px索引查询、范围和完整指纹可读且无横向溢出,实际文件行定位通过",
|
||||
"索引刷新失败保留归属和解释,旧结果禁用并可重试恢复"
|
||||
],
|
||||
"pageErrors": [],
|
||||
"requestFailures": [],
|
||||
"root": "D:\\Ai-project\\REA逆向\\Agent-Workbench\\.qa\\index-ui-8c1879b7-0cae-4317-abf3-0d8a08053ab4",
|
||||
"primaryProjectId": "aac0e660-995b-45b8-80f9-9d4600016791",
|
||||
"otherProjectId": "02811d53-9145-446d-bf0e-057b4bca3af9"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"version": "1.3.0",
|
||||
"testedAt": "2026-10-29T09:52:45.109Z",
|
||||
"platform": "win32",
|
||||
"node": "v24.22.1",
|
||||
"command": "npm test",
|
||||
"tests": 112,
|
||||
"passed": 112,
|
||||
"failed": 0,
|
||||
"skipped": 0,
|
||||
"cancelled": 0,
|
||||
"durationMs": 147134.9173,
|
||||
"logSha256": "382482cce71e278acda6d64d40793164840ec076ba80db9db26a1a2b090e5622",
|
||||
"initialRun": {
|
||||
"tests": 110,
|
||||
"passed": 108,
|
||||
"failed": 2,
|
||||
"reason": "Windows Node HTTP ECONNRESET in restart/event fixtures; isolated repro passed 2/2, finite QA requests use independent connections and record response phase, without replay."
|
||||
},
|
||||
"scope": "Behavior, API, index/patch contracts, real process recovery and consecutive in-place upgrade; no M2/M6 completion-rate claim."
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 184 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 114 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 182 KiB |
Reference in New Issue
Block a user