Skip to content

refactor(platform): phase 6 migrate daemon IPC lifecycle - #1334

Merged
zackees merged 3 commits into
mainfrom
refactor/platform-phase-6-ipc
Aug 21, 2026
Merged

refactor(platform): phase 6 migrate daemon IPC lifecycle#1334
zackees merged 3 commits into
mainfrom
refactor/platform-phase-6-ipc

Conversation

@zackees

@zackees zackees commented Aug 21, 2026

Copy link
Copy Markdown
Member

Closes #1312

Summary

  • add the neutral fbuild_core::platform::ipc local endpoint, peer-facts, TCP listener, and readiness APIs
  • move running-process backend endpoint transport, daemon TCP socket policy, and Windows native shutdown notifications out of shared daemon callers
  • enforce owner-only local endpoints — atomic pre-bind fchmod on Linux, post-bind chmod of the socket path on Darwin (interprocess mode() relies on fchmod-on-socket-fd, which Darwin rejects), and a protected Windows Owner Rights DACL
  • move interprocess/socket2 ownership into fbuild-core and extend exact boundary enforcement for the IPC capability

Compatibility

  • broker frame routing and running-process probe behavior are unchanged
  • HTTP/protobuf surfaces are unchanged
  • daemon bind retry/yield policy remains in fbuild-daemon; only one-attempt native listener construction moved
  • Windows close/logoff/shutdown events still feed the existing Tokio shutdown channel

Characterization and validation

  • RED: empty IPC facade failed local endpoint roundtrip/peer-facts and TCP readiness tests
  • GREEN: platform tests pass, including Windows anonymous-identity denial for the owner-only named pipe
  • daemon readiness test passes
  • serialized daemon ownership tests: 8 passed, 1 subprocess helper ignored by design
  • platform-boundary Python tests: 28 passed
  • workspace clippy with -D warnings passes
  • clud-review: clean
  • full Windows repo suite reached two unrelated long-run abnormal process exits; both affected crates pass isolated (fbuild-packages-fetch: 131/131, fbuild-serial: 184 passed/1 ignored)

Inventory

  • exact enforcement ledger: 107 -> 94
  • normalized Dylint projection: 103 -> 92
  • research inventory: 137 -> 142 (94 caller rows + 48 exact authorized boundary rows)
  • remaining caller IPC rows: 0

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@zackees, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 90da1f2d-f249-428a-b6d0-ecfe4ee3b2d9

📥 Commits

Reviewing files that changed from the base of the PR and between 662569f and ef36a1e.

⛔ Files ignored due to path filters (3)
  • Cargo.lock is excluded by !**/*.lock
  • ci/platform_boundary_ledger.tsv is excluded by !**/*.tsv
  • ci/platform_boundary_research.tsv is excluded by !**/*.tsv
📒 Files selected for processing (27)
  • Cargo.toml
  • ci/enforce_platform_boundary.py
  • ci/platform_boundary_research.py
  • ci/test_enforce_platform_boundary.py
  • ci/test_platform_boundary_research.py
  • crates/fbuild-core/Cargo.toml
  • crates/fbuild-core/src/platform/README.md
  • crates/fbuild-core/src/platform/ipc.rs
  • crates/fbuild-core/src/platform/linux/ipc.rs
  • crates/fbuild-core/src/platform/linux/mod.rs
  • crates/fbuild-core/src/platform/linux/process.rs
  • crates/fbuild-core/src/platform/macos/ipc.rs
  • crates/fbuild-core/src/platform/macos/mod.rs
  • crates/fbuild-core/src/platform/macos/process.rs
  • crates/fbuild-core/src/platform/process.rs
  • crates/fbuild-core/src/platform/windows/ipc.rs
  • crates/fbuild-core/src/platform/windows/mod.rs
  • crates/fbuild-core/src/platform/windows/process.rs
  • crates/fbuild-daemon/Cargo.toml
  • crates/fbuild-daemon/src/broker/backend.rs
  • crates/fbuild-daemon/src/main.rs
  • docs/architecture/portability.md
  • docs/architecture/runtime.md
  • docs/platform-boundary-research-inventory.md
  • docs/platform-boundary-research.md
  • dylints/enforce_platform_boundary/src/baseline.txt
  • dylints/enforce_platform_boundary/src/lib.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

zackees and others added 2 commits August 21, 2026 14:33
Darwin does not support fchmod() on socket fds; interprocess maps the
EINVAL from ListenerOptions::mode() to ErrorKind::Unsupported, so every
macOS local-endpoint bind failed (Check macOS on #1334: 'bind local
endpoint: Kind(Unsupported)'). Linux keeps the atomic pre-bind fchmod.

On macOS, bind first and chmod the socket path to 0600 immediately
after, failing closed if the chmod fails.

Co-Authored-By: Claude <noreply@anthropic.com>
@zackees
zackees force-pushed the refactor/platform-phase-6-ipc branch from 22d86d9 to 722ad4c Compare August 21, 2026 21:34
The Darwin post-bind-chmod change moved the PermissionsExt import and
usage lines in macos/ipc.rs and dropped the unused ListenerOptionsExt
import; the committed inventory drifted accordingly.

Co-Authored-By: Claude <noreply@anthropic.com>
@zackees
zackees merged commit 4476ca1 into main Aug 21, 2026
96 checks passed
@zackees
zackees deleted the refactor/platform-phase-6-ipc branch August 21, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

refactor(platform): phase 6/9 migrate daemon IPC and lifecycle mechanics

1 participant