okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Version 0.2.15 / Control 0.1.61: app and Terminal 0.2.15, Control 0.1.61; every engine package stays 0.1.60 (the v0.2.14 files, carried by absolute url)e39a52e33

main
12.4 KiB153 linesraw

Strata packaging: targets, recipes and locks

This page is for developers who build the desktop app, the Terminal archive and the engine packages. To install Strata, use docs/INSTALL.md. It describes the current release (app and Terminal 0.2.15, Control 0.1.61, engines 0.1.60). How packages are signed and published is in UPDATES.md, and the package format is in ENGINE-COMPONENT.md.

Release assets show what was published; the platform guides and retained reports show what was tested. A published package does not qualify every GPU, model or feature on its platform.

Quick start

I want toSee
Build the desktop appDesktop app
Build an engine packageENGINE-COMPONENT.md
Build the Terminal archiveThe Terminal archive
Sign and publish a releaseUPDATES.md
Test an update against a local feedUPDATES.md

The target matrix

Each row is an OS, CPU ABI and backend. A row is qualified only after the acceptance checklist (below) has run on it.

TargetApp artifactEngine package recipeStatus
macos-arm64-metal.app and .dmg (Tauri)Metal strata, bundled with strata-vision (packaging/build_vision_mac.sh)Built. Self-test passes from the mounted DMG. Inference measurements are in MAC.md. Signing: packaging/mac/sign-and-notarize.sh (mac/README.md).
darwin-arm64 Terminalself-contained .tar.gzanyBuilt and verified. Runs from a moved directory with no system Python.
windows-x86_64-cudaNSIS .exe (Tauri)cuda13 and cuda12Built and tested on a Windows PC with an NVIDIA card: silent install with a System32-only PATH, a real model, an agent chat.
windows-x86_64-hipNSIS .exe (Tauri)tools/hip/build_windows.batPublished. Strix Halo inference is recorded in STRIX_HALO.md. This does not qualify every discrete Radeon card (AMD_HIP.md).
linux-x86_64-cudaAppImage (Tauri)packaging/build_cuda_linux.sh, built in a glibc 2.35 chrootcuda13 built and tested on RTX 3060 and RTX A4000 (app in the browser, a real model, a picture). cuda12 built.
linux-x86_64-hipAppImage (Tauri)packaging/build_hip_linux.shrx9070 (gfx1200 / gfx1201) built and tested on a Radeon AI PRO R9700. rx7900 (gfx1100 / 1101 / 1102) built, not run on an RX 7000 card. rx6000 (gfx1030 / 1031) built, not tested on a real RX 6000 card.
linux-aarch64-cudanone (no AppImage for arm64)packaging/build_cuda_linux_aarch64.sh, built on the DGX Spark (cuda13, sm_121)The engine package and the Terminal archive built and tested on one DGX Spark (DGX_SPARK_LINUX.md). Not tried on any other arm64 machine.
linux-x86_64-syclnonepackaging/build_sycl_linux.sh (one JIT package for Alchemist and Battlemage)Engine package built and tested on an Arc A750. Battlemage is supported and untested by us.
windows-x86_64-syclnonenoneGated. No native Windows SYCL path exists upstream.
macos-x86_64-*nonenoneUnsupported. The macOS engine is Apple Silicon only.

Cross-compilation is not attempted for the desktop app. Tauri bundles are per OS, and the Windows installer is built on Windows. The Python contracts, the owner transport, the checks and the engine build recipes are portable.

The private Node runtime

The desktop bundle ships a pinned standalone Node beside the App Host, so an end user supplies no runtime. It is not committed (about 117 MB, an input rather than source). Fetch and verify it:

apps/desktop/scripts/fetch-node.sh                 # host platform
apps/desktop/scripts/fetch-node.sh --target linux-x64
apps/desktop/scripts/fetch-node.sh --check         # verify what is installed

The script refuses an archive whose SHA-256 differs from the digest recorded for that target. The digests come from nodejs.org's SHASUMS256.txt for the pinned version. To bump the version, change STRATA_NODE_VERSION, add the new digests and run --check. fetch-node.ps1 is the Windows equivalent.

Desktop app

cd apps/desktop
./scripts/fetch-node.sh                                                      # the sidecar (once)
npm install --prefix ../host && npm --prefix ../host run build                # the UI
cargo tauri build --bundles app                                              # macOS: Strata.app
./scripts/make-dmg.sh                                                        # macOS DMG (headless; Tauri's default step needs a Finder session)
cargo tauri build --bundles nsis                                             # Windows, on Windows: per-user NSIS installer
cargo tauri build --bundles appimage deb                                     # Linux, on Linux

The Windows installer is per-user and needs no elevation (installMode: currentUser in tauri.conf.json). Models, profiles and sessions live outside the install directory (~/.strata and the platform state directories), so uninstalling the app does not remove them.

Build boxes build without a signing key: the default tauri.conf.json has createUpdaterArtifacts: false. Signing happens on the release PC (UPDATES.md).

Strata Control and the engine in the installed app

The installer carries Control, and on a Mac the Metal engine too. Neither fetches anything when it runs.

Control (<install>/control, built by apps/desktop/scripts/stage-control.py) is the same bundle as the Terminal archive: the pinned CPython 3.12.15, the hash-locked wheels, strata_control, strata_cli and serve, plus a BUNDLE.json with the interpreter and lock digests. The host finds it beside itself or through STRATA_CONTROL_DIR, runs it on its own interpreter (PYTHONNOUSERSITE=1, no PYTHONHOME or PYTHONPATH) and starts a model with strata profile create|use-config and strata runtime start. The engine then runs under the owner runtime (loopback TCP and a 256-bit token on Windows, a private socket elsewhere; a Job Object or process group; leases), and a second client such as the Terminal can attach to the same instance.

The app starts each engine with runtime start --die-with-pid <host>, so the engine ends with the host. The host ends with the shell (a kill-on-close Job Object on Windows; the host watches its parent everywhere). The app is a single instance: a second launch focuses the open window. One app can run several engines (profiles app-1, app-2, ...). Every close path is in docs/CLOSING.md.

The engine. The Windows and Linux installers carry no engine. On the first start the app shows the engine for the card with its size and one Download button (with progress and resume), or installs an engine file the person already has ("I already have the file"). The Mac dmg keeps its small Metal engine in <install>/engine-bundle/<package folder>. Either way the engine ends up in the per-user component folder, after the package is checked against its manifest (%LOCALAPPDATA%\Strata\components, $XDG_DATA_HOME/strata/components, or STRATA_COMPONENTS_DIR), where Control finds it like any engine that strata update installed:

components/engine/<version>-<platform>-<backend>[-<variant>]/
    engine-component.json     the manifest (see ENGINE-COMPONENT.md)
    strata[.exe]  *.dll | *.so   the binary and the GPU runtime libraries beside it

A run config names it as "exe": "component:strata-engine". At start, strata_control/engine_component.py picks the package for this PC (platform, then the backend its GPU needs, found with nvidia-smi, rocminfo or sycl-ls, or STRATA_ENGINE_BACKEND), checks every file's size and SHA-256 and puts the package folder first on the library path. A mismatch is EngineIntegrityError and nothing starts.

When no package matches, strata serve ends with exit 5 and "No engine for this PC was found". It never fetches. Before that point everything is a warning: strata launch says it could not find an engine, asks whether to go on, downloads the model and ends with the next step (exit 0, nothing started). The app shows the same warning with an "Update engine" button in Settings. packaging/package_engine.py makes a local package from a build folder.

No acquisition at run time. STRATA_NO_ACQUIRE=1 (set by the Tauri shell for the host, and by the host for Control) makes strata_control/acquisition.py refuse pip, downloads and compiles. On the host side server/acquisition.mjs refuses the llama.cpp and cloudflared fetches (a connector placed in components/cloudflared/ is used as it is). Models the user chooses to download are a separate, explicit action. apps/host/tests/no-acquire.test.mjs fails on any outbound request or installer process. apps/desktop/scripts/installed-flow.mjs drives an installed app end to end.

The Terminal archive

The Terminal bundles a private Python and its dependencies for windows-x86_64, linux-x86_64, linux-aarch64 (DGX Spark) and darwin-arm64 (package_terminal.py --target ..., built on the target OS).

  • The interpreter is python-build-standalone CPython 3.12.15, digest-checked at build time.
  • Packages come from packaging/locks/runtime-<target>-cp312.txt and are installed with pip install --require-hashes --no-deps --only-binary=:all: at build time only. lock_wheels.py makes the lock; review its diff when a pin changes.
  • Wrappers: bin/strata.cmd and bin/strata.ps1 on Windows, bin/strata on POSIX. START-HERE.bat, SETUP.bat, UPDATE.bat, setup.sh and update.sh use a python/ folder beside them when there is one.
  • smoke_terminal.py <archive> extracts an archive into a clean environment (a path with a space, a PATH with no Python) and runs --version, doctor, profile list, install and serve --engine mock.
  • Check each archive's BUNDLE.json and lock digests. An old archive is not upgraded when the source lock changes.

What a platform must produce before it is qualified

  1. The app launches and the window serves the supplied UI from the host's origin.
  2. The owner transport works: one owner per installation, a second client attaches, a stale owner can be recovered, and no client can stop a process it does not own.
  3. Real inference on a supported pack, with the engine build hash and the model hashes recorded.
  4. A qualification run on that platform, with raw evidence kept. The Mac-first run in October 2026 is the earlier example: history/docs/work/QUALIFICATION-KIT.md.

Release checks and gaps

  • CI covers scripts, Terminal checks, Metal builds and Docker images (.github/workflows). It does not replace native desktop packaging, signing or real-GPU acceptance on every target. Some recipes still run by hand.
  • Signing needs the owner's credentials, which are never in this tree. The feed and every engine package are signed with the feed key (feed_tool.py); the app installers with the Tauri updater key (UPDATES.md). The Mac app and Terminal archive are signed and notarised on a Mac that holds the Developer ID certificate. No Windows code-signing certificate is configured, so Windows may warn about the installer.
  • Check the licenses and provenance of bundled fonts and assets when packaging. The early D05 checklist lacked redistribution evidence; treat that as an open checklist finding, not an audit of every release asset.

History / older measurements

  • Tauri config: an early draft used perMachine, oneClick and deleteAppDataOnUninstall. The Tauri schema rejects them; the current config uses installMode: currentUser.
  • Repository size: apps/desktop/src-tauri/target and the Node sidecar were briefly committed, which left about 324 MB in the git object store. They are untracked and ignored now. History was not rewritten.
  • Mac packaging tests: the first DMG self-test (8/8) and the engine's 17 kernel-parity suites ran on an Apple M4 GPU in a 16 GiB Mac, with service stand-ins for signing. Later inference measurements on larger Macs are in MAC.md.
  • Intel Arc: official since 0.1.40.2. The 2026-10 B70 tests used the source build, not the engine package. sycl/setup_intel.py (Docker) remains the source-build route.
1# Strata packaging: targets, recipes and locks
2
3This page is for developers who build the desktop app, the Terminal archive and the engine packages. To install Strata, use
4[docs/INSTALL.md](../docs/INSTALL.md). It describes the current release (app and Terminal 0.2.15, Control 0.1.61, engines 0.1.60).
5How packages are signed and published is in [UPDATES.md](UPDATES.md), and the package format is in [ENGINE-COMPONENT.md](ENGINE-COMPONENT.md).
6
7Release assets show what was published; the platform guides and retained reports show what was tested. A published package does not
8qualify every GPU, model or feature on its platform.
9
10## Quick start
11
12| I want to | See |
13| --- | --- |
14| Build the desktop app | [Desktop app](#desktop-app) |
15| Build an engine package | [ENGINE-COMPONENT.md](ENGINE-COMPONENT.md#building-a-package) |
16| Build the Terminal archive | [The Terminal archive](#the-terminal-archive) |
17| Sign and publish a release | [UPDATES.md](UPDATES.md#releasing) |
18| Test an update against a local feed | [UPDATES.md](UPDATES.md#testing-locally) |
19
20## The target matrix
21
22Each row is an OS, CPU ABI and backend. A row is `qualified` only after the acceptance checklist
23([below](#what-a-platform-must-produce-before-it-is-qualified)) has run on it.
24
25| Target | App artifact | Engine package recipe | Status |
26| --- | --- | --- | --- |
27| `macos-arm64-metal` | `.app` and `.dmg` (Tauri) | Metal `strata`, bundled with `strata-vision` (`packaging/build_vision_mac.sh`) | Built. Self-test passes from the mounted DMG. Inference measurements are in [MAC.md](../docs/MAC.md). Signing: `packaging/mac/sign-and-notarize.sh` ([mac/README.md](mac/README.md)). |
28| `darwin-arm64` Terminal | self-contained `.tar.gz` | any | Built and verified. Runs from a moved directory with no system Python. |
29| `windows-x86_64-cuda` | NSIS `.exe` (Tauri) | `cuda13` and `cuda12` | Built and tested on a Windows PC with an NVIDIA card: silent install with a System32-only PATH, a real model, an agent chat. |
30| `windows-x86_64-hip` | NSIS `.exe` (Tauri) | `tools/hip/build_windows.bat` | Published. Strix Halo inference is recorded in [STRIX_HALO.md](../docs/STRIX_HALO.md). This does not qualify every discrete Radeon card ([AMD_HIP.md](../docs/AMD_HIP.md)). |
31| `linux-x86_64-cuda` | AppImage (Tauri) | `packaging/build_cuda_linux.sh`, built in a glibc 2.35 chroot | `cuda13` built and tested on RTX 3060 and RTX A4000 (app in the browser, a real model, a picture). `cuda12` built. |
32| `linux-x86_64-hip` | AppImage (Tauri) | `packaging/build_hip_linux.sh` | `rx9070` (gfx1200 / gfx1201) built and tested on a Radeon AI PRO R9700. `rx7900` (gfx1100 / 1101 / 1102) built, not run on an RX 7000 card. `rx6000` (gfx1030 / 1031) built, not tested on a real RX 6000 card. |
33| `linux-aarch64-cuda` | none (no AppImage for arm64) | `packaging/build_cuda_linux_aarch64.sh`, built on the DGX Spark (`cuda13`, `sm_121`) | The engine package and the Terminal archive built and tested on one DGX Spark ([DGX_SPARK_LINUX.md](../docs/DGX_SPARK_LINUX.md)). Not tried on any other arm64 machine. |
34| `linux-x86_64-sycl` | none | `packaging/build_sycl_linux.sh` (one JIT package for Alchemist and Battlemage) | Engine package built and tested on an Arc A750. Battlemage is supported and untested by us. |
35| `windows-x86_64-sycl` | none | none | Gated. No native Windows SYCL path exists upstream. |
36| `macos-x86_64-*` | none | none | Unsupported. The macOS engine is Apple Silicon only. |
37
38Cross-compilation is not attempted for the desktop app. Tauri bundles are per OS, and the Windows installer is built on Windows.
39The Python contracts, the owner transport, the checks and the engine build recipes are portable.
40
41## The private Node runtime
42
43The desktop bundle ships a pinned standalone Node beside the App Host, so an end user supplies no runtime. It is not committed
44(about 117 MB, an input rather than source). Fetch and verify it:
45
46```sh
47apps/desktop/scripts/fetch-node.sh                 # host platform
48apps/desktop/scripts/fetch-node.sh --target linux-x64
49apps/desktop/scripts/fetch-node.sh --check         # verify what is installed
50```
51
52The script refuses an archive whose SHA-256 differs from the digest recorded for that target. The digests come from nodejs.org's
53`SHASUMS256.txt` for the pinned version. To bump the version, change `STRATA_NODE_VERSION`, add the new digests and run `--check`.
54`fetch-node.ps1` is the Windows equivalent.
55
56## Desktop app
57
58```sh
59cd apps/desktop
60./scripts/fetch-node.sh                                                      # the sidecar (once)
61npm install --prefix ../host && npm --prefix ../host run build                # the UI
62cargo tauri build --bundles app                                              # macOS: Strata.app
63./scripts/make-dmg.sh                                                        # macOS DMG (headless; Tauri's default step needs a Finder session)
64cargo tauri build --bundles nsis                                             # Windows, on Windows: per-user NSIS installer
65cargo tauri build --bundles appimage deb                                     # Linux, on Linux
66```
67
68The Windows installer is per-user and needs no elevation (`installMode: currentUser` in `tauri.conf.json`). Models, profiles and
69sessions live outside the install directory (`~/.strata` and the platform state directories), so uninstalling the app does not remove them.
70
71Build boxes build without a signing key: the default `tauri.conf.json` has `createUpdaterArtifacts: false`. Signing happens on the
72release PC ([UPDATES.md](UPDATES.md#releasing)).
73
74## Strata Control and the engine in the installed app
75
76The installer carries Control, and on a Mac the Metal engine too. Neither fetches anything when it runs.
77
78**Control** (`<install>/control`, built by `apps/desktop/scripts/stage-control.py`) is the same bundle as the Terminal archive:
79the pinned CPython 3.12.15, the hash-locked wheels, `strata_control`, `strata_cli` and `serve`, plus a `BUNDLE.json` with the
80interpreter and lock digests. The host finds it beside itself or through `STRATA_CONTROL_DIR`, runs it on its own interpreter
81(`PYTHONNOUSERSITE=1`, no `PYTHONHOME` or `PYTHONPATH`) and starts a model with `strata profile create|use-config` and
82`strata runtime start`. The engine then runs under the owner runtime (loopback TCP and a 256-bit token on Windows, a private
83socket elsewhere; a Job Object or process group; leases), and a second client such as the Terminal can attach to the same instance.
84
85The app starts each engine with `runtime start --die-with-pid <host>`, so the engine ends with the host. The host ends with the shell
86(a kill-on-close Job Object on Windows; the host watches its parent everywhere). The app is a single instance: a second launch focuses
87the open window. One app can run several engines (profiles `app-1`, `app-2`, ...). Every close path is in [docs/CLOSING.md](../docs/CLOSING.md).
88
89**The engine.** The Windows and Linux installers carry no engine. On the first start the app shows the engine for the card with its size
90and one Download button (with progress and resume), or installs an engine file the person already has ("I already have the file").
91The Mac dmg keeps its small Metal engine in `<install>/engine-bundle/<package folder>`. Either way the engine ends up in the per-user
92component folder, after the package is checked against its manifest (`%LOCALAPPDATA%\Strata\components`, `$XDG_DATA_HOME/strata/components`, or `STRATA_COMPONENTS_DIR`),
93where Control finds it like any engine that `strata update` installed:
94
95    components/engine/<version>-<platform>-<backend>[-<variant>]/
96        engine-component.json     the manifest (see ENGINE-COMPONENT.md)
97        strata[.exe]  *.dll | *.so   the binary and the GPU runtime libraries beside it
98
99A run config names it as `"exe": "component:strata-engine"`. At start, `strata_control/engine_component.py` picks the package for this PC
100(platform, then the backend its GPU needs, found with nvidia-smi, rocminfo or sycl-ls, or `STRATA_ENGINE_BACKEND`), checks every
101file's size and SHA-256 and puts the package folder first on the library path. A mismatch is `EngineIntegrityError` and nothing starts.
102
103When no package matches, `strata serve` ends with exit 5 and "No engine for this PC was found". It never fetches. Before that point
104everything is a warning: `strata launch` says it could not find an engine, asks whether to go on, downloads the model and ends with
105the next step (exit 0, nothing started). The app shows the same warning with an "Update engine" button in Settings.
106`packaging/package_engine.py` makes a local package from a build folder.
107
108**No acquisition at run time.** `STRATA_NO_ACQUIRE=1` (set by the Tauri shell for the host, and by the host for Control) makes
109`strata_control/acquisition.py` refuse pip, downloads and compiles. On the host side `server/acquisition.mjs` refuses the llama.cpp
110and cloudflared fetches (a connector placed in `components/cloudflared/` is used as it is). Models the user chooses to download are a
111separate, explicit action. `apps/host/tests/no-acquire.test.mjs` fails on any outbound request or installer process.
112`apps/desktop/scripts/installed-flow.mjs` drives an installed app end to end.
113
114## The Terminal archive
115
116The Terminal bundles a private Python and its dependencies for `windows-x86_64`, `linux-x86_64`, `linux-aarch64` (DGX Spark) and `darwin-arm64`
117(`package_terminal.py --target ...`, built on the target OS).
118
119- The interpreter is python-build-standalone CPython 3.12.15, digest-checked at build time.
120- Packages come from `packaging/locks/runtime-<target>-cp312.txt` and are installed with
121  `pip install --require-hashes --no-deps --only-binary=:all:` at build time only. `lock_wheels.py` makes the lock; review its diff when a pin changes.
122- Wrappers: `bin/strata.cmd` and `bin/strata.ps1` on Windows, `bin/strata` on POSIX. `START-HERE.bat`, `SETUP.bat`, `UPDATE.bat`, `setup.sh`
123  and `update.sh` use a `python/` folder beside them when there is one.
124- `smoke_terminal.py <archive>` extracts an archive into a clean environment (a path with a space, a PATH with no Python) and runs
125  `--version`, `doctor`, `profile list`, `install` and `serve --engine mock`.
126- Check each archive's `BUNDLE.json` and lock digests. An old archive is not upgraded when the source lock changes.
127
128## What a platform must produce before it is qualified
129
1301. The app launches and the window serves the supplied UI from the host's origin.
1312. The owner transport works: one owner per installation, a second client attaches, a stale owner can be recovered, and no client can stop a process it does not own.
1323. Real inference on a supported pack, with the engine build hash and the model hashes recorded.
1334. A qualification run on that platform, with raw evidence kept. The Mac-first run in October 2026 is the earlier example: [history/docs/work/QUALIFICATION-KIT.md](../history/docs/work/QUALIFICATION-KIT.md).
134
135## Release checks and gaps
136
137- CI covers scripts, Terminal checks, Metal builds and Docker images ([.github/workflows](../.github/workflows)). It does not replace native desktop
138  packaging, signing or real-GPU acceptance on every target. Some recipes still run by hand.
139- Signing needs the owner's credentials, which are never in this tree. The feed and every engine package are signed with the feed key
140  (`feed_tool.py`); the app installers with the Tauri updater key ([UPDATES.md](UPDATES.md)). The Mac app and Terminal archive are signed and
141  notarised on a Mac that holds the Developer ID certificate. No Windows code-signing certificate is configured, so Windows may warn about the installer.
142- Check the licenses and provenance of bundled fonts and assets when packaging. The early D05 checklist lacked redistribution evidence;
143  treat that as an open checklist finding, not an audit of every release asset.
144
145## History / older measurements
146
147- **Tauri config:** an early draft used `perMachine`, `oneClick` and `deleteAppDataOnUninstall`. The Tauri schema rejects them; the
148  current config uses `installMode: currentUser`.
149- **Repository size:** `apps/desktop/src-tauri/target` and the Node sidecar were briefly committed, which left about 324 MB in the git object
150  store. They are untracked and ignored now. History was not rewritten.
151- **Mac packaging tests:** the first DMG self-test (8/8) and the engine's 17 kernel-parity suites ran on an Apple M4 GPU in a 16 GiB Mac, with service stand-ins for signing.
152  Later inference measurements on larger Macs are in [MAC.md](../docs/MAC.md).
153- **Intel Arc:** official since 0.1.40.2. The 2026-10 B70 tests used the source build, not the engine package. `sycl/setup_intel.py` (Docker) remains the source-build route.