Dependency publication now recovers interrupted config/facts changes before activation and leases live generations during collection. Receipts retain update correlation and failed steps across nested command boundaries. Doctor and desktop surfaces report those failures through shared owners. Move checkout updates out of the desktop facade. Stage a detached Windows relaunch waiter before shutdown, with bounded handshake and process-birth checks. Keep packaged lifecycle tests isolated from the installed app. Native verification exposed two production races: cron maintenance imported the interactive CLI and rewrote TERMINAL_CWD, and install-ID reads collided with first publication. Use the existing owners and locks. Plugin checks now run at startup and each due-gated housekeeping tick, not after 60 ticks. Share updater-test mutation boundaries and remove collection-root fixtures. Separate cold MCP startup from command latency and give the real HTTP drip test enough time to reach body handling. Root npm check passed, including packaging. The fixed-tree Windows Python run reported 44557 passed, one failed, and 1404 skipped, plus one retry-only HTTP test. Those final failures now pass in a 35-test bounded batch. A real isolated gateway wrote startup and periodic plugin-check receipts. Full final-tree CI, bundled Sandbox deployment, and actual App Installer relaunch remain unverified. docs/pm-audit-status.md records these limits.
25 lines
1.0 KiB
Python
25 lines
1.0 KiB
Python
"""Recovery does not overwrite a config edited after interrupted publication."""
|
|
import pytest
|
|
|
|
|
|
def test_recovery_refuses_to_replace_newer_config(tmp_path, monkeypatch):
|
|
from hermes_cli.runtime_state import recover_publication, runtime_lock
|
|
from hermes_cli.plugins_admission import _config_commit
|
|
import pm.paths as paths
|
|
from hermes_cli.runtime_paths import install_state_dir
|
|
|
|
monkeypatch.setenv("HERMES_HOME", str(tmp_path))
|
|
repo = tmp_path / "repo"
|
|
repo.mkdir()
|
|
monkeypatch.setattr(paths, "repo_root", lambda: repo)
|
|
config = tmp_path / "config.yaml"
|
|
config.write_bytes(b"plugins:\n enabled: [old]\n")
|
|
with runtime_lock(repo):
|
|
_config_commit({"new"}, set())
|
|
config.write_bytes(config.read_bytes() + b"model: user-choice\n")
|
|
changed = config.read_bytes()
|
|
with pytest.raises(RuntimeError, match="config changed"):
|
|
recover_publication(repo)
|
|
assert config.read_bytes() == changed
|
|
assert (install_state_dir(repo) / "publication.json").is_file()
|