Skip to content

The agent that grows with you

chore(update): waive the deliberate catch-alls and unbounded update children for the health ratchet

Teknium39961e89ce6a
diff --git a/hermes_cli/_old_updater.py b/hermes_cli/_old_updater.py
index b29ed20eedf..df0c93ce099 100644
--- a/hermes_cli/_old_updater.py
+++ b/hermes_cli/_old_updater.py
@@ -157,6 +157,9 @@ def _run_in_custody(argv: list, root: Path, **kwargs) -> int:
print(f" ⚠ The update's job would not take the takeover ({refusal}); it runs outside the job, "
"holding its own checkout lease.", flush=True)
resume(proc)
+ # The takeover is the rest of a committed update (sync + build): a bound would abandon it
+ # mid-write. It dies with this updater (kill-on-close job, or the except path below).
+ # health: allow HX006 -- unbounded by design: the update's own supervised child
return proc.wait()
except BaseException:
proc.kill()
@@ -170,7 +173,7 @@ def _checkout_custody(root: Path) -> dict:
held = getattr(sys.modules.get("hermes_cli.update_lock"), "checkout_lock_fds", None)
try:
fds = tuple(held(root)) if held is not None and os.name == "posix" else ()
- except Exception: # noqa: BLE001 - an old module's surprise must not fail the update
+ except Exception: # health: allow BLE001 -- any older release's checkout_lock_fds; no fds = takeover locks itself
fds = ()
return {"pass_fds": fds} if fds else {}
diff --git a/hermes_cli/update_completion.py b/hermes_cli/update_completion.py
index a83d05d9a03..f5e34590173 100644
--- a/hermes_cli/update_completion.py
+++ b/hermes_cli/update_completion.py
@@ -349,6 +349,7 @@ def _prepare(request: dict, request_path: Path, result_path: Path) -> int:
# and dependency graph. No application maintenance runs in this bootstrap.
from hermes_cli.update_lock import checkout_lock_fds
+ # health: allow HX006 -- the prepared completion child is the update's build; it runs to the end
code = _exit_status(subprocess.call(command, cwd=root, env=activation_environment(root),
pass_fds=checkout_lock_fds(root)))
if not result_path.exists():
diff --git a/hermes_cli/update_custody.py b/hermes_cli/update_custody.py
index 521a039916c..dff1668f5ae 100644
--- a/hermes_cli/update_custody.py
+++ b/hermes_cli/update_custody.py
@@ -125,7 +125,7 @@ def _past_commit() -> bool:
from hermes_cli.update_receipt import _current
current = _current.get()
- except Exception: # noqa: BLE001 - unknown: never claim that nothing changed
+ except Exception: # health: allow BLE001 -- fail closed: unknown = past commit, never "nothing changed"
return True
return current is not None and any(stage.get("name") == "apply" for stage in current.data.get("stages") or ())
@@ -166,7 +166,7 @@ def git_argv(git_cmd: Sequence[str], args: Sequence[str]) -> list[str]:
def _held() -> dict | None:
try:
from hermes_cli import update_lock
- except Exception: # noqa: BLE001 - a torn tree's launch repair: no updater runs from it
+ except Exception: # health: allow BLE001 -- a torn tree's half-written module raises anything; no updater runs
return None
return update_lock._HELD
diff --git a/hermes_cli/update_lock.py b/hermes_cli/update_lock.py
index 67d474abd76..6da39e07d20 100644
--- a/hermes_cli/update_lock.py
+++ b/hermes_cli/update_lock.py
@@ -227,7 +227,7 @@ def process_create_time(pid: int | None = None) -> float | None:
return _stdlib_create_time(target)
try:
return float(psutil.Process(target).create_time())
- except Exception:
+ except Exception: # health: allow BLE001 -- liveness probe: any psutil failure degrades to the stdlib probe
return _stdlib_create_time(target)
@@ -870,7 +870,7 @@ def read_live_update(*, path: Path | None = None, install_root: Path | str | Non
if _reclaim_dead(marker, install_root) == "held":
return UpdateHolder(pid=0, age_seconds=max(parsed.age(), 0.0) if parsed.started_at is not None else 0.0,
held=True)
- except Exception as exc: # "never raises": an unreadable state is no live update
+ except Exception as exc: # health: allow BLE001 -- documented never-raises probe: unjudgeable = no live update
logger.debug("Could not judge update marker %s: %s", marker, exc)
return None