The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
ci: start the real-update suites for every file on the update path
Teknium424d52c524d6
diff --git a/scripts/ci/classify_changes.py b/scripts/ci/classify_changes.pyindex 9ec4e6fe729..7315c0f00da 100644--- a/scripts/ci/classify_changes.py+++ b/scripts/ci/classify_changes.py@@ -135,6 +135,12 @@ _DESKTOP_UPDATER_TEST_PREFIX = "tests/scripts/desktop_update/"_DESKTOP_UPDATER_FILES = {"apps/desktop/electron/updater-process.ts","apps/desktop/electron/managed-ssh-update.ts",+ # The other half of the marker / result contract the script implements.+ "apps/desktop/electron/update-marker.ts",+ "apps/desktop/electron/handoff-result.ts",+ # Python the script runs: the post-update verify and the staged app swap.+ "hermes_cli/desktop_update_verify.py",+ "hermes_cli/main_desktop.py","tests/conftest.py","pyproject.toml",}@@ -174,6 +180,45 @@ _DESKTOP_E2E_SHARED = ("apps/desktop/e2e/fix-electron-tracing","apps/desktop/e2e/run-tmp",)+# What `hermes update` runs outside the update_* module family: the steps of the+# pipeline (entry, lock, early recovery, completion tail, launchers, fleet+# restart/verify, Windows pause/resume) and the lock / marker / recovery state+# the update_* modules import. Editing any of these changes what a real update+# does, so the real-update suites (Linux e2e-upgrade and the Windows+# install + update journey, including its crash cells) must run on the PR.+_UPDATE_PIPELINE = (+ "hermes_cli/main.py", # cmd_update: lock, pre-update backup, receipt boundary+ "hermes_cli/main_dashboard.py", # hangup protection + update.log mirror+ "hermes_cli/main_desktop.py", # staged Desktop swap / rebuild in the tail+ "hermes_cli/_early_recovery.py", # interrupted pull / shim restore at launch+ "hermes_cli/venv_sync.py", # completion obligation + launch-time tail+ "hermes_cli/source_", # source_completion/_build/_releases/_check/_stamp+ "hermes_cli/_launchers.py",+ "hermes_cli/release_channels.py",+ "hermes_cli/gitlock.py", # git self-heal + partial-clone fetch+ "hermes_cli/process_identity.py", # marker owner liveness+ "hermes_cli/runtime_state.py",+ "hermes_cli/relaunch.py",+ "hermes_cli/managed_uv.py",+ "hermes_cli/npm_engine.py",+ "hermes_cli/_scan_venv_blockers.py",+ "hermes_cli/dashboard_procs.py",+ "hermes_cli/desktop_update", # desktop_update_verify+ "hermes_cli/gateway.py", # fleet restart / verify+ "hermes_cli/gateway_windows", # Windows pause / resume+ "hermes_cli/gateway_launchd.py",+ "hermes_cli/gateway_migrate",+ "hermes_cli/gateway_supervised_restart.py",+ "hermes_bootstrap.py", # every launch's prepare_launch+ "hermes_constants.py", # root home = update marker location+ "gateway/status.py", # code_sha stamp the fleet verify reads+ "gateway/control_socket.py", # pause-for-update verb+ "gateway/code_skew.py",+ "gateway/host_rendezvous.py",+ "gateway/shutdown_forensics.py",+ "gateway/restart.py",+ "scripts/desktop-update/", # the hand-off scripts run `hermes update`+)_E2E_LANES: dict[str, tuple[str, ...]] = {"e2e": (*_PY_TEST_HARNESS,@@ -201,6 +246,7 @@ _E2E_LANES: dict[str, tuple[str, ...]] = {"hermes_cli/install_","hermes_cli/_install_","hermes_cli/main_install",+ *_UPDATE_PIPELINE,),"e2e_desktop_core": (*_DESKTOP_E2E_SHARED,@@ -226,9 +272,21 @@ _E2E_LANES: dict[str, tuple[str, ...]] = {"apps/desktop/electron/gateway-stop-before-update","apps/desktop/electron/pre-update-","apps/desktop/electron/install-stamp",+ # The rest of the Electron update path (codemap desktop-update §1):+ # main.ts owns the gate / backend stop / hand-off launch hunks (the+ # classifier sees files, not hunks), the result reader, the install+ # kind, the attach-time version check and the in-place app swap.+ "apps/desktop/electron/main.ts",+ "apps/desktop/electron/handoff-result",+ "apps/desktop/electron/desktop-installation",+ "apps/desktop/electron/backend-discovery",+ "apps/desktop/electron/host-backend-attach",+ "apps/desktop/electron/bundle-swap",+ "apps/desktop/electron/app-installer-file","scripts/desktop-update/","scripts/install.sh","hermes_cli/desktop_update",+ "hermes_cli/main_desktop.py","hermes_cli/update_",),}diff --git a/tests/ci/test_classify_changes.py b/tests/ci/test_classify_changes.pyindex 509d660a36e..54875f75af2 100644--- a/tests/ci/test_classify_changes.py+++ b/tests/ci/test_classify_changes.py@@ -175,16 +175,18 @@ CASES = {# The Windows desktop-update hand-off is a PowerShell integration surface:# its tests spawn the real script and poll its loopback server. They run# when the script, the Electron side that launches it, or their own test- # files change — not on every hermes_state.py PR.+ # files change — not on every hermes_state.py PR. The script runs a real+ # `hermes update`, and the Windows crash cells that kill it mid-run live in+ # the install + update journey, so it starts e2e_upgrade as well."windows.ps1 → desktop_updater": (["scripts/desktop-update/windows.ps1"],- _lanes(python=True, desktop_updater=True, e2e_desktop_update=True),+ _lanes(python=True, desktop_updater=True, e2e_upgrade=True, e2e_desktop_update=True),),# The shipped updater page is exercised by the desktop Electron suite;# a page-only change must run that suite as well as the server tests."updater ui.html → frontend + desktop_updater": (["scripts/desktop-update/ui.html"],- _lanes(python=True, frontend=True, desktop_updater=True, e2e_desktop_update=True),+ _lanes(python=True, frontend=True, desktop_updater=True, e2e_upgrade=True, e2e_desktop_update=True),),"desktop-update test → desktop_updater": (["tests/scripts/desktop_update/test_desktop_update_windows_progress.py"],@@ -332,6 +334,22 @@ CASES = {_lanes(python=True, scan=True, e2e_upgrade=True, e2e_desktop_update=True),),"PM → e2e_upgrade + docker": (["pm/environments.py"], _lanes(python=True, scan=True, e2e_upgrade=True, docker=True)),+ # The update pipeline lives beyond the update_* family too: the entry+ # point, launch-time recovery, the gateway restart/pause surface.+ "cmd_update entry → e2e_upgrade": (["hermes_cli/main.py"], _lanes(python=True, scan=True, e2e_upgrade=True)),+ "gateway status stamp → e2e_upgrade": (["gateway/status.py"], _lanes(python=True, scan=True, e2e_upgrade=True)),+ "desktop verify → desktop_updater + both update suites": (+ ["hermes_cli/desktop_update_verify.py"],+ _lanes(python=True, scan=True, desktop_updater=True, e2e_upgrade=True, e2e_desktop_update=True),+ ),+ "electron main → desktop update": (+ ["apps/desktop/electron/main.ts"],+ _lanes(frontend=True, e2e_desktop_update=True),+ ),+ "handoff result reader → desktop_updater + desktop update": (+ ["apps/desktop/electron/handoff-result.ts"],+ _lanes(frontend=True, desktop_updater=True, e2e_desktop_update=True),+ ),"desktop backend spawn → desktop core": (["apps/desktop/electron/backend-child.ts"],_lanes(frontend=True, e2e_desktop_core=True),@@ -405,6 +423,71 @@ def test_every_slow_lane_path_matches_a_tracked_file():assert dead == set()+# Every file the `hermes update` pipeline runs on the update path (the step+# tables of the updater audit's cli-update and desktop-update code maps). A+# PR that edits only one of these must start the real-update suite that would+# catch the regression; before, main.py / _early_recovery.py / relaunch.py /+# gateway/ / hermes_bootstrap.py skipped both the Linux and Windows journeys.+_UPDATE_PATH_FILES = (+ "hermes_cli/main.py",+ "hermes_cli/main_dashboard.py",+ "hermes_cli/main_desktop.py",+ "hermes_cli/_early_recovery.py",+ "hermes_cli/venv_sync.py",+ "hermes_cli/update_lock.py",+ "hermes_cli/update_cmd.py",+ "hermes_cli/update_completion.py",+ "hermes_cli/update_cmd_windows.py",+ "hermes_cli/update_cmd_zip.py",+ "hermes_cli/_update_takeover.py",+ "hermes_cli/source_completion.py",+ "hermes_cli/source_build.py",+ "hermes_cli/source_releases.py",+ "hermes_cli/_launchers.py",+ "hermes_cli/gitlock.py",+ "hermes_cli/process_identity.py",+ "hermes_cli/relaunch.py",+ "hermes_cli/gateway.py",+ "hermes_cli/gateway_windows.py",+ "hermes_cli/gateway_migrate.py",+ "hermes_cli/desktop_update_verify.py",+ "hermes_bootstrap.py",+ "hermes_constants.py",+ "gateway/status.py",+ "gateway/control_socket.py",+ "gateway/code_skew.py",+ "scripts/desktop-update/windows.ps1",+ "scripts/desktop-update/posix.sh",+)+_DESKTOP_UPDATE_PATH_FILES = (+ "apps/desktop/electron/main.ts",+ "apps/desktop/electron/update-marker.ts",+ "apps/desktop/electron/update-gate.ts",+ "apps/desktop/electron/updater-process.ts",+ "apps/desktop/electron/updater/checkout.ts",+ "apps/desktop/electron/handoff-result.ts",+ "apps/desktop/electron/desktop-installation.ts",+ "apps/desktop/electron/backend-discovery.ts",+ "apps/desktop/electron/host-backend-attach.ts",+ "scripts/desktop-update/windows.ps1",+ "scripts/desktop-update/posix.sh",+ "hermes_cli/desktop_update_verify.py",+ "hermes_cli/main_desktop.py",+)++[email protected]("path", _UPDATE_PATH_FILES)+def test_every_update_path_file_starts_the_real_update_suite(path):+ assert (_REPO / path).is_file(), f"{path} moved: update the classifier and this table"+ assert classify([path])["e2e_upgrade"], path++[email protected]("path", _DESKTOP_UPDATE_PATH_FILES)+def test_every_desktop_update_path_file_starts_the_desktop_update_suite(path):+ assert (_REPO / path).is_file(), f"{path} moved: update the classifier and this table"+ assert classify([path])["e2e_desktop_update"], path++_REPO = Path(__file__).resolve().parents[2]