From 42d3c236ef70832368430307424c98a8b4e11091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=97=D0=B0=D1=80=D1=83=D0=B1=D0=B8=D0=BD=20=D0=A4=D0=B8?= =?UTF-8?q?=D0=BB=D0=B8=D0=BF=D0=BF?= <289370046+zarubinphil@users.noreply.github.com> Date: Wed, 17 Jun 2026 17:55:14 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20P2=20launchd-hardening=20=E2=80=94=20ses?= =?UTF-8?q?sion-reaper=20PATH=20+$HOME/.local/bin=20+=20smoke-=D0=B2=D0=B0?= =?UTF-8?q?=D0=BB=D0=B8=D0=B4=D0=B0=D1=86=D0=B8=D1=8F=20plist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - session-reaper.plist.example: PATH +$HOME/.local/bin (reaper зовёт claude для хэндоффа → был риск status=127; асимметрия с health/registry-watch устранена; KGB-29) - раздельные log/err (StandardErrorPath → .err.log; CIA-13) - smoke: plutil-lint всех plist + PATH-консистентность ($HOME/.local/bin обязателен; анти-регресс) Co-Authored-By: Claude Opus 4.8 (1M context) --- launchd/com.athena.session-reaper.plist.example | 4 ++-- smoke/smoke.sh | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/launchd/com.athena.session-reaper.plist.example b/launchd/com.athena.session-reaper.plist.example index 8ee6de9..f2908ad 100644 --- a/launchd/com.athena.session-reaper.plist.example +++ b/launchd/com.athena.session-reaper.plist.example @@ -14,10 +14,10 @@ EnvironmentVariables - PATH/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin + PATH$HOME/.local/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin StartInterval1800 StandardOutPath$HOME/.claude/session-reaper.log - StandardErrorPath$HOME/.claude/session-reaper.log + StandardErrorPath$HOME/.claude/session-reaper.err.log diff --git a/smoke/smoke.sh b/smoke/smoke.sh index d75102a..a7a9669 100755 --- a/smoke/smoke.sh +++ b/smoke/smoke.sh @@ -97,6 +97,19 @@ chk "bootstrap.sh синтаксис" "bash -n '$HERE/bootstrap.sh'" chk "bootstrap.sh исполняем" "[ -x '$HERE/bootstrap.sh' ]" command -v shellcheck >/dev/null && chk "shellcheck bootstrap.sh" "shellcheck -S error '$HERE/bootstrap.sh'" || echo " · shellcheck не установлен (skip)" +echo "[launchd] plist валидны + PATH-консистентность" +if command -v plutil >/dev/null; then + for p in "$HERE"/launchd/*.plist "$HERE"/launchd/*.plist.example; do + [ -e "$p" ] || continue; b="$(basename "$p")" + t="$(mktemp)"; sed "s#\$HOME#$HOME#g" "$p" > "$t" + chk "plist валиден: $b" "plutil -lint '$t' >/dev/null 2>&1"; rm -f "$t" + # Агенты с EnvironmentVariables.PATH обязаны включать $HOME/.local/bin (claude/node там; KGB-29). + if grep -q 'PATH' "$p"; then + chk "PATH содержит \$HOME/.local/bin: $b" "grep -A1 'PATH' '$p' | grep -q '\$HOME/.local/bin'" + fi + done +else echo " · plutil нет (skip — не macOS)"; fi + echo "[паритет] Claude и Codex видят одно (если развёрнуто)" if [ -d "$HOME/.claude" ] && [ -d "$HOME/.codex" ]; then # Реальная сверка содержимого, не факт существования папок (KGB-23).