Skip to content

feat(inspect): report Windows process protection in census rows - #18

Closed
karljamoralin wants to merge 1 commit into
openclaw:mainfrom
karljamoralin:feat/inspect-process-protection
Closed

karljamoralin wants to merge 1 commit into
openclaw:mainfrom
karljamoralin:feat/inspect-process-protection

Conversation

@karljamoralin

@karljamoralin karljamoralin commented Oct 16, 2026 •

Copy link
Copy Markdown

Related: openclaw/openclaw#173430

What problem this solves

On Windows, listProcesses() can't tell a protected system process (for example Microsoft Defender's DefenderSessionHelper.exe, a PPL process) apart from any other process whose command line is unreadable. Both come back as owner: "same" with an identity and no command. 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 from PS_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 implies level: "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 built dist/inspect.js entry point with listProcesses({ timeoutMs: 15000, includeCommand: true }), once on the main thread and once in a worker_threads Worker. Output is trimmed to the relevant rows; image names come from tasklist, and no paths are printed.

Main thread and Worker produced identical rows (393 / 392 rows, 216 with protection in both):

protected row, command unavailable (same owner):
  pid 7500  DefenderSessionHelper.exe  owner: same  identity: present  command: absent
            protection: { level: "light", signer: "antimalware" }

ordinary row (the inspecting node.exe):
  pid 4072  node.exe  owner: same  identity: present  command: present
            protection: { level: "none", signer: "none" }

inaccessible row keeps unknown facts:
  pid 308   Secure System  owner: unknown  identity: absent  command: absent
            protection: absent

all returned protection objects frozen: true

This matches the reporter's capture in openclaw/openclaw#173430 (DefenderSessionHelper.exe → 0x31, gateway node.exe → 0x00), now reproduced through this build.

Tests: new inspect.test.ts case 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 warnings is clean. There is no recorded base-fail run: on main, protection is simply not a field.

Known gap

real command inspection and Worker boundary fails 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, so pnpm check is not fully green locally; CI should confirm.

Docs (docs/inspect.md, docs/api.md) and the changelog Unreleased entry are updated.

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

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
@karljamoralin
karljamoralin force-pushed the feat/inspect-process-protection branch from 163bfbd to 815c767 Compare October 16, 2026 00:58
@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex review: blocked before merge.

What this changes

Adds optional Windows protection level and signer facts to process census rows.

Example: Inspect DefenderSessionHelper.exe at PID 7500 on Windows 11.

  • Before: The row has owner same and an identity, but no command or protection information.
  • After: The row additionally reports protection with level light and signer antimalware.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Scoped runtime evidence now clears the earlier proof gap, and no introduced defect was found; owner direction remains unresolved and automated validation of this head is absent.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The updated PR body exercises the changed native census and TypeScript wrapper through built dist/inspect.js on Windows 11 x64 at the reviewed head, showing protected, ordinary, and inaccessible rows plus frozen protection objects on both the main thread and a Worker.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Needs a maintainer decision · Fix scope: Partial
User problem: Windows census consumers cannot distinguish a protected process from an ordinary process whose command is unreadable.
Reason: The library capability is complete within its stated scope, but resolving openclaw/openclaw#173430 additionally requires a consumer policy change, and the new public contract awaits owner direction.

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
Reviewed head: 815c7677c8a6d9f85092dab19de4548b4a0da11f
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should the inspect API expose the proposed protection level and signer vocabulary as a supported public contract?
  • Recommendation: Approve the fact-only API: Accept the optional protection object and its unknown-value semantics while keeping application exclusion decisions outside proc-safe.
  • Why: This adds an exported capability with a concrete consumer need, but neither this PR nor its linked report contains an owner approval of the direction.

Before merge

  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

None.

Tests

  • Missing end-to-end proof: The added native integration assertion has no recorded base-fail run, although the supplied shipped-entry-point output covers the requested Windows scenarios.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Windows census retained-handle observations and unknown facts keeps the original intent (feat: add native process command inspection #3: Preserve every enumerated PID, derive each row's facts through one retained process object, and report unavailable observations without application admission policy.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit f44b488 adds native/src/inspect.rs:673 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f44b488c4e6f; files: native/src/inspect.rs)

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status no longer selects a status label.

Label justifications:

  • P2: A focused Windows inspection capability with a demonstrated consumer need and limited scope.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Obtain the inspection owner's decision on the exported protection contract.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-16T01:12:52.044Z sha 815c767 :: needs real behavior proof before merge. :: none

Reviewed October 15, 2026, 9:36 PM ET / October 16, 2026, 01:36 UTC (Revision 2).

@karljamoralin

Copy link
Copy Markdown
Author

@clawsweeper re-review

Added real behavior proof to the PR body: built dist/inspect.js output on Windows from the main thread and a Worker, showing a protected row with unavailable command data, an ordinary row with protection none, and an inaccessible row with unknown facts.

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 16, 2026
@karljamoralin

Copy link
Copy Markdown
Author

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.

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

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant