Repository navigation
Apps' own WebAssembly functions: the wasm capability (contract 1.7.0), wasm.<function> tools and fns/*.wasm in the store gate - #140
Merged
Conversation
ymote
force-pushed
the
feat/wasm-capability-mvp
branch
from
October 8, 2026 00:35
f5434fa to
21d7c8b
Compare
KNOWN_CAPABILITIES gains `wasm`: the app's own functions, WebAssembly modules in its bundle's fns/, run by the host's `wasm` service in a sandbox with a deadline and a memory cap. A function gets its input and returns its output; it reaches no file, network, clock or other app, and the grant implies no other capability. The store shows "Run its own sandboxed functions on this device"; the listing's line says what they cannot reach. A growth test pins it as its own exact grant. 1.7.0 is not on crates.io; publishing follows review (publish-app-contract). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tool may route to the app's own WebAssembly function with host_method "wasm.<function>". The host runs the bundle's module in a sandbox where the function reaches nothing but its input, so it is outside the reviewed shared-service list and has no risk or private_data floor; the manifest must still declare `wasm`. app-policy now asks for contract 1.7, which knows the capability. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A WebAssembly module becomes the one executable a store bundle may carry: at fns/<name>.wasm ([a-z0-9_-], at most 64 characters), a core module (magic and version 1), at most 8 per bundle, and only when the manifest declares `wasm`. A module elsewhere, misnamed or not wasm is refused as contents-invalid; one without the capability, or a ninth, as `functions`; the capability without modules is a warning. The host checks a module's imports and exports when it loads it. PUBLISHING and SUBMITTING (English and Chinese) gain the `functions` check, the `wasm` row, and `wasm.<function>` in the host_method rules, and say that no release serves it yet; the READMEs say the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ymote
force-pushed
the
feat/wasm-capability-mvp
branch
from
October 8, 2026 00:48
21d7c8b to
b7fa3ab
Compare
Collaborator
Author
|
Local CI on b7fa3ab (this branch rebased on main e812331), macOS arm64, the steps of
🤖 Generated with Claude Code |
This was referenced Oct 8, 2026
tyreseluo
pushed a commit
to tyreseluo/OctoSense-App-Hub
that referenced
this pull request
Oct 12, 2026
publish-app-contract published octosense-app-contract 1.7.0 (the `wasm` capability, OctoSense-org#140) on 2026-10-07. The CHANGELOG, the contract README's "Versions on crates.io" and AGENTS.md now say so, and that `cargo update -p octosense-app-contract` moves a consumer to 1.7.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
An app may ship its own functions as WebAssembly modules in
fns/*.wasm, and the host runs them for that app only. This PR is App Hub's side: the contract, the agent-tool rule and the store gate. OctoSense's runtime andwasmservice are in OctoSense-org/OctoSense#364, which pins this branch.KNOWN_CAPABILITIESgainswasm. (1.6.0, from Expose versioned host APIs and execute admitted app tools #138, is already on crates.io.) A function gets its input and returns its output; it reaches no file, network, clock or other app. The grant implies no other capability. The store shows "Run its own sandboxed functions on this device".host_method: "wasm.<function>"to run the app's own function. It needs thewasmcapability. Unlike the reviewed shared host methods it has no risk floor and noprivate_datarequirement, because the function sees only the arguments it is given. app-policy now asks for contract1.7..wasmbecomes the one executable a bundle may carry, under these rules:fns/<name>.wasm, the name[a-z0-9_-]and at most 64 characters.wasm.wasmwithout any module.PUBLISHINGgains thefunctionscheck, thewasmcapability row, andwasm.<function>in thehost_methodrules.SUBMITTINGlistswasmamong the capabilities released stores refuse.wasmyet.Release
The crate goes to 1.7.0 with a CHANGELOG entry. Per the contract's release rules, it needs review from App Hub and one app owner (Rinx) before
publish-app-contractruns. 1.7.0 is not published; until it is, a consumer patches crates.io's copy with this repository's revision, as the contract README describes.How it was tested
mainafter Expose versioned host APIs and execute admitted app tools #138,cargo test --locked -p octosense-app-contract -p octosense-app-policy -p octosense-app-hub: 228 passed, 0 failed. New tests:wasm.<function>as a host method.app-contract.ymlruns it:cargo test --all-targets: 37 passed;cargo test --doc: 2 passed;cargo clippy --all-targets --no-deps -- -D warnings: clean.wasm-labbuild (Apps' own Rust functions in WebAssembly, behind the wasm-lab feature (ADR 0011) OctoSense#364):os.wasmlabdeclaredwasmand its agent's tools usedhost_method: "wasm.<function>", admitted by this policy;fns/*.wasmrunning on a device. Today's OctoSense builds don't install from a catalog with a 1.6.0 app.The design and measurements are in ADR 0011 (proposed), in OctoSense-org/OctoSense#364.
🤖 Generated with Claude Code