Jadpo is experimental and not ready for production. These docs follow the compiler's main branch as of 30 Oct 2026. What's built · Install 0.1.0
jadpo
Reference: Standard library

Standard library · rule

type.random_context

Randomness is read outside an action.

Area 19, Standard library; not declinable; the next step is usually the agent's.

A random operation reads the generator, so only actions, tests and fixtures call it; a function is pure, and so is an inline function or a constant, as for area 10's type.clock_context. So do crypto.encrypt, for its nonce, and crypto.hash_password, for its salt.

example
type OrderReference = Text {}/// An order's reference, which a customer reads out on the phone.function order_reference() -> OrderReference {    return OrderReference(random.code(8))}
text
error: A function can't call `random.code` --> main.jadpo:5:27  |5 |     return OrderReference(random.code(8))  |                           ^^^^^^^^^^^^^^ reads the generator  reason: A function is pure: it gives the same result for the same arguments, so a random value it needs arrives as a parameter; only actions read the generator, which a test seeds so that it repeats.  next: Pass the value in as a parameter, made in the action that calls this (agent)  rule: type.random_context  help: https://jadpo.dev/docs/errors/type.random_contextcheck failed: 1 error, 1 file

Markdown for agents: /docs/errors/type.random_context.md.Built from Jadpo main at a707efb.