Why there are two formats
They are not competing spellings of the same thing. They answer to different readers.
A real app makes the difference concrete. The Budget Planner corpus app is 98 source files totalling
about 133 KB, and it compiles to a single 225 KB JSON document.
The size is not the point. Ninety-eight files that each describe one thing can be reviewed one at a
time; one 225 KB document cannot.
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 cannot contain a duplicate key;
arrays preserve order and are 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 is not 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 will meet it
Mostly you will not. Three places you might:cordango build writes it under .cordango/build/<key>/. Deterministic: 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 is not 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.

