fix: P2 launchd-hardening — session-reaper PATH +$HOME/.local/bin + smoke-валидация plist
- 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) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
01b51e86db
commit
42d3c236ef
@@ -14,10 +14,10 @@
|
|||||||
</array>
|
</array>
|
||||||
<key>EnvironmentVariables</key>
|
<key>EnvironmentVariables</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>PATH</key><string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
|
<key>PATH</key><string>$HOME/.local/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
|
||||||
</dict>
|
</dict>
|
||||||
<key>StartInterval</key><integer>1800</integer>
|
<key>StartInterval</key><integer>1800</integer>
|
||||||
<key>StandardOutPath</key><string>$HOME/.claude/session-reaper.log</string>
|
<key>StandardOutPath</key><string>$HOME/.claude/session-reaper.log</string>
|
||||||
<key>StandardErrorPath</key><string>$HOME/.claude/session-reaper.log</string>
|
<key>StandardErrorPath</key><string>$HOME/.claude/session-reaper.err.log</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -97,6 +97,19 @@ chk "bootstrap.sh синтаксис" "bash -n '$HERE/bootstrap.sh'"
|
|||||||
chk "bootstrap.sh исполняем" "[ -x '$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)"
|
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 '<key>PATH</key>' "$p"; then
|
||||||
|
chk "PATH содержит \$HOME/.local/bin: $b" "grep -A1 '<key>PATH</key>' '$p' | grep -q '\$HOME/.local/bin'"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else echo " · plutil нет (skip — не macOS)"; fi
|
||||||
|
|
||||||
echo "[паритет] Claude и Codex видят одно (если развёрнуто)"
|
echo "[паритет] Claude и Codex видят одно (если развёрнуто)"
|
||||||
if [ -d "$HOME/.claude" ] && [ -d "$HOME/.codex" ]; then
|
if [ -d "$HOME/.claude" ] && [ -d "$HOME/.codex" ]; then
|
||||||
# Реальная сверка содержимого, не факт существования папок (KGB-23).
|
# Реальная сверка содержимого, не факт существования папок (KGB-23).
|
||||||
|
|||||||
Reference in New Issue
Block a user