Skip to content

ADR 0014 phase 4: an app's pinned shared components in the wasm service - #454

Merged
ymote merged 3 commits into
mainfrom
feat/wasm-shared-components
Oct 10, 2026
Merged

ymote merged 3 commits into
mainfrom
feat/wasm-shared-components

Conversation

@ymote

@ymote ymote commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Stacked on #453, the 14th sweep, whose App Hub pin 40abb23b carries App Hub #190, shared components. It stays a draft until #453 merges.

What it adds

A shared component (App Hub ADR 0003) is a component that App Hub publishes on its own. An app pins it under components by alias, id, exact version and BLAKE3 digest, and requires wasm-shared-components-v1.

The wasm service (crates/shell/src/wasm_service.rs) now:

  • loads each pinned component beside the app's fns/. It gets the files from octosense_appstore::components::resolved_in: a system app's from its bundle, an installed app's from the shared store. Each file is checked against the verified catalog and its digest on every load, and nothing is fetched there;
  • routes the component's exports as wasm.<alias>.<function>;
  • gives the app its own instance, under its own grants, as for a component in its fns/. An app may call only shared components;
  • has warm compile them ahead too;
  • has wasm.functions name the component each function comes from ("shared").

There is a test hook (SHARED_RESOLVER), and a manifest that pins nothing never asks the store.

Docs: docs/wasm.md and docs/wasm.zh-CN.md (Shared components, Not done yet), and ADR 0014's status.

Checks (macOS, on #453's sources: makepad d653bc44 overlay tree 0e7e0dac, App Hub 40abb23b)

From phone/, cargo test --locked --features mobile-apps -p octosense-shell wasm_service::tests: 10 passed. They include a_pinned_shared_component_answers_as_alias_and_function, which runs a bundle with no fns/ and one pinned component (md.to_html, md.count keeping its state, a bare name refused, describe naming the component).

Not verified

No App Hub catalog has published a shared component yet, so installing an app that pins one and calling it in a shell is unverified. Nothing was run on a device.

🤖 Generated with Claude Code

@ymote
ymote force-pushed the chore/runtime-makepad-d653bc44 branch from 62fc450 to cf9a6a8 Compare October 10, 2026 02:34
@ymote
ymote force-pushed the feat/wasm-shared-components branch from 6356135 to 740e1f6 Compare October 10, 2026 04:13
@ymote
ymote changed the base branch from chore/runtime-makepad-d653bc44 to fix/component-host-calls-declared October 10, 2026 04:13
@ymote
ymote marked this pull request as ready for review October 10, 2026 04:13
ymote and others added 3 commits October 9, 2026 22:24
A shared component (App Hub ADR 0003) is a component App Hub publishes
on its own; an app pins it by alias, id, exact version and BLAKE3 digest.
The wasm service now loads each one the app pins beside its fns/, from
octosense_appstore::components::resolved_in (a system app's from its
bundle, an installed app's from the shared store, checked against the
verified catalog and its digest on every load), and routes its exports
as wasm.<alias>.<function>. The app gets its own instance, under its own
grants, as for a component in its fns/; an app may call only shared
components. warm compiles them ahead too, and wasm.functions names the
component each function comes from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ymote
ymote force-pushed the feat/wasm-shared-components branch from 740e1f6 to 5dc972b Compare October 10, 2026 05:24
@ymote
ymote changed the base branch from fix/component-host-calls-declared to main October 10, 2026 05:39
@ymote
ymote merged commit 8943ba6 into main Oct 10, 2026
2 of 7 checks passed
@ymote

ymote commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

Merged as part of a train (#452 → #454 → #455) on one local CI pass at the train's top head ddc3bd3. The run was tools/ci-local.sh --only apps,desktop,phone --linux-host --offload: ci-local: PASSED in 14m00s, every step passed and none was skipped. Main's tree after the three merges (cb24135) is 1ecabd25, the tested tree exactly.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant