Skip to content
85 changes: 60 additions & 25 deletions docs/adr/0002-event-driven-app-agents.md

Large diffs are not rendered by default.

327 changes: 327 additions & 0 deletions docs/adr/0004-native-apps-hosting-and-peers.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/adr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Decisions for the OctoSense repository: the shell, its services, the system apps
| [0001](0001-one-octosense-repository.md) | One OctoSense repository for the shell, its services, the system apps and both packagings | Accepted |
| [0002](0002-event-driven-app-agents.md) | Event-driven app agents: apps think on their own triggers and publish cards to the glance screen | Proposed |
| [0003](0003-shared-octos-client-access.md) | Talk to Octos: one kernel for native and external clients (opt-in) | Implemented; Android unverified |
| [0004](0004-native-apps-hosting-and-peers.md) | Native apps, app agents and cross-app work: one manifest, hosting per target, an agent for every app, approvals by the person | Accepted |

## Home (phone shell) decisions, 2026-09-16 to 2026-09-25

Expand Down
1 change: 1 addition & 0 deletions docs/adr/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ OctoSense 仓库的决策:Shell、Shell 服务、系统应用,以及桌面
| [0001](0001-one-octosense-repository.md)(英文) | 用一个 OctoSense 仓库承载 Shell、Shell 服务、系统应用和两种打包形态 | 已接受 |
| [0002](0002-event-driven-app-agents.md)(英文) | 事件驱动的应用智能体:应用按自己的触发条件思考,并把卡片发布到一览屏 | 提议中 |
| [0003](0003-shared-octos-client-access.md)(英文) | Talk to Octos:原生与外部客户端共用一个内核(需手动开启) | 已实现;Android 未验证 |
| [0004](0004-native-apps-hosting-and-peers.md)(英文) | 原生应用、应用智能体与跨应用协作:一份清单、按目标平台托管、每个应用都有智能体、由本人批准 | 已接受 |

## Home(手机 Shell)的决策,2026-09-16 至 2026-09-25

Expand Down
8 changes: 8 additions & 0 deletions docs/adr/home/0002-agentic-app-security-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,11 @@ Running a real compiled card (`apps/calendar/cards/calendar-01`) through the ref

- [ADR 0001: Hybrid Android launcher and system bridge](0001-hybrid-android-launcher-and-system-bridge.md)
- Mini-program containment as prior art: dual-thread split with a host-owned bridge, per-app storage isolation with a size cap, and a registered domain allowlist per app — [container architecture](https://dev.to/ai_superapp/mini-program-container-architecture-how-dual-thread-rendering-works-3if7), [storage](https://developers.weixin.qq.com/miniprogram/en/dev/framework/ability/storage.html), [network](https://developers.weixin.qq.com/miniprogram/en/dev/framework/ability/network.html), [native renderer](https://developers.weixin.qq.com/miniprogram/en/dev/framework/runtime/skyline/introduction.html).

## Amendment, 2026-09-28 ([ADR 0004](../0004-native-apps-hosting-and-peers.md))

- **Native trust tier.** Native Rust apps are first-party and reviewed only, declared in `native-apps.json`; anything from the store is a script app. An in-process native module is trusted code: a splash isolate does not contain native Rust.
- **Process isolation on desktops.** Native apps run in their own process on macOS, Windows and Linux with Vulkan and Wayland, under an OS sandbox declared per app (files, network, child processes). Mobile, wasm and Linux without Vulkan host them in-process.
- **App agents for every app,** reached through the shell only (a process app never talks to the kernel), with the person's consent at first use.
- **Standing approvals.** The person may approve in advance through narrow, time-boxed, audited rules that the shell enforces; the system agent never approves.
- **Storage.** Every app, script or native, uses one host layout (`apps/<app id>/accounts/<hash>/`, `common/`, `cache/`; secrets under `secrets/<app id>/`, never in a jail), declared in its manifest's `storage` block. The agent's workspace is its account folder, as this ADR's `SessionProfile` already makes it the jail.
4 changes: 4 additions & 0 deletions docs/adr/home/0004-system-apps-are-contained-script-apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ Found by building these three apps; each fix is general, not app-specific.
- Photos: pinch-to-zoom is wired but unverified on a device; there is no device photo library, which would need its own capability and service.
- Maps: no offline archives; places, routes and guidance come from the same keyless services as before.
- Runtime: a view that starts hidden does not draw its `show_bg` background (use `SolidView`); string-keyed object maps with long keys are pathologically slow.

## Amendment, 2026-09-28 ([ADR 0004](../0004-native-apps-hosting-and-peers.md))

The native exceptions to this ADR, and why they stay native: **App Hub** (the store and the Card runner every script app runs in), **Rinx** (a separate product with its own repository) and **Terminal** (a PTY and child processes, which the script sandbox deliberately forbids). They are declared in `native-apps.json`. The native News, Maps and Photos crates kept for comparison are deleted; the script apps are the only versions.