feat: add C# and Rust Windows Computer Use feasibility spike - #4555
Draft
sunheyi6 wants to merge 8 commits into
Draft
feat: add C# and Rust Windows Computer Use feasibility spike#4555sunheyi6 wants to merge 8 commits into
sunheyi6 wants to merge 8 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This draft PR adds a language-blind Windows Computer Use feasibility spike for C#
System.Windows.Automationand a direct-COM Rust helper, aligned withapache/maka#4318.Scope
The spike implements a bounded, fail-closed private JSON-RPC protocol for supervised Windows helpers. It covers HWND/PID/process-start-time/window-generation identity, one-shot snapshot and authorization tokens, UIA observation, semantic
set_value/click/select/toggle/scroll actions, typed readback, target-window WGCCreateForWindow(HWND)capture, cancellation, hung-provider recovery, parent-death cleanup, and C#SendInputABI diagnostics. The action tier does not fall back to coordinates, rectangles,PostMessage, foreground forcing, or arbitrary keyboard input. The explicitly named compatibility tier permits only one-shot authorized Unicode/EnterSendInputafter exact foreground/focus/identity checks.Latest cross-machine validation
Validation was run on Windows 11 Pro
10.0.26200, x64, on 2026-09-02. All real-application tests used isolated temporary fixtures, Chrome profiles, user-data directories, or documents. No existing user Chrome profile or user document was opened or modified.Environment:
v22.16.010.0.400rustc 1.89.0, cargo1.89.026.8.0.3atD:\soft\program\soffice.exe152.0.7977.x, temporary profiles onlyBuild and protocol checks:
cargo fmt --checkpasses.cargo clippy --all-targets -- -D warningspasses.34/34and protocol3/3; the combined comparison result is74/74.Application matrix:
force-renderer-accessibility-completemode.unknownand is not upgraded.ValuePatternwas exposed.Document/ValuePatternwas verified.The
unknown,blocked, andnot testedoutcomes are preserved as evidence. A page-oracle success is not rewritten as helper verification, mutation is not retried merely to change an outcome, and identity checks are not weakened.Published artifacts and performance
The published package is self-contained
win-x64, single-file, and trimming-disabled. It is intentionally unsigned and recordsdistributionReady=false; it is experimental evidence, not a production release certification.maka-cu-windows.exe: 199,642,135 bytes, SHA256A705BCF778CD15187AD7FECF00AF0017E06279B8393588ECEED557947EEDE576maka-cu-windows-rust.exe: 533,504 bytes, SHA256E297321C6D74F8B34FC66261B21E06FDDE894A7E28CF5DA115C06B10D3190ADDD753288D843A8D6331D6ED33CA792C76B9B2DD8EC7FEFCF2019D0CB716CF61BF69–80 ms, Rust39–41 ms22.7 MiB, Rust approximately7.2 MiB62 ms, Rust239 msChanges made after the initial PR validation
WgcCaptureinterop warning.ControlType.DocumentforValuePattern/InvokePatternso Notepad text actions are represented safely.experiments/maka-cu-windows/CROSS-MACHINE-TEST-REPORT-2026-09-02.md.Evidence files
experiments/maka-cu-windows/CROSS-MACHINE-TEST-REPORT-2026-09-02.mdexperiments/maka-cu-windows/comparison-results-cross-machine.jsonexperiments/maka-cu-windows/app-task-results-cross-machine.jsonexperiments/maka-cu-windows/browser-results-semantic-cross-machine-latest.jsonexperiments/maka-cu-windows/browser-results-navigation-cross-machine-latest.jsonexperiments/maka-cu-windows/observe-tree-results-cross-machine.jsonexperiments/maka-cu-windows/real-app-probe-cross-machine.jsonFinal boundary
The fixture/protocol baseline and the tested semantic Computer Use paths are reproduced. No additional source defect is indicated by this matrix. This is suitable as clean-machine runtime/package evidence for the experiment, but it is not signed production distribution, arbitrary-Windows-app certification, or a production backend admission. Remaining limitations are the intentionally unknown helper-side Enter result, safe semantic document write coverage where providers expose no reliable
ValuePattern, production signing, and independent OS-level parent supervision.中文翻译
这是一个针对
apache/maka#4318的语言无关 Windows Computer Use 可行性实验 PR,包含 C#System.Windows.Automationhelper 和直接 COM 的 Rust helper。范围
该实验实现了一个受监督 Windows helper 使用的、有界且失败关闭的私有 JSON-RPC 协议,覆盖 HWND/PID/进程启动时间/windowGeneration 身份、一次性 snapshot 和授权 token、UIA 观察、语义
set_value/点击/选择/切换/滚动动作、typed readback、目标窗口 WGCCreateForWindow(HWND)截图、取消、卡住 provider 恢复以及父进程退出清理,并包含 C#SendInputABI 诊断。动作层不会回退到坐标、矩形、PostMessage、强制前台或任意键盘输入。明确命名的 compatibility tier 只有在严格的前台/焦点/身份检查通过后,才允许一次性授权的 Unicode/EnterSendInput。最新跨机器验证
验证于 2026-09-02 在 Windows 11 Pro
10.0.26200、x64 上完成。所有真实应用测试都使用隔离的临时 fixture、Chrome profile、user-data 目录或文档。没有打开或修改现有用户 Chrome profile 或用户文档。环境:
v22.16.010.0.400rustc 1.89.0、cargo1.89.026.8.0.3,路径为D:\soft\program\soffice.exe152.0.7977.x,仅使用临时 profile构建和协议检查:
cargo fmt --check通过。cargo clippy --all-targets -- -D warnings通过。34/34和 protocol3/3;合计 comparison 结果为74/74。应用矩阵:
force-renderer-accessibility-complete模式下重复 3 次。unknown,不会升级。ValuePattern。Document/ValuePattern。unknown、blocked和not tested结果均作为证据保留。page oracle 成功不会被改写成 helper verified,不会为了改变结果而重试变更动作,也不会放宽身份检查。发布产物和性能
发布包是 self-contained
win-x64、single-file 且禁用 trimming。它有意保持 unsigned,并记录distributionReady=false;这是实验性证据,不是生产发行版认证。maka-cu-windows.exe:199,642,135 bytes,SHA256A705BCF778CD15187AD7FECF00AF0017E06279B8393588ECEED557947EEDE576maka-cu-windows-rust.exe:533,504 bytes,SHA256E297321C6D74F8B34FC66261B21E06FDDE894A7E28CF5DA115C06B10D3190ADDD753288D843A8D6331D6ED33CA792C76B9B2DD8EC7FEFCF2019D0CB716CF61BF69–80 ms,Rust39–41 ms22.7 MiB,Rust 约7.2 MiB62 ms,Rust239 ms初始 PR 验证后的改动
WgcCaptureinterop warning。ControlType.Document探测ValuePattern/InvokePattern,使 Notepad 文本动作可以安全呈现。experiments/maka-cu-windows/CROSS-MACHINE-TEST-REPORT-2026-09-02.md。证据文件
experiments/maka-cu-windows/CROSS-MACHINE-TEST-REPORT-2026-09-02.mdexperiments/maka-cu-windows/comparison-results-cross-machine.jsonexperiments/maka-cu-windows/app-task-results-cross-machine.jsonexperiments/maka-cu-windows/browser-results-semantic-cross-machine-latest.jsonexperiments/maka-cu-windows/browser-results-navigation-cross-machine-latest.jsonexperiments/maka-cu-windows/observe-tree-results-cross-machine.jsonexperiments/maka-cu-windows/real-app-probe-cross-machine.json最终边界
fixture/protocol 基线以及已测试的语义 Computer Use 路径均已复现。该矩阵没有显示出仍需修复的源代码缺陷。它可以作为本实验的 clean-machine runtime/package 证据,但不是签名生产发行版、任意 Windows 应用认证或生产 backend 准入证据。剩余限制包括有意保留的 helper 侧 Enter 结果 unknown、provider 没有可靠
ValuePattern时的安全语义文档写入覆盖、生产签名以及独立的 OS 级父进程监督。