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

ErrorsReads and writes · rule

data.expected_version_unversioned

On this page

A write says expected_version: of an entity that keeps no RecordVersion.

Area 6, Reads and writes; not declinable; the next step is usually the agent's.

Why Jadpo refuses it

expected_version: lets a change go ahead only while the stored record is at the version the client read, so two changes made from one copy can't both win. That needs a version on every record: a field typed RecordVersion, which Jadpo sets to 1 on create and moves on with every change. An entity without one has nothing to compare, and the write would go ahead whatever the client saw.

What it looks like

main.jadpo:

example
type TodoTitle = Text {    max_length: 200}entity Todo {    id: Uuid    title: TodoTitle}type RenameTodo = Input {    title: Todo.title    version: Int}action rename_todo(todo_id: Todo.id, input: RenameTodo) fails TodoNotFound -> Todo {    return attempt Todo.update(todo_id) {        expected_version: input.version        set: {            title: input.title        }    }}
jadpo checkcheck failed: 1 error, 1 file

error Todo keeps no version for Todo.update to expect

--> main.jadpo:17:9

   |17 |         expected_version: input.version   |         ^^^^^^^^^^^^^^^^ no `RecordVersion`
reason
expected_version: lets the change go ahead only while the stored version is the one the client read, so its entity keeps one: a field typed RecordVersion, which Jadpo sets to 1 on create and moves on with every change. Todo has none.
next
Add version: RecordVersion to Todo and send it out and back, or remove expected_version: ... (agent)
rule
data.expected_version_unversioned
help
https://jadpo.dev/docs/errors/data.expected_version_unversioned

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

How to fix it

If people change todos from a copy they read earlier, give Todo a version, send it out with the record and back with the change, and map a stale one in conflict::

example
entity Todo {    id: Uuid    title: TodoTitle    version: RecordVersion}type RenameTodo = Input {    title: Todo.title    version: Todo.version}action rename_todo(todo_id: Todo.id, input: RenameTodo) fails TodoNotFound, TodoChanged -> Todo {    return attempt Todo.update(todo_id) {        expected_version: input.version        set: {            title: input.title        }        conflict: {            Todo.version: TodoChanged        }    }}

A rename made from a copy someone else changed since is now refused as TodoChanged, a 409, and the title they saved is kept.

If the last change should win, remove expected_version: ...:

example
action rename_todo(todo_id: Todo.id, input: RenameTodo) fails TodoNotFound -> Todo {    return attempt Todo.update(todo_id) {        set: {            title: input.title        }    }}

The rename now writes whatever version the todo holds, and the input sends no version.

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