Commit Graph

21 Commits

Author SHA1 Message Date
teknium1 466ccac5ab fix(windows-update): a user-launched hermes serve/dashboard is never a Desktop backend
Canonicalising _is_backend_argv onto _hermes_holder_subcommand dropped the
'-m hermes_cli.main' entry-shape discriminator the old predicate had. That
widened _orphaned_desktop_backend_pids to tree-kill a standalone hermes.exe
serve / hermes dashboard whose console parent died. The Desktop's only spawn
shape is -m hermes_cli.main (apps/desktop/electron/main.ts), so _is_backend_argv
now forwards to _looks_like_desktop_control_plane — the same canonical-subcommand
AND entry-shape predicate — instead of a second copy. Test matrix gains a
'Desktop backend?' column with plain hermes serve / hermes.exe dashboard rows.
2026-09-13 05:21:02 -07:00
teknium1 c1e58f4cb2 fix(process-identity): desktop reap, Windows updater and profile liveness use the canonical matchers
Two kill/relaunch predicates decided identity by argv substring, the bug class root AGENTS.md
forbids: hermes_cli/dashboard_procs.py::_is_desktop_local_serve_cmdline (`"serve" not in cmd`,
on the orphan-reap KILL path) and hermes_cli/update_cmd_windows.py::_is_backend_argv
(`" serve" in argv_low`, in the very file that defines _hermes_holder_subcommand). Both now ask
the canonical token classifier; host/port are read as flag values, not substrings.

hermes_cli/profiles.py::_check_gateway_running open-coded rungs 1/3 of
gateway.status.resolve_gateway_liveness and skipped the multiplexer rung; it is now that ladder
scoped to the profile dir (pid probe keeps cleanup_stale=False so a probe for another profile
never unlinks its PID file). The gateway/status.py ladder itself is untouched.

Behavior change: `hermes kanban --preserve-cache --host 127.0.0.1 --port 0` and
`-m dashboard serve`-style argv are no longer classified as serve backends (never killed /
relaunched as one); a named profile served by the live default multiplexer now reads as
running from _check_gateway_running (previously only via the separate
_served_by_running_multiplexer OR at some call sites).
2026-09-13 05:21:02 -07:00
Teknium e83816a4d1 review-fix(comments): restore lost #NNNN rationale comments across non-test source (mechanical sweep, condensed, code unchanged)
For each issue anchor present in BASE 63279301bc non-test .py and absent on HEAD, the BASE comment/docstring block was re-attached at the HEAD location of the code it explained (matched by the distinctive code line / enclosing def). Sentences already covered by an existing HEAD comment were deduped; the issue number always survives. Insert-only: no code lines changed.
2026-09-03 09:44:26 -07:00
Teknium d1bb7fb9cf refactor(hermes_cli/update): fold venv-holder classification and service-stop guards in the Windows update module 2026-09-03 00:02:04 -07:00
Teknium 01d07b6b6c refactor(hermes_cli/update): unify try/log/default + SCM service handle in the Windows update module; compact docstrings 2026-09-02 23:58:28 -07:00
Teknium b5605b7a82 refactor(hermes_cli/update): compact Windows gateway pause/resume module — walrus rungs, poll helper reuse, shared purpose tuple 2026-09-02 23:52:18 -07:00
Teknium 5bf59a2e3a refactor(hermes_cli/update): fold argv snapshot + SCM token bookkeeping in the Windows pause path 2026-09-02 22:59:37 -07:00
Teknium 5607b7beeb refactor(hermes_cli/update): hoist stdlib imports, single-line remaining signatures in update_cmd_windows 2026-09-02 22:55:58 -07:00
Teknium d8a1ee3bfd refactor(hermes_cli/update): table-drive the ledger/orphan tree-reap rungs 2026-09-02 22:50:53 -07:00
Teknium 35b0d18987 refactor(hermes_cli/update): _poll_until + module-level identity-alive check for SCM service stop/start 2026-09-02 22:39:13 -07:00
Teknium c99cefd33c refactor(hermes_cli/update): table-drive SCM rollback, compact pause/resume/venv-guard call sites in update_cmd_windows 2026-09-02 22:30:34 -07:00
Teknium 36b9c06778 refactor(hermes_cli/update): compact venv-holder classifier, ledger/orphan rungs, and service-identity checks in update_cmd_windows 2026-09-02 22:26:28 -07:00
Teknium 1a3c611e02 refactor(hermes_cli/update): _abort_on_error ctx manager for mandatory Windows steps; fold relaunch try/except pairs; compact multi-line prints/raises 2026-09-02 22:00:23 -07:00
Teknium 15569c3d8d refactor(hermes_cli/update): compact update_cmd_windows docstrings (keep every WHY) 2026-09-02 21:33:04 -07:00
Teknium 426bac85bf refactor(hermes_cli/update): split Windows pause/resume/venv-guard god functions into phase helpers; unify psutil/sc.exe/reap-rescan patterns; compact restart_recovery bucketing 2026-09-02 21:16:03 -07:00
Teknium 60041b787a refactor(update): join short multi-line statements onto one line (AST-identical, -416 lines) 2026-09-02 16:52:38 -07:00
Teknium 15651bd877 refactor(update): lift cold-start plan and SCM service pause out of _pause_windows_gateways_for_update (261 -> 163 LOC) 2026-09-02 16:50:01 -07:00
Teknium 0bfcf42133 refactor(update): unify venv-prefix and backend-argv helpers in update_cmd_windows (3+2 call sites) 2026-09-02 16:48:45 -07:00
Teknium d46eb1f964 refactor(update): collapse 90 try/except-pass and try/except-logger.debug blocks into suppress()/_best_effort() (new leaf update_cmd_common.py) 2026-09-02 16:34:55 -07:00
Teknium a59680217f refactor(update): hand-compact comments/docstrings in split modules (AST-identical); re-export get_hermes_home/shutil; repoint source-inspection tests 2026-09-02 16:11:02 -07:00
Teknium 5206a504ca refactor(update): split Windows gateway lifecycle into update_cmd_windows.py 2026-09-02 15:40:14 -07:00