Why an intermediate representation
The project's central artifact is neither the manifest nor any platform's
output format: it is the .aapkg package, an explicit intermediate
representation — the "ONNX model" analogy of this system. This page records
why that choice exists and what it costs.
The problem it solves
Without an intermediate form, "build for N platforms" means N generators
that each read the project directory and guess. Every generator re-detects,
re-validates and re-encodes, and they drift apart: the web build knows about
index.html, the desktop build about a bundle identifier, the mobile build
about an app id, and none of them agree on what the app is. Users
experience this as "it works on the web but the desktop build serves last
week's version."
The shape of the choice
The compiler makes one package: a manifest (identity, frontend, backend, capabilities, window), the built frontend, the backend form (source plus lock by default), assets, and the checks report that gated it. Creators are renderers of that package — they read a documented, versioned, checksummed thing, never the developer's directory.
What it buys
- A testable seam. A package can be validated, diffed, archived and
reproduced without any platform toolchain. The tests gate
packand open every creator's input with the same reader. - Creator independence. New platforms are new plugins; the core and the package format do not move.
- Honest failure. When a creator refuses a package, it refuses declared capabilities — a language both the developer and the tool share, because both read the same manifest.
- Provenance. The checks report ships inside the package. Anyone can ask "what did the tool verify before this existed?" without trusting the machine that built it.
What it costs
One format to keep honest: aapkg.json is versioned and migrated like the
manifest, and an intermediate representation nobody adopts is just an extra
step. The project pays that cost deliberately — the alternative, N diverging
guesses, is how "portable" tools historically die. The package layout
itself is documented in
the package and portability.
Rendered from docs/explanation/why-the-intermediate-representation.md on main.