Delivery to devices
Vard code runs on a device in the runtime, from sources, so from Vard’s point of view “building the app” means a bundle: a deterministic set of files any host understands.
vard bundle
vard bundle examples/firebase --out build/app # a directory
vard bundle examples/firebase --out app.vpk # a single archive
build/app/
app.vard the app's sources
@firebase/firebase.vard package sources (the @name/... path marks a package file for the linker)
vard.lock the package graph — the compiler on the device reads it by itself
fonts/, assets/ project resources
bundle.json metadata
{
"vard": "0.1.0",
"sha256": "f626985f…",
"native_fingerprint": "cffccd18…",
"natives": ["android firebase dev.vard.firebase.FirebaseModule", "event authChanged", "fn analyticsLog", "…"],
"caps": ["native"],
"packages": [{ "name": "firebase", "version": "1.0.0", "sha256": null }]
}
sha256— the hash of the bundle content (the same deterministic.vpkformat).native_fingerprint— the hash of the sorted list of everything that must exist in the native part:extern fnandextern eventnames and the packages’ native modules.caps— the resulting capabilities of the app and its packages.
The device needs no package manager: the host passes the runtime a list of (path, text),
and vard_lang::compile recognizes @name/... files and vard.lock by itself. The FFI did
not change.
Android
The platforms/android build does everything itself:
settings.gradle.ktsrunsvard android-modules <vard.app>— the list of packages with[native.android]— and includes each library as:vard-<name>;:appdepends on them;- the
bundleVardApptask runsvard bundle <vard.app> --out build/generated/vardAssets/app; VardActivityreads*.vardandvard.lockfrom the assets; modules register throughdev.vard.module.*meta-data in the libraries’ manifests.
cd platforms/android
./gradlew installDebug -Pvard.app=examples/firebase
The -Pvard.firebase=true flag is gone: depending on the firebase package includes its
native module.
Over-the-air updates (OTA)
An interpreted bundle can be replaced without rebuilding and reinstalling the app — on one condition: the native part has not changed. That is exactly what the native fingerprint checks.
| Change | Fingerprint | Deliverable OTA |
|---|---|---|
| layout, logic, styles, texts | same | yes |
| a new version of a package without native code | same | yes |
a new extern fn / extern event or a new native module | different | no — needs a new app release |
vard ota init ./channel # once: prints the channel key to compile into the app
vard ota publish examples/todo --channel ./channel --version 1.0.1
channel/
public/config.json {"vard_ota": 1, "key": "<ed25519 public key>"}
public/bundles/<sha256>.vpk immutable bundles
public/<native_fingerprint>/latest.json {"sha256", "size", "version", "published", "sig"}
private/ota.key the signing key — never publish it
latest.json is signed over vard-ota/1 <fingerprint> <sha256> <version>. A device:
- downloads
<its own fingerprint>/latest.jsonand the bundle it names (static hosting, any CDN); - calls
vard_ota_install(latest, bundle, len, key, fingerprint, dir)(C ABI; Rustvard_ffi::ota_install) — it checks the signature with the key compiled into the app, the bundle hash, the fingerprint inside the bundle and that the sources compile, then writes the bundle todiratomically; any failure leaves the current bundle in place; - loads
dirinstead of the built-in bundle on the next start.
Implemented: channels, publishing, verification and installation (tested in
crates/vard-ffi/tests/ota.rs). Not yet: the download-and-swap loop inside the Android and iOS
shells (a few dozen lines of platform code around vard_ota_install).
The channel is addressed by the fingerprint, so a device physically cannot receive a bundle that needs native code it does not have. For AI-first development this closes the loop: an agent fixed a bug → the tests passed headless → a bundle with the same fingerprint safely goes to users; a change that needs new native code automatically becomes a store release.
Reproducibility
- The same
vard.tomlgives the same version selection (MVS);vard.lockpins the hashes. .vpkarchives are deterministic: sorted paths, no timestamps, no permissions.vard bundlegives the samesha256for the same inputs on any machine.- Offline: packages from the cache (
~/.vard/cache/),builtinand path dependencies need no network.