From 58a2fe3046725a48ad9cb0448e658c8978864a0a Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 14 Aug 2026 13:20:20 +0000 Subject: [PATCH] =?UTF-8?q?feat(cluster):=20RFC=20010=20c1=20=E2=80=94=20c?= =?UTF-8?q?luster=20feature=20flag=20+=20optional=20serde/postcard=20deps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Off by default; the default build stays libc-only. serde (payload contract) and postcard (payload codec) are optional, no default features. src/cluster.rs is an intentionally empty cfg-gated stub so the flag's default-build invariance is reviewable in isolation. --- Cargo.toml | 8 ++++++++ src/cluster.rs | 6 ++++++ src/lib.rs | 2 ++ 3 files changed, 16 insertions(+) create mode 100644 src/cluster.rs diff --git a/Cargo.toml b/Cargo.toml index 8b101b6..362b77d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,11 @@ budget-accounting = [] # and unflagged; only the optional gen_server transport sits behind this, so a # release build pays nothing for an observer it never starts. observer = [] +# RFC 010 c1: clustering. Off by default — the default build stays libc-only, +# byte-for-byte (gate checked per phase). serde is the payload contract, +# postcard the payload codec; both minimal (no default features). Everything +# cluster-shaped lives behind this flag. +cluster = ["dep:serde", "dep:postcard"] # Run-queue selection: exactly one, compile-time (see src/run_queue.rs). # Non-default variants need --no-default-features (features are additive). rq-mutex = [] @@ -44,6 +49,9 @@ cc = "1" [dependencies] libc = "0.2" +# RFC 010 §2 — only compiled under `--features cluster`. +serde = { version = "1", default-features = false, optional = true } +postcard = { version = "1", default-features = false, optional = true } [target.'cfg(loom)'.dependencies] loom = "0.7" diff --git a/src/cluster.rs b/src/cluster.rs new file mode 100644 index 0000000..9326694 --- /dev/null +++ b/src/cluster.rs @@ -0,0 +1,6 @@ +//! RFC 010 — clustering (smarm⇄smarm, explicit remote boundary). +//! +//! c1: feature flag + optional deps only. The owned envelope (c2), transport +//! trait (c3), and everything above them land in later chunks. This module is +//! intentionally empty so the `cluster` feature's default-build invariance is +//! reviewable in isolation. diff --git a/src/lib.rs b/src/lib.rs index 7dfb3f4..3a6ee80 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,6 +14,8 @@ pub mod actor; pub mod causal; pub mod channel; +#[cfg(feature = "cluster")] +pub mod cluster; pub mod context; pub mod gen_server; pub mod gen_statem;