Decisions: app identity and trust (2026-11-06)
This page is generated from the project corpus and rewritten on every docs build. Edit the source in corpus/, not here.
Settled with the owner in the imbatranim-apps grill on 2026-11-06, then
checked against how Unix, Windows, Android and macOS do the same things
(research-unix-and-windows-conventions.md).
The work is in the todos named below. Changing one of these needs an
explicit revisit and a log.md entry.
Apps run as their own identity, and files carry Unix modes
Each running app has an identity: its app id acts as a user, and each running copy has an instance id that acts as a pid. Every call it makes to the OS carries both. Files in the apps' data area carry an owner and a mode.
- Modes are full Unix modes: read, write and execute for owner, group and others.
- Groups follow Unix's user-private-group scheme. Each app has a group of
its own, plus its install group as a second one, so Office's five apps
share
imbatranim-office. A suite's shared folder is setgid, so new files join its group. - Private by default: new data files are
rw-------and foldersrwx------, as under umask 077. - Built-in apps share the group
system.
The owner, acting through Files or the Terminal, sees everything, as the owner of the home folder.
Why: the owner asked for "a mix between processes from an unix system and permissions unix system". Android isolates apps the same way, with one Linux user per app.
Why not real Linux users: the container has one Linux user and no root, and no brief may grant root. So the OS keeps owner and mode in its database and enforces them in its own file API.
The limit: apps run in the desktop's page, so the OS checks each call, but a hostile app could still reach around it, as threads in one Unix process can. Each app's token is kept out of the others' reach, and the catalog's review and the trust prompt guard the rest.
Rejected:
- owner and others read only, with no groups (the first proposal);
- moving every app into its own frame for real isolation, which would undo the shared kit and the native look.
Built in apps-run-as-their-own-identity (brief 68, 2522407, 2026-11-06):
- Tokens are minted by the client and kept in memory, sent as
X-Imbatranim-App-Token. A refusal (APP_TOKEN_REFUSED) makes the client mint a new one; a token lasts 6 hours idle, and a closed app's instance lives on for a 2 s grace. - Settings, Files and Terminal act as the owner (
ACTS_AS_USER). - Owner's stricter default (2026-11-06): built-in apps lose blanket home
access, with folders
rwx--x--xand filesrw-------. In effect since 2026-11-09 (brief 70,8b10be0), with a grant path for each built-in's file flows (see the next section but one). - Limits against a hostile app: its token is in the page's memory, so a script in the same page can read it; the checks guard the OS's calls, not the page. The catalog's review and the trust prompt guard the rest.
- An uninstall ends its apps' identities (2026-11-08): their tokens and
file grants go when it starts, and until it ends they get no token and
write no data. A catalog app no installed descriptor holds gets no token
at all, since it would otherwise read as a built-in; so does an app from a
URL (an
x-id) once it isn't installed (2026-11-09).
Installable apps keep data in folders by kind
Owner's pick: real files in a folder per app. The research split it the XDG way:
~/.config/imbatranim/<app-id>/for settings;~/.local/share/imbatranim/<app-id>/for data;~/.local/state/imbatranim/<app-id>/for history and recents;~/.cache/imbatranim/<app-id>/for anything that can be rebuilt.
system.data takes the kind. Uninstalling removes the cache always, and the
rest only when the owner ticks "Also remove its data". Windows also leaves
AppData behind when a program is uninstalled. Backups skip the caches.
The app's recents follow its data (owner, 2026-11-09, brief 76's review): the box also deletes its OS recents, files and folders, so a reinstall is given nothing back from before; a plain uninstall keeps them, so a reinstalled Git GUI still reopens its repositories. Rejected: always deleting them (a reinstall's list would open nothing) and never (a removed app's folders would stay handed back to it).
The imbatranim/ level keeps app ids from clashing with Linux programs'
folders, as Windows' vendor folder does. This refines the folder in
decisions-marketplace-suites.md.
Built in apps-get-a-data-folder-of-their-own.
Installable apps see other files only by grant
An installable app sees its own folders, plus any file or folder the owner gives it:
- one opened with it through the OS (Files, Start's recents, Open With);
- one picked in
system.fs.pick*.
A grant lasts for that window. Built-in apps are held to the same rule since 2026-11-09 (the owner's stricter default above).
Why: Android's scoped storage, Flatpak's document portal and the macOS sandbox's user-selected files all work this way. The OS already has the pickers as a portal (2026-08-06), and Office already opens and saves only what it was handed or picked.
Rejected: full home access for installable apps.
The REST API Client's typed file paths become a picker. Built in
installable-apps-get-files-by-grant.
What was built (brief 70, 2026-11-06 to 2026-11-09):
- Who gives. Core gives as the user for its launchers, Files, Start and
the pickers. An open an app makes (
system.intents.openApp) gives with the app's token: only what the app holds, or one of its own recents to a window of its own (a file, or since brief 76 a folder: Git GUI's repositories, recorded only while it held the folder whole). A notification action's payload is the app's words and gives nothing. - Grant kinds.
file(read, write, make),read(a file an app hands on that it may only read),folder(everything under it, except another app's data) andlisting. - An opened file's folder (owner, 2026-11-09). An OS-made open or a pick
also gives a
listingof the file's folder (list it, read the files directly in it) to an app whose manifest declaresreadsOpenedFolder: Media Player, Image Viewer and Notepad. Not subfolders, since a file at the top of home would otherwise give all of home. Rejected: the folder for every app; one file only for everyone (the queue, prev/next and relative images would break). - Notepad's attachments (owner, 2026-11-09). An OS-made open also lets
an app declaring
attachesUnderAssets(Notepad only) make anassets/folder beside the opened file, list it, read the files in it and add new ones. It can't replace, rename or remove anything there; a taken name gets a number (shot-2.png). So attaching an image is silent again, and the most an open Notepad window can do is add files underassets/. Rejected: the Save dialog on every attach (as first built, now the fallback without the grant); write on the note's whole folder (every sibling note could be overwritten); images as data URLs (huge notes other tools show as base64). Built 2026-11-09 as theassetsgrant (79). - Reopening.
system.fs.reopenRecentgives a window one of its app's own recents again, with no more than the app could do to it when it was recorded (a recent says whether it was writable): the Code Editor's restored tabs, Git GUI's recent repos. Built-ins that made new files or picked folders on their own now ask in the OS's dialogs: Notepad's new file and image attach, the Snipping Tool's save, Git GUI's repository, find in files' folder.
URL apps run natively once trusted (revisits 2026-10-07)
This revisits decisions-marketplace.md's
"Sandboxed apps from a URL": an app from a URL treated as malicious, run
prebuilt in an opaque-origin frame with notify only. The owner wants
every app to run like the others, as plugins.
- Verified apps are listed in a
verified.jsonin imbatranim-apps, each entry a repo and a pinned commit. The OS reads the file at a commit pinned with each OS release, so the git hash vouches for it (apt reaches the same goal with signed metadata) and nothing changes between OS updates. They install like Marketplace apps. - Unverified apps show a warning first. It names the publisher (the GitHub owner and repo), lists the capabilities, and says plainly that a trusted app acts as the owner, Terminal included. "Trust and install" sits behind a "More info" step, as Windows SmartScreen does. Every new commit asks again.
- Choices are trust or cancel. There is no sandboxed option, so the frame path can be retired once nothing uses it.
- Settings shows where each app came from: a Verified badge or "Trusted by you", with its source.
- A trusted app builds from source at its pinned commit like any Marketplace app, under the same identity and file-grant rules.
Why: the owner: "If it is not verified, it should show a pop-up at installation like windows does with un-checked sources, if you say you trust it, you can go forward to install it natively."
Rejected:
- keeping URL apps sandboxed;
- drawing their UI natively from a sandbox (remote-dom);
- a verified list read live from GitHub, where a compromised account could mark anything verified.
Built in brief 74 (2026-11-09). The sandboxed path went in brief 82 the same day: version 1 is refused at the check, and an install left from before lists as "No longer supported" in Settings → Marketplace, with Uninstall only. It gets no app token, and a version 2 install of the same app replaces the row.
WASM threads are on
The desktop sends Cross-Origin-Opener-Policy: same-origin and
Cross-Origin-Embedder-Policy: require-corp, and every frame it serves
sends matching headers. That is the Browser app's proxy origin, the only
frame left since the URL-app frame went (2026-11-09). credentialless is the fallback if
require-corp blocks the proxy.
Rejected: threads off until an app needs them. Built in
kit-apps-may-run-webassembly (brief 67, 932d92e, 2026-11-06):
- WASM compiles under
'wasm-unsafe-eval'onscript-src. - One switch:
EMBEDDER_POLICYinsecurity-headers.tsisrequire-corp;credentiallessis the fallback if it blocks something real. - Frames always send
require-corp, whatever the switch says. URL apps run natively since 2026-11-09, so they get threads too. - Cost: a popup opened from a proxied page loses
window.opener, so a site's popup sign-in can break in the Browser.