Why there are two formats
Because they answer to different readers.
A real app makes that concrete. The Budget Planner corpus app is 98 source files totalling about
133 KB, and it compiles to a single 225 KB JSON document.
Size isn’t the interesting part. Ninety-eight files that each describe one thing can be reviewed one
at a time. A 225 KB document can’t be.
The same entity, both ways
fields is a map and the field key is the map key. In the App Definition, fields is an
array and every item carries its own key. Maps read better and can’t hold a duplicate key. Arrays
preserve order, which is what a schema validator and a code generator want.
The envelope
Five things are required at the top level:schemaVersion, key, name, version and
entities. An app with no entities isn’t an app.
the data model
What the app stores and how records point at each other.
the interface
Block trees, the screens they compose into, and how the app looks.
behaviour
Lifecycles, the actions that move between states, and what happens automatically.
access
Who may read and write what.
metadata
What kind of application this is, and what it is for.
Where you’ll meet it
Mostly you won’t. Three places you might:cordango build writes it under .cordango/build/<key>/. It’s deterministic, so the same
source produces the same bytes.
cordango import goes the other way. Hand it an existing App Definition and it produces source
files you can edit.
cordango publish sends one to an instance. It builds from source rather than from
.cordango/, because a build artifact is a cache, and a cache isn’t an authority.
Comparing definitions
Two App Definitions with identical meaning can differ byte for byte, because storing one asjsonb
reorders its keys. Compare them by their definition hash rather than by their text.
Next
The schema
The formal contract, how it is composed, and how to validate against it.
Targets
What turns an App Definition into a running application.

