Roc programs, capabilities and equivalent hosts
Research snapshot of November 23, 2026. Code and issue observations refer to the cited revisions and collection times.
The From an app directory to a reproducible guest release traces a counter from the existing template through replay, a separately assessed capability change and rollback. The World capability catalogue distinguishes runtime provider contracts from Roc SDK helpers.
November 23 ownership update. Xaltha’s claim covers the two-provider regression. The Fleet retry on the owner’s branch reports success. The test log was unavailable to this reviewer. The morning check preceded Xaltha’s follow-up PR #13368. Xaltha’s full follow-up on the same commit failed in the Nix flake check. The captured log requires authenticated access. Inspect that log to identify the failed check before changing the test or dispatching again.
Program research and proposed extensions. Repository evidence is pinned to developing-today/code commit 4cfceaa8afc08cf2cea88b9d733a2ace14c8ad5a as surveyed November 23, 2026. “Shipped” below means present in that source. No build, device test or production deployment was performed for this chapter. A provider registration, a working executor and a physical device test are three different claims.
The contract a world author actually implements
ID already has the portable program interface. A Roc world supplies eight pure members. A program receives a seed, a participant ID and serialized input. It returns text or structured projections. The host asks for effects by reading the program’s wants projection. The program receives accepted host events through the same update function under participant 0. A replicated reader or replay does not issue live effects. Preserve this contract for existing worlds, including pre-version-getter guests. Roc platform · Plaza ABI v1 · actor
| Guest entry | Roc type in the current platform | Author obligation |
|---|---|---|
| init | U64 → Model | Use the supplied seed. |
| update | Model, U64, Str → Model | Interpret input and result events, including refusal. |
| view | Model → Str | Produce the default UTF-8 view or validated surface. |
| layout | Model, U64, U64 → Str | Fit the connection’s viewport. The Wasm ABI can fall back to view. |
| records | Model → Str | Emit a JSON record projection for host validation. |
| wants | Model → Str | Emit subscriptions and pending one-shot requests with correlation IDs. |
| snapshot | Model → Str | Serialize enough state to resume, including pending IDs when needed. |
| restore | Str → Model | Recover snapshots alongside records and preserve replay semantics. |
The checked-in platform provides roc_* symbols for the internal host adapter. Its wasm32 output exposes the versioned plaza_* interface, exported memory and byte-range/ownership conventions. Existing Wasm can omit some projections and the version getter. The current runner allowlists the getter without using it for negotiation. New mandatory semantics would require explicit version admission plus a compatibility path. ID pins compiler nightly-2026-10-04-130536d. The Nix recipe verifies release bytes and lists Linux x86-64 and ARM64 compiler distributions. That list describes where the compiler runs. Its platform target list contains wasm32 and x64musl. The optional admin-installed Linux native executable uses subprocess resource limits and call deadlines. Hardware time and its wall-clock deadline do not measure portable Wasm fuel. Compiler pin · Nix recipe · native worker
The permission boundary
Roc has one platform per app. The current language distinguishes pure -> from effectful => functions named with a trailing !. Roc’s platform supplies its I/O. An ID pure world expresses an I/O request as data. Adding ! at a UI adapter does not grant ambient access to the world. Keep platform/dialect-specific data layout in the ID adapter. Keep hashes, protocol version, finite resources and refusal semantics under ID’s governance. The import gate already checks a library’s transitive capability requirements against what the caller and platform admit. Existing fixtures require exact diagnostics. Language reference · Purity · Import fixtures
A host request goes through ceiling, grant and actor scope. A client provider additionally requires the originating client’s offer and local decision. Location and microphone use need explicit permission per use. Device OS authorization and ID authorization can fail independently. The checked-in v1 registry carries name, version, kind, argument schema, bounds, actor scope, default ceiling, provider side and disclosure class. The client’s own class table defines the user-facing explanation. Unknown classes disclose conservatively. Use the existing reconnect baseline, expansion/sideways comparison and invite pin work when describing a new capability. Never prompt a user to approve pure arithmetic. Registry · Disclosure classes · Reconnect · Invite pins
Registry crosswalk
At the pinned revision, reading define_provider_registry! yields 34 entries: 23 host request declarations, four subscriptions, one asynchronous event and six pure platform modules. Two client-side entries bring the production union to 36. The feature-gated test probe is outside that count. The table covers the entire production union. All guest projections are pure. Every runtime provider below is an effect observed by the guest through data. Refusal codes in v1 include unknown_cap, cap_denied, bad_args, failed, actor_denied, outside_ceiling and result_too_large. Machine-stable codes and advisory reasons already distinguish policy, missing support and bad input. Generic bounds include 64 KiB/wants, 64 entries per list, 64-byte request IDs/names, 8 KiB serialized arguments and 64 KiB result event. Definition and bounds · Host dispatch · Dispatch audit oracle
The work column proposes dimensions for a versioned host metering schedule. It does not assign prices or claim they are charged today. Every invocation has a bounded admission cost. Add units only for actual work using the upper bound authorized before dispatch. Current provider limits and guest fuel remain applicable.
| Names | Input → result or event | Work and local outcome | Main-source executor or current gap |
|---|---|---|---|
| time.now, random.u64 | () → Unix-ms now or u64 value | Constant per read. Inject recorded value for replay. | World host. |
| time.tick, players | Positive interval → tick(now, interval), or subscribe → joined/left participant | Per delivered event. Tick floor, four distinct intervals. | World host subscriptions. |
| players.list, world.info | () → participant rows, or world ID and sequence | Per row/output byte, or constant metadata. | World host. Actor context required. |
| chat.say, chat.history | text → sequence; count? → bounded lines | Per committed/read byte plus rows. Chat write or read scope. Bad count rejected, default 16, max 64. | World host. |
| records.read | prefix?, after? → ordered page with next_after | Scanned items and returned bytes with an independent scan limit. Malformed cursor is bad_args. | World host. |
| kv.get, kv.set, kv.delete | key → value; key,value → stored bytes; key → deleted | Key/value bytes and durable changes. Per-world byte/count limits. Missing get yields null. | World host, durable. |
| blob.put, blob.get, blob.delete | base64 → BLAKE3,size; hash → base64 or null; hash → deleted | Decoded bytes, hash and durable bytes. Repeated identical put has one address. | World host. Small blob interface has a 4 KiB content cap, so general-media streaming needs another bounded interface. |
| http.fetch | url → final URL,status,body,byte count | Per request, bounded body and redirects. Off by default, per-hop allowlist and timeout. | World host outbound. Its network operation is not reissued during replay. |
| notify | text → world event sequence | Per payload byte and bounded notification attempt. Off by default. | Durable world event. Distinguish from the device hint below. |
| schedule.at, schedule.cancel | id,at, optional interval/count/world → scheduling result; id → cancelled | Per pending slot and firing. Future horizon and recurrence caps. | World host. One action per durable occurrence. |
| device.info | v? → versioned display/input/sensor/audio/network manifest | Bounded manifest bytes. Unknown version bad_args. | Host that can supply the manifest. Absent information yields refusal. |
| form.present, form.cancel, form.result | form_id, form → presentation token; form_id → cancelled; deferred result event → world update | Fields, bytes, pending form slots. Validate token, shape and action. | World host; calling form.result as a request returns bad_args/event_only. |
| loc.position, loc.watch | max_accuracy_m? → reading; interval → reading events | Per sample/delivery, accuracy and interval ceiling. Per-use consent, OS denial and unavailable fix stay distinguishable. | Host with location adapter. No hardware coverage inferred. |
| speech.transcribe, speech.capture, speech.synthesize | () → transcription; subscription → capture frames; text → synthesis | Proposed duration/frame/input bounds; transcription and capture require per-use consent. | Registered. Two request executors absent by explicit authority-audit oracle. Current subscription parser only recognizes players, tick and location. Do not advertise live speech execution from this registry. |
| client.file.read, client.notify | relative path → file reply; head? → content-free resync acknowledgment | Maximum read 32 KiB; notify reply ceiling 1 KiB. Dual gates. | Linux reference shell has an opt-in file executor. Device notification registration is evident; a native Android OS executor and device test are unverified. |
| Key, Screen | Pure key-event parsing; portable cell grid construction | Guest Wasm instructions; host validates output dimensions/bytes. | Exposed Roc modules, compile-gated. |
| RocJson, RocGrid | Pure JSON operations and immutable grid helpers | Guest fuel proportional to operations; enforce ordinary guest bounds. | Exposed Roc modules. |
| RocCap, RocText | Pure request-ID/session/document helpers and text manipulation | Guest fuel. RocCap builds request data without executing I/O. | Exposed Roc modules. |
The registry includes disclosures with class unknown deliberately. Assigning those classes changes permission UX and needs its existing versioned review. For publication, generate rows from PROVIDER_REGISTRY.entries() under production features and join hand-reviewed semantics by (name, version). Fail coverage on a missing row, surplus row, duplicate key, impossible executor claim or unclassified status. Extend the registry with a cost-profile reference only after agreeing on versioning and a calibration fixture. Do not keep a second editable provider-name list. Registry exit proof
Fuel, replay and hosted effects
ID currently pins Wasmtime 49.0.6 with Cranelift, enables consume_fuel, rejects all imports, bounds memory and tracks per-call fuel. Its guest burn scheduler admits work by process and, where configured, account, with least-attained-service scheduling. Normal resource exhaustion for a guest and saturation of a scheduling queue are different results. Proposed host charges should refer to units such as rows visited, bytes hashed, frames decoded or samples produced. Cap rows visited even when few records survive a filter. A write with unknown final expense reserves maximum allowed resources, settles actual work once, and returns unused capacity. Execution cost, consent and transferring payment are distinct decisions. Sandbox · Wasmtime pin · Scheduling
Current actor after_change de-duplicates request IDs, bounds its remembered set at 4,096, documents that an evicted ID may execute again and refuses stale pre-restart requests. Treat that as the actual baseline. A financial, trade or external effect needing end-to-end idempotence should have a durable operation identity bound to principal, world, operation and canonical argument digest. Atomic commit of effect and receipt, or an outbox with a cooperating idempotent recipient, is a prerequisite for retrying that effect automatically. An external service without such a facility must surface an unknown outcome after ambiguous failure. Keep sensitive capability handles, permission prompts and private data out of publicly replayed records. An accepted result which is necessary for replay must have an appropriate visibility class and retention policy. Actor implementation
For portable replay, bind guest hash, compiler/platform bundle, ABI, event codec and fuel schedule. Fix or forbid platform-specific floating-point behavior for state that is signed. Wasmtime documents NaN canonicalization, deterministic relaxed SIMD or disabling that proposal, deterministic imports, memory/table growth limits and deterministic interrupts. An ID engine option that is not specified explicitly in the pinned constructor cannot be assumed configured from a language-level claim of purity. Specify restoration versus historical metering policy deliberately on a compiler or Wasmtime upgrade. Wasmtime determinism guidance
Equivalent I/O across hosts
The shell contract is the interface between a client role and a world-host role. A thick Android client can own durable local state without opening an unsolicited listener. An ESP32 with only a confirmation button cannot enter an arbitrary paragraph; the task must be narrowed at capability negotiation or explicitly handed off by the user. The protocol remains the same. Contract checker · Android implementation issue · Hardware shell
| Host in priority order | Demonstrated or recorded | Equivalence and acceptance target |
|---|---|---|
| Linux CLI/TUI | Terminal builder and live native/terminal parity fixture; x64musl trusted-worker option and wasm32 guest platform. | Map keys/paste/resize to existing frames. Assert journal result plus screen/text/form projection. Unsupported rich behavior gets explicit alternatives. |
| Linux native GUI | Bevy main installs scene and audio plugins. Native form widgets and a file provider exist. Capability statement still excludes rich surfaces. | Verify actual declared vs installed features per release before describing native coverage. Assert semantic action/tree and a renderer-specific visual snapshot. |
| Android native | Existing product decision is Kotlin/Jetpack Compose around a Rust client-only core, local journal, foreground-first synchronization, two-gate providers. A third-party Roc Android app is a separate upstream prototype. | Adopt those product decisions. A test app may reuse a pure Roc computation and compare it with the ID guest, but granting the third-party runtime direct effects would bypass ID. Validate IME composition/commit, accessibility actions, process death, offline edits and rejoin, revoke between offer and invocation, and physical arm64 keystore behavior. |
| Web | Browser IndexedDB adapter, web shell contract and app interface present. | Restore local cursor on refresh, simulate losing network, replay same semantic input. Compare DOM role/name/state and accepted actions. A Canvas screenshot alone cannot prove keyboard operability. |
| macOS and Windows | Upstream RocRay distributes desktop bundles. ID conformance on each runtime/hardware combination remains to be demonstrated independently. | Per-platform artifacts and granular tags. Require same core outcome, native control semantics, and explicit capability availability. |
| ESP32-class | Transport-free hardware-shell fold supports presence, journal head and confirm/act; no local world host, free text, rich renderer or provider offers in the spike. | Test wake, resync after discontinuity and confirm against the published projection. Refuse unsupported essential tasks. A desktop Rust fixture does not qualify as a physical board run. |
Semantic input examples: activate a tic-tac-toe cell by keyboard focus+Enter, touch, or accessibility activation; retain the same coordinate and admitted move. Reorder a mind-map node by dragging, or by selecting source and destination then invoking Move. Distinguish committed text from pre-edit IME text. Supply a focus target, accessible action, role and label for every enabled semantic action. For path-dependent freehand sketching, preserve ordered samples and pressure/timing only where the declared instrument actually provides them; never fabricate pressure and call it stylus support. Prompt once to choose an equivalent path that changes what data leaves the device. Keyboard · Single-pointer drag alternative · Android transient state
What Luke Boswell’s research demonstrates
The personal blog index returned eight posts over direct HTTP, including the November Android article which the search snapshot omitted. The January 2024 Action-State GUI experiment draws counters through Zig/raylib with state owned by Roc. November’s physics demo uses roc-ray with roc-pga2d. The basic-cli/roc-ansi editor demonstrates a terminal adapter. Three htmx posts cover initial request routing, event-driven updates of list and tree views, and a data table. The August 2025 multi-entrypoint article explains an interpreter shim dispatching named host entrypoints. Upstream PR 8214 merged September 9, 2025. These are examples for studying the boundary. The oldest examples visibly use older Roc syntax. Index · GUI · Physics · Editor · htmx I · htmx II · htmx III · Entrypoints · PR
| Upstream source checked | Result and ID decision |
|---|---|
| roc-ray release and official example | Latest retrieved release 0.12.3, November 19, paired with nightly-2026-11-18-a520eed, default desktop/X11 and separate Wayland bundle. Example page uses 0.11.1 with an October compiler and has init!/update!/render!. Its headless smoke proves execution without checking appearance. Keep the ID compiler pin until the whole ID guest corpus and Linux worker parity pass on the new compiler. |
| roc-signals README | Pure Roc reactive engine and components; browser runtime applies commands and hosts external effects. Native behavioral specifications replay in headless Chrome. Borrow cross-host scenarios and dependency-scoped invalidation for projections. |
| roc-native-android README | Explicit proof of concept. Pure Roc UI/roc-signals engine, Android native widgets, small Kotlin shell, arm64-only library, API 26+ device/emulator, APK creation/signing through SDK tools. Upstream example pins engine 0.8.0-rc1. Author states CI cross-compiles/links Android examples and executes the same host code on macOS; Android runs are manual emulator runs. No workers or drag/long-press/swipe; generated app cannot add Kotlin services through the scaffolding tool yet. Hardware instructions are not hardware execution evidence. The author’s Android article confirms the Zig JNI bridge, Kotlin host, and manual MacBook emulator demonstration. |
| roc-tui README and roc-gui README | roc-tui’s author archived it and favors roc-ansi. roc-gui is an early GPUI project with behavioral/performance harness, lists macOS/Linux Wayland/Windows and explicitly advises against production use. ID should retain its existing shells and independently verify portability. |
| roc-awesome catalogue and Hasnep index | Use to discover pure packages and record immutable content hashes. Check public API, compiler compatibility, source/license and test behavior per package before inclusion. |
| Supplied Reddit shortlink, canonical post, Roclet | Direct GET returned 301 to Roclet: reactive notebooks in Roc. Reddit’s live HTML returned a browser challenge. The indexed November 2 post itself credits Aurélien Géron, links the Roclet project, and points readers to the language community’s notebook discussion. The live Roclet project demonstrates dependent cells recomputing, a relative Roc package with supporting modules, and CSV attachments. For ID, persist notebook source, attachments and dependency hashes as authoritative objects; recompute derived output with a pinned guest and explicit effect grants. This provides a first app spanning the graph, Roc and Atlas without granting notebooks ambient network or filesystem access. |
| Separate November 23 Android discussion | Independently located thread about shared pure packages across platform-specific native frontends. The Android demonstration is documented firsthand in the author’s article. |
Verification and next slices
- Repair the registry exit proof and ABI chapter. The test
the_client_segment_is_exactly_the_declared_client_providersinpkgs/id/tests/provider_registry_exit_proof.rsasserts one client provider while the production registry declares two. Keep every side/default-ceiling check and compare the ordered independent names [client.file.read, client.notify]; check both resolved manifests. Route the single integration test through Fleet, with its declared composition and absent-from-legacy-CATALOG as oracle. The ABI markdown lists only 11 runtime names and points to moved implementation files. A generated production-registry crosswalk and checked source references address both kinds of drift. Exit proof · Registry assembly - Use the shipped Roc guest as the first application oracle. Reuse tic-tac-toe, existing native/terminal live-session and checked-in Wasm fixtures. Feed identical seed, ordered accepted input and recorded host results. Compare canonical public records and snapshot round-trip, then score each host’s actual presentation/accessibility independently. Test absent optional exports, refusal, oversize output and guest exhaustion. Have the snapshot probe prove record equality before compaction. Tic-tac-toe · Live-session test · Golden harness issue
- Extend the existing presentation work. Compare shell statement against installed scene/audio handlers and real negotiated contract revision. Keep native widget coverage independent. Respect the recorded mobile adoption and existing #7938 phases, beginning at the Rust client-only facade and a real-device key spike. Apply the same actions to the native, web and hardware contracts where representable. Native main · Native statement · Rich presentation
- Expand provider families through the existing registry. Candidate host interfaces include bounded graph path queries on a pinned authorized snapshot, numerical decomposition with matrix dimensions/precision, media decoding with input/output dimensions, and local embedding with content hash/model hash/vector schema. Treat nondeterministic numerics/semantic search as host observations, version numerical kernels, and journal authorized decisive results only when replay needs them. The guest retains its pure representation; opting out of models or codecs must leave text/metadata operations usable. These candidate names, result schemas, prices and backend coverage have not been assigned or shipped. Coordinate with Atlas and asset design before granting or charging an app for any of these operations.