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++
P2003 findings: DeepSeek setup says in one line when GitHub cannot be reached (a 10 s check before any download, not minutes of retries) and no longer fetches or test-starts the Strata engine, llama.cpp source or CUDA libraries it does not use; install.sh is one function called on the last line (a half-downloaded file runs nothing) and every documented one-liner is 'curl ... -o install.sh && sh install.sh' so a failed curl cannot look like success; tests
Niko122151d23fdd1e32
diff --git a/AGENTS.md b/AGENTS.mdindex 486a86cae..01a3c8656 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -19,7 +19,7 @@ Follow **[docs/AI_SETUP.md](docs/AI_SETUP.md)**. For an agent that has a shell,1. Install the Terminal. It needs no administrator rights.```sh- curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh | sh # Linux, Mac+ curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh # Linux, Macirm https://github.com/Niko1221/Strata/releases/latest/download/install.ps1 | iex # Windows PowerShell```diff --git a/README.de.md b/README.de.mdindex e422baeec..cfea1dd33 100644--- a/README.de.md+++ b/README.de.md@@ -108,7 +108,7 @@ Das Terminal ist der Befehl `strata`, gedacht für Skripte, Server und KI-AgentsLinux und Mac:```sh-curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh | sh+curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh```Windows (PowerShell):diff --git a/README.es.md b/README.es.mdindex c90d47fd9..d072d5f7f 100644--- a/README.es.md+++ b/README.es.md@@ -109,7 +109,7 @@ La Terminal es el comando `strata`, pensado para scripts, servidores y agentes dLinux y Mac:```sh-curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh | sh+curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh```Windows (PowerShell):diff --git a/README.fr.md b/README.fr.mdindex 9661a6bd4..c8cbf03fc 100644--- a/README.fr.md+++ b/README.fr.md@@ -109,7 +109,7 @@ Le Terminal est la commande `strata`, pensée pour les scripts, les serveurs etLinux et Mac :```sh-curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh | sh+curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh```Windows (PowerShell) :diff --git a/README.ja.md b/README.ja.mdindex b3ba4196c..272e396ab 100644--- a/README.ja.md+++ b/README.ja.md@@ -105,7 +105,7 @@ Strata は **[Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-NextLinux と Mac:```sh-curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh | sh+curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh```Windows(PowerShell):diff --git a/README.md b/README.mdindex 06b39950c..1b6bf4d98 100644--- a/README.md+++ b/README.md@@ -107,7 +107,7 @@ The Terminal is the `strata` command, for scripts, servers and AI agents.Linux and Mac:```sh-curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh | sh+curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh```Windows (PowerShell):diff --git a/README.pt-BR.md b/README.pt-BR.mdindex 7fe4ac539..3f4464cbc 100644--- a/README.pt-BR.md+++ b/README.pt-BR.md@@ -105,7 +105,7 @@ O Terminal é o comando `strata`, para scripts, servidores e agentes de IA.Linux e Mac:```sh-curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh | sh+curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh```Windows (PowerShell):diff --git a/README.zh-CN.md b/README.zh-CN.mdindex cab50bb0b..ce74ece44 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -105,7 +105,7 @@ Strata 运行 **[Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-NLinux 和 Mac:```sh-curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh | sh+curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh```Windows(PowerShell):diff --git a/SECURITY.md b/SECURITY.mdindex 85ad66c26..8bd61c841 100644--- a/SECURITY.md+++ b/SECURITY.md@@ -74,7 +74,7 @@ the model. The section above is about the engine's HTTP server. This is what theThe Terminal installs with one line:```sh-curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh | sh+curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.shirm https://github.com/Niko1221/Strata/releases/latest/download/install.ps1 | iex```diff --git a/docker/compose/MAC.md b/docker/compose/MAC.mdindex a3017acdc..9842f1af9 100644--- a/docker/compose/MAC.md+++ b/docker/compose/MAC.md@@ -3,7 +3,7 @@Docker on a Mac runs Linux in a virtual machine that has no access to the Mac's GPU (no Metal), so a container could onlyuse the CPU, and Strata has no CPU-only mode worth running. Use the Mac app or the Terminal instead:- curl -fsSL <release-folder>/install.sh | sh # then: strata launch+ curl -fsSL <release-folder>/install.sh -o install.sh && sh install.sh # then: strata launchSee docs/MAC.md and docs/TERMINAL_LAUNCH.md. The same goes for Windows with Docker Desktop and an AMD or Intel card:the WSL2 virtual machine passes NVIDIA cards through, not Radeon or Arc cards. Use the Windows app or Terminal.diff --git a/docs/AI_SETUP.md b/docs/AI_SETUP.mdindex 36ae9d426..5d8be6739 100644--- a/docs/AI_SETUP.md+++ b/docs/AI_SETUP.md@@ -65,7 +65,7 @@ its SHA-256, unpacks it into the user's home folder, checks the release's signedPATH.```-Linux, Mac: curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh | sh+Linux, Mac: curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.shWindows (PowerShell): irm https://github.com/Niko1221/Strata/releases/latest/download/install.ps1 | iex```diff --git a/docs/INSTALL.md b/docs/INSTALL.mdindex 100174f39..dc3dd2a7f 100644--- a/docs/INSTALL.md+++ b/docs/INSTALL.md@@ -87,7 +87,7 @@ way for scripts, servers and AI agents. Linux (x86-64), Mac (Apple Silicon) andLinux and Mac:```sh-curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh | sh+curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh```Windows (PowerShell):diff --git a/docs/TERMINAL_LAUNCH.md b/docs/TERMINAL_LAUNCH.mdindex ecec84ef3..dfb790ea9 100644--- a/docs/TERMINAL_LAUNCH.md+++ b/docs/TERMINAL_LAUNCH.md@@ -7,7 +7,7 @@ in the Terminal's look, with presets, an Advanced table, an access choice and a## Install (one line)```sh-curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh | sh # Linux, macOS+curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh # Linux, macOSirm https://github.com/Niko1221/Strata/releases/latest/download/install.ps1 | iex # Windows PowerShell```diff --git a/packaging/install.sh b/packaging/install.shindex 05ced3ab8..df6b41e0a 100644--- a/packaging/install.sh+++ b/packaging/install.sh@@ -1,7 +1,7 @@#!/bin/sh# Strata Terminal: one-line installer for Linux and macOS.#-# curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh | sh+# curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh## What it does, in order (and nothing else):# 1. finds out which computer this is (system, processor, graphics card) so it can fetch the right archive;@@ -31,96 +31,101 @@ die() { printf 'strata installer: %s\n' "$*" >&2; exit 1; }[ -n "$FEED" ] || die "this installer does not know where the Strata release folder is. Set STRATA_FEED to its address and run it again, for example: STRATA_FEED=https://example.org/strata sh install.sh"-# ---- tools-if command -v curl >/dev/null 2>&1; then- fetch() { curl -fsSL --retry 3 -o "$2" "$1"; }-elif command -v wget >/dev/null 2>&1; then- fetch() { wget -q -O "$2" "$1"; }-else- die "neither curl nor wget is installed, so nothing can be downloaded. Install one (for example: sudo apt install curl) and run this again."-fi-if command -v sha256sum >/dev/null 2>&1; then- sha() { sha256sum "$1" | cut -d' ' -f1; }-elif command -v shasum >/dev/null 2>&1; then- sha() { shasum -a 256 "$1" | cut -d' ' -f1; }-else- die "no sha256sum or shasum was found, so the download cannot be checked. Install coreutils and run this again."-fi-command -v tar >/dev/null 2>&1 || die "tar is not installed; install it and run this again."+# Everything below is one function, called on the last line: a download that stops half-way is a syntax error (nothing runs), not a half installer.+main() {+ # ---- tools+ if command -v curl >/dev/null 2>&1; then+ fetch() { curl -fsSL --retry 3 -o "$2" "$1"; }+ elif command -v wget >/dev/null 2>&1; then+ fetch() { wget -q -O "$2" "$1"; }+ else+ die "neither curl nor wget is installed, so nothing can be downloaded. Install one (for example: sudo apt install curl) and run this again."+ fi+ if command -v sha256sum >/dev/null 2>&1; then+ sha() { sha256sum "$1" | cut -d' ' -f1; }+ elif command -v shasum >/dev/null 2>&1; then+ sha() { shasum -a 256 "$1" | cut -d' ' -f1; }+ else+ die "no sha256sum or shasum was found, so the download cannot be checked. Install coreutils and run this again."+ fi+ command -v tar >/dev/null 2>&1 || die "tar is not installed; install it and run this again."++ # ---- 1. this computer+ os=$(uname -s); arch=$(uname -m)+ case "$os-$arch" in+ Linux-x86_64|Linux-amd64) platform=linux-x86_64 ;;+ Darwin-arm64|Darwin-aarch64) platform=macos-arm64 ;;+ Linux-aarch64|Linux-arm64) die "this computer ($os $arch) has an ARM processor. Strata needs an NVIDIA or AMD graphics card and has no engine for ARM Linux, so it could not run a model here. Use a Linux PC with an Intel or AMD processor (x86_64) and one of those cards." ;;+ Darwin-x86_64) die "this Mac has an Intel processor. Strata for Mac needs Apple silicon (M1 or newer), so it could not run a model here." ;;+ *) die "this computer ($os $arch) has no Strata Terminal. Supported: Linux x86_64 with an NVIDIA or AMD card, macOS on Apple silicon (Windows: use install.ps1)." ;;+ esac+ gpu=""+ if command -v nvidia-smi >/dev/null 2>&1; then+ gpu=$(nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null | head -1 || true)+ [ -n "$gpu" ] && gpu="NVIDIA $gpu"+ fi+ if [ -z "$gpu" ] && [ "$os" = Linux ] && command -v lspci >/dev/null 2>&1; then+ gpu=$(lspci 2>/dev/null | grep -iE 'vga|3d|display' | head -1 | sed 's/^[^:]*: *//' || true)+ fi+ if [ -z "$gpu" ] && [ "$os" = Darwin ]; then+ gpu=$(system_profiler SPDisplaysDataType 2>/dev/null | sed -n 's/^ *Chipset Model: //p' | head -1 || true)+ fi+ say "Strata Terminal installer"+ say " This computer: $os $arch ($platform)${gpu:+, graphics: $gpu}"+ say " Release folder: $FEED"-# ---- 1. this computer-os=$(uname -s); arch=$(uname -m)-case "$os-$arch" in- Linux-x86_64|Linux-amd64) platform=linux-x86_64 ;;- Darwin-arm64|Darwin-aarch64) platform=macos-arm64 ;;- Linux-aarch64|Linux-arm64) die "this computer ($os $arch) has an ARM processor. Strata needs an NVIDIA or AMD graphics card and has no engine for ARM Linux, so it could not run a model here. Use a Linux PC with an Intel or AMD processor (x86_64) and one of those cards." ;;- Darwin-x86_64) die "this Mac has an Intel processor. Strata for Mac needs Apple silicon (M1 or newer), so it could not run a model here." ;;- *) die "this computer ($os $arch) has no Strata Terminal. Supported: Linux x86_64 with an NVIDIA or AMD card, macOS on Apple silicon (Windows: use install.ps1)." ;;-esac-gpu=""-if command -v nvidia-smi >/dev/null 2>&1; then- gpu=$(nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null | head -1 || true)- [ -n "$gpu" ] && gpu="NVIDIA $gpu"-fi-if [ -z "$gpu" ] && [ "$os" = Linux ] && command -v lspci >/dev/null 2>&1; then- gpu=$(lspci 2>/dev/null | grep -iE 'vga|3d|display' | head -1 | sed 's/^[^:]*: *//' || true)-fi-if [ -z "$gpu" ] && [ "$os" = Darwin ]; then- gpu=$(system_profiler SPDisplaysDataType 2>/dev/null | sed -n 's/^ *Chipset Model: //p' | head -1 || true)-fi-say "Strata Terminal installer"-say " This computer: $os $arch ($platform)${gpu:+, graphics: $gpu}"-say " Release folder: $FEED"+ # ---- 2. download and check+ work=$(mktemp -d "${TMPDIR:-/tmp}/strata-install.XXXXXX") || die "cannot make a temporary folder"+ trap 'rm -rf "$work"' EXIT INT TERM+ fetch "$FEED/install-manifest.txt" "$work/manifest.txt" || die "could not read $FEED/install-manifest.txt. Check the address and your internet connection."+ line=$(awk -v p="$platform" '$1 == p { print; exit }' "$work/manifest.txt")+ [ -n "$line" ] || die "this release has no Terminal for $platform."+ set -- $line+ version=$2; rel=$3; want=$4+ say " Terminal $version ($(( ${5:-0} / 1048576 )) MB)"+ say "Downloading…"+ fetch "$FEED/$rel" "$work/terminal.tar.gz" || die "the download failed. Check your internet connection and run this again; nothing was installed."+ got=$(sha "$work/terminal.tar.gz")+ [ "$got" = "$want" ] || die "the download does not match the release's checksum (got $got, wanted $want). It was not installed; try again, and if it repeats the release folder is damaged."+ say " Checksum ok."-# ---- 2. download and check-work=$(mktemp -d "${TMPDIR:-/tmp}/strata-install.XXXXXX") || die "cannot make a temporary folder"-trap 'rm -rf "$work"' EXIT INT TERM-fetch "$FEED/install-manifest.txt" "$work/manifest.txt" || die "could not read $FEED/install-manifest.txt. Check the address and your internet connection."-line=$(awk -v p="$platform" '$1 == p { print; exit }' "$work/manifest.txt")-[ -n "$line" ] || die "this release has no Terminal for $platform."-set -- $line-version=$2; rel=$3; want=$4-say " Terminal $version ($(( ${5:-0} / 1048576 )) MB)"-say "Downloading…"-fetch "$FEED/$rel" "$work/terminal.tar.gz" || die "the download failed. Check your internet connection and run this again; nothing was installed."-got=$(sha "$work/terminal.tar.gz")-[ "$got" = "$want" ] || die "the download does not match the release's checksum (got $got, wanted $want). It was not installed; try again, and if it repeats the release folder is damaged."-say " Checksum ok."+ # ---- 3. unpack+ dest="$DATA_DIR/terminal/$version"+ mkdir -p "$DATA_DIR/terminal" "$BIN_DIR"+ rm -rf "$dest.incoming"; mkdir -p "$dest.incoming"+ tar -xzf "$work/terminal.tar.gz" -C "$dest.incoming" || die "the archive could not be unpacked (is the disk full?). Nothing was installed."+ if [ ! -f "$dest.incoming/bin/strata" ]; then # an archive with one top folder (a terminal archive instead of the feed's control package)+ inner=$(ls -d "$dest.incoming"/*/ 2>/dev/null | head -1)+ if [ -n "$inner" ] && [ -f "${inner}bin/strata" ]; then+ mv "${inner%/}" "$dest.inner" && rm -rf "$dest.incoming" && mv "$dest.inner" "$dest.incoming"+ fi+ fi+ [ -f "$dest.incoming/bin/strata" ] || { rm -rf "$dest.incoming"; die "the archive does not look like a Strata Terminal (no bin/strata). Nothing was installed."; }+ chmod +x "$dest.incoming/bin/strata" 2>/dev/null || true-# ---- 3. unpack-dest="$DATA_DIR/terminal/$version"-mkdir -p "$DATA_DIR/terminal" "$BIN_DIR"-rm -rf "$dest.incoming"; mkdir -p "$dest.incoming"-tar -xzf "$work/terminal.tar.gz" -C "$dest.incoming" || die "the archive could not be unpacked (is the disk full?). Nothing was installed."-if [ ! -f "$dest.incoming/bin/strata" ]; then # an archive with one top folder (a terminal archive instead of the feed's control package)- inner=$(ls -d "$dest.incoming"/*/ 2>/dev/null | head -1)- if [ -n "$inner" ] && [ -f "${inner}bin/strata" ]; then- mv "${inner%/}" "$dest.inner" && rm -rf "$dest.incoming" && mv "$dest.inner" "$dest.incoming"+ # ---- 4. the signed feed, checked with the Terminal just unpacked+ if [ "${STRATA_INSTALL_TEST_TRUST:-}" = 1 ]; then+ fetch "$FEED/test-trust.json" "$work/test-trust.json" || { rm -rf "$dest.incoming"; die "the test feed has no test-trust.json"; }+ STRATA_UPDATE_TRUSTED_KEYS="$work/test-trust.json"; export STRATA_UPDATE_TRUSTED_KEYS+ fi+ say "Checking the release's signature…"+ if ! "$dest.incoming/bin/strata" update --check --no-engine --feed "$FEED" >"$work/check.txt" 2>&1; then+ sed -e 's/^/ /' "$work/check.txt" >&2+ rm -rf "$dest.incoming"+ die "the release folder's signed feed could not be verified, so nothing was installed. The reason is printed above; if it names a newer feed already accepted here, use the newest release folder, or follow the step it gives. If you trust this source and see no such reason, ask its owner to publish a signed feed."fi-fi-[ -f "$dest.incoming/bin/strata" ] || { rm -rf "$dest.incoming"; die "the archive does not look like a Strata Terminal (no bin/strata). Nothing was installed."; }-chmod +x "$dest.incoming/bin/strata" 2>/dev/null || true+ say " Signature ok."-# ---- 4. the signed feed, checked with the Terminal just unpacked-if [ "${STRATA_INSTALL_TEST_TRUST:-}" = 1 ]; then- fetch "$FEED/test-trust.json" "$work/test-trust.json" || { rm -rf "$dest.incoming"; die "the test feed has no test-trust.json"; }- STRATA_UPDATE_TRUSTED_KEYS="$work/test-trust.json"; export STRATA_UPDATE_TRUSTED_KEYS-fi-say "Checking the release's signature…"-if ! "$dest.incoming/bin/strata" update --check --no-engine --feed "$FEED" >"$work/check.txt" 2>&1; then- sed -e 's/^/ /' "$work/check.txt" >&2- rm -rf "$dest.incoming"- die "the release folder's signed feed could not be verified, so nothing was installed. The reason is printed above; if it names a newer feed already accepted here, use the newest release folder, or follow the step it gives. If you trust this source and see no such reason, ask its owner to publish a signed feed."-fi-say " Signature ok."+ # ---- 5. in place+ rm -rf "$dest"+ mv "$dest.incoming" "$dest"+ ln -sfn "$dest" "$DATA_DIR/terminal/current"+ ln -sf "$DATA_DIR/terminal/current/bin/strata" "$BIN_DIR/strata"+ case ":$PATH:" in+ *":$BIN_DIR:"*) say "Installed. Run: strata launch" ;;+ *) say "Installed. Run: $BIN_DIR/strata launch"+ say " (To type just 'strata', add this line to your shell profile: export PATH=\"$BIN_DIR:\$PATH\")" ;;+ esac+}-# ---- 5. in place-rm -rf "$dest"-mv "$dest.incoming" "$dest"-ln -sfn "$dest" "$DATA_DIR/terminal/current"-ln -sf "$DATA_DIR/terminal/current/bin/strata" "$BIN_DIR/strata"-case ":$PATH:" in- *":$BIN_DIR:"*) say "Installed. Run: strata launch" ;;- *) say "Installed. Run: $BIN_DIR/strata launch"- say " (To type just 'strata', add this line to your shell profile: export PATH=\"$BIN_DIR:\$PATH\")" ;;-esac+main "$@"diff --git a/setup.py b/setup.pyindex f919cdb72..6397873b7 100644--- a/setup.py+++ b/setup.py@@ -7743,6 +7743,24 @@ def dsv41_engine_dir(eng: Path) -> Path:return (home() if CONTROL else Path(eng).parent) / DSV41_ENGINE_DIR+def github_reachable(timeout: float = 10.0) -> bool:+ """Does GitHub answer within `timeout` seconds (any HTTP answer counts; no answer, a refused or timed-out connection does not)? One quick check+ instead of minutes of retries when the connection is down (a SYN that is never answered)."""+ try:+ _urlopen(urllib.request.Request("https://github.com", method="HEAD", headers={"User-Agent": "strata-setup"}), timeout=timeout).close()+ return True+ except urllib.error.HTTPError:+ return True+ except (OSError, urllib.error.URLError):+ return False+++def dsv41_engine_pending(eng: Path) -> bool:+ """A DeepSeek engine package file the person put in engine-dsv41/ is there to be installed (no download needed)."""+ from strata_control import dsv41_engine+ return bool(dsv41_engine.pending(dsv41_engine_dir(eng)))++def dsv41_manual_steps(eng: Path) -> str:return (f"If you downloaded the DeepSeek engine package from the release page (the file strata-dsv41-...-{'windows' if WIN else 'linux'}-....{'zip' if WIN else 'tar.gz'}), "f"run the same command again with --dsv41-package PATH-OF-THE-FILE (strata launch accepts it too), or put the file in {dsv41_engine_dir(eng)} "@@ -8000,9 +8018,14 @@ def install_dsv41(a, family, gpu, hip, amd, cuda_tk, multi, port, ram, adopted,pip_install(runtime_packages(),"numpy, jinja2, regex, pyyaml, tqdm, requests, cmake, ninja, pillow, psutil, textual (the screens)")- step(4, "the Strata engine")- llama, eng, meta, lib_dirs, gpu, _vision = engine_step(a, gpu, hip, amd, cuda_tk, "none")+ # DeepSeek runs on its own engine package: the Strata (Qwen) engine, its llama.cpp source and its CUDA libraries are not needed for it, so none of+ # them is downloaded or test-started here (they were ~700 MB, and a stop on every one of them when GitHub could not be reached).+ step(4, "the DeepSeek engine")+ eng, meta, lib_dirs = ROOT / "engine", {"version": None}, []exe = dsv41_exe(eng)+ if exe is None and not getattr(a, "dsv41_package", None) and not dsv41_engine_pending(eng) and not github_reachable():+ fail("Strata can't reach GitHub to download the DeepSeek engine.",+ "Check the internet connection and run the same command again. " + dsv41_manual_steps(eng))if exe is None and not getattr(a, "build", False):get_dsv41_engine(eng, hip, getattr(a, "dsv41_package", None))exe = dsv41_exe(eng)diff --git a/strata_cli/launch/runner.py b/strata_cli/launch/runner.pyindex af47fa792..18aaa9c47 100644--- a/strata_cli/launch/runner.py+++ b/strata_cli/launch/runner.py@@ -543,6 +543,9 @@ class Runner:# ---- 1. the enginedef ensure_engine(self) -> None:+ if self.multi_file(): # DeepSeek: its own engine package (setup fetches it); the Strata engine is not used+ self.emit("engine", "DeepSeek runs on its own engine package, so the Strata engine is not downloaded for it.", 100)+ returnself.emit("engine", "Checking the engine for this computer…")from strata_control import engine_component as ecroot = Path(self.components_dir) if self.components_dir else None@@ -947,7 +950,7 @@ class Runner:env.pop("STRATA_NEED_ENGINE", None)if self.engine_problem:env["STRATA_ALLOW_NO_ENGINE"] = "1" # the person said go on: setup warns about the engine instead of stopping- else:+ elif not self.multi_file(): # (DeepSeek does not use the Strata engine: nothing to require)env["STRATA_NEED_ENGINE"] = "1"for k in ("PYTHONHOME", "PYTHONPATH", "VIRTUAL_ENV"):env.pop(k, None)diff --git a/tests/terminal/test_install_scripts_env.py b/tests/terminal/test_install_scripts_env.pyindex 30ea0b5a3..ec5fe6512 100644--- a/tests/terminal/test_install_scripts_env.py+++ b/tests/terminal/test_install_scripts_env.py@@ -12,6 +12,12 @@ SH = ROOT / "packaging" / "install.sh"class Text(unittest.TestCase):+ def test_the_readme_one_liner_cannot_succeed_on_a_failed_download(self):+ for name in ("README.md", "README.de.md", "docs/INSTALL.md", "docs/TERMINAL_LAUNCH.md"):+ text = (ROOT / name).read_text(encoding="utf-8")+ self.assertNotIn("install.sh | sh", text, name) # `curl ... | sh` runs nothing and exits 0 when curl fails+ self.assertIn("install.sh -o install.sh && sh install.sh", text, name)+def setUp(self):self.ps1 = PS1.read_text(encoding="utf-8")self.sh = SH.read_text(encoding="utf-8")@@ -51,3 +57,41 @@ class Run(unittest.TestCase):if __name__ == "__main__":unittest.main()++[email protected](shutil.which("sh") and os.uname().sysname in ("Linux", "Darwin") if hasattr(os, "uname") else False, "needs sh on Linux or macOS")+class InstallShFailsVisibly(unittest.TestCase):+ """A broken download of install.sh must not look like a finished install."""++ def run_sh(self, text, **env):+ import tempfile+ with tempfile.TemporaryDirectory() as d:+ f = Path(d) / "install.sh"+ f.write_text(text, encoding="utf-8", newline="\n")+ home = Path(d) / "home"+ home.mkdir()+ r = subprocess.run(["sh", str(f)], capture_output=True, text=True, timeout=120,+ env={**os.environ, "HOME": str(home), "STRATA_DATA_DIR": str(home / "data"), "STRATA_BIN_DIR": str(home / "bin"), **env})+ return r, home++ def test_the_script_is_one_function_called_on_the_last_line(self):+ text = SH.read_text(encoding="utf-8")+ self.assertIn("\nmain() {", text)+ self.assertEqual(text.rstrip().splitlines()[-1], 'main "$@"')++ def test_syntax(self):+ self.assertEqual(subprocess.run(["sh", "-n", str(SH)], capture_output=True).returncode, 0)++ def test_a_half_downloaded_script_runs_nothing_and_fails(self):+ lines = SH.read_text(encoding="utf-8").splitlines(True)+ r, home = self.run_sh("".join(lines[:int(len(lines) * 0.8)]))+ self.assertNotEqual(r.returncode, 0)+ self.assertFalse((home / "data").exists() or (home / "bin").exists())++ def test_an_unreachable_release_folder_stops_with_a_reason_and_a_failing_exit(self):+ if not shutil.which("curl") and not shutil.which("wget"):+ self.skipTest("no curl or wget")+ r, home = self.run_sh(SH.read_text(encoding="utf-8"), STRATA_FEED="http://127.0.0.1:9")+ self.assertEqual(r.returncode, 1)+ self.assertIn("could not read", r.stderr)+ self.assertFalse((home / "bin" / "strata").exists())diff --git a/tools/test_setup_dsv41.py b/tools/test_setup_dsv41.pyindex 358aacc77..cedf07952 100644--- a/tools/test_setup_dsv41.py+++ b/tools/test_setup_dsv41.py@@ -156,6 +156,7 @@ class Install(unittest.TestCase):self.addCleanup(self.tmp.cleanup)self.root = Path(self.tmp.name)self.calls = []+ self.github_up = Trueself.cfg = {}self.exe = self.root / "engine" / ("strata-dsv41.exe" if setup.WIN else "strata-dsv41")eng = self.root / "engine"@@ -172,6 +173,7 @@ class Install(unittest.TestCase):patches = [mock.patch.object(setup, "download", lambda url, dst, what=None: self.calls.append(("get", url, dst))),mock.patch.object(setup, "verify_sha256", lambda s, size, sha, own=False: self.calls.append(("sha", s.name, own))),mock.patch.object(setup, "free_gb", lambda p: 900.0),+ mock.patch.object(setup, "github_reachable", lambda timeout=10.0: self.github_up),mock.patch.object(setup, "pip_install", lambda *a, **k: None),mock.patch.object(setup, "engine_step", engine_step),mock.patch.object(setup, "run", lambda cmd, **k: self.calls.append(("run", cmd))),@@ -334,6 +336,48 @@ ISTA = "IST-DAS-2.00bpw"RTX5070 = {"index": 0, "name": "NVIDIA GeForce RTX 5070", "vram_gb": 12.0, "vendor": "nvidia"}+class NoNetwork(Install):+ """GitHub cannot be reached (a connection that is never answered): one plain line at once, not minutes of retries; and the Strata engine is not used."""++ def test_unreachable_github_is_one_plain_line_before_anything_is_downloaded(self):+ self.github_up = False+ rc, out = self.install(engine=False)+ self.assertEqual(rc, 1, out)+ self.assertIn("Strata can't reach GitHub to download the DeepSeek engine.", out)+ self.assertIn("Check the internet connection and run the same command again.", out)+ self.assertFalse([c for c in self.calls if c[0] == "get"])++ def test_a_package_the_person_has_needs_no_github(self):+ self.github_up = False+ self.install(engine=False) # (the first run only creates the folders)+ pk = self.root / "engine-dsv41"+ pk.mkdir(exist_ok=True)+ (pk / "strata-dsv41-0.1.49-x.tar.gz").write_bytes(b"x")+ with mock.patch.object(setup.dsv41_engine_module if hasattr(setup, "dsv41_engine_module") else __import__("strata_control.dsv41_engine", fromlist=["x"]),+ "install_package", lambda *a, **k: None):+ rc, out = self.install(engine=False)+ self.assertNotIn("can't reach GitHub", out)++ def test_the_strata_engine_is_not_part_of_a_deepseek_install(self):+ rc, out = self.install()+ self.assertEqual(rc, 0, out)+ self.assertFalse([c for c in self.calls if c[0] == "engine"]) # engine_step is not called any more+ self.assertIn("DeepSeek engine", out)+++class GithubCheck(unittest.TestCase):+ def test_github_reachable_answers_quickly_in_both_directions(self):+ import urllib.error+ with mock.patch.object(setup, "_urlopen", side_effect=urllib.error.URLError("timed out")):+ self.assertFalse(setup.github_reachable(1))+ with mock.patch.object(setup, "_urlopen", side_effect=OSError("unreachable")):+ self.assertFalse(setup.github_reachable(1))+ with mock.patch.object(setup, "_urlopen", side_effect=urllib.error.HTTPError("https://github.com", 403, "no", {}, None)):+ self.assertTrue(setup.github_reachable(1)) # any answer means it is reachable+ with mock.patch.object(setup, "_urlopen", return_value=mock.MagicMock()):+ self.assertTrue(setup.github_reachable(1))++class OfficialSets(unittest.TestCase):"""The two official IST-DAS sets (ISTA-DASLab/DeepSeek-V4.1-Flash-1017-GSQ-RCO-GGUF): the catalog, the pins, the pack recipe, the fit words."""