fix(pm): own interpreter selection and dependency recovery
Pin uv and uvx to the PM interpreter instead of ambient Python discovery.
A matching dependency stamp cannot prove that installed files still exist.
Repair now rebuilds the recorded workspace and lock in a fresh generation,
checks startup imports, and publishes the selection only after success.
Run startup recovery before dependency activation. Keep manual PM repair
reachable when the selected environment is damaged. Preserve plugin
selection, retry ownership, and the previous generation on failure.
Remove the separate pip, ensurepip, per-extra, and install-time quarantine
ladders. Keep orphan launcher restoration.
Verification: 717 targeted tests passed on native Windows ARM64, with
56 skipped. Ruff, diff checks, and the source-scoped compat check passed.
A disposable real Hermes install recovered deleted YAML and dotenv files,
then printed CLI help with exit 0. Its lock and stamp stayed unchanged.
The full suite and a release build were not run for this change.
2026-09-08 23:39:55 -04:00
|
|
|
"""PM-owned uv commands use the installed interpreter, never host discovery."""
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
import importlib
|
|
|
|
|
import os
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
import shutil
|
|
|
|
|
import subprocess
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
2026-09-11 18:00:04 -04:00
|
|
|
from pm._uv import _toolchain
|
fix(pm): own interpreter selection and dependency recovery
Pin uv and uvx to the PM interpreter instead of ambient Python discovery.
A matching dependency stamp cannot prove that installed files still exist.
Repair now rebuilds the recorded workspace and lock in a fresh generation,
checks startup imports, and publishes the selection only after success.
Run startup recovery before dependency activation. Keep manual PM repair
reachable when the selected environment is damaged. Preserve plugin
selection, retry ownership, and the previous generation on failure.
Remove the separate pip, ensurepip, per-extra, and install-time quarantine
ladders. Keep orphan launcher restoration.
Verification: 717 targeted tests passed on native Windows ARM64, with
56 skipped. Ruff, diff checks, and the source-scoped compat check passed.
A disposable real Hermes install recovered deleted YAML and dotenv files,
then printed CLI help with exit 0. Its lock and stamp stayed unchanged.
The full suite and a release build were not run for this change.
2026-09-08 23:39:55 -04:00
|
|
|
from pm.lock import Facts, Lockfile
|
|
|
|
|
from pm.package import InstallError
|
|
|
|
|
from pm.packages import Python, Uv
|
|
|
|
|
from pm.store import current_target
|
|
|
|
|
|
refactor(build): share product recipes across distributions
Build TUI, web, desktop UI and runnable agent products from explicit
prepared inputs. Keep dependency preparation separate from distribution
packaging, with PM and native builds sharing uv environment construction.
Docker copies compiled frontend products instead of build dependencies.
Nix retains uv2nix environments and consumes shared assembly through store
references. Native desktop and Termux use the same launcher and frontend
contracts. Preserve the independent PM runtime and source imports from
arbitrary working directories.
Keep failed frontend builds from replacing the previous product, reject
source/output overlap, and bound dependency-process output draining.
Include hermes_wisdom in the Nix wheel: real CLI smoke tests exposed its
missing package declaration on the base revision too.
Verified focused Python and JavaScript suites, Docker build/runtime checks,
Nix desktop and CLI/ACP checks, standalone TUI and packaged Electron PTY,
and real full-Chromium interaction. Native signed installers, Android device
installation and the full repository suite remain CI verification.
2026-09-11 13:16:55 -04:00
|
|
|
|
|
|
|
|
|
fix(pm): own interpreter selection and dependency recovery
Pin uv and uvx to the PM interpreter instead of ambient Python discovery.
A matching dependency stamp cannot prove that installed files still exist.
Repair now rebuilds the recorded workspace and lock in a fresh generation,
checks startup imports, and publishes the selection only after success.
Run startup recovery before dependency activation. Keep manual PM repair
reachable when the selected environment is damaged. Preserve plugin
selection, retry ownership, and the previous generation on failure.
Remove the separate pip, ensurepip, per-extra, and install-time quarantine
ladders. Keep orphan launcher restoration.
Verification: 717 targeted tests passed on native Windows ARM64, with
56 skipped. Ruff, diff checks, and the source-scoped compat check passed.
A disposable real Hermes install recovered deleted YAML and dotenv files,
then printed CLI help with exit 0. Its lock and stamp stayed unchanged.
The full suite and a release build were not run for this change.
2026-09-08 23:39:55 -04:00
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
|
def installed_uv(tmp_path, monkeypatch):
|
2026-10-08 17:22:54 +02:00
|
|
|
from pm import paths
|
|
|
|
|
from pm import registry
|
fix(pm): own interpreter selection and dependency recovery
Pin uv and uvx to the PM interpreter instead of ambient Python discovery.
A matching dependency stamp cannot prove that installed files still exist.
Repair now rebuilds the recorded workspace and lock in a fresh generation,
checks startup imports, and publishes the selection only after success.
Run startup recovery before dependency activation. Keep manual PM repair
reachable when the selected environment is damaged. Preserve plugin
selection, retry ownership, and the previous generation on failure.
Remove the separate pip, ensurepip, per-extra, and install-time quarantine
ladders. Keep orphan launcher restoration.
Verification: 717 targeted tests passed on native Windows ARM64, with
56 skipped. Ruff, diff checks, and the source-scoped compat check passed.
A disposable real Hermes install recovered deleted YAML and dotenv files,
then printed CLI help with exit 0. Its lock and stamp stayed unchanged.
The full suite and a release build were not run for this change.
2026-09-08 23:39:55 -04:00
|
|
|
|
|
|
|
|
uv = shutil.which("uv")
|
|
|
|
|
assert uv, "the interpreter selection contract requires real uv"
|
|
|
|
|
store = tmp_path / "store"
|
|
|
|
|
lock = Lockfile(tmp_path / "lock.json")
|
|
|
|
|
target = current_target()
|
|
|
|
|
digest = "1" * 64
|
|
|
|
|
entry = store / "uv"
|
|
|
|
|
entry.mkdir(parents=True)
|
|
|
|
|
binary = entry / ("uv.exe" if os.name == "nt" else "uv")
|
|
|
|
|
shutil.copy2(uv, binary)
|
|
|
|
|
lock.set_pin("uv", "test", {target: {"url": "https://test.invalid/uv", "sha256": digest}})
|
|
|
|
|
lock.set_pin("python", "test", {target: {"url": "https://test.invalid/python", "sha256": digest}})
|
|
|
|
|
lock.save()
|
|
|
|
|
facts = Facts(store / "facts.json")
|
|
|
|
|
facts.record("uv", "test", entry.name, {}, store, target=target, artifacts=[digest])
|
|
|
|
|
monkeypatch.setattr(paths, "lockfile_path", lambda: lock.path)
|
|
|
|
|
monkeypatch.setattr(paths, "store_root", lambda: store)
|
|
|
|
|
monkeypatch.setattr(paths, "writable_store_root", lambda: store)
|
|
|
|
|
monkeypatch.setitem(registry._packages, "uv", Uv())
|
|
|
|
|
return tmp_path, binary, facts, target, digest
|
|
|
|
|
|
|
|
|
|
|
2026-09-11 18:00:04 -04:00
|
|
|
def test_internal_tooling_cannot_escape_package_queries(installed_uv):
|
|
|
|
|
from pm import env_for, installed_package
|
|
|
|
|
|
|
|
|
|
_, binary, facts, target, digest = installed_uv
|
|
|
|
|
assert "PATH" not in Uv().env(binary.parent, target)
|
|
|
|
|
# Legacy facts can contain PATH even after the package stops exporting it.
|
|
|
|
|
facts.record("uv", "test", binary.parent.name, {"PATH": [str(binary.parent)]},
|
|
|
|
|
binary.parent.parent, target=target, artifacts=[digest])
|
|
|
|
|
assert str(binary.parent) not in env_for("uv", "venv", base_env={"PATH": "external"})["PATH"]
|
|
|
|
|
with pytest.raises(ValueError, match="internal"):
|
|
|
|
|
installed_package("uv")
|
|
|
|
|
|
|
|
|
|
|
fix(pm): own interpreter selection and dependency recovery
Pin uv and uvx to the PM interpreter instead of ambient Python discovery.
A matching dependency stamp cannot prove that installed files still exist.
Repair now rebuilds the recorded workspace and lock in a fresh generation,
checks startup imports, and publishes the selection only after success.
Run startup recovery before dependency activation. Keep manual PM repair
reachable when the selected environment is damaged. Preserve plugin
selection, retry ownership, and the previous generation on failure.
Remove the separate pip, ensurepip, per-extra, and install-time quarantine
ladders. Keep orphan launcher restoration.
Verification: 717 targeted tests passed on native Windows ARM64, with
56 skipped. Ruff, diff checks, and the source-scoped compat check passed.
A disposable real Hermes install recovered deleted YAML and dotenv files,
then printed CLI help with exit 0. Its lock and stamp stayed unchanged.
The full suite and a release build were not run for this change.
2026-09-08 23:39:55 -04:00
|
|
|
def test_all_uv_commands_keep_the_pm_interpreter(installed_uv, monkeypatch):
|
2026-10-08 17:22:54 +02:00
|
|
|
from pm import registry
|
fix(pm): own interpreter selection and dependency recovery
Pin uv and uvx to the PM interpreter instead of ambient Python discovery.
A matching dependency stamp cannot prove that installed files still exist.
Repair now rebuilds the recorded workspace and lock in a fresh generation,
checks startup imports, and publishes the selection only after success.
Run startup recovery before dependency activation. Keep manual PM repair
reachable when the selected environment is damaged. Preserve plugin
selection, retry ownership, and the previous generation on failure.
Remove the separate pip, ensurepip, per-extra, and install-time quarantine
ladders. Keep orphan launcher restoration.
Verification: 717 targeted tests passed on native Windows ARM64, with
56 skipped. Ruff, diff checks, and the source-scoped compat check passed.
A disposable real Hermes install recovered deleted YAML and dotenv files,
then printed CLI help with exit 0. Its lock and stamp stayed unchanged.
The full suite and a release build were not run for this change.
2026-09-08 23:39:55 -04:00
|
|
|
|
|
|
|
|
root, uv, facts, target, digest = installed_uv
|
|
|
|
|
selected = root / "store" / "selected-python"
|
|
|
|
|
clean = {key: value for key, value in os.environ.items() if not key.startswith("UV_")}
|
|
|
|
|
clean.update({"UV_NO_CONFIG": "1", "UV_OFFLINE": "1", "UV_PYTHON_DOWNLOADS": "never"})
|
|
|
|
|
subprocess.run([str(uv), "venv", "--python", sys.executable, str(selected)],
|
|
|
|
|
cwd=root, env=clean, check=True, capture_output=True, timeout=60)
|
|
|
|
|
python = selected / ("Scripts/python.exe" if os.name == "nt" else "bin/python")
|
|
|
|
|
|
|
|
|
|
class FixturePython(Python):
|
|
|
|
|
binary_rel = {"win32": "Scripts/python.exe", "posix": "bin/python"}
|
|
|
|
|
|
|
|
|
|
monkeypatch.setitem(registry._packages, "python", FixturePython())
|
|
|
|
|
facts.record("python", "test", selected.name, {}, selected.parent,
|
|
|
|
|
target=target, artifacts=[digest])
|
|
|
|
|
monkeypatch.setenv("UV_PYTHON", str(root / "ambient-python"))
|
|
|
|
|
monkeypatch.setenv("UV_PROJECT_ENVIRONMENT", str(root / "ambient-venv"))
|
|
|
|
|
before = dict(os.environ)
|
2026-09-11 18:00:04 -04:00
|
|
|
from pm._uv import _toolchain
|
|
|
|
|
from pm.environment import managed_environment
|
fix(pm): own interpreter selection and dependency recovery
Pin uv and uvx to the PM interpreter instead of ambient Python discovery.
A matching dependency stamp cannot prove that installed files still exist.
Repair now rebuilds the recorded workspace and lock in a fresh generation,
checks startup imports, and publishes the selection only after success.
Run startup recovery before dependency activation. Keep manual PM repair
reachable when the selected environment is damaged. Preserve plugin
selection, retry ownership, and the previous generation on failure.
Remove the separate pip, ensurepip, per-extra, and install-time quarantine
ladders. Keep orphan launcher restoration.
Verification: 717 targeted tests passed on native Windows ARM64, with
56 skipped. Ruff, diff checks, and the source-scoped compat check passed.
A disposable real Hermes install recovered deleted YAML and dotenv files,
then printed CLI help with exit 0. Its lock and stamp stayed unchanged.
The full suite and a release build were not run for this change.
2026-09-08 23:39:55 -04:00
|
|
|
|
2026-09-11 18:00:04 -04:00
|
|
|
assert _toolchain(realize=False) == (uv, python)
|
|
|
|
|
assert dict(os.environ) == before
|
fix(pm): own interpreter selection and dependency recovery
Pin uv and uvx to the PM interpreter instead of ambient Python discovery.
A matching dependency stamp cannot prove that installed files still exist.
Repair now rebuilds the recorded workspace and lock in a fresh generation,
checks startup imports, and publishes the selection only after success.
Run startup recovery before dependency activation. Keep manual PM repair
reachable when the selected environment is damaged. Preserve plugin
selection, retry ownership, and the previous generation on failure.
Remove the separate pip, ensurepip, per-extra, and install-time quarantine
ladders. Keep orphan launcher restoration.
Verification: 717 targeted tests passed on native Windows ARM64, with
56 skipped. Ruff, diff checks, and the source-scoped compat check passed.
A disposable real Hermes install recovered deleted YAML and dotenv files,
then printed CLI help with exit 0. Its lock and stamp stayed unchanged.
The full suite and a release build were not run for this change.
2026-09-08 23:39:55 -04:00
|
|
|
project = root / "project"
|
|
|
|
|
project.mkdir()
|
|
|
|
|
(project / "pyproject.toml").write_text(
|
|
|
|
|
'[project]\nname="pm-python-proof"\nversion="1"\nrequires-python=">=3.11"\n'
|
|
|
|
|
'[tool.uv]\npackage=false\n', encoding="utf-8",
|
|
|
|
|
)
|
|
|
|
|
(project / ".python-version").write_text(str(root / "host-only-python"), encoding="utf-8")
|
2026-09-11 18:00:04 -04:00
|
|
|
environment = managed_environment(root / "candidate", offline=True)
|
|
|
|
|
assert environment.python == python
|
|
|
|
|
environment.create()
|
|
|
|
|
environment.lock(project)
|
|
|
|
|
environment.sync(project)
|
|
|
|
|
environment.check()
|
|
|
|
|
result = subprocess.run([str(environment.executable), "-I", "-c", "import sys; print(sys.prefix)"],
|
|
|
|
|
capture_output=True, text=True, check=True, timeout=30)
|
|
|
|
|
assert Path(result.stdout.strip()).resolve() == environment.destination.resolve()
|
|
|
|
|
assert dict(os.environ) == before
|
fix(pm): own interpreter selection and dependency recovery
Pin uv and uvx to the PM interpreter instead of ambient Python discovery.
A matching dependency stamp cannot prove that installed files still exist.
Repair now rebuilds the recorded workspace and lock in a fresh generation,
checks startup imports, and publishes the selection only after success.
Run startup recovery before dependency activation. Keep manual PM repair
reachable when the selected environment is damaged. Preserve plugin
selection, retry ownership, and the previous generation on failure.
Remove the separate pip, ensurepip, per-extra, and install-time quarantine
ladders. Keep orphan launcher restoration.
Verification: 717 targeted tests passed on native Windows ARM64, with
56 skipped. Ruff, diff checks, and the source-scoped compat check passed.
A disposable real Hermes install recovered deleted YAML and dotenv files,
then printed CLI help with exit 0. Its lock and stamp stayed unchanged.
The full suite and a release build were not run for this change.
2026-09-08 23:39:55 -04:00
|
|
|
|
|
|
|
|
|
2026-09-24 10:28:25 -04:00
|
|
|
def test_project_environment_replaces_generation_when_pinned_python_moves(installed_uv, tmp_path, monkeypatch):
|
|
|
|
|
"""An unchanged dependency pin cannot reuse a venv made by another tools store."""
|
|
|
|
|
from pm import operations
|
2026-10-08 17:22:54 +02:00
|
|
|
from pm import registry
|
2026-09-24 10:28:25 -04:00
|
|
|
from tests.pm._fixtures import _run, _wheel, stage_host_python
|
|
|
|
|
|
|
|
|
|
root, uv, facts, target, digest = installed_uv
|
|
|
|
|
store = root / "store"
|
|
|
|
|
from pm.store import tree_digest
|
|
|
|
|
facts.record("uv", "test", uv.parent.name, {}, store, target=target,
|
|
|
|
|
artifacts=[digest], digest=tree_digest(uv.parent))
|
|
|
|
|
|
|
|
|
|
class FixturePython(Python):
|
|
|
|
|
binary_rel = {"win32": "Scripts/python.exe", "posix": "bin/python"}
|
|
|
|
|
|
|
|
|
|
monkeypatch.setitem(registry._packages, "python", FixturePython())
|
|
|
|
|
interpreters = [stage_host_python(store / name / "bin" / "python")
|
|
|
|
|
for name in ("python-a", "python-b")]
|
|
|
|
|
project = tmp_path / "project"
|
|
|
|
|
project.mkdir()
|
|
|
|
|
wheel = _wheel(tmp_path, "side_dep")
|
|
|
|
|
(project / "pyproject.toml").write_text(
|
|
|
|
|
'[project]\nname="pm-generation-proof"\nversion="1"\nrequires-python=">=3.11"\n'
|
|
|
|
|
'dependencies=["side-dep==1.0"]\n[tool.uv]\npackage=false\nno-index=true\n'
|
|
|
|
|
f'find-links=["{wheel.parent.as_posix()}"]\n', encoding="utf-8",
|
|
|
|
|
)
|
|
|
|
|
env = {key: value for key, value in os.environ.items()
|
|
|
|
|
if not key.startswith(("UV_", "PYTHON")) and key != "VIRTUAL_ENV"}
|
|
|
|
|
env.update(UV_CACHE_DIR=str(tmp_path / "cache"), UV_PYTHON_DOWNLOADS="never")
|
|
|
|
|
_run([str(uv), "lock", "--python", str(interpreters[0])], cwd=project, env=env)
|
|
|
|
|
locked = (project / "uv.lock").read_bytes()
|
|
|
|
|
selection_root = tmp_path / "selection"
|
|
|
|
|
chosen = []
|
|
|
|
|
for interpreter in (*interpreters, interpreters[0]):
|
|
|
|
|
facts.record("python", "test", interpreter.parent.parent.name, {}, store,
|
|
|
|
|
target=target, artifacts=[digest], digest=tree_digest(interpreter.parent.parent))
|
|
|
|
|
selected = operations.ensure_project_environment(
|
|
|
|
|
"test-environment", project, root=selection_root, explicit=True)
|
|
|
|
|
chosen.append(selected)
|
|
|
|
|
assert Path(_run([str(selected), "-I", "-c",
|
|
|
|
|
"import sys, side_dep; print(sys.base_prefix)"], cwd=project, env=env)) == interpreter.parent.parent
|
|
|
|
|
assert (project / "uv.lock").read_bytes() == locked
|
|
|
|
|
assert chosen[0] != chosen[1] != chosen[2]
|
|
|
|
|
|
|
|
|
|
# A failed replacement must leave the previously selected environment intact.
|
|
|
|
|
facts.record("python", "test", interpreters[1].parent.parent.name, {}, store,
|
|
|
|
|
target=target, artifacts=[digest], digest=tree_digest(interpreters[1].parent.parent))
|
|
|
|
|
active = (selection_root / "active.json").read_bytes()
|
|
|
|
|
monkeypatch.setattr(operations, "build_environment", lambda **kwargs: (_ for _ in ()).throw(RuntimeError("build failed")))
|
|
|
|
|
with pytest.raises(RuntimeError, match="build failed"):
|
|
|
|
|
operations.ensure_project_environment("test-environment", project, root=selection_root, explicit=True)
|
|
|
|
|
assert (selection_root / "active.json").read_bytes() == active
|
|
|
|
|
assert operations.environment_python("test-environment", root=selection_root) == chosen[-1]
|
|
|
|
|
|
|
|
|
|
|
fix(pm): own interpreter selection and dependency recovery
Pin uv and uvx to the PM interpreter instead of ambient Python discovery.
A matching dependency stamp cannot prove that installed files still exist.
Repair now rebuilds the recorded workspace and lock in a fresh generation,
checks startup imports, and publishes the selection only after success.
Run startup recovery before dependency activation. Keep manual PM repair
reachable when the selected environment is damaged. Preserve plugin
selection, retry ownership, and the previous generation on failure.
Remove the separate pip, ensurepip, per-extra, and install-time quarantine
ladders. Keep orphan launcher restoration.
Verification: 717 targeted tests passed on native Windows ARM64, with
56 skipped. Ruff, diff checks, and the source-scoped compat check passed.
A disposable real Hermes install recovered deleted YAML and dotenv files,
then printed CLI help with exit 0. Its lock and stamp stayed unchanged.
The full suite and a release build were not run for this change.
2026-09-08 23:39:55 -04:00
|
|
|
def test_uv_refuses_discovery_when_pm_python_is_missing(installed_uv, monkeypatch):
|
|
|
|
|
root, _, facts, target, digest = installed_uv
|
2026-09-18 23:27:05 -04:00
|
|
|
ensure = importlib.import_module("pm.install")
|
fix(pm): own interpreter selection and dependency recovery
Pin uv and uvx to the PM interpreter instead of ambient Python discovery.
A matching dependency stamp cannot prove that installed files still exist.
Repair now rebuilds the recorded workspace and lock in a fresh generation,
checks startup imports, and publishes the selection only after success.
Run startup recovery before dependency activation. Keep manual PM repair
reachable when the selected environment is damaged. Preserve plugin
selection, retry ownership, and the previous generation on failure.
Remove the separate pip, ensurepip, per-extra, and install-time quarantine
ladders. Keep orphan launcher restoration.
Verification: 717 targeted tests passed on native Windows ARM64, with
56 skipped. Ruff, diff checks, and the source-scoped compat check passed.
A disposable real Hermes install recovered deleted YAML and dotenv files,
then printed CLI help with exit 0. Its lock and stamp stayed unchanged.
The full suite and a release build were not run for this change.
2026-09-08 23:39:55 -04:00
|
|
|
monkeypatch.setattr(ensure, "lazy_installs_allowed", lambda: False)
|
|
|
|
|
monkeypatch.setenv("UV_PYTHON", str(root / "ambient-python"))
|
2026-09-11 18:00:04 -04:00
|
|
|
assert _toolchain(realize=False) is None
|
fix(pm): own interpreter selection and dependency recovery
Pin uv and uvx to the PM interpreter instead of ambient Python discovery.
A matching dependency stamp cannot prove that installed files still exist.
Repair now rebuilds the recorded workspace and lock in a fresh generation,
checks startup imports, and publishes the selection only after success.
Run startup recovery before dependency activation. Keep manual PM repair
reachable when the selected environment is damaged. Preserve plugin
selection, retry ownership, and the previous generation on failure.
Remove the separate pip, ensurepip, per-extra, and install-time quarantine
ladders. Keep orphan launcher restoration.
Verification: 717 targeted tests passed on native Windows ARM64, with
56 skipped. Ruff, diff checks, and the source-scoped compat check passed.
A disposable real Hermes install recovered deleted YAML and dotenv files,
then printed CLI help with exit 0. Its lock and stamp stayed unchanged.
The full suite and a release build were not run for this change.
2026-09-08 23:39:55 -04:00
|
|
|
assert not (root / "store" / "python-test").exists()
|
|
|
|
|
with pytest.raises(InstallError, match="python"):
|
2026-09-11 18:00:04 -04:00
|
|
|
_toolchain()
|
fix(pm): own interpreter selection and dependency recovery
Pin uv and uvx to the PM interpreter instead of ambient Python discovery.
A matching dependency stamp cannot prove that installed files still exist.
Repair now rebuilds the recorded workspace and lock in a fresh generation,
checks startup imports, and publishes the selection only after success.
Run startup recovery before dependency activation. Keep manual PM repair
reachable when the selected environment is damaged. Preserve plugin
selection, retry ownership, and the previous generation on failure.
Remove the separate pip, ensurepip, per-extra, and install-time quarantine
ladders. Keep orphan launcher restoration.
Verification: 717 targeted tests passed on native Windows ARM64, with
56 skipped. Ruff, diff checks, and the source-scoped compat check passed.
A disposable real Hermes install recovered deleted YAML and dotenv files,
then printed CLI help with exit 0. Its lock and stamp stayed unchanged.
The full suite and a release build were not run for this change.
2026-09-08 23:39:55 -04:00
|
|
|
|
|
|
|
|
entry = root / "store" / "missing-binary"
|
|
|
|
|
entry.mkdir()
|
|
|
|
|
facts.record("python", "test", entry.name, {}, entry.parent,
|
|
|
|
|
target=target, artifacts=[digest])
|
2026-09-10 03:50:40 -04:00
|
|
|
recorded = facts.path.read_bytes()
|
2026-09-11 18:00:04 -04:00
|
|
|
assert _toolchain(realize=False) is None
|
2026-09-10 03:50:40 -04:00
|
|
|
with pytest.raises(InstallError, match="lazy installs are disabled: python"):
|
2026-09-11 18:00:04 -04:00
|
|
|
_toolchain()
|
2026-09-10 03:50:40 -04:00
|
|
|
assert facts.path.read_bytes() == recorded
|
|
|
|
|
assert not list(entry.iterdir())
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
|
|
|
|
|
|
2026-10-08 15:08:46 -07:00
|
|
|
@pytest.mark.platforms("windows")
|
|
|
|
|
def test_bundled_uv_uses_a_verified_writable_python_without_changing_runtime(installed_uv, monkeypatch):
|
2026-10-08 17:22:54 +02:00
|
|
|
from pm import paths
|
|
|
|
|
from pm import registry
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
from pm.store import Store, tree_digest
|
|
|
|
|
|
|
|
|
|
root, uv_binary, facts, target, digest = installed_uv
|
2026-10-08 15:08:46 -07:00
|
|
|
ensure = importlib.import_module("pm.install")
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
shipped = uv_binary.parent.parent
|
|
|
|
|
writable = root / "writable-tools"
|
|
|
|
|
monkeypatch.setattr(paths, "writable_store_root", lambda: writable)
|
|
|
|
|
(shipped.parent / "manifest.json").write_text("{}", encoding="utf-8")
|
|
|
|
|
|
2026-10-08 15:08:46 -07:00
|
|
|
class FixturePython(Python):
|
|
|
|
|
def verify(self, entry, target):
|
|
|
|
|
return "" if self.binary(entry, target).read_bytes() == b"pinned interpreter" else "damaged Python"
|
|
|
|
|
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
class FixtureUv(Uv):
|
|
|
|
|
emulated_arch_targets = {target}
|
|
|
|
|
|
|
|
|
|
monkeypatch.setitem(registry._packages, "uv", FixtureUv())
|
|
|
|
|
facts.record("uv", "test", uv_binary.parent.name, {}, shipped,
|
|
|
|
|
target=target, artifacts=[digest], digest=tree_digest(uv_binary.parent))
|
2026-10-08 15:08:46 -07:00
|
|
|
python = FixturePython()
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
monkeypatch.setitem(registry._packages, "python", python)
|
|
|
|
|
entry = shipped / python.store_entry("test", target)
|
2026-10-08 15:08:46 -07:00
|
|
|
entry.mkdir()
|
|
|
|
|
binary = entry / "python.exe"
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
binary.write_bytes(b"pinned interpreter")
|
2026-10-08 15:08:46 -07:00
|
|
|
(entry / "python.dll").write_bytes(b"pinned runtime")
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
facts.record("python", "test", entry.name, python.env(entry, target), shipped,
|
|
|
|
|
target=target, artifacts=[digest], digest=tree_digest(entry))
|
|
|
|
|
before = facts.path.read_bytes()
|
2026-10-08 15:08:46 -07:00
|
|
|
shipped_digest = tree_digest(entry)
|
|
|
|
|
monkeypatch.setattr(ensure, "lazy_installs_allowed", lambda: False)
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
|
2026-10-08 15:08:46 -07:00
|
|
|
def no_download(*args, **kwargs):
|
|
|
|
|
raise AssertionError("the verified Python must be copied without downloading")
|
|
|
|
|
|
|
|
|
|
monkeypatch.setattr(Store, "fetch_many", no_download)
|
|
|
|
|
assert _toolchain(realize=False) is None
|
|
|
|
|
assert not writable.exists()
|
|
|
|
|
with pytest.raises(InstallError, match="lazy installs are disabled"):
|
|
|
|
|
_toolchain()
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
assert not writable.exists()
|
2026-10-08 15:08:46 -07:00
|
|
|
|
|
|
|
|
resolved_uv, python = _toolchain(explicit=True)
|
|
|
|
|
copied = writable / entry.name
|
|
|
|
|
assert resolved_uv == uv_binary
|
|
|
|
|
assert python == copied / "python.exe"
|
|
|
|
|
assert tree_digest(copied) == shipped_digest
|
|
|
|
|
copied_fact = Facts(writable / "facts.json").get("python")
|
|
|
|
|
assert copied_fact["digest"] == shipped_digest
|
|
|
|
|
assert copied_fact["artifacts"] == [digest]
|
|
|
|
|
assert copied_fact["target"] == target
|
|
|
|
|
assert ensure.installed_package("python").binary == binary
|
|
|
|
|
assert str(copied) not in ensure.env_for("python")["PATH"]
|
|
|
|
|
|
|
|
|
|
def no_copy(*args, **kwargs):
|
|
|
|
|
raise AssertionError("a matching copy must be reused")
|
|
|
|
|
|
|
|
|
|
with monkeypatch.context() as reuse:
|
|
|
|
|
reuse.setattr(shutil, "copytree", no_copy)
|
|
|
|
|
assert _toolchain(realize=False)[1] == python
|
|
|
|
|
assert _toolchain()[1] == python
|
|
|
|
|
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
assert facts.path.read_bytes() == before
|
2026-10-08 15:08:46 -07:00
|
|
|
assert tree_digest(entry) == shipped_digest
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
|
|
|
|
|
|
2026-09-12 18:57:16 -04:00
|
|
|
@pytest.mark.parametrize("damage", [None, "source", "copy", "publication"])
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
def test_copy_failure_preserves_previous_python(installed_uv, monkeypatch, damage):
|
2026-10-08 17:22:54 +02:00
|
|
|
from pm import registry
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
from pm.store import Store, tree_digest
|
|
|
|
|
|
|
|
|
|
root, _, facts, target, digest = installed_uv
|
2026-09-18 23:27:05 -04:00
|
|
|
ensure = importlib.import_module("pm.install")
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
shipped = facts.path.parent
|
|
|
|
|
writable = root / "writable-tools"
|
|
|
|
|
writable.mkdir()
|
|
|
|
|
python = Python()
|
|
|
|
|
monkeypatch.setattr(python, "verify", lambda *_: "")
|
|
|
|
|
monkeypatch.setitem(registry._packages, "python", python)
|
|
|
|
|
entry_name = python.store_entry("test", target)
|
|
|
|
|
source = shipped / entry_name
|
|
|
|
|
source.mkdir()
|
2026-09-12 18:57:16 -04:00
|
|
|
binary_rel = python.binary(source, target).relative_to(source)
|
|
|
|
|
(source / binary_rel).parent.mkdir(parents=True, exist_ok=True)
|
|
|
|
|
(source / binary_rel).write_bytes(b"new interpreter")
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
facts.record("python", "test", entry_name, {}, shipped,
|
|
|
|
|
target=target, artifacts=[digest], digest=tree_digest(source))
|
|
|
|
|
previous = writable / entry_name
|
|
|
|
|
previous.mkdir()
|
2026-09-12 18:57:16 -04:00
|
|
|
(previous / binary_rel).parent.mkdir(parents=True, exist_ok=True)
|
|
|
|
|
(previous / binary_rel).write_bytes(b"previous interpreter")
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
previous_facts = Facts(writable / "facts.json")
|
|
|
|
|
previous_facts.record("python", "previous", entry_name, {}, writable,
|
|
|
|
|
target=target, artifacts=[digest], digest=tree_digest(previous))
|
|
|
|
|
before = previous_facts.path.read_bytes()
|
|
|
|
|
copytree = shutil.copytree
|
|
|
|
|
|
|
|
|
|
if damage == "source":
|
2026-09-12 18:57:16 -04:00
|
|
|
(source / binary_rel).write_bytes(b"damaged source")
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
elif damage == "copy":
|
2026-09-12 18:57:16 -04:00
|
|
|
def damaged_copy(src, dest, *args, **kwargs):
|
|
|
|
|
result = copytree(src, dest, *args, **kwargs)
|
|
|
|
|
if Path(src) == source:
|
|
|
|
|
(dest / binary_rel).write_bytes(b"damaged copy")
|
|
|
|
|
return result
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
monkeypatch.setattr(shutil, "copytree", damaged_copy)
|
2026-09-12 18:57:16 -04:00
|
|
|
elif damage == "publication":
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
def failed_publication(*args, **kwargs):
|
|
|
|
|
raise OSError("publication refused")
|
|
|
|
|
monkeypatch.setattr(Store, "publish", failed_publication)
|
|
|
|
|
|
2026-09-12 18:57:16 -04:00
|
|
|
if damage is None:
|
|
|
|
|
monkeypatch.setattr(Store, "fetch_many", lambda *args, **kwargs: pytest.fail("copy downloaded bytes"))
|
fix(desktop): preserve MSIX runtime and add Store updates
Use a verified writable copy of pinned Python for uv builds. Keep the
signed launchers and bundled Python as the MSIX runtime so plugin
rebuilds do not remove package access.
Identify Microsoft Store builds from the artifact stamp. Use StoreContext
for update checks, downloads, and installation requests inside Hermes.
Keep relaunch and recovery ownership across the update. Do not report
unknown checks or no-op requests as successful installations.
Open the build commit link in the system browser.
Verification: 168 Python tests, 107 Electron tests, and 121 renderer tests
passed. Typechecks, lint, lock validation, and desktop builds passed.
A real packaged process completed plugin admission, import, and repair.
Store-acquired download, installation, and relaunch remain unverified.
This host has only the sideloaded MSIX. Its real Store API call returned
an error, which the app reports as unknown. macOS updates are unchanged.
2026-09-10 15:17:18 -04:00
|
|
|
ensure._install(python, ensure._lockfile(), previous_facts, Store(writable), target,
|
|
|
|
|
copy_from=(facts, Store(shipped)))
|
2026-09-12 18:57:16 -04:00
|
|
|
assert tree_digest(previous) == tree_digest(source)
|
|
|
|
|
assert previous_facts.get("python")["digest"] == facts.get("python")["digest"]
|
|
|
|
|
else:
|
|
|
|
|
with pytest.raises(InstallError, match="verification|copied bytes|publication refused"):
|
|
|
|
|
ensure._install(python, ensure._lockfile(), previous_facts, Store(writable), target,
|
|
|
|
|
copy_from=(facts, Store(shipped)))
|
|
|
|
|
assert (previous / binary_rel).read_bytes() == b"previous interpreter"
|
|
|
|
|
assert previous_facts.path.read_bytes() == before
|