Jadpo is experimental and not ready for production. These docs follow the compiler's main branch as of 29 Nov 2026. What's built · Install 0.6.0
jadpo
ReferenceErrors

ErrorsEntities, stores and migrations · rule

data.unique_decimal_places

On this page

A unique rule covers a field kept as JSON that holds a percentage, or another value whose places its type doesn't fix, which its JSON can write two ways.

Area 5, Entities, stores and migrations; not declinable; the next step is usually the agent's.

Why Jadpo refuses it

A field whose type is an object, an enum with data, a list, a set or a map is kept whole as its JSON, and a unique rule over it compares the digest of that JSON. A percentage keeps its places in its JSON, so 12.5% and 12.50% are == in code but written differently, as is any value whose places its type doesn't fix. The rule would let both in, and two records would hold what code calls the same value.

What it looks like

main.jadpo:

example
/// What a cup of coffee is made with.type Recipe = Object {    milk: Percentage}entity Coffee {    id: Uuid    recipe: Recipe {        unique: true    }}
jadpo checkcheck failed: 1 error, 1 file

error Coffee.recipe can be written two ways, so no unique rule can compare it

--> main.jadpo:9:9

  |9 |         unique: true  |         ^^^^^^ kept as JSON
reason
Coffee.recipe is kept as its JSON, and a unique rule compares the digest of that JSON; it holds a Percentage, whose JSON keeps its places, so 12.5% and 12.50% are == in code but written differently, and the rule would let both in.
next
Hold a decimal whose type has a scale: instead, or leave the field out of the unique rule (agent)
rule
data.unique_decimal_places
help
https://jadpo.dev/docs/errors/data.unique_decimal_places

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

How to fix it

If the share has a fixed number of places, keep it as a decimal whose type has a scale:, so each value is written one way:

example
type MilkShare = Decimal {    scale: 1    min: 0.0    max: 100.0}/// What a cup of coffee is made with.type Recipe = Object {    milk: MilkShare}entity Coffee {    id: Uuid    recipe: Recipe {        unique: true    }}

No two coffees can now share a recipe.

If two records may share one, remove the rule:

example
/// What a cup of coffee is made with.type Recipe = Object {    milk: Percentage}entity Coffee {    id: Uuid    recipe: Recipe}

Two coffees may now be made with the same recipe.

Markdown for agents: /docs/errors/data.unique_decimal_places.md.Built from Jadpo's main branch at commit 9080dc3.