Skip to content

feat(tui): query Windows processes in-process#684

Closed
huangzesen wants to merge 1 commit into
dev4/windows-tui-native-20260718from
dev4/windows-native-process-query-20260718
Closed

feat(tui): query Windows processes in-process#684
huangzesen wants to merge 1 commit into
dev4/windows-tui-native-20260718from
dev4/windows-native-process-query-20260718

Conversation

@huangzesen

@huangzesen huangzesen commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace Windows wmic.exe / PowerShell process-table queries with an in-process WMI adapter
  • keep Unix on its existing ps adapter behind build-tagged platform files
  • reuse the exact existing LingTai launch-marker and agent-path matcher for WMI ProcessId + nullable CommandLine rows
  • preserve the current exported Port and error shape: one-agent checks still collapse query errors; all-agent scans still return them
  • update the nearby Contract, Anatomy, and conformance tests

Stack

Dependencies

  • github.com/yusufpapurcu/wmi v1.2.4 (MIT; tag resolves to 6c94d732ac31d45ca1f62731b1682157ce85e224)
  • transitive github.com/go-ole/go-ole v1.2.6 (MIT)
  • both compile into the TUI; users install no helper or service

Scope boundaries

  • no Slice B running / stopped / unknown Port migration
  • no backend/kernel/config/filesystem/migration behavior changes
  • no real-Windows-readiness claim
  • unrelated tui/agent_count_windows.go WMIC use remains out of scope and is not hidden by this PR
  • retained exported ParseWMICOutput remains a legacy deterministic parser only; Windows production observation no longer calls it

Parent-reviewed validation before opening

  • go test ./internal/processscan ./internal/process -count=1
  • go test . -run 'TestArchitectureEntryLinks|TestGovernedProcessContractGraph' -count=1
  • gofmt -d on all changed Go files
  • git diff --check
  • selected Windows files/imports: check.go + scan_windows.go; no os/exec
  • negative source check: no WMIC, PowerShell, shell, or external process-table helper in scan_windows.go
  • GOOS=windows GOARCH=amd64 go test -c for internal/processscan and internal/process
  • GOOS=windows GOARCH=amd64 go build . for the full TUI
  • all three generated artifacts are PE32+ console x86-64
  • module checksums verified; dependency licenses and WMI COM lifecycle inspected

Evidence limits

  • cross-build only; no real Windows 11 WMI/COM execution yet
  • validation compiler was Go 1.26.4; repo directive remains Go 1.26.1
  • x64 only; no arm64 claim
  • real provider, permission, and WMI-service failure behavior still needs Windows 11 evidence

No merge is requested or authorized by this PR opening.

Post-open validation at exact head 5d064bf048f04c648cd440f15891b374ede62719

  • go test ./... -count=1 — PASS (all TUI packages)
  • go vet ./... — PASS
  • worktree remained clean at the exact PR head

Independent exact-head review has been requested from the TUI source owner; no merge is authorized while that review is pending.

@huangzesen

Copy link
Copy Markdown
Collaborator Author

Independent exact-head review — PASS

Locked stack reviewed:

  • base: 0cca1ded27db2cbfd227b8399c139667aecfcc08
  • head: 5d064bf048f04c648cd440f15891b374ede62719
  • P1 findings: none
  • P2 findings: none
  • optional in-scope follow-ups: none

The independent read-only review verified:

  • exact Win32_Process / ProcessId uint32 / nullable CommandLine *string mapping;
  • wmi.Client{PtrNil:true} behavior and same-thread COM initialization, cleanup, and OS-thread locking in cached wmi v1.2.4 source;
  • shared marker/path matching, provider-row order, and retained one-agent vs all-agent error semantics;
  • correct Unix/Windows build-tag isolation and no WMIC, PowerShell, shell, downloader, or external-helper fallback in the Windows production/dependency path;
  • exact dependency graph, MIT licenses, and go mod verify;
  • Contract/Anatomy truth, citations, reciprocity, and absence of Slice B/backend/kernel/config/fs/migration/readiness scope leak.

Independent commands included:

  • go test ./internal/processscan -count=1 — PASS
  • focused architecture graph tests — PASS
  • GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go test -c ./internal/processscan — PASS, PE32+ x86-64
  • git diff --check — PASS
  • exact dependency verification and project/dependency no-helper scans — PASS
  • fresh snapshot ended at exact head with clean status

This evidence is read-only and head-bound. It is not GitHub approval, real-Windows runtime proof, or merge authorization.

@huangzesen

Copy link
Copy Markdown
Collaborator Author

Superseded by #685, which carries the nine independently reviewed interfaces on a new branch as requested. This PR is closed without merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant