Beskid

Jump to a Beskid service

Platform specification
featureStandard

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() -> i64 SHALL delegate to the __random_next_i64 builtin, NextIntRange(i64 min, i64 max) SHALL return a value in the requested range with bounds clamped as required by the runtime, and NextFloat() -> f64 MUST 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, NextIntRange MUST fail with Core.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