macos-local-ipc-integrity
macOS Local IPC Integrity
Separate transport/decode/admission from authoritative commit/observation. Only the authority proves commit—not writes, send completions, or accepted.
Inspect and Define
Trace identity/ownership, framing/EOF/teardown, queue bounds, reconnect/replay, authorization/opaque resources, suspensions, single-writer commit, and fresh verification. For an Apple-native same-host service, evaluate NSXPCConnection first; this skill's byte-stream contracts apply when MCP stdio or a custom Unix-socket transport is the intended boundary.
Use Xcode MCP DocumentationSearch for Apple API behavior; see Apple documentation.
Define version, framing/limits/overload, correlation versus stable operation ID/digest, resource preconditions, and distinct rejected, accepted, committed, duplicate, conflicted, failed, and unknown.
Preserve Invariants
- Stream reads are arbitrary chunks: apply the selected transport's framing incrementally; cap before allocation; decode complete frames; keep stdout protocol-only; closure is EOF; serialize writes; bound per-peer/global bytes and work. Never silently discard an admitted command or outcome: overload and disconnect must have an explicit result or an
unknownstate recoverable through operation lookup. - JSON-RPC
idis correlation, not idempotency; notifications cannot prove commit and batches are not transactions. Preserve MCP negotiation. See framing/reconnect/flow. - Post-submission disconnect is
unknown. Retry only the same operation ID/digest. Commit restart-safe replay evidence atomically with the mutation; return matching duplicates without reapplying. Query after reconnect; bound backoff. - Reachability is not authorization. At the authority, check principal/method/resource, resolve opaque IDs, prevent path-based confused deputies, and revalidate capability, identity, policy, revision, and duplicates after every suspension. Keep delegated tokens narrow/unlogged.
- Use prepare → revalidate → write → commit. Return
committedonly after durable mutation, revision, operation ID, digest, and replayable result. Hold no locks/transactions across external awaits. See authorization/commit.