Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.
C++
build-feed writes install-manifest.txt from the Control packs (what install.sh and install.ps1 read); test of the release path; docs
Niko1221af78949b1747
diff --git a/packaging/README.md b/packaging/README.mdindex 989ca1355..e70a3c4fb 100644--- a/packaging/README.md+++ b/packaging/README.md@@ -136,7 +136,7 @@ user chooses to download are a separate, explicit action. `apps/host/tests/no-acwork.* Signing needs the owner's credentials, which are never in this tree. The update feed and every engine package are signed with the feed key(`feed_tool.py`, [UPDATES.md](UPDATES.md)); the app installers with the Tauri updater key. The Mac app and Terminal archive are signed and- notarised on a Mac that holds the Developer ID certificate, with `packaging/mac/sign-and-notarize.sh` ([mac/README.md](mac/README.md)). No+ notarised on a Mac that holds the Developer ID certificate, with `packaging/mac/sign-and-notarize.sh` ([mac/README.md](mac/README.md)); for a release, `--updater-archive` also packs the notarised app as `Strata.app.tar.gz` for the in-app Mac update (the one `tauri build` makes holds the unsigned app), signed with the Tauri key on the PC and added with `feed_tool.py set-app-platform`. NoWindows code-signing certificate is configured in this tree; Windows may warn about an installer that is not signed.* No font or asset redistribution evidence has been gathered (D05). The app currently ships thebrand assets from the supplied UI ZIP, which is fine for an internal candidate and not sufficientdiff --git a/packaging/UPDATES.md b/packaging/UPDATES.mdindex 00c8c9198..93703aeea 100644--- a/packaging/UPDATES.md+++ b/packaging/UPDATES.md@@ -113,8 +113,8 @@ A key rotation is a release that carries both public keys; the old private key s## Releasing (when the owner says go)python packaging/feed_tool.py sign-package <engine package folder> --key <feed-key.json>- python packaging/feed_tool.py pack-engine <engine package folder> --out RELEASE/engine- python packaging/feed_tool.py pack-control <control bundle folder> --version V --platform P --out RELEASE/control+ python packaging/feed_tool.py pack-engine <engine package folder> --out RELEASE/engine --url-prefix ""+ python packaging/feed_tool.py pack-control <control bundle folder> --version V --platform P --out RELEASE/control --url-prefix "" # add --format zip for windows-x86_64# the app installers carry the engine out of the box: fill apps/desktop/src-tauri/resources/engine-bundle/<package folder> with the signed# engine packages first (the tester builds do the same); tauri.conf.json lists that folder as a resource for every buildTAURI_SIGNING_PRIVATE_KEY=<path to tauri-updater.key> npx tauri build --config src-tauri/tauri.release.conf.json # installers + their .sig files (one build per OS)@@ -145,6 +145,12 @@ Mach-O in the app with the Developer ID and notarises and staples it, which chanThe Windows installer and the Linux AppImage need no extra step: their `.sig` files from `tauri build` are the ones to pass to `set-app-platform`. Re-signing the Mac app after the archivewas made (a second `sign-and-notarize.sh` run) makes a new archive: sign and add it again.+`build-feed` also writes `RELEASE/install-manifest.txt`, the file the one-line installers read (`install.sh` L76, `install.ps1` L45): one line per Control package,+`platform version url sha256 size`, taken from the `*.entry.json` files in `RELEASE/control`. The Control package is the Terminal that `install.sh` unpacks (it must hold `bin/strata`).+`install.sh` unpacks with `tar -xzf` and `install.ps1` with `Expand-Archive`, so `windows-x86_64` must be packed with `--format zip` and the other platforms as `tar.gz`;+`build-feed` leaves a pack in the wrong format out of the manifest and says so. Pack Control for every platform you want the one-line install to cover (`install.sh` knows `linux-x86_64` and `macos-arm64`, `install.ps1` `windows-x86_64`);+a platform with no line gets "this release has no Terminal for <platform>". Upload `install.sh` and `install.ps1` from `packaging/` unchanged: their built-in address is the release folder.+The feed is hosted as the files of a GitHub release of `Niko1221/Strata`. The built-in address is`https://github.com/Niko1221/Strata/releases/latest/download` (`strata_cli/update_cmd.py` `DEFAULT_FEED` adds `/strata-feed.json`; `install.sh`and `install.ps1` use the folder). GitHub assets are flat, so build the packages with `--url-prefix ""` and upload every file of the release folderdiff --git a/packaging/feed_tool.py b/packaging/feed_tool.pyindex 837b1fa40..4be335c9b 100644--- a/packaging/feed_tool.py+++ b/packaging/feed_tool.py@@ -178,6 +178,7 @@ def build_feed(out: Path, *, key: dict, sequence: int, channel: str = "stable",control_dir: Path | None = None, app_json: Path | None = None, expires_days: int | None = None,now: dt.datetime | None = None) -> dict:now = now or dt.datetime.now(dt.timezone.utc)+ install_manifest = ""document: dict = {"schema_version": feedmod.SCHEMA_VERSION, "feed": "strata-updates", "channel": channel,"sequence": sequence, "generated_at": now.strftime("%Y-%m-%dT%H:%M:%SZ"),"expires_at": (now + dt.timedelta(days=expires_days)).strftime("%Y-%m-%dT%H:%M:%SZ") if expires_days else None}@@ -191,6 +192,13 @@ def build_feed(out: Path, *, key: dict, sequence: int, channel: str = "stable",raise SystemExit(f"the control packages are for different versions: {sorted(versions)}")if entries:document["control"] = {"version": versions.pop(), "packages": [{k: v for k, v in e.items() if k != "version"} for e in entries]}+ for e in entries: # install.sh unpacks with tar -xzf, install.ps1 with Expand-Archive: a pack in the other format cannot be installed that way+ want = "zip" if e["platform"].startswith("windows") else "tar.gz"+ if e.get("format") != want:+ print(f"note: the {e['platform']} control package is {e.get('format')}, so it is left out of install-manifest.txt "+ f"(the one-line installer needs {want}; pack-control --format {want})", file=sys.stderr)+ continue+ install_manifest += f"{e['platform']} {e['version']} {e['url']} {e['sha256']} {e['size']}\n"if app_json:document["app"] = json.loads(Path(app_json).read_text(encoding="utf-8"))payload = (json.dumps(document, indent=1, sort_keys=True) + "\n").encode("utf-8")@@ -198,6 +206,8 @@ def build_feed(out: Path, *, key: dict, sequence: int, channel: str = "stable",(Path(out) / feedmod.FEED_NAME).write_bytes(payload)signature = signing.sign_bytes(key, payload)(Path(out) / (feedmod.FEED_NAME + feedmod.SIGNATURE_SUFFIX)).write_text(json.dumps(signature) + "\n", encoding="utf-8")+ if install_manifest: # what install.sh / install.ps1 read: platform version url sha256 size, one line per Terminal (Control) package+ (Path(out) / "install-manifest.txt").write_text(install_manifest, encoding="utf-8", newline="\n")if "app" in document: # the file the Tauri updater plugin readslatest = Path(out) / "app" / "latest.json"latest.parent.mkdir(parents=True, exist_ok=True)diff --git a/packaging/make_local_feed.py b/packaging/make_local_feed.pyindex d6d79c457..4fb4bb394 100644--- a/packaging/make_local_feed.py+++ b/packaging/make_local_feed.py@@ -10,7 +10,7 @@What it writes into FEED (the folder a person would host):strata-feed.json + .sig the signed feed (Ed25519, the key in KEYDIR, made once, never inside a git checkout)control/*, engine/* the Terminal (as a "control" package) and each engine package, archived- install-manifest.txt one line per platform for install.sh / install.ps1: platform version url sha256 size+ install-manifest.txt one line per platform for install.sh / install.ps1: platform version url sha256 size (written by feed_tool build-feed)install.sh, install.ps1 the one-line installers with this feed's address filled in (--url)test-trust.json the PUBLIC test key: `STRATA_UPDATE_TRUSTED_KEYS=<this file>` lets this build trust the feed(the real key goes into strata_control/update_keys.json at release; this one never does)@@ -72,7 +72,6 @@ def main(argv=None) -> int:shutil.rmtree(out, ignore_errors=True)(out / "engine").mkdir(parents=True)(out / "control").mkdir(parents=True)- manifest_lines: list[str] = []version = a.versionwith tempfile.TemporaryDirectory(prefix="strata-feed-") as tmp:tmpdir = Path(tmp)@@ -86,7 +85,6 @@ def main(argv=None) -> int:"macos-arm64" if ("darwin" in term.name or "macos" in term.name) else "linux-x86_64") # the feed's own platform namesfmt = "zip" if platform.startswith("windows") else "tar.gz"entry = ft.pack_control(folder, out / "control", version=v, platform=platform, fmt=fmt)- manifest_lines.append(f"{platform} {v} {entry['url']} {entry['sha256']} {entry['size']}")print(f"control {platform} {v}: {entry['size'] // 1048576} MB")for n, pkg in enumerate(a.engine):copy = tmpdir / f"e{n}" / pkg.name@@ -97,7 +95,6 @@ def main(argv=None) -> int:shutil.rmtree(copy.parent, ignore_errors=True)ft.build_feed(out, key=key, sequence=a.sequence, channel=a.channel, engine_dir=out / "engine" if a.engine else None,control_dir=out / "control" if a.terminal else None)- (out / "install-manifest.txt").write_text("\n".join(manifest_lines) + "\n", encoding="utf-8")base = a.url.rstrip("/")for name in ("install.sh", "install.ps1"):text = (ROOT / "packaging" / name).read_text(encoding="utf-8").replace(RELEASE_FEED, base)diff --git a/tests/terminal/test_launch_install.py b/tests/terminal/test_launch_install.pyindex 888a0f265..7a8d011ff 100644--- a/tests/terminal/test_launch_install.py+++ b/tests/terminal/test_launch_install.py@@ -140,6 +140,56 @@ class Feed(unittest.TestCase):finally:server.shutdown()+ def test_the_release_path_writes_install_manifest_and_the_unchanged_install_sh_installs_from_it(self):+ """pack-control (flat names, as for GitHub assets) + build-feed, the files a release uploads; not make_local_feed."""+ import feed_tool+ with tempfile.TemporaryDirectory() as tmp:+ work = Path(tmp)+ archive = self.make_bundle(work)+ unpacked = work / "unpacked"+ unpacked.mkdir()+ folder = mlf.extract_terminal(archive, unpacked)+ release = work / "release"+ feed_tool.keygen(work / "keys")+ key = feed_tool._load_key(work / "keys" / "feed-key.json")+ entry = feed_tool.pack_control(folder, release / "control", version="9.9.9", platform="linux-x86_64", url_prefix="")+ shutil.move(str(release / "control" / entry["url"]), str(release / entry["url"])) # GitHub assets are flat+ feed_tool.build_feed(release, key=key, sequence=1, control_dir=release / "control")+ line = (release / "install-manifest.txt").read_text().split()+ self.assertEqual(line, ["linux-x86_64", "9.9.9", entry["url"], entry["sha256"], str(entry["size"])])+ self.assertEqual(json.loads((release / "strata-feed.json").read_text())["control"]["packages"][0]["sha256"], entry["sha256"])+ bad = work / "bad" # a Windows pack that is not a zip cannot be installed by install.ps1: left out of the manifest+ feed_tool.build_feed(bad, key=key, sequence=1, control_dir=self._windows_tar_pack(folder, work))+ self.assertFalse((bad / "install-manifest.txt").exists())+ shutil.copy2(ROOT / "packaging" / "install.sh", release / "install.sh") # uploaded unchanged+ shutil.copy2(work / "keys" / "feed-key.pub.json", release / "test-trust.json")+ if os.name == "nt" or not (shutil.which("sh") and shutil.which("curl") and shutil.which("tar")):+ self.skipTest("the real install.sh run needs POSIX sh, curl and tar")+ handler = partial(SimpleHTTPRequestHandler, directory=str(release))+ handler.log_message = lambda *a, **k: None # type: ignore[attr-defined]+ server = ThreadingHTTPServer(("127.0.0.1", 0), handler)+ threading.Thread(target=server.serve_forever, daemon=True).start()+ try:+ home = work / "home"+ home.mkdir()+ env = {**os.environ, "HOME": str(home), "STRATA_FEED": f"http://127.0.0.1:{server.server_address[1]}",+ "STRATA_INSTALL_TEST_TRUST": "1", "STRATA_PYTHON": sys.executable, "STRATA_NO_ACQUIRE": ""}+ for k in ("XDG_DATA_HOME", "STRATA_UPDATE_TRUSTED_KEYS"):+ env.pop(k, None)+ r = subprocess.run(["sh", str(release / "install.sh")], capture_output=True, text=True, env=env, timeout=240)+ self.assertEqual(r.returncode, 0, r.stdout + r.stderr)+ self.assertIn("Checksum ok", r.stdout)+ self.assertIn("Signature ok", r.stdout)+ self.assertTrue((home / ".local" / "bin" / "strata").exists())+ finally:+ server.shutdown()++ def _windows_tar_pack(self, folder: Path, work: Path) -> Path:+ import feed_tool+ out = work / "badcontrol"+ feed_tool.pack_control(folder, out, version="9.9.9", platform="windows-x86_64", fmt="tar.gz", url_prefix="")+ return out+if __name__ == "__main__":unittest.main()