Skip to content

feat(inspect): add Darwin process census and PID selection - #19

Merged
steipete merged 2 commits into
mainfrom
feat/darwin-process-census
Oct 17, 2026
Merged

steipete merged 2 commits into
mainfrom
feat/darwin-process-census

Conversation

@steipete

@steipete steipete commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Darwin callers can now enumerate processes through @openclaw/proc-safe/inspect, including parent PIDs, process groups, ownership, and kernel state. Topology remains available for foreign-owner processes whose birth identity is denied, and retained zombies remain visible rather than being mistaken for missing PIDs.

ProcessSnapshot adds independent parentPid, processGroupId, and state fields plus the exported ProcessState union. Darwin reads short BSD records for topology and ownership, full records for optional birth identity, and the existing SDK kernel-record bridge for libproc-excluded zombies. Birth identity brackets optional combined observations against PID reuse. Both Darwin and Windows accept pids selections after validating a complete enumeration; Windows also exposes its already-known parent PID. Native deadlines and unknown-fact semantics remain intact. Linux and FreeBSD census stays unsupported.

Validation includes real setsid, stopped, zombie, foreign-owner, missing-PID, and native-deadline observations on the main thread and Workers under Node and Bun. The Windows selection proofs also cover process-ACL and caller-token denial. Local macOS arm64 checks pass: pnpm check, native build, native-required inspection tests (23 tests per runtime), identity/lifecycle proof, and Cargo clippy. CI covers macOS and Windows on both architectures, plus the existing Linux and FreeBSD matrix. Import benchmarks confirm the entry point remains lazy.

Exact-head CI passed all 24 checks, including FreeBSD ARM64 on Node 22 and 24. Independent isolated review is clean through P2.

@clawsweeper

clawsweeper Bot commented Oct 17, 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026

Copy link
Copy Markdown

Codex review: needs changes before merge.

What this changes

Adds an optional pids selection to Windows process census calls while retaining complete enumeration checks and explicit unknown facts.

Example: On Windows, inspect running PID 4072 with pids: [4072, 4072].

  • Before: The census reads facts for every enumerated process; callers must filter the returned rows.
  • After: The census validates the complete enumeration, reads facts only for PID 4072, and returns one row.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, apparently correct extension with meaningful real-OS fixture coverage; evidence remains harness-based.
Proof confidence 🦐 gold shrimp (3/6) The supplied maintainer-authored exemption applies; selection runs through real native main-thread/Worker fixtures in passing Windows CI, while the body and discussion provide no separate live selection trace.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Windows callers interested in a few processes currently incur observation work for every enumerated PID before filtering results.
Reason: The optional selection provides a concrete capability without changing existing calls; the supplied maintainer-authored direction settles adoption of this additive option.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: it adds useful Windows selection support absent from main, preserves census safety contracts, and has no actionable introduced defect.

Priority: P2
Reviewed head: 477b1cd731ec400a0dc4f05beacc6815029abd33

Before merge

  • Complete next step - Mark this PR ready for review when the Windows-only scope is final.

Findings

None.

Tests

  • Missing end-to-end proof: No standalone shipped-entry-point selection output or recorded base-fail/head-pass comparison is supplied; exact-head native fixtures cover the changed cases.
Agent review details

How this fits together

The inspect subpath validates application options, invokes native Windows enumeration and retained-handle inspection, and returns frozen process observations.

flowchart LR
  A[Application options] --> B[TypeScript validation]
  B --> C[Complete Windows enumeration]
  C --> D[Selected PID filter]
  D --> E[Retained handle observations]
  E --> F[Frozen process rows]
Loading

Technical review

Best possible solution:

Land the focused Windows selection extension when the author considers the draft ready, retaining existing census defaults and safety checks.

Do we have a high-confidence way to reproduce the issue?

This is a capability addition rather than a reported bug; current-main signatures and native code establish that selecting PIDs before per-process inspection is unavailable.

Is this the best way to solve the issue?

Filtering inside the existing native census avoids unnecessary foreign-process reads while preserving enumeration validation, observation semantics, and the existing API owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against cb91f900a68d.

Provenance checked

  • Windows census enumeration, retained-handle facts, and default behavior keeps the original intent (feat: add native process command inspection #3: Return complete enumeration observations with explicit uncertainty, retained process identity, bounded deadlines, and no application admission policy.)
  • README inspection contract keeps the original intent (docs: add README, logo and 0.1.0 release notes #11: Document capability signatures and the package's explicit value, absence, and error contracts.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Review metrics

Metric Value Why it matters
Change distribution Production +25/-6; tests and fixtures +30/-0; documentation +13/-2 The small additive API change is supported by broader selection and denial coverage without unrelated production refactoring.

Labels

Label changes:

  • add P2: Useful additive Windows inspection functionality with limited platform scope and no demonstrated urgent regression.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Useful additive Windows inspection functionality with limited platform scope and no demonstrated urgent regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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.

Reviewed October 16, 2026, 9:28 PM ET / October 17, 2026, 01:28 UTC.

@steipete steipete changed the title feat(inspect): filter Windows process census by selected PIDs feat(inspect): add Darwin process census and PID selection Oct 17, 2026
@steipete
steipete marked this pull request as ready for review October 17, 2026 01:51
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T01:53:44.727796Z 5bf07c7 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete merged commit 27f3562 into main Oct 17, 2026
24 checks passed
@steipete
steipete deleted the feat/darwin-process-census branch October 17, 2026 01:52
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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant