Repository navigation
feat(inspect): report Windows process protection in census rows - #18
karljamoralin wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Add `protection` (`level` and `signer`) to `listProcesses()` rows, decoded from PS_PROTECTION through the same retained limited-query handle as the owner and identity facts. Omitted when the query is denied or the value is outside the documented ranges. Related: openclaw/openclaw#173430
163bfbd to
815c767
Compare
|
Codex review: blocked before merge. What this changesAdds optional Windows protection level and signer facts to process census rows. Example: Inspect DefenderSessionHelper.exe at PID 7500 on Windows 11.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains This PR adds a useful capability absent from current main, with no concrete introduced defect found; adopting the exported contract still needs the inspection owner's decision. Priority: P2 Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe inspect subpath passes census options to native Windows inspection, which enumerates PIDs and returns frozen observations derived through retained process handles. flowchart LR
A[Application] --> B[TypeScript inspect API]
B --> C[Native Windows census]
C --> D[Retained process handle]
D --> E[Identity owner and protection facts]
E --> F[Frozen census rows]
Technical reviewBest possible solution: Adopt the optional fact-only protection contract if the inspection owner approves, leaving consumer admission policy to a separate change. Do we have a high-confidence way to reproduce the issue? Current-main types and native census code establish the missing protection observation, supported by the linked affected-host capture; no target code was executed during this review. Is this the best way to solve the issue? Reading protection through the existing retained handle fits the census architecture, preserves unknown facts, and avoids embedding the consumer's exclusion policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cb91f900a68d. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 15, 2026, 9:36 PM ET / October 16, 2026, 01:36 UTC (Revision 2). |
|
@clawsweeper re-review Added real behavior proof to the PR body: built |
|
🦞👀 Re-review progress:
|
|
Closing: the maintainers fixed the underlying Windows update-repair refusal inside OpenClaw in openclaw/openclaw#173783 (merged), which closed openclaw/openclaw#173430 without needing a protection field from proc-safe. This API would have no consumer now, so I'm withdrawing it rather than asking for a decision on it. The branch stays on my fork in case a future caller needs process protection facts. |
Related: openclaw/openclaw#173430
What problem this solves
On Windows,
listProcesses()can't tell a protected system process (for example Microsoft Defender'sDefenderSessionHelper.exe, a PPL process) apart from any other process whose command line is unreadable. Both come back asowner: "same"with an identity and nocommand. Consumers have no kernel-reported fact to separate them.Change
Each row now carries an optional
protection: { level: "none" | "light" | "full", signer: ... }. It is decoded fromPS_PROTECTION(ProcessProtectionInformation, information class 61, one byte) through the same retained limited-query handle as the owner and identity facts, so it needs no extra access and shares the row's PID-reuse protection. It is omitted when the query is denied or the value is outside the documented ranges. Absence never implieslevel: "none". The package only reports the fact; it adds no admission policy.Evidence
Run on Windows 11 x64 (non-elevated, same account) against this branch's build (
815c767), calling the builtdist/inspect.jsentry point withlistProcesses({ timeoutMs: 15000, includeCommand: true }), once on the main thread and once in aworker_threadsWorker. Output is trimmed to the relevant rows; image names come fromtasklist, and no paths are printed.Main thread and Worker produced identical rows (393 / 392 rows, 216 with
protectionin both):This matches the reporter's capture in openclaw/openclaw#173430 (
DefenderSessionHelper.exe→0x31, gatewaynode.exe→0x00), now reproduced through this build.Tests: new
inspect.test.tscase asserts the caller's own row is{ level: "none", signer: "none" }and every reported protection is in range and frozen (15 of 16 inspect tests pass).cargo clippy --workspace --locked -- -D warningsis clean. There is no recorded base-fail run: onmain,protectionis simply not a field.Known gap
real command inspection and Worker boundaryfails on my Windows machine (test/fixtures/inspect-child.rs:38, "file not found"), and it fails the same way without this change. I haven't investigated it, sopnpm checkis not fully green locally; CI should confirm.Docs (
docs/inspect.md,docs/api.md) and the changelogUnreleasedentry are updated.