Commit Graph

10 Commits

Author SHA1 Message Date
Teknium
21aa99db8c fix(update): retired updater shims never start an update from live code
Every retired shim called stop_for_relaunch() unconditionally, so a current-tree
caller (a plugin, a serve/dashboard/gateway, main.__getattr__'s lazy export)
reaching one ran the whole update-finish takeover: dependency sync, desktop
rebuild, gateway restart, backend kill -- and the restarted process could reach
the shim again (#122656). lazy_deps.install_specs and psutil_android's import
were already gated on in_historical_update(); the other 60 shims were not.

One shared gate, _old_updater.stop_historical_updater(hook, error): hands off
exactly as before when a historical updater entrypoint frame is on the stack
(or the process already handed off and is unwinding), otherwise raises a
catchable error (ImportError for installer-shaped shims, matching
install_specs; RetiredUpdaterHook otherwise). install_specs now uses it too.
main._write_update_incomplete_marker resolves to a gated old_updater_deps shim
instead of aliasing stop_for_relaunch. Every frozen-surface name is retained.

Fixes #124881
Fixes #122656
2026-11-14 01:03:00 -08:00
ang-fleet-workers[bot]
9481c17fe7 fix(update): importing hermes_cli.psutil_android must not run the update takeover; launchd restart checks label ownership
hermes_cli/psutil_android.py called stop_for_relaunch() at module level,
so any importer (an import smoke, a doc tool) ran a full update takeover:
dependency sync, launcher publication, then finish_update's launchd
restart. Gate the import-time handoff on _old_updater.in_historical_update(),
the same frame-walk gate tools.lazy_deps.install_specs uses; every shipped
caller ran inside _cmd_update_impl.

_restart_launchd_gateway_after_update now applies the
launchd_label_foreign_home rule the sibling loop already applies, so an
invoking label whose plist pins another HERMES_HOME is left alone.

Tests: new tests/hermes_cli/test_import_side_effect_canary.py imports every
shipped module under a temp HOME/HERMES_HOME with an audit hook that refuses
service-manager execs, child interpreters and out-of-root writes. On
be5e9f72c6 it fails naming only hermes_cli.psutil_android; with this change
it passes. Also: test_invoking_label_of_another_home_is_left_alone,
test_psutil_android_import_outside_an_update_starts_nothing, the e2e
import-smoke exclusion of psutil_android dropped (AST check inverted).
2026-11-13 23:49:02 -08:00
ethernet
cdf48a1fd2 fix(update): restore the retired old-updater shims the main merge overwrote
An origin/main merge brought back main's live implementations where this
branch had retirement shims: psutil_android (download + extract), the
dashboard_procs concurrent-shim scan, and update_cmd_windows reaching the
holder scan through hermes_cli.main's retired alias. An already-running
pre-PM updater must hand off to the fresh child, never resume its ladder.
Post-update dashboard cleanup is isolated like its siblings (#112604), and
the holder-retirement probes assert the hand-off through the fresh-child
seam instead of a bare SystemExit(0).
2026-09-19 03:52:12 -04:00
ethernet
45c77a40cf fix: read text files with encoding=utf-8-sig in code merged from main
Same rule as 6e294f543d for the reads that arrived with the origin/main merge;
the Windows footguns lane is blocking.
2026-09-19 01:38:09 -04:00
teknium1
30657d197d refactor(update): psutil Android installer extracts through the shared safe-tar guard
hermes_cli/psutil_android carried its own tar path-traversal / link-member
guard (a 0.87 copy of archive_safe.safe_extract_targz). One guard for every
tar.gz we extract; the installer keeps raising PsutilAndroidInstallError so
its callers' except clauses are unchanged.

Behavior change: the psutil path now also rejects Windows-absolute and
backslash-smuggled member names (archive_safe.normalize_archive_parts), and
chmod failures on extracted files are suppressed identically.
2026-09-13 05:07:11 -07:00
Teknium
7d4207ed1b refactor(hermes_cli): drop intra-function paragraph blanks in g5 files (whitespace-only) 2026-09-02 21:00:55 -07:00
Teknium
4df107c161 refactor(hermes_cli): fold short multi-line calls/signatures in g5 files (AST-identical) 2026-09-02 20:47:24 -07:00
Teknium
cbf945e42e refactor(hermes_cli): proxy adapters/cli/sse_done + relaunch/resource_limits/psutil_android/relay_cutover — dict dispatch, unified stderr printer, compact prose 2026-09-02 20:38:10 -07:00
Teknium
cfa327e5dc refactor(hclib): remaining hermes_cli library modules — dead code, unified helpers, flattened branches 2026-09-02 15:03:42 -07:00
Dusk1e
aa3466063b fix(android): reject unsafe tar members in psutil compatibility installer 2026-05-28 02:36:09 -07:00