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

ErrorsEntities, stores and migrations · rule

data.total_type

On this page

A total's type doesn't fit what it totals: a count is built on Int with min: 0, a sum on what it adds up, and either allows 0.

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

Why Jadpo refuses it

A total holds what the records it counts add up to, so its type says what that can be. A count is a whole number of records, never below none, so its type is built on Int with min: 0. A sum holds what its parts add up to, so its type is built on what it adds up: the same Int, Decimal places or currency. A record with nothing counted holds 0, so either type allows 0, and is never none. A bound on a sum of parts that may be above and below 0 is refused too, since removing a record could then pass it, and a cascade, a purge or an erasure removes records with nothing to refuse.

What it looks like

main.jadpo:

example
type CheerCount = Int {}entity Story {    id: Uuid    cheers: CheerCount {        total: count(Cheer.story_id)    }}entity Cheer {    id: Uuid    story_id: Story.id {        on_delete: OnDelete.cascade    }}
jadpo checkcheck failed: 1 error, 1 file

error Story.cheers counts records, so its type is built on Int with min: 0

--> main.jadpo:5:5

  |5 |     cheers: CheerCount {  |     ^^^^^^ not a count's type
reason
A count is a whole number of records, never below none, so its type says so: built on Int, with min: 0, and a max: if it has a limit. Story.cheers is CheerCount.
next
Type it as one built on Int with min: 0 (agent)
rule
data.total_type
help
https://jadpo.dev/docs/errors/data.total_type

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

How to fix it

If the total counts records, say that it is never below none, and give it a max: if it has a limit. main.jadpo becomes:

example
type CheerCount = Int {    min: 0}entity Story {    id: Uuid    cheers: CheerCount {        total: count(Cheer.story_id)    }}entity Cheer {    id: Uuid    story_id: Story.id {        on_delete: OnDelete.cascade    }}

CheerCount now holds any number of cheers from none up, as a count does.

Markdown for agents: /docs/errors/data.total_type.md.Built from Jadpo's main branch at commit 72d483f.