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

## 0.14.0 (unreleased)

- Validate parent/child creation times in acceptance process-tree snapshots, rejecting stale parent-PID edges after Windows PID reuse. Keep strict exit checks for the real observed Code Host descendants.

- Synchronize bilingual setup/cache guidance, architecture/data flow, managed Skill manuals, native Host guidance and remaining roadmap with the verified 0.14.0 behavior. Separate healthy confirmation from recovery and current implementation from planned project binding/admission limits.

- Bind builtin context cache reuse to the selected file contents; rescan bounded local-text inputs and reuse declarations by content within the existing memory budget. Untracked directories, deep files, additions/deletions and same-size edits no longer reuse stale query results. CLI output without an input manifest is not reused as a cached snapshot.
- Treat a missing overflow attachment as a cache miss for memory and disk readers, including after another process prunes the shared cache.
- Confirm healthy same-root workspaces without draining business requests. Cancelling read-only confirmation does not enter recovery or reset a healthy Host; real rebind and cleanup failures retain the recovery gate.
- Preserve the healthy Roslyn Host and snapshot on repeated same-workspace opens, including Windows case/separator aliases. Retain typed restart/reload requirements and sticky cleanup recovery; concurrent recovery confirmations reset only once.
- Remove cancelled mutex waiters immediately while preserving FIFO order and ownership through running-task cleanup. This is cancellation hygiene; bounded MCP admission remains planned.

- Make stale/failed tray observations explicit, refresh passively before manual release, report registration failures and keep native listeners available after malformed registrations. Preserve warm Roslyn state across settings visibility and connection changes.
- Bind native Release source inputs and complete published outputs at build time; reject stale native artifacts even when regenerating the delivery manifest.

Expand Down
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ On 2026-09-08, the owner authorized applying main protection. The read-back conf

SDK policy follows [Microsoft global.json guidance](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json); dependency locking uses [NuGet locked restore](https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#locking-dependencies).

Current implementation is described in the [architecture guide](WinCode-架构与数据流说明.md). Remaining work is maintained in the [active engineering plan](WinCode-下一轮工程化迭代计划书.md); completed work belongs in CHANGELOG and the append-only work log. For documentation-only changes, verify local links, commands, version claims and evidence boundaries; do not claim a new runtime regression without running it.
Current implementation is described in the [architecture guide](WinCode-架构与数据流说明.md). Remaining work is maintained in the [active engineering plan](WinCode-下一轮工程化迭代计划书.md); completed work belongs in CHANGELOG and the append-only work log. For documentation-only changes, verify local links, commands, version claims and evidence boundaries; do not claim a new runtime regression without running it. The four managed Skill files are delivery inputs, so regenerate/verify the manifest after updating them; this does not synchronize an installed client Skill or reconnect its MCP process.

Node 22 CI runs `npm run test:error-contracts` and uploads its bounded report. It exercises protocol errors, matching tool-error text/structured payloads, real generated-file trash failures and workspace recovery; injected UI images test serialization only. Run it locally after changes to these boundaries.

`npm run test:manual-release` verifies ten actual Roslyn release/reload cycles in generated C# projects, old-location rejection, stable owned resources, retained cache/watcher, edits while cold and A/B workspace reuse. The optional Tray is built and version/fingerprint checked by `check`; `check:desktop` additionally runs `npm run test:tray`, exercising actual WinForms and secured Named Pipes with two isolated stdio MCP clients and simulated Roslyn lifetimes. Reports are under `test-tmp/manual-release/` and `test-tmp/tray/`. UI screenshots are local only; these checks do not enable autostart or alter installed MCP client configuration.

The core inventory includes `tests/runtime-cache-regressions.test.ts`: actual input freshness despite same-size/restored-mtime writes, additions/deletions, bounded parsing reuse, missing overflow in memory/disk caches, two actual cache processes, and same-root cancellation/slow-query interleaving. Keep these adversarial cases when changing caching or workspace lifecycle. Process-tree observation also tests PID reuse: every parent edge must respect creation order, so an old system process cannot become a new Helper descendant merely through a recycled PID. A client cancellation may settle before Gateway cleanup; same-root confirmation is not a drain barrier. Observe actual in-flight completion within the existing budget, then retain strict owned-process exit assertions.

After a nontrivial test failure, investigate official documentation and relevant real GitHub implementations/issues before choosing a fix. Record the observed failure, applicability of the reference and actual rerun result; do not replace verification with copied examples or arbitrary longer sleeps. Obvious syntax, object-shape and path mistakes can be corrected directly.

`npm run test:tray-workflow` (also in `check:desktop`) uses two compiled stdio MCP instances, real C# fixtures, the native settings handlers and authenticated pipes. It checks warm-state continuity across spaced queries, busy refusal, targeted release/recovery and Tray exit. No active Codex configuration is changed.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Add WinCode as a stdio MCP server in your agent client configuration (for client
}
```

Without `--workspace`, WinCode initially uses the server process's current working directory, which may differ from your intended project. Before querying, ask the agent to call `workspace_open` with the target project's absolute path, for example `workspace_open({"path":"C:/path/to/project"})`. Repeat this when switching projects; the server installation path stays the same. One server process has one active workspace, so calls sharing that process must not interleave queries for different projects. For concurrent independent projects, configure separate server instances with distinct names and explicit workspace paths.
Without `--workspace`, WinCode initially uses the server process's current working directory, which may differ from your intended project. Before querying, ask the agent to call `workspace_open` with the target project's absolute path, for example `workspace_open({"path":"C:/path/to/project"})`. Repeat this when switching projects; the server installation path stays the same. Confirming the same healthy workspace keeps the Roslyn Host/snapshot warm and does not drain active queries. Cancelling that confirmation does not force recovery; known restart/cleanup failures still follow the explicit recovery path. One server process has one active workspace, so calls sharing that process must not interleave queries for different projects. For concurrent independent projects, configure separate server instances with distinct names and explicit workspace paths.

**Specify a project at startup:** Add `--workspace` followed by the project directory:

Expand Down Expand Up @@ -180,7 +180,7 @@ Coding agent ── stdio MCP ── WinCode

- **Owned-process cleanup:** UI inspection executes out-of-process via an isolated helper (`tools/WinCode.UIA.Host`). All process cleanups target only the owned helper process tree via Windows `taskkill /T`; the inspected target application is never terminated or injected.
- **Concurrency Protection:** UI inspection and health checks share a serial execution mutex to prevent native UIA message pump deadlocks. Workspace switches safely drain in-flight calls before changing cache namespaces.
- **Byte-Bounded Cache:** Memory and disk caches enforce strict byte caps (default 32 MiB serialized memory, 128 MiB disk quota including disk-spilled overflow snapshots). Debounced file watching (150 ms) and index probing invalidate the ~2.5s fingerprint memo upon disk changes.
- **Byte-Bounded Cache:** The shared cache manager bounds retained serialized data (default 32 MiB memory, 128 MiB disk including overflow); these are not process RSS limits. Local-text queries re-enumerate bounded inputs and reuse declarations by content hash. Builtin packs validate the actual selected contents before reuse; CLI output without a verified input manifest is not cached. Missing overflow files become cache misses. Watch/index probes invalidate the ~2.5s change-hint memo; that hint is not proof of source identity or a guarantee that watcher events are complete.

| UI budget | Limit / behavior |
| --- | --- |
Expand Down Expand Up @@ -283,7 +283,7 @@ npm run delivery:verify
}
```

省略 `--workspace` 时,WinCode 初始使用服务进程的当前工作目录,它不一定是你要分析的项目。查询前,让 Agent 调用 `workspace_open` 并传入目标项目的绝对路径,例如 `workspace_open({"path":"C:/path/to/project"})`。换项目时再次调用即可,服务安装路径无需修改。一个服务进程只有一个活动工作区,共享该进程的调用不能交错查询不同项目;如需同时独立查询多个项目,应配置名称不同、各自明确指定工作区路径的服务实例。
省略 `--workspace` 时,WinCode 初始使用服务进程的当前工作目录,它不一定是你要分析的项目。查询前,让 Agent 调用 `workspace_open` 并传入目标项目的绝对路径,例如 `workspace_open({"path":"C:/path/to/project"})`。换项目时再次调用即可,服务安装路径无需修改。同一健康工作区的重复确认保留 Roslyn Host/快照,不等待在途业务排空;取消该确认不会强制进入恢复。已知重启要求和清理失败仍走显式恢复路径。一个服务进程只有一个活动工作区,共享该进程的调用不能交错查询不同项目;如需同时独立查询多个项目,应配置名称不同、各自明确指定工作区路径的服务实例。

**启动时指定项目:**添加 `--workspace`,并在其后填写项目目录:

Expand Down Expand Up @@ -406,7 +406,7 @@ Coding Agent ── stdio MCP ── WinCode

- **目标进程绝对免疫:**UI 取证由独立的 C# 辅助进程(`tools/WinCode.UIA.Host`)在进程外执行。所有清理操作严格仅终止自身派生的 Helper 辅助进程树(通过 Windows `taskkill /T`),**被测目标应用进程受绝对免疫保护,绝不被终止或注入**。
- **防死锁与并发保护:**UI 自动化访问与健康检查共用串行互斥锁,杜绝底层 Win32/UIA 消息泵死锁。切换工作区前会先等待排空在途请求,超时则拒绝切换,保证会话隔离安全。
- **按字节硬封顶缓存:**代码缓存按工作区物理隔离,采用序列化内存估算与字节上限清理策略(默认内存预算 32 MiB、磁盘配额 128 MiB,包含超大快照落盘文件)。结合 150 ms 去抖监听与 Git 索引探测,文件变更时指纹缓存及时失效
- **按字节约束缓存:**缓存条目按工作区 namespace 隔离,多个实例仍可能共用磁盘目录;默认序列化内存预算 32 MiB、磁盘配额 128 MiB(含 overflow),不等于进程 RSS 上限。local-text 每次有界扫描实际输入,按内容哈希复用声明解析;内置打包核对实际选中文件的内容后复用,没有可核验输入清单的 CLI 结果不缓存。附件缺失按缓存未命中重建。150 ms 去抖监听与索引探测只使约 2.5 秒的变更提示 memo 失效,不能证明源码完整身份或保证监听事件无遗漏

| 取证预算指标 | 限制值与行为策略 |
| --- | --- |
Expand Down
6 changes: 3 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Security policy / 安全策略

The latest 0.13.x version and current `main` are maintained. Older versions do not have a separate backport commitment. Supported runtimes are Node 24 (primary) and Node 22 (compatibility), on Windows x64; build requirements are in [CONTRIBUTING](CONTRIBUTING.md).
The latest 0.13.x version and current `main` are maintained; the current development line on `main` is 0.14.0. Older versions do not have a separate backport commitment. Supported runtimes are Node 24 (primary) and Node 22 (compatibility), on Windows x64; build requirements are in [CONTRIBUTING](CONTRIBUTING.md).

目前维护最新 0.13.x 版本与 `main`,不承诺对旧版本单独回补。Windows x64 上以 Node 24 为主要环境、22 为兼容环境;构建要求见贡献指南。
目前维护最新 0.13.x 版本与 `main`;`main` 当前开发线为 0.14.0,不承诺对旧版本单独回补。Windows x64 上以 Node 24 为主要环境、22 为兼容环境;构建要求见贡献指南。

Report suspected vulnerabilities through [GitHub private vulnerability reporting](https://github.com/linnnn89/WinCode/security/advisories/new). Include the affected version/build identity, reproduction steps, expected and observed behavior, and a minimal sanitized example. Do not include credentials, personal databases or private source unnecessarily. Avoid publishing exploit details in a public issue before coordination with the maintainer.

Expand All @@ -12,4 +12,4 @@ Reports are triaged as maintainer availability permits. There is no guaranteed r

维护者按实际可用时间评估与复现,不承诺固定响应或修复时限。确认的问题及缓解措施通过报告沟通,并按需发布补丁或安全公告。扫描任务成功不等于已有告警已关闭。

Relevant boundaries include workspace path containment, shell arguments and process ownership, bounded resource consumption, and UI audit integrity. WinCode may terminate helper processes it owns during cleanup; inspected application PIDs must remain outside that ownership. UI inspection and screenshots can expose application data, so reports should use isolated fixtures. Local audit logs and content hashes are diagnostic evidence, not tamper-proof records or release signatures. Report a violation of these boundaries even when a test currently passes.
Relevant boundaries include workspace path containment, shell arguments and process ownership, bounded resource consumption, and UI audit integrity. WinCode may terminate helper processes it owns during cleanup; inspected application PIDs must remain outside that ownership. UI inspection and screenshots can expose application data, so reports should use isolated fixtures. Local audit logs and content hashes are diagnostic evidence, not tamper-proof records or release signatures. Report a violation of these boundaries even when a test currently passes. Workspace namespaces and separate PIDs do not prove cross-process storage isolation. A bounded change hint is not source identity; current builtin cache reuse validates selected content and treats missing overflow as a miss, without promising an atomic workspace snapshot or permanent file lease. Unified admission limits and task-level workspace binding remain planned; existing cache budgets are not process memory limits.
Loading