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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## 0.15.0 (unreleased)

- Report Roslyn snapshot diagnostic totals before sample limits, bounded error-code/project counts and explicit sample omissions; preserve unknown totals for legacy Hosts and conservative semantic coverage. Update Skill guidance to distinguish dependency loading from excluded generator coverage.

- Preserve single-target referenced projects' own framework during Roslyn design-time loading, preventing a Windows entry framework from hiding restored library dependencies. Keep explicit entry/multi-target selection, existing import hooks and per-Host output ownership; add a mixed-framework package-reference regression.
- Add an optional Skill-managed session using the existing MCP client SDK and a persistent interactive terminal. Start the Gateway on the first tool call, validate workspace/build/provider, reuse the connection and Roslyn snapshot, preserve complete MCP results as local JSON/image attachments, and close owned resources explicitly or on owner exit. Disable the client's native WinCode MCP entry to prevent its automatic startup; no automatic retry/reconnection, new service or dependency is introduced.
- Preserve completed/partial trash outcomes and actual file locations when the request deadline expires during metadata finalization. Propagate cancellation before the move and keep interruption accounting; client cancellation or disconnection still does not guarantee delivery of a final response.
- Add optional Roslyn reference `limit` (1–1000, default 100, requires `symbolLocation`). Impact reports retain `totalReferences` and `referencesTruncated` alongside the existing returned `referencesCount`; unknown totals remain null and semantic risk/coverage rules stay unchanged.
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Reports and bounded stage logs are under `test-tmp/check/<run>/`. CI retains the

Windows CI jobs have a 20-minute overall budget for cold setup and native acceptance. Node 22 runs shared-cache checks early, then gives SDK concurrency and design-time output ownership separate steps. Design-time readiness uses the production Roslyn load budget of 120 seconds; it does not impose an additional cold-start performance target. Production request deadlines remain unchanged.

`node scripts/verify-design-time-concurrency.mjs --phase semantics --filter semantics/mixed` checks a multi-target entry selected as Windows against a plain .NET library with a package dependency and an existing early props hook. It reuses a dependency already locked by the Code Host, restores the generated fixture offline, and verifies the framework-specific reference and compilation diagnostics through the published Host. The complete design-time acceptance includes this scenario.

`npm run test:owner-death` kills only a generated Gateway during confirmed initial MSBuild work and checks all previously observed process identities for survivors. `node scripts/verify-owner-death.mjs --repomix` audits the actual adapter with a controlled Node CLI, without installing Repomix. `check:desktop` also runs the `--desktop` owner-death scenario against the isolated WPF fixture: the UIA Helper must exit while the target remains alive; the fixture is closed separately after recording that result. Reports are kept under `test-tmp/owner-death/`. These checks never identify client applications by process name.

`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.
Expand Down
2 changes: 1 addition & 1 deletion WinCode-下一轮工程化迭代计划书.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
| 事项 | 已知情况 | 下一步 |
| --- | --- | --- |
| 已安装 Codex 的冷启动确认 | Skill 按需入口已通过真实终端连续 Roslyn 查询、关闭和所属进程退出;Node 22.23.2 与 24.19.0 本地核心回归均为 462 通过、1 项可选夹具跳过。Node 24 已在 I:/New-tarven 完成后台 UI 和真实图片附件验证,Node 22 补验了该项目的实际终端声明/引用流程。原生 wincode 已设 enabled=false,已安装 Skill 四文件一致 | 正常刷新/重新启动 Codex,确认未调用时没有新建 WinCode 进程。当前任务未重启宿主;保存配置不会清除旧连接。Node 22 证据见 test-tmp/node22-validation/report.json |
| Tavern 的 Roslyn 语义覆盖 | 本地 App 项目 Release/net10.0-windows 快照正确返回导航声明及两处引用,并跨 UI 调用保持身份;同时排除 24 个分析器/生成器,报告 CS8795 和部分 Microsoft.Data/Microsoft.ML 的 CS0234。源码正常构建/隔离启动不能消除这些设计时诊断 | 如需扩大到完整项目语义,先核对设计时项目引用、TFM 和依赖解析,再区分生成器策略造成的缺口;当前维持 incomplete,不根据局部零引用判断删除安全。证据:test-tmp/tavern-skill-JNZ7Wu/report.json |
| Tavern 的生成源码覆盖 | 单目标引用框架被入口覆盖的问题已在本地修复;实际 Host 不再报告 Microsoft.Data/Microsoft.ML 依赖缺失。当前 Codex 终端验证了 Tokenizer、SQLite 参数类型及具体引用,导航两处引用仍正确。完整 Host 诊断现为 11 项 CS8795,均涉及生成正则;24 个分析器/生成器引用仍排除 | 单独评估生成源码的受控支持、定位和快照失效,不直接启用全部生成器。queryComplete=false/incomplete 仍是保守契约,局部零引用不能证明删除安全。最新证据:test-tmp/roslyn-dependency-debug/tavern-report.json;原验收报告作为历史保留 |
| UI 和托盘的间歇性失败 | PR #41 将真实端点启动检查移到顺序阶段,main 两个 Node 版本均通过,3000 ms 生产超时未变;隐藏/唤出、截图/提示窗及原生启动延迟的根因仍未全部定位 | 再现时保存错误码、原生日志和步骤耗时,再针对原因修复;不把调度修正及重跑通过称为已解决所有 UI/托盘问题 |
| SDK 突发请求警告 | main 的 128 请求阶段仍记录 11 个 drain 监听器警告,阶段结束后为 0;此次实际客户端连续查询未出现调用失败,但未采集该客户端的监听器统计 | 若普通负载也出现问题,再检查发送背压及监听器释放。不提高监听器上限来隐藏警告,也不据此认定内存泄漏 |

Expand Down
2 changes: 2 additions & 0 deletions WinCode-架构与数据流说明.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

N4 实现:`DesignTimeBuild` 使用已有 SDK 的 ProjectCollection 做原项目求值,保留原中间目录的 Compile 排除规则及自定义导入;目标运行仍交给 MSBuildWorkspace,使用每 Host UUID 的私有 IntermediateOutputPath。Configuration/TargetFramework 必须为字面目录段,规范化后的输出必须位于所属 UUID 内;原求值的无效项目异常保持 `PROJECT_LOAD_FAILED`。输入扫描仅过滤已判定不参与默认编译的原中间产物,实际文档/显式输入仍校验,自定义 Compile 保守处理。`OwnedBuildOutputs` 记录原生所有权清单,正常关闭回收;`RoslynHostClient` 在实际退出后调用 `DesignTimeArtifacts` 回收所属命名空间。内部 inputPolicy 为 2,缺失/旧策略 Host 的拒绝和进程回收已有专项测试。当前发布目录通过交付身份核验;复杂 target、任意动态项目图及断电后的孤儿产物仍不在本地通过范围内。

项目引用加载:入口及多目标项目继续使用显式指定的框架;单目标引用项目先按自身声明求值,再通过所属 Host 目录中的 props 将框架覆盖限定到该引用项目。覆盖在 Directory.Build.props/SDK 包导入前生效,并保留原 CustomBeforeDirectoryBuildProps 导入,避免入口的全局 Windows 框架污染普通 .NET 类库的依赖解析。此策略不承诺为多目标引用自动挑选最近兼容框架。分析器/生成器仍被排除;queryComplete=false 和 incomplete 是保守契约,不能因编译诊断清零就改为全项目完整。

## 1. 整体定位与结构

WinCode 是一个运行在本机的 **MCP 工具网关**:接收编码 Agent 的结构化请求,组织代码或桌面证据,再把正文与证据边界一起返回。Agent 的模型推理在客户端侧;WinCode 自身没有模型推理服务或向量数据库。
Expand Down
21 changes: 21 additions & 0 deletions docs/codex_worklog.md
Original file line number Diff line number Diff line change
Expand Up @@ -1430,3 +1430,24 @@
- 随后仅在检查子进程环境中前置便携版 PATH,并以同一 Node 执行 `scripts/check.mjs`;父进程和通过 PATH 启动的子 Node 均读回 v22.23.2。完整核心检查通过:463 项中 462 通过、0 失败、1 项跳过(原有可选 Tavern 固定路径不存在),类型检查、Gateway/原生构建、生产 stdio 和交付核验全部成功。报告 `test-tmp/check/2026-09-12T09-20-46-120Z-core/report.json`。Gateway buildId 与 Node 24 构建一致,仍为 `7491337da2426a3ccc4f2df4a11a5f28982fc86852ae5485305ffeb78bceec7e`;记录 Node 22 工具链的新交付 contentId=`7592124791ab0b901a432405cbcdb4b87f2c7312bfe093c4ebca2a553576e1a0`,matched=true。
- 在当前 Codex 交互终端使用便携版启动真实 Skill 入口,绑定 `I:/New-tarven` 和上一轮显式授权的 Roslyn 配置。4 次显式请求覆盖 hello、声明搜索、精确引用和再次 hello;Gateway 两次自报 v22.23.2,实际入口 PID=26740、Gateway PID=9412 的命令行均指向便携版 Node 22。instanceId=`87e949f7-776c-4380-86ed-3623bcc09f42` 保持一致,snapshotId=`6c1db72b22ea42ec85a3a87959ffdda1` 从声明传到引用;第 127、130 行两处引用按实际源码 UTF-16 位置核验成功。Tavern 已知设计时语义缺口仍返回 incomplete,没有把版本兼容性通过解释为全项目语义完整。
- 会话显式关闭并退出;记录的 5 个所属进程全部消失,survivors=[]。新执行环境读回系统默认 Node 仍为 v24.19.0。汇总报告 `test-tmp/node22-validation/report.json`,原始 MCP 响应位于 `test-tmp/skill-sessions/run-lRbqki/`。本轮未重启 Codex、未复跑桌面或 CI 的全部附加专项,未提交/推送;现有待验表移除 Node 22 未验状态,保留宿主冷启动观察。

## 2026-09-12 18:13 — 修复单目标引用项目的设计时依赖解析(北京时间)

- 用户批准先修复依赖解析并用 Tavern 实测,生成器支持单独处理。基于已合并的 `c229198` 新建 `codex/roslyn-project-reference-loading`;本轮未提交或推送。改动限定在 Code Host 的 DesignTimeBuild、现有设计时验收脚本和相关文档,未修改 Tavern 源码/依赖/数据库、公共 MCP 接口或分析器策略。
- 最小复现:Windows App 引用 net10.0 类库,类库使用本机已有且 Code Host 锁定的 System.Composition.AttributedModel 10.0.1。离线正常构建成功,旧发布 Host 却报告 CS0234。隔离诊断副本显示类库带有 WINDOWS 预处理符号且缺少该包的 MetadataReference;只移除工作区全局 TargetFramework 后,依赖和编译诊断恢复正常,输出隔离未变。证据依次为 `test-tmp/roslyn-dependency-debug/case-c7jw7W/report.json`、`case-N4wxIN/report.json`、`case-wDsTsn/report.json`。生产代码没有加入诊断开关。
- 根因是工作区全局框架覆盖了单目标引用项目。对照安装的 Roslyn 5.9.0 对应源码确认:MSBuildWorkspace 的 properties 等同 MSBuild 全局参数,并传到每个项目。参考:https://github.com/dotnet/roslyn/blob/35d9211b841e7613c1d2f8f5af6d628ace696c4c/src/Workspaces/MSBuild/Core/MSBuild/MSBuildWorkspace.cs 。MSBuild 导入中的 TreatAsLocalProperty 作用域参考:https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-properties#local-properties-and-imports 。最初直接移除全局框架仅作为诊断,正式修复仍保留入口及多目标项目的显式选择。
- 正式实现先按单目标引用自身声明求值,在所属 Host UUID 目录生成限定到该项目的早期 props 覆盖;保留原 CustomBeforeDirectoryBuildProps 导入、原中间目录排除规则及所有权回收。没有为多目标引用添加自动选择最近兼容框架的规则,也没有扫描 DLL 补引用或自动还原用户项目。
- 新增恰好一个回归场景 `semantics/mixed/production`:多目标入口选择 Windows、普通类库保留 net10.0、锁定包引用可见、原早期导入保留、跨项目引用正确。旧实现失败报告 `test-tmp/design-time-production/run-PBaQ0n/report.json`;首次修复通过 `run-VdaJNe/report.json`。补充原早期导入断言后的语义阶段 6/6 通过(`run-kQFKMX`),并发/取消/崩溃阶段 5/5(`run-y3fFYK`)、外部构建/源码失效阶段 6/6(`run-V37sRQ`)、输入变化阶段 5/5(`run-VQ4JN1`),合计 22 个实际生产 Host 场景,均无所属进程残留。没有失败的生产修复循环,也没有跳过失败断言。
- 当前 Codex 的真实 Skill 交互终端在 `I:/New-tarven` 执行 7 次工具调用。Tokenizer 参数签名、SQLite connection/transaction 参数签名均正确解析;EstimateTiktokenMessages 第 25 行、RepairCharactersAsync 第 151 行,以及 ShowCharactersAsync 第 127/130 行引用逐项与磁盘 UTF-16 位置核对一致。同一 Gateway instanceId=`c64b1f1f-3889-45aa-b208-7460c92cf4b6`、snapshotId=`c30b726a198b46ada192eb212ce72d46` 被连续复用,关闭后记录的 5 个进程均退出。实际生产 Host 完整诊断不再含缺失依赖的 CS0234,剩余 11 项均为生成正则实现缺失的 CS8795;原 MCP 简略响应仅展示前五条,不能拿以前显示的两处正则错误当作总数。汇总 `test-tmp/roslyn-dependency-debug/tavern-report.json`;原始响应 `test-tmp/skill-sessions/run-aXAiN9/`。Tavern 前后 Git 状态仅有原有 `.publish-verify/`,本轮未启动目标应用或接触个人资料库。
- Node 22.23.2 执行一次完整核心检查,通过 463 项中的 462 项,0 失败,1 项原有可选 Tavern 固定夹具跳过;类型检查、构建、生产 stdio 和交付核验通过。报告 `test-tmp/check/2026-09-12T10-10-53-659Z-core/report.json`。Gateway buildId 仍为 `7491337da2426a3ccc4f2df4a11a5f28982fc86852ae5485305ffeb78bceec7e`(本轮仅修改原生加载实现),交付 contentId=`6902e19593c6b55b4712cb2a5e31d8dcecc6adab27a185b87a7d7aacf23a5987`。上述 22 个专项及 Tavern 真实终端使用 Node 24.19.0;未重复 Node 24 全套核心检查或运行本轮云端 CI。
- 边界:24 个分析器/生成器引用仍排除,queryComplete=false 和 analysisCompleteness=incomplete 的保守契约未变;本次解决依赖加载缺口,不声称全项目语义完整。作者自查不等于独立审查,当前 Codex 宿主冷启动观察也未在本轮补验。诊断副本及原始附件集中保留在忽略的 `test-tmp/roslyn-dependency-debug/`,不作为交付文件。

## 2026-09-12 18:45 — 诊断计数与 Skill 防误判规则(北京时间)

- 用户授权与上述依赖修复一起提交 PR、通过必需检查后合并,并同步本地 wincode Skill。Host 在每项目二十条样例裁剪前统计当前快照编译错误,单列加载诊断;直接符号/引用响应 semanticContext.diagnosticSummary 返回总数、最多各十组的错误码/项目计数及分组省略数,Gateway 给出五条展示样例与省略条数。旧 Host 未提供统计时总数为 null、countsComplete=false;不补写零。limitations 保留简短计数,使组合工具也能带出覆盖边界。
- countsComplete 仅指已加载快照的编译错误和加载诊断统计,不覆盖编译警告、被排除分析器/生成器或未加载项目。queryComplete=false、analysisCompleteness=incomplete 保持不变。必要元数据超出引用预算仍按原契约拒绝;未增加工具、依赖、服务、自动 restore 或生成器执行。
- 扩展既有 120 引用集成用例:固定 25 条 CS1029 加一条编译警告,验证计数先于 Host 的二十条和 Gateway 的五条上限,警告不计入错误。旧发布 Host 失败见 test-tmp/diagnostic-red.log;首次发布新 Host 后通过见 diagnostic-green.log,120 个引用仍正确且最终输出遵守预算。另加一个旧 Host 未知/不一致统计拒绝测试;连同上一轮 mixed 夹具,本任务新增两个自动化场景,未超过三项。
- Node 22.23.2 本轮完整核心检查:464 项、463 通过、0 失败、0 取消、1 项原有可选 Tavern 固定夹具跳过;类型检查、Gateway/原生构建、生产 stdio、交付核验通过。报告 test-tmp/check/2026-09-12T10-39-52-054Z-core/report.json。buildId=2072ef38b631017d6f82fc404a3fa1a75a4619cf53422ea87f6098b3d6f58b8d,schemaHash/17 工具未变;Node 24 的聚焦真实 Host 回归通过。未重复运行无关桌面套件。
- 当前 Codex 的 Node 24 真实 Skill 终端对 Tavern 搜索 ShowCharactersAsync 并查询引用,返回诊断总数 11、CS8795=11、App=2、Infrastructure=9、Core=0、加载诊断=0、展示=5、省略=6、排除分析器引用=24。第 127/130 行两处引用按磁盘 UTF-16 位置核验;两个响应复用 snapshotId=d394f23675ab42e382d304601f647b72。原始结果 test-tmp/skill-sessions/run-nolmHH/,入口/Gateway instanceId=0cb7610a-f126-4f76-943f-858fb598f7e2。显式关闭后五个记录所属进程全部退出;Tavern Git 仍仅有原有 .publish-verify/,没有业务源码或资料库改动。
- Skill 保持短入口,只更新 references/code.md 与 references/diagnostics.md:先看完整统计,再区分框架/依赖加载与生成器覆盖;不凭错误码自动安装包或反复重试。skill-creator quick_validate 以 Python UTF-8 模式通过。现有 sync-skill.mjs --apply 已备份后同步 C:/Users/40218/.agents/skills/wincode,备份目录 .wincode-backup-17cc7064-c86b-4973-b869-b0f34d2f1e9d;再次只读检查四份受管文件 matched=true。合并后复核。
- 尚待本次 PR 的精确提交 CI 和合并;作者自查不是独立审查。生成器覆盖与宿主冷启动观察仍是已有明确边界,不将本轮通过描述为已解决它们。
Loading