From f52a09ebfa2c33fcbda6521b51d29033446a0858 Mon Sep 17 00:00:00 2001 From: repo-worker-code Date: Tue, 3 Nov 2026 10:08:53 -0600 Subject: [PATCH] docs(id-core): split WorldExecutionProfile::validate/resolve rustdoc (#4373) The validate doc was two half-merged blocks: a heading describing resolve's clamping, a subject-less sentence about None inheritance, an empty caller bracket where the apply-time caller's name was lost, and a second # Errors section. resolve() had no doc comment at all. validate now describes only validation (floors, None inherits), names both callers with the resolve link and the manifest validator, and has one # Errors section. resolve() carries its own doc (lower-or-inherit, clamping, module-size cap from hard, error propagation). Docs only; no signature or behavior change. --- pkgs/id/crates/id-core/src/world_limits.rs | 38 ++++++++++++++-------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/pkgs/id/crates/id-core/src/world_limits.rs b/pkgs/id/crates/id-core/src/world_limits.rs index 6136c198a5..cf64aad8f8 100644 --- a/pkgs/id/crates/id-core/src/world_limits.rs +++ b/pkgs/id/crates/id-core/src/world_limits.rs @@ -308,22 +308,17 @@ pub struct WorldExecutionProfile { } impl WorldExecutionProfile { - /// Validate values and resolve them beneath the server's hard limits. + /// Validate the requested bounds on their own. /// - /// A request may lower a bound or inherit it, but can never raise the - /// server ceiling. The Wasm module-size cap is always taken from `hard`. + /// Every bound that is set must be positive and at or above its floor: + /// Wasm memory at least one Wasm page, native address space at least + /// 16 MiB, and every other bound nonzero. A bound left as `None` + /// inherits the server ceiling and is always valid. /// - /// # Errors - /// - /// A requested bound of zero or a value that cannot be represented on - /// this host. - /// Validate the requested bounds on their own: every bound that is set - /// must be positive and at or above its floor. inherits the - /// server ceiling and is always valid. - /// - /// This is the single source of truth for the bound checks: [] - /// runs it against the live profile at apply time, and the world - /// manifest validator runs it at parse time, so a manifest can never + /// This is the single source of truth for the bound checks: + /// [`Self::resolve`] runs it against the live profile at apply time, + /// and the world manifest validator (`WorldManifest::validate`, in the + /// parent `id` crate) runs it at parse time, so a manifest can never /// accept bounds that apply would later refuse (#3015). /// /// # Errors @@ -359,6 +354,21 @@ impl WorldExecutionProfile { Ok(()) } + /// Resolve these requested bounds beneath the server's hard limits. + /// + /// Every bound may lower the server ceiling or inherit it, but never + /// raise it: a set value is clamped to the corresponding `hard` limit + /// and a `None` value takes the ceiling. The Wasm module-size cap is + /// always taken from `hard` (the profile cannot request it). + /// + /// Calls [`Self::validate`] first, so an invalid requested bound is + /// refused here exactly as the world manifest validator refuses it at + /// parse time (#3015). + /// + /// # Errors + /// + /// Propagates [`Self::validate`]'s errors, and fails when a resolved + /// bound cannot be represented on this host. pub fn resolve(self, hard: RuntimeLimits) -> Result { self.validate()?;