Skip to content

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

Description

@zackees

Position

fbuild should stay as close to a monocrate as possible. We do not want a separate fbuild-broker crate at all.

PR #559 (feat/v1-broker-adoption) introduces a new crates/fbuild-broker/ crate (protocol + service + session modules) to adopt the running-process v1 broker session. That takes the workspace from 11 crates to 12 in the wrong direction.

Why fold it in instead

  • The broker session is consumed by exactly one crate — fbuild-daemon (it is the tokio process that calls …BrokerSession::adopt). A standalone crate adds a public API surface, a Cargo.toml, a README, and a dependency edge for code with a single in-tree consumer.
  • The "protocol/service/session" split is internal organization, which a module tree expresses just as well as a crate — without the packaging overhead.
  • Keeping it in-crate matches the existing convention: per-platform orchestrators live as modules under fbuild-build, not as one crate each.

Ask

Move the running-process v1 adoption out of a standalone crate and into an existing one — fbuild-daemon is the natural home:

crates/fbuild-daemon/src/broker/
    mod.rs        (was fbuild-broker/src/lib.rs)
    protocol.rs
    service.rs
    session.rs

If any of it is genuinely needed by another crate (e.g. the CLI's daemon running-process diagnostic prints service::SERVICE_NAME / MIN_VERSION), expose just those constants from wherever they land rather than keeping a whole crate alive for them — or have the CLI ask the daemon over the existing HTTP API.

Acceptance

  • No crates/fbuild-broker/ directory; workspace stays at 11 crates.
  • running-process v1 adoption (protocol/service/session) lives as a module inside an existing crate (fbuild-daemon preferred).
  • register_payload_protocol! pin and the RUNNING_PROCESS_DISABLE=1 rollback behavior are preserved exactly.
  • fbuild daemon running-process diagnostic still prints the same facts.
  • cargo test/clippy green.

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions