Documented tree replacement (the history has no git-subtree metadata): 3-way merge of the old subtree (570201a:engine/strata) against upstream 41cf05a06a25dd29103b7b27a2279a3f60c21876 (2026-10-25), merge base = the old pin d9ab8435 (tree-identical to upstream 5b734e42; d9ab8435 is not an ancestor of upstream main). Local patches re-applied by hand where they conflicted (15 files): STRATA_CUDA_STATIC profile, experimental KAR experts and KAR PLE arms, keyless V-only arm (now beside upstream's K8V4 hybrid KV and fused norm+rope). Details, conflict table and left-out files are in docs/upstream.md. Left out (weights, captures, logs, media): new bench/results (2022 files), binary media and app assets (61), docs/work/evidence (24), *.bin / *.gguf data files, and the 7 files the first import already left out. scripts/build-cpu.sh: build the 11 CPU tests upstream registered since the old pin (they ran as "Not Run"). Checked: build-cpu.sh 16/16 ctest in WSL; sm_86 CUDA objects of the patched files compile, also with the KAR macros on. No GPU run, no quality gate. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
66 lines
3.0 KiB
Python
66 lines
3.0 KiB
Python
"""The Terminal tells people the app's version (0.2.3), and its README no longer contradicts itself."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
import subprocess
|
|
import sys
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
import strata_cli
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
sys.path.insert(0, str(ROOT / "packaging"))
|
|
import package_terminal # noqa: E402
|
|
|
|
|
|
class ProductVersion(unittest.TestCase):
|
|
def test_it_is_the_apps_own_version_or_a_terminal_only_release_after_it(self):
|
|
cargo = ROOT / "apps" / "desktop" / "src-tauri" / "Cargo.toml"
|
|
if not cargo.is_file():
|
|
self.skipTest("no app source in this tree")
|
|
m = re.search(r'^version\s*=\s*"([^"]+)"', cargo.read_text(encoding="utf-8"), re.MULTILINE)
|
|
# 0.2.3.1 is a Control-only hotfix: the Terminal says 0.2.3.1 while the app (and its updater entry) stay 0.2.3
|
|
# 0.2.4 is a Terminal release: the app stays 0.2.3 (the Terminal is never older than the app)
|
|
as_tuple = lambda v: tuple(int(p) for p in v.split("."))
|
|
self.assertGreaterEqual(as_tuple(strata_cli.PRODUCT_VERSION), as_tuple(m.group(1)))
|
|
self.assertEqual(as_tuple(strata_cli.PRODUCT_VERSION)[:2], as_tuple(m.group(1))[:2])
|
|
|
|
def test_dash_dash_version_leads_with_it_and_keeps_the_build_number(self):
|
|
out = subprocess.run([sys.executable, str(ROOT / "strata.py"), "--version"], capture_output=True, text=True, check=True).stdout
|
|
self.assertTrue(out.startswith(f"strata {strata_cli.PRODUCT_VERSION} (build {strata_cli.version()};"), out)
|
|
self.assertIn(sys.executable, out) # the packaging smoke test reads the interpreter back from this line
|
|
|
|
def test_the_build_number_stays_numeric_for_the_engine_compatibility_checks(self):
|
|
self.assertRegex(strata_cli.version(), r"^[0-9]+(\.[0-9]+)+$")
|
|
|
|
|
|
class Readme(unittest.TestCase):
|
|
def readme(self, target: str) -> str:
|
|
return package_terminal._readme("0.2.3", target)
|
|
|
|
def test_it_does_not_say_nothing_downloads_and_then_that_launch_fetches(self):
|
|
text = " ".join(self.readme("windows-x86_64").split())
|
|
self.assertNotIn("Starting and serving never install or download anything", text)
|
|
self.assertIn("Serving and watching", text)
|
|
self.assertIn("Only two commands fetch files", text)
|
|
self.assertIn("`strata launch`", text)
|
|
|
|
def test_the_launch_doc_it_points_at_is_in_the_archive(self):
|
|
self.assertIn("docs/TERMINAL_LAUNCH.md", self.readme("linux-x86_64"))
|
|
self.assertIn("docs/TERMINAL_LAUNCH.md", package_terminal.PAYLOAD)
|
|
self.assertTrue((ROOT / "docs" / "TERMINAL_LAUNCH.md").is_file())
|
|
|
|
def test_free_memory_guidance_fits_the_system(self):
|
|
win, lin, mac = (self.readme(t) for t in ("windows-x86_64", "linux-x86_64", "darwin-arm64"))
|
|
self.assertNotIn("free -g", win)
|
|
self.assertIn("FreePhysicalMemory", win)
|
|
self.assertIn("Task Manager", win)
|
|
self.assertIn("free -g", lin)
|
|
self.assertNotIn("free -g", mac)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|