The app's TypeScript, app.ts and everything under src/, is the data module. On an iPhone it runs inside a lean Hermes virtual machine that Exact embeds. That engine is not a browser and not Node, and the differences explain many choices in the code. For what the module contains, see The data module.
Where it runs
Host | Engine | Notes |
|---|---|---|
iOS (simulator and device) | Hermes, bytecode only | Loaded after the first pixel. "Until then every answer is |
Web host | The browser's own engine | Used for development and tests only, see The web host for development |
| Bun | Unit tests import the sources directly, see Bun unit tests |
Build
Exact type-checks app.ts in strict mode (ES2023 target, WebWorker web APIs, never the DOM's UI types), bundles it with Rolldown into one script and compiles it with hermesc to bytecode (reference, producer). The heap ceiling is DEFAULT_MAX_HEAP = 64 << 20, 64 MiB (js/src/lib.rs). A module load over 50 ms is journalled, so top-level work should stay cheap.
What exists and what is missing
From Exact's table of what a data module can use:
Available | Missing or refused |
|---|---|
| The DOM ( |
| WebAssembly, so no Argon2id |
| Most of |
| An ambient clock: |
|
|
|
|
| Dynamic code ( |
How the app adapts
Constraint | What the code does | Source |
|---|---|---|
No Ed25519, HKDF or XChaCha20 in | Pure JavaScript | |
No WASM | Password-protected | |
No ambient clock | Time is a source argument. The contract passes | |
Hardened prototypes | "Exact hardens Error.prototype; define an own property rather than assigning through it." Error subclasses set | |
Timers wait for fetch | "Source timers only run after native fetch settles", so every request passes | me/sources.ts L23-L29, read/client.ts L10-L15, vault/api.ts L76-L81 |
Long-lived connections | A source returns | |
Dynamic code refused | "Exact rejects superjson's is-what dependency (dynamic Function constructor)", so the superjson envelope is decoded by hand | |
Node fast paths in codecs | CBOR and gzip are a vendored browser-only bundle | |
100 ms per turn | Yields between crypto steps | |
Quadratic work is costly | "Linear traversal accepts newest-first histories without recursion or quadratic work on Hermes" |
Timeouts in use: 15 s for site reads, publishing and notify, 5 s for unauthenticated vault calls, 20 s for authenticated ones (vault/api.ts L12-L14). The signed POST to the agents server passes no exactTimeout (agents/sources.ts L71-L79).
Answers must match their shape exactly
"An answer is held to its shape exactly: a field the shape does not declare, at any depth, fails the resource as a thrown error does" (guide). TypeScript lets a spread through, so sources build replies field by field. A failed read should throw so Exact keeps the previous answer on screen. A mutation may instead return a shaped refusal such as {ok: false, error, value: ''} (me/sources.ts L19-L21).
npm import rules
The module "imports its own .ts/.js and pure-JS npm packages (ESM or CommonJS, a browser build first); one needing Node (fs, Buffer), the DOM or a native addon is refused by name" (start-here). grants must be literal because "the build reads them without running the module" (app.ts L3). The runtime also proves itself: crypto.test.contract runs a signing and encryption self-test inside the host engine, see Parity vectors.
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime