Skip to content

Cross-process locks: key liveness on pid + process start identity #413

Description

@justrach

From the prime-agent analysis. They never trust a bare pid: every lock/lease owner record carries processStartId (Linux: /proc//stat start-time field; macOS: ps -o lstart= -p <pid>; Windows: process start ticks). A recycled pid cannot steal a lease; stale locks are reclaimed only when identity provably mismatches.

graff fit: session_lock.zig, worktree_lease.zig, and the planned cross-process credential-store lock (oauth-arc backlog: scratchpad/oauth_findings.json). Add {pid, start_id} to owner records; liveness check = pid alive AND start identity matches.

Small, self-contained, and it upgrades every future lock (daemon leases included) for free.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions