Data isolation
Every durable or sensitive resource has one owner. Isolation is expressed through native roots, one SQLite owner, Guest-specific mounts and lifecycle deletion, not through a naming convention that App code is expected to honor voluntarily.
Ownership matrix
| Resource | Owner | Read | Write |
|---|---|---|---|
Top-level /workspace | Pi Agent | resident workspace Tools/System mechanisms | resident workspace Tools/System mechanisms |
| Ordinary App SQLite | that App | Action + read-only View Projection | Action transaction only |
| Ordinary App files/data root | that App | only mounts scoped to that App | only mounted App-local mechanisms |
| Packaged JSON resources | App release | frozen value in that App's Guests | never at runtime |
| Credential values | native host on behalf of App | native request adapter only | Installer/provisioning lifecycle |
| Wi-Fi/model configuration | native host | bounded System facts | native Settings/provisioning commands |
| JavaScript heap | one Guest | that Guest | that Guest |
One SQLite owner
View and Action Guests do not open competing embedded database connections. A nativeDbModule owner serializes operations for the App's SQLite file. The View mount enables PRAGMA query_only around reads; write operations are not exposed there.
View isolation
A View receives bounded query results, declared JSON resources, its own presentation heap and pointer input. It does not receive provider responses, raw credentials or the Action call stack. Returning PocketPi.action() asks native routing to perform a mutation elsewhere.
Agent isolation
The Agent sees public Tool schemas and Tool results. It does not see App table files or native credentials. Cross-App coordination happens through public capabilities, not by joining private databases or walking another App's data root.
Guest isolation
QuickJS globals, objects, promises and job queues never cross Guest boundaries. Shared Framework and App source are evaluated separately in each Guest. Data that must coordinate those isolated instances crosses a native contract or durable App state.
Isolation after lifecycle changes
- View/Action Guest eviction removes only transient heap and retained nodes.
- Update replaces source and cached Guests while preserving compatible App Data.
- Uninstall removes source, private data root, schedule state, Tool routes, credentials and cached Guests.
- Pi Agent's System lifecycle and workspace are unaffected by ordinary App uninstall.