Scope
MZI defines an application artifact that compatible hosts can open without a platform rebuild. It separates portable behavior, semantic interface intent and application data from the operating system. It does not prescribe a programming language, rendering engine, graphical style, registry or store.
Terms
- Package
- A deterministic archive carrying application logic and declared resources.
- Host
- Software that validates a package, grants authority, executes logic and renders supported semantic nodes.
- Interface
- A host-independent tree describing meaning and interaction, not pixels or platform widgets.
- Host data
- Versioned application state stored by the host under a stable application storage key.
- Capability
- An explicit, scoped request for authority over a host resource.
Package
An Application 0.2 package MUST contain the manifest, declared WebAssembly binary, semantic interface, data schema and WIT contract. Component Model binaries MUST use component encoding. Paths MUST be relative and MUST NOT escape the archive root.
[package]
name = "field-notes"
version = "0.4.0"
component = "app.wasm"
[runtime]
wasi = "0.3"
entry = "mzi:application/invoke"
abi = "mzi:[email protected]"
component-model = true
[application]
interface = "interface.mzi.json"
data = "data.schema.json"
contract = "wit/mzi.wit"Application 0.2
The interface document MUST declare mzi_ui: 0.2, actions and a semantic view tree. Supported proof nodes include screen, heading, text, stats, stat, form, input, list, item, check, button and note. A list binds a host-owned collection and supplies an item template.
{
"type": "list",
"bind": "notes",
"item": {
"type": "item",
"children": [
{ "type": "check", "bind": "done", "label_bind": "title", "action": "toggle-note" }
]
}
}Actions map semantic events to Wasm exports. After a successful decision, a host MAY apply a declared collection effect. Application code receives values; it does not receive direct storage access.
String argument transformation
The semantic action length transformation MUST trim the ECMAScript whitespace and line-terminator set at both ends, then count UTF-16 code units. Interior whitespace is preserved and no Unicode normalization is applied. Non-string and missing values yield zero. This is not a UTF-8 byte count or a count of visible characters.
Conformance cases cover combining sequences, astral emoji and the complete trimming set. This clarification is implemented in current host source; existing native installers require a rebuilt release.
State lifecycle
A data schema above version 1 MUST declare a stable storage_key and directed migration edges. The key identifies application data across changing package hashes and MUST be bound to the verified publisher key on first approval. A host MUST reject different publishers, downgrades and missing, ambiguous or cyclic paths.
{
"mzi_data": "0.2",
"version": 2,
"storage_key": "app.mzi.field-notes",
"migrations": [
{ "from": 1, "to": 2, "export": "migrate" }
]
}Before the first migration step, the host MUST retain the prior bytes as a versioned backup. Every step MUST execute through application.migrate with explicit source and target versions. The host MUST commit only a valid state object returned by the complete declared path.
Identity and signatures
SHA-256 identifies one exact deterministic archive. A mzi-signature/1 entry carries an Ed25519 public key, its SHA-256 key ID, canonical payload digest and signature. The domain-separated canonical payload commits to every sorted path and exact file length and bytes except SIGNATURE, avoiding recursive identity.
A valid signature proves continuity of a cryptographic key, not legal identity or trust. Registries, revocation, rotation and recovery are outside this draft. The included Field Notes key is a public deterministic development fixture.
Host obligations
A host MUST inspect package structure before execution, deny undeclared authority, surface capability requests, and isolate application logic from host internals. Unsupported nodes, effects, migration paths, imports or host tasks MUST cause visible rejection.
Application 0.5 network tasks MUST be matched against the signed manifest at execution time. A relative URL requires self and resolves against the exact HTTPS distribution.origin; an absolute URL requires its exact HTTPS origin. Browser Host 0.7 and Desktop Host 0.8 omit application credentials and referrers, reject redirects, limit URLs to 2,048 characters and response bodies to 256 KiB, and abort network work after five seconds.
Security model
Possession of a package grants no ambient authority. Hosts MUST verify the complete signed payload before displaying a publisher or reading stable state. Browser Host rejects unsupported component imports and executes bindings inside a dedicated Worker. Windows and Linux hosts use Wasmtime fuel plus a host deadline. State output is limited to 4 MB and migrations to two seconds per edge. This is not yet a complete production sandbox.
Component execution
Application 0.3 defines typed invocation and migration, 0.4 adds host imports, and 0.5 adds the two-stage http-get / complete-http task protocol. A host MUST reject profiles it cannot execute; it MUST NOT reinterpret a newer package through an older ABI.