Jadpo is experimental and not ready for production. These docs follow the compiler's main branch as of 1 Nov 2026. What's built · Install 0.2.0
jadpo
Reference: Built-in services

Built-in services · rule

flag.read_context

On this page

A function, a constant or other pure code reads a flag, which only an action, a test or a route's run: can.

Area 16, Built-in services; not declinable; the next step is usually the agent's.

Why Jadpo refuses it

A flag's value is worked out for whoever is calling, and can change while the app runs. A function gives the same result for the same arguments, so a flag read inside one would make it give different answers for the same call, and its tests would no longer say what it does.

What it looks like

example
type CheckoutSteps = Int {    min: 1    max: 3}flags {    new_checkout: Bool {        default: false        owner: "payments"        expires: "2099-01-31"    }}function checkout_steps() -> CheckoutSteps {    if (flags.new_checkout) {        return 1    }    return 3}
jadpo checkcheck failed: 1 error, 1 file

error A function can't read flags.new_checkout

--> main.jadpo:15:9

   |15 |     if (flags.new_checkout) {   |         ^^^^^^^^^^^^^^^^^^ reads a flag
reason
A flag's value is worked out for the caller while the app runs, and a function gives the same result for the same arguments, so it can't read one; an action reads it and passes its value in as a parameter.
next
Read flags.new_checkout in the action that calls this, and pass its value as a parameter (agent)
rule
flag.read_context
help
https://jadpo.dev/docs/errors/flag.read_context

(agent) at the end of the next: line means your coding agent can make the fix itself.

How to fix it

If the function's callers are actions, read the flag there and pass its value in:

example
function checkout_steps(new_checkout: OnePage) -> CheckoutSteps {    if (new_checkout) {        return 1    }    return 3}action start_checkout() -> CheckoutSteps {    return checkout_steps(OnePage(flags.new_checkout))}

checkout_steps is pure again, and its tests can pass it either value.

Markdown for agents: /docs/errors/flag.read_context.md.Built from Jadpo main at e00e61f.