Core Random
Canonical OpenSpec capability for Core Random.
Document layout: Feature capability layoutConforming
## Purpose## Requirements
Core.Random Specification
Purpose
Core.Random supplies integer and floating-point pseudo-random values through the runtime random provider.
Requirements
Requirement: Random value generation: Decision [D-CORE-PRIM-0110]
The Beskid standard SHALL enforce the following migrated contract section. Accepted ADR decisions are binding; uppercase requirement keywords retain their BCP-14 meaning.
NextInt() -> i64SHALL delegate to the__random_next_i64builtin,NextIntRange(i64 min, i64 max)SHALL return a value in the requested range with bounds clamped as required by the runtime, andNextFloat() -> f64MUST return a value from 0.0 through 1.0.
Stable ID: BSP-REQ-0000000000000110
Scenario: Conformance exercises Decision
- GIVEN an implementation claims conformance with this capability
- WHEN behavior governed by this contract section is exercised
- THEN every MUST, SHALL, REQUIRED, prohibition, and accepted decision in the section is satisfied
Requirement: Invalid random ranges: Decision [D-CORE-PRIM-0111]
The Beskid standard SHALL enforce the following migrated contract section. Accepted ADR decisions are binding; uppercase requirement keywords retain their BCP-14 meaning.
When
min > max,NextIntRangeMUST fail withCore.Random.RandomError.InvalidRange()rather than generate a value; the error submodule SHALL expose this variant.
Stable ID: BSP-REQ-0000000000000111
Scenario: Conformance exercises Decision
- GIVEN an implementation claims conformance with this capability
- WHEN behavior governed by this contract section is exercised
- THEN every MUST, SHALL, REQUIRED, prohibition, and accepted decision in the section is satisfied