Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Windows CI jobs have a 20-minute overall budget for cold setup and native accept

`node scripts/measure-runtime-baseline.mjs` creates a small C# project, runs three fresh stdio clients, measures unused/cold/warm/exit phases, and profiles source Router startup separately. It records snapshots under `test-tmp/runtime-baseline/`, using the existing SDK. Run it without competing check jobs for a comparison; samples share OS/SDK caches and do not establish a p95, a clean-machine benchmark, or installed-client acceptance. Instrumented startup I/O counts cover the selected asynchronous Node filesystem methods and `child_process.spawn`, not all native/kernel I/O.

For opt-in fixed-profile TavernDesk acceptance, use `npm run test:tavern-context -- <repository> --ui-pid=<PID> --ui-hwnd=<HWND>` and `npm run test:product -- <repository> <PID> <HWND>`. The latter checks the fixed profile receipt and performs six navigation-to-source tasks without source filenames supplied in advance. Native candidate discovery is counted, source reads used only as the oracle are separate, and all returned bodies are checked against current file hashes. Source candidates remain distinct from verified runtime bindings. The scripts do not install prerequisites, launch the target application or use personal databases.
For opt-in fixed-profile TavernDesk acceptance, use `npm run test:tavern-context -- <repository> --ui-pid=<PID> --ui-hwnd=<HWND>` and `npm run test:product -- <repository> <PID> <HWND>`. Omit the UI arguments from the first command to run only the eight context scenarios. Both scripts bind the target repository at Gateway startup, verify the root reported by hello, and keep cache/trash in a separate temporary directory. The latter checks the fixed profile receipt and performs six navigation-to-source tasks without source filenames supplied in advance. Native candidate discovery is counted, source reads used only as the oracle are separate, and all returned bodies are checked against current file hashes. Source candidates remain distinct from verified runtime bindings. The scripts do not install prerequisites, launch the target application or use personal databases. Their fresh stdio connections do not verify the active agent-client connection or its Roslyn workflow.

The delivery manifest covers Gateway JavaScript, all published Host files including dependency sidecars, four managed Skill documents, and package/SDK/Host lock configuration. It records the Git revision and toolchains. Timestamps and checkout paths do not participate in content identity. Native Release builds run through `scripts/publish-native.mjs host|codeHost|tray` after locked restore (automatically inside `check`). The build records repository source/shared files and build settings before compilation, verifies they stayed unchanged, and seals the complete publish output. Delivery verification rejects changed source or artifacts; regenerating a delivery manifest cannot bless old DLLs. Direct `dotnet publish` is suitable for isolated fixtures; use the canonical script for delivery. This is a repository input fingerprint, not an attestation of arbitrary external MSBuild imports or the SDK installation. Hashes detect local mismatches; they are not signatures. Run a complete check after changing delivery inputs. Keep a complete previous checkout/artifact set for rollback; do not mix old DLLs with a new Gateway.

Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ Each Roslyn Host writes design-time intermediate files to its own directory whil

Each instance accepts up to **32 unfinished tool requests**, including queued requests. Passive hello and `tools/list` share a separate limit of **4 requests**. Raw arguments are limited to **64 KiB of UTF-8 JSON**. Queueing counts toward the request timeout; overload returns `SERVER_BUSY`. A cancelled request still counts toward the limit until its operation finishes cleanup. Shared-cache reads check the selected source content and cached attachments, and rebuild missing or corrupted entries.

**Test results on 2026-09-11:** [PR #37](https://github.com/linnnn89/WinCode/pull/37) and its cache-test correction [PR #38](https://github.com/linnnn89/WinCode/pull/38) are merged. The resulting `main` commit `d51f3e1` passed [Node 22/24 CI](https://github.com/linnnn89/WinCode/actions/runs/34571066627) and all three [CodeQL checks](https://github.com/linnnn89/WinCode/actions/runs/34571066444). The Node 22 report records 451 core tests passed, zero failed and one optional TavernDesk test skipped. Shared-cache tests passed 8/8, SDK concurrency tests 10/10 and design-time isolation tests 21/21; these three reports list no cleanup failures or leftover processes.
**Verified baseline on 2026-09-11:** Navigation and compact UI results ([PR #40](https://github.com/linnnn89/WinCode/pull/40)), followed by the worktree `.git` filter and Tray test scheduling correction ([PR #41](https://github.com/linnnn89/WinCode/pull/41)), are merged. The resulting `main` commit `631f8ba` passed [Node 22/24 CI](https://github.com/linnnn89/WinCode/actions/runs/34586761303) and all three [CodeQL checks](https://github.com/linnnn89/WinCode/actions/runs/34586761201). Node 22 recorded 453 core tests passed, zero failed and one optional TavernDesk test skipped; Roslyn Host 59/59, Gateway 22/22, shared-cache 8/8, SDK concurrency 10/10 and design-time isolation 21/21 passed. Node 22 runs additional acceptance stages, so its total job duration is not a Node 22/24 performance comparison.

The opt-in TavernDesk scripts now bind the requested repository at startup and keep cache/trash in a separate temporary directory. The eight real-project context scenarios passed locally. The six UI product tasks remain unverified in this run: the dedicated TavernDesk application exited with `UnauthorizedAccessException` before showing its window. These scripts use fresh stdio connections; they do not verify the active Codex connection or its Roslyn workflow.

Concurrent UI inspection, the full Roslyn workflow in actual agent clients, and resource use during extended runs still need testing. Pending work is listed in the [remaining test plan](WinCode-下一轮工程化迭代计划书.md); previous results and failures are in the [work log](docs/codex_worklog.md).

Expand Down Expand Up @@ -320,7 +322,9 @@ npm run delivery:verify

每个实例最多接受 **32 个尚未完成的工具请求**,包含排队中的请求。被动 hello 和 `tools/list` 另行共享 **4 个请求名额**。原始参数上限为 **64 KiB UTF-8 JSON**。排队时间计入请求超时;超过容量时返回 `SERVER_BUSY`。取消的请求需完成清理后才不再占用名额。共享缓存会核对所选源码的内容和缓存附件,缺失或损坏时重建。

**2026-09-11 测试结果:**[PR #37](https://github.com/linnnn89/WinCode/pull/37) 及共享缓存测试修正 [PR #38](https://github.com/linnnn89/WinCode/pull/38) 均已合并。合并后的 `main` 提交 `d51f3e1` 通过 [Node 22/24 CI](https://github.com/linnnn89/WinCode/actions/runs/34571066627) 和三项 [CodeQL 检查](https://github.com/linnnn89/WinCode/actions/runs/34571066444)。Node 22 报告中,核心测试 451 项通过、0 项失败、1 项可选 TavernDesk 测试跳过;共享缓存测试通过 8/8,SDK 并发测试 10/10,设计时隔离测试 21/21。这三组测试均未报告清理失败或遗留进程。
**2026-09-11 已验证基线:**代码导航和 UI 精简输出([PR #40](https://github.com/linnnn89/WinCode/pull/40)),以及 worktree 的 `.git` 文件过滤与托盘测试调度修正([PR #41](https://github.com/linnnn89/WinCode/pull/41))均已合并。合并后的 `main` 提交 `631f8ba` 通过 [Node 22/24 CI](https://github.com/linnnn89/WinCode/actions/runs/34586761303) 和三项 [CodeQL 检查](https://github.com/linnnn89/WinCode/actions/runs/34586761201)。Node 22 记录核心测试 453 项通过、0 项失败、1 项可选 TavernDesk 测试跳过;Roslyn Host 59/59、Gateway 22/22、共享缓存 8/8、SDK 并发 10/10、设计时隔离 21/21 均通过。Node 22 还执行额外验收,不能用两个任务的总耗时比较 Node 22/24 的性能。

可选 TavernDesk 验收脚本已改为启动时绑定目标仓库,缓存和回收站使用独立临时目录。真实项目的 8 个上下文场景已在本机通过;本轮 6 个 UI 产品任务尚未验证,因为专用测试应用在显示窗口前以 `UnauthorizedAccessException` 退出。这些脚本使用新建的 stdio 连接,不代表当前 Codex 连接或其中的 Roslyn 流程已经验证。

UI 并发检查、实际 Agent 客户端中的完整 Roslyn 操作流程,以及长期运行的资源占用仍需测试。未完成事项见[后续测试计划](WinCode-下一轮工程化迭代计划书.md),历史测试结果和失败记录见[工作日志](docs/codex_worklog.md)。

Expand Down
13 changes: 7 additions & 6 deletions WinCode-下一轮工程化迭代计划书.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# WinCode 后续测试计划

更新:2026-09-11(北京时间)。当前版本为 **0.15.0 / main `d51f3e1`**。版本和 CI 状态见 [README](README.md),实现方式见[架构说明](WinCode-架构与数据流说明.md),历史结果见[工作日志](docs/codex_worklog.md)。
更新:2026-09-11(北京时间)。当前版本为 **0.15.0**,已验证的 main 基线为 `631f8ba`。版本和 CI 状态见 [README](README.md),实现方式见[架构说明](WinCode-架构与数据流说明.md),历史结果见[工作日志](docs/codex_worklog.md)。

固定工作区、保持已加载的 Host、请求数量限制、独立的设计时输出目录和共享缓存回归测试已完成。PR #37/#38 已合并,Node 22/24 和 CodeQL 检查通过。这些内容已从待办中移除,下面只保留尚未完成的测试和未定位的问题。
固定工作区、保持已加载的 Host、请求数量限制、独立的设计时输出目录、共享缓存回归,以及 PR #40/#41 的代码导航、UI 精简输出和测试修正已合并,Node 22/24 和 CodeQL 检查通过。TavernDesk 验收脚本已修正启动工作区,针对性回归先失败后通过,真实项目的 8 个上下文场景通过。下面保留尚未完成的测试和未定位的问题。

## 待完成的测试与问题排查

| 事项 | 已知情况 | 下一步 |
| --- | --- | --- |
| 实际客户端中的 Roslyn 操作 | 已确认本机 Codex 连接运行 0.15.0 / local-text,WinCode Skill 已安装;尚未在当前版本的实际客户端中测完 Roslyn 流程 | 使用已配置 Roslyn 的连接,依次测试符号搜索、引用查询、影响分析和重构建议;修改源码后,确认旧符号位置被拒绝,重新搜索可恢复查询。原计划中的两个实际应用、A/B 并发任务和 Codex 测试仍需完成;agy CLI 测试继续暂缓 |
| 两个 MCP 连接同时检查 UI | 现有测试覆盖一个连接对同一窗口的并发请求,尚未覆盖两个独立 Gateway | 用 WPF 测试程序分别测试两个连接检查不同窗口、同时检查同一窗口。核对 PID/HWND、控件内容、截图是否来自指定窗口,以及辅助进程是否正常退出 |
| UI 和托盘的间歇性失败 | 仍有未定位的隐藏/唤出、截图/提示窗问题,以及托盘 `--endpoint` 启动超时记录;后续测试通过还不足以说明原因已经查清 | 复现时保存错误码、原生日志和各步骤耗时,定位后重测原操作。此前结果和缺失的原始报告已在工作日志中说明 |
| SDK 突发请求警告 | 128 个请求突发发送时曾出现 11 个 drain 监听器的警告,结束后监听器数量回到 0;服务端请求限制无法消除客户端已经产生的发送积压 | 先检查常见的连续任务是否受影响。若再次出现,检查客户端发送背压及监听器的注册与释放,不仅通过提高监听器数量上限来隐藏警告 |
| TavernDesk 的 6 个 UI 产品任务 | 工作区绑定已修正;本次专用测试应用在显示窗口前以 `UnauthorizedAccessException` 退出,尚未执行 UI 任务 | 先查明应用在专用 profile 中启动失败的原因,再用匹配的启动回执、PID/HWND 执行 `test:product`;不使用日常数据库替代 |
| 两个 MCP 连接同时检查 UI | 单连接排队及审计 Mutex 拒绝已有测试;完整双 Gateway 窗口流程尚未覆盖,共用审计目录的重叠操作会返回 `AUDIT_BUSY` | 以现有 WPF 夹具验证不同窗口和同一窗口:核对目标归属、输出及进程清理,明确验证 `AUDIT_BUSY` 和操作结束后的恢复;先不改锁或加入重试队列 |
| 实际客户端中的 Roslyn 操作 | 自动化 Gateway 22 场景及 A/B/A 冷启动已通过;当前客户端完整流程仍未验证 | 核对实际连接的构建身份和 Roslyn 配置,用一个代表性项目连续执行搜索、引用、影响分析和重构建议;在隔离源码副本修改后验证旧位置被拒绝、重新搜索可恢复。只有发现具体缺口才扩大项目数量;agy CLI 继续暂缓 |
| UI 和托盘的间歇性失败 | PR #41 将真实端点启动检查移到顺序阶段,main 两个 Node 版本均通过,3000 ms 生产超时未变;隐藏/唤出、截图/提示窗及原生启动延迟的根因仍未全部定位 | 再现时保存错误码、原生日志和步骤耗时,再针对原因修复;不把调度修正及重跑通过称为已解决所有 UI/托盘问题 |
| SDK 突发请求警告 | main 的 128 请求阶段仍记录 11 个 drain 监听器警告,阶段结束后为 0;服务端限流不能消除客户端发送积压 | 先在上述实际客户端连续任务中观察是否影响使用;若普通负载也出现,再检查发送背压及监听器释放。不提高监听器上限来隐藏警告,也不据此认定内存泄漏 |

## 遇到相关需求时再测试

Expand Down
7 changes: 4 additions & 3 deletions WinCode-架构与数据流说明.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WinCode 架构与数据流

**适用版本:0.15.0,main `d51f3e1`;更新:2026-09-11(北京时间)。该版本已合并,Node 22/24 和 CodeQL 检查通过,尚未发布 GitHub Release。实际客户端 Roslyn 流程和 UI 并发测试仍待完成,当前测试结果见 [README](README.md)。**
**适用版本:0.15.0;更新:2026-09-11(北京时间)。已验证的 main 基线 `631f8ba` 包含 PR #40/#41,Node 22/24 和 CodeQL 检查通过,尚未发布 GitHub Release。实际客户端 Roslyn 流程和双连接 UI 测试仍待完成,当前测试结果见 [README](README.md)。**

本说明描述当前源码中已实现的结构。GitHub 分支保护的历史只读核查日期为 2026-09-08;本轮核对 PR 检查状态,不把它等同重新审计全部保护设置。历史实测结果见[工作记录](docs/codex_worklog.md)。源码版本、磁盘构建和客户端当前连接是三个不同对象,不能互相替代。

Expand Down Expand Up @@ -52,7 +52,7 @@ flowchart TB
| 原生 Host | 按 PID/HWND 取证,执行有界 UIA 搜索及截图 | [Program.cs](tools/WinCode.UIA.Host/Program.cs)、[BoundedUiSearch](tools/WinCode.UIA.Host/BoundedUiSearch.cs)、[UiAudit](tools/WinCode.UIA.Host/UiAudit.cs) |
| 构建交付层 | 锁定构建、回归、stdio 验证、产物身份、Skill 一致性 | [check.mjs](scripts/check.mjs)、[delivery-manifest](scripts/delivery-manifest.mjs)、[sync-skill](scripts/sync-skill.mjs) |

`ExtensionManager` 目前保留兼容接口,没有内置注册项,不承担实际插件生态或工具发现职责。Gateway 当前列出 15 个工具名称,其中包含影响分析别名;工具名称数量不等于独立业务能力数量。
`ExtensionManager` 目前保留兼容接口,没有内置注册项,不承担实际插件生态或工具发现职责。Gateway 当前列出 17 个工具名称,其中包含影响分析别名;工具名称数量不等于独立业务能力数量。

## 2. 一次请求怎样通过系统

Expand Down Expand Up @@ -179,6 +179,7 @@ flowchart TB
- UI→XAML→C# 是候选证据链。动态绑定、模板、资源字典没有被完整求值;保持 `runtimeSourceVerified=false`。源码候选读取失败时保留已取得的 UI 快照。
- Host 使用 UIA/Win32 读取目标窗口;取消与超时清理自有 Helper,不终止目标应用。该设计不提供点击、输入或聊天生成能力。
- 审计保存开始/结束等简要记录;达到阈值时提醒或拒绝新 UI 访问。日志是本地可写文件,不提供防篡改保证。
- 同一 Gateway 的 UI 请求在适配器内排队;不同 Gateway 共用审计目录时,由原生命名 Mutex 保护整个操作,发生重叠会返回 `AUDIT_BUSY`。双连接测试应检查这一返回及后续恢复,不能假定两个请求都能同时成功。

## 5. 状态、存储与生命周期

Expand Down Expand Up @@ -280,7 +281,7 @@ flowchart LR

本说明的架构图、数据表与关口表共同描述当前实现;新增功能应说明接入哪条数据流、使用哪个现有契约、在哪个关口拒绝或降级,以及如何留下真实验收证据。

工作区失败恢复、trash 部分完成、有界负载和基础错误迁移已落实;当前待办见[计划](WinCode-下一轮工程化迭代计划书.md)。实际客户端 Roslyn 验收由用户明确暂缓;条件性性能研究不表示已发现泄漏。
工作区失败恢复、trash 部分完成、有界负载和基础错误迁移已落实;当前待办见[计划](WinCode-下一轮工程化迭代计划书.md)。实际客户端 Roslyn 流程仍需单独验收,新建 stdio 连接的测试不能替代它;条件性性能研究不表示已发现泄漏。

## 2026-09-09 职责拆分

Expand Down
Loading