Skip to content

refactor(broker): fold fbuild-broker crate into fbuild-daemon module (#560) - #561

Merged
zackees merged 1 commit into
mainfrom
fix/560-fold-broker-into-daemon
Jun 13, 2026
Merged

refactor(broker): fold fbuild-broker crate into fbuild-daemon module (#560)#561
zackees merged 1 commit into
mainfrom
fix/560-fold-broker-into-daemon

Conversation

@zackees

Copy link
Copy Markdown
Member

Summary

Resolves#560. fbuild stays as close to a monocrate as possible: the standalone fbuild-broker crate introduced by #559 is removed and its protocol/service/session modules now live under crates/fbuild-daemon/src/broker/. Stacked on feat/v1-broker-adoption so the diff is just the fold, not a re-review of #559.

  • No more fbuild-broker crate. The running-process v1 adoption is a module inside fbuild-daemon (the tokio process that actually adopts the broker session), matching how per-platform orchestrators live under fbuild-build.
  • register_payload_protocol! pin and RUNNING_PROCESS_DISABLE=1 rollback preserved exactly — the macro pin stays in broker/protocol.rs (the real consumer); the escape-hatch test moved with session.rs.
  • CLI diagnostic keeps working without depending on the daemon.fbuild-cli is a thin HTTP client and must not depend on fbuild-daemon, so the dependency-free pieces the daemon running-process diagnostic prints — CacheRoots + the display constants (CI_TRUSTED_INSTANCE, MIN_VERSION, FBUILD_PAYLOAD_PROTOCOL, FBUILD_PROTOCOL_VERSION) — moved into fbuild-paths::running_process. A drift test asserts the daemon's macro pin equals the fbuild-paths display copy.
  • New-crate lint guard.crate-gate.yml runs ci/check_workspace_crates.py, which fails CI if [workspace] members gains an entry outside the approved allowlist (a justified new crate must be added to the allowlist in the same PR with rationale).
  • Monocrate policy documented in CLAUDE.md and crates/CLAUDE.md.

Test plan

  • soldr cargo check --workspace --all-targets — clean; Cargo.lock no longer references fbuild-broker
  • soldr cargo clippy -p fbuild-daemon -p fbuild-paths -p fbuild-cli --all-targets -- -D warnings — clean (only the pre-existing MSRV-config notice)
  • soldr cargo test -p fbuild-paths -p fbuild-daemon --lib — all 15 broker tests pass in their new home, including payload_protocol_matches_paths_display_copy (drift guard) and disable_env_and_unreachable_broker_contracts (rollback)
  • uv run python ci/check_workspace_crates.py — OK: 14 approved members, no new crates; verified it flags an unexpected member
  • CI green on crate-gate.yml

🤖 Generated with Claude Code

@coderabbitai

coderabbitaiBot commented Jun 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4793891e-9eeb-445b-bf08-32698530addd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/560-fold-broker-into-daemon

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 and usage tips.

…560)
fbuild stays as close to a monocrate as possible: the standalone
fbuild-broker crate (PR #559) is removed and its protocol/service/session
modules now live under crates/fbuild-daemon/src/broker/. The
register_payload_protocol! pin and RUNNING_PROCESS_DISABLE=1 rollback
behavior are preserved exactly.
The dependency-free pieces the CLI `daemon running-process` diagnostic
prints — CacheRoots plus the display constants (CI_TRUSTED_INSTANCE,
MIN_VERSION, FBUILD_PAYLOAD_PROTOCOL, FBUILD_PROTOCOL_VERSION) — move into
fbuild-paths::running_process so fbuild-cli need not depend on fbuild-daemon
or pull in running-process. A drift test asserts the daemon's macro pin
equals the fbuild-paths display copy.
Adds a monocrate guard: crate-gate.yml runs ci/check_workspace_crates.py,
failing CI if a new workspace member is added outside the approved
allowlist. Documents the "never add a new crate" policy in CLAUDE.md and
crates/CLAUDE.md.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@zackees
zackeesforce-pushed the fix/560-fold-broker-into-daemon branch from 11f1fad to 233bb71CompareJune 13, 2026 16:17
@zackees
zackees changed the base branch from feat/v1-broker-adoption to mainJune 13, 2026 16:17
@zackees
zackees merged commit 650bd89 into mainJun 13, 2026
1 check passed
Sign up for freeto 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.

Don't add a separate fbuild-broker crate — keep fbuild close to a monocrate

1 participant

@zackees