Skip to content

feat: add process identity and Darwin coalition capabilities - #1

Merged
steipete merged 6 commits into
mainfrom
koffi/p0-scaffold
Oct 10, 2026
Merged

steipete merged 6 commits into
mainfrom
koffi/p0-scaffold

Conversation

@steipete

@steipete steipete commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add @openclaw/proc-safe with lazy process identity and Darwin coalition capabilities. Identity reports PID, parent, epoch birth, resolution, and exited state. Linux and FreeBSD also expose boot-relative birth for stable PID-reuse comparisons. Unreaped zombies and retained Windows objects keep their identities; uncertain observations throw typed errors.

Missing-record results are policy-aware. Cached FreeBSD visibility settings and the actual Linux /proc mount determine whether absence is proven or must be reported as access-denied with a visibility-policy reason. Imports never initialize the addon, and no shell fallback runs in the package.

Validation

All 24 required checks pass at 99deacb740b28084caab846d59fe78ccee6c8468: CI run. The complete branch review has no actionable findings.

  • Node 22/24 on all ten targets; Bun on its supported platforms; real main-thread and Worker observations.
  • Positive unreaped-zombie tests, retained Windows exit code 259, Darwin sandbox denial, controlled Windows ACL denial from a restricted token, Linux private hidepid namespaces, and restricted FreeBSD visibility tests.
  • Isolated root-only npm/pnpm consumer installs and platform filtering. FreeBSD uses npm after Linux prepares dependencies and JavaScript.
  • Lint, type checks, clippy, audit, package checks, and exact certificate-identity regression tests pass. Local Node/Bun suites pass 37/37.

FreeBSD 14.4 runs under real FreeBSD kernels; ARM64 CPU execution is QEMU-emulated. Cargo builds inside each VM and the shared native suite runs directly with Node. No pnpm executable is needed inside the VMs.

Native and release boundaries

Darwin's SDK-compiled kernel observation supplies zombie identities excluded by libproc. Windows keeps handles through birth/parent/exit observations and disambiguates STILL_ACTIVE from an application exiting with code 259. Ten exact-version optional packages keep imports lean.

The protected-tag release workflow verifies collected tarball bytes, registry signatures, and exact workflow certificate identity. Platform packages verify before root publication. No packages, tags, releases, or repository settings were published or changed.

Ready for maintainer review; this PR has not been merged.

@clawsweeper

clawsweeper Bot commented Oct 10, 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 P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. 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 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge.

What this changes

This PR adds native process identity and ancestry APIs, Darwin coalition queries, platform packages, and release automation.

Example: A Windows child exits with code 259 while another process retains its kernel handle.

  • Before: Current main provides no process identity API.
  • After: readProcessIdentity returns the retained birth identity with exited set to true.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful native implementation with substantial OS validation and no concrete introduced finding, but the release authority evidence remains insufficient.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Product

Kind: Feature · Worth it: Yes
User problem: Applications need typed process birth and parent observations that distinguish missing, retained, and inaccessible processes.
Reason: The capabilities realize the current-main repository contract and have clear value; the supplied repository state establishes maintainer authorship, so no repeated direction approval is requested.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: current main lacks these useful native capabilities, and this PR contains substantial unique work; the earlier Windows denial blocker is resolved.

Priority: P2
Reviewed head: 99deacb740b28084caab846d59fe78ccee6c8468

Before merge

  • Add real behavior proof - Authority-chain proof required: native lifecycle, retained-exit, denial, and Worker checks support the process APIs, but the body and discussion supply no production release-owner artifact showing allowed effects, unprotected or off-main source rejection, invalidated authority rejected during queued jobs or reruns, and invalid provenance rejected before promotion; provide redacted terminal output or logs, omitting credentials, IPs, and non-public endpoints. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve security concern: Validate retained release-source authority - Downstream privileged jobs rely on the earlier validation result; protection or source-authorization changes during queued work and reruns are not checked by these owners, and the supplied evidence does not establish whether external enforcement prevents their final effects.
  • Resolve merge risk - Establish that invalidated tag or release-source authorization cannot survive queued or rerun jobs into npm publication or GitHub release changes.

Findings

  • [medium] Validate retained release-source authority — .github/workflows/release.yml:95

Tests

  • Missing end-to-end proof: Supply release-owner evidence for allowed effects, forbidden or invalidated source rejection before effects, and invalid provenance rejected before promotion.
Agent review details

How this fits together

TypeScript capability subpaths lazily load a platform addon that converts kernel observations into process identities, coalition information, or typed errors.

flowchart LR
  A[Application] --> B[Capability API]
  B --> C[Lazy native loader]
  C --> D[Platform addon]
  D --> E[Kernel observation]
  E --> F[Identity or typed error]
Loading

Technical review

Best possible solution:

Preserve the native observation APIs and ensure release authorization remains valid when publication and promotion perform their final effects.

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

This PR introduces capabilities rather than fixing a current-main bug; real-addon lifecycle and Worker checks exercise the native paths.

Is this the best way to solve the issue?

Lazy capability subpaths and native-owned observations fit the repository contract, while the privileged release path needs a verified authorization handoff.

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Validate authorization at release effects (recommended)
    Make the publishing and release owners reject invalidated source authority before their effects, and demonstrate allowed, forbidden, and queued or rerun cases.
  2. Defer publishing automation
    Separate privileged publication and promotion into a focused follow-up while retaining the native capability work.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Ensure npm publication and GitHub release changes reject invalidated release-source authority, including queued jobs and reruns; require evidence through the production release owners.

Provenance checked

  • README package scope keeps the original intent (085ebb9: The original README describes lazy, platform-specific, fail-closed mechanisms that supply facts while leaving application policy with callers.)

Testing

Proof path: in-process harness.

Security

Needs attention: Release-source authority persists across jobs without established revocation behavior at publication and promotion.

Evidence

Security concerns:

  • [medium] Validate retained release-source authority — .github/workflows/release.yml:95
    Downstream privileged jobs rely on the earlier validation result; protection or source-authorization changes during queued work and reruns are not checked by these owners, and the supplied evidence does not establish whether external enforcement prevents their final effects.
    Confidence: 0.88

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 085ebb9 adds AGENTS.md:5 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 085ebb9701b6; files: AGENTS.md)

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is an initial capability addition without an established released-user outage.
  • merge-risk: 🚨 security-boundary: The new workflow carries a release-source decision into later jobs with npm publishing and GitHub release authority.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

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

  • Add final-effect proof for unprotected or off-main release sources and prove invalidated authority cannot survive queued publishing jobs or reruns.

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 need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (5 earlier review cycles)
  • reviewed 2026-10-10T04:04:10.497Z sha 32a4bf8 :: needs real behavior proof before merge. :: [P2] Return null for an already-exited Windows process
  • reviewed 2026-10-10T04:12:33.323Z sha 479be52 :: needs real behavior proof before merge. :: [P2] Return null for an already-exited Windows process
  • reviewed 2026-10-10T04:29:44.402Z sha 479be52 :: needs real behavior proof before merge. :: [P2] Return null for an already-exited Windows process
  • reviewed 2026-10-10T05:25:49.522Z sha ba01a0e :: needs real behavior proof before merge. :: [P2] Use a deterministic Windows access-denial fixture
  • reviewed 2026-10-10T05:46:07.337Z sha 46707c6 :: needs real behavior proof before merge. :: none

Reviewed October 10, 2026, 2:14 AM ET / 06:14 UTC (Revision 6).

@steipete steipete changed the title feat: scaffold process identity and Darwin capabilities feat: add process identity and Darwin coalition capabilities Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant