From 127b56a61aa84c26f52feb8b672c89112f607a1a Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 20 May 2026 22:55:22 -0700 Subject: [PATCH] style: docstring + whitespace cleanup on secure_parent_dir - Drop two extra blank lines between display_hermes_home and secure_parent_dir - Fix docstring saying 'depth < 2' (actual guard is parts < 3) --- hermes_constants.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hermes_constants.py b/hermes_constants.py index a81441e2080..f2d01157664 100644 --- a/hermes_constants.py +++ b/hermes_constants.py @@ -235,14 +235,13 @@ def display_hermes_home() -> str: return str(home) - - def secure_parent_dir(path: Path) -> None: """Chmod ``0o700`` on the parent directory of *path*, but only if safe. - Refuses to chmod ``/`` or any top-level directory (depth < 2) to - prevent catastrophic host bricking when ``HERMES_HOME`` or other - path env vars resolve to an unexpected location. + Refuses to chmod ``/`` or any top-level directory (resolved parent with + fewer than 3 parts, i.e. ``/`` or any direct child like ``/usr``) to + prevent catastrophic host bricking when ``HERMES_HOME`` or other path + env vars resolve to an unexpected location. See https://github.com/NousResearch/hermes-agent/issues/25821. """