Repository navigation
Description
Raised out of #1166. The gh-write-guard hook can be installed with a command that never runs, and nothing would say so.
The defect
host-setup/agent-safety/claude/install.py picks the interpreter it writes into settings.json on bare presence:
def hook_launcher():
if shutil.which("python3"):
return "python3"
return sys.executableshutil.which answers for anything on PATH under that name. On a Windows host carrying the Microsoft Store app execution alias, that is a stub which cannot run a script at all, so the hook command written into settings.json would be one that never executes. The hook is the enforcement layer for this repo's write-safety rules, so a hook that silently never runs is the worst shape this failure can take.
install.sh has a weaker form of the same problem. It does run the candidate:
for c in python3 python; do
if command -v "$c" >/dev/null 2>&1 && "$c" -c 'import sys; raise SystemExit(0 if sys.version_info[0] == 3 else 1)' 2>/dev/null; thenbut it reads only the exit code, and it sends stderr to /dev/null. install.ps1 is the one that gets it right, preferring py -3 first.
Severity, honestly stated
Latent rather than live on the maintainer's host: ~/.claude/settings.json there carries no hooks block at all, so nothing is currently mis-wired. #1166 also removes the App Installer alias stub that triggers the Windows case, and supplies a real python3, so the specific trigger is narrower after it. Neither of those fixes the validation, which is what this issue is about, and the agent-safety tree is deliberately standalone and must keep working on a host install-tools.ps1 has never touched.
What a fix looks like
Run the candidate and read its output rather than its presence or its exit code: something that prints a known value and a version, checked against the 3.11 floor the installer and hook already require, with the failure reported rather than swallowed. install.sh should stop discarding stderr on the probe for the same reason.
Worth checking at the same time whether an already-written settings.json carrying a stale or non-working launcher is detected by --report, since a host installed before a fix would otherwise stay broken and pass its own check.
Activity
ptr727 commentedon Nov 1, 2026
Decision needed (decision triage, 2026-11-01)
Question: Should the agent-safety installer stop choosing the interpreter it writes into settings.json by presence alone, and instead run the candidate and check its version against the 3.11 floor, stop install.sh's probe discarding stderr, and have
--reportexecute the registered launcher?Options, recommended first:
--report"execute the deployed file directly"). Doing the same for the launcher closes the remaining way to register a hook that silently never runs, and fixes hosts installed before the fix, since--reportcompares only the path today. No work in flight.python3preference for the interpreter that already passed the 3.11 check by running the installer. Simpler, but an absolute path breaks when the interpreter is upgraded or moved, common on Windows. No work in flight.Evidence: install.py:465-472 unchanged:
if shutil.which("python3"): return "python3". install.sh:15 ends its probe with2>/dev/nulland reads only the exit code. install.py:115-118 (runs_hook): "The path is compared and the launcher is not". The self-test at install.py:1600 runssys.executable, not the written launcher. install.ps1 already preferspy -3.Blocks: none
ptr727 commentedon Nov 1, 2026
Maintainer answer (decision triage, 2026-11-01): Option 1: approved as proposed. This agent-safety installer change is approved for implementation: run-validate the launcher against the 3.11 floor, stop install.sh's probe discarding stderr, and have --report execute the registered launcher.
ptr727 commentedon Nov 10, 2026
Released (2026-11-10): PR #4032 merged into
developat 4673434 on the maintainer's go-ahead, and its branch and worktree are removed, so this claim holds no files.Backlog burndown claim (attended run 2026-11-10, round 1, group G2). Branch:
burndown/1172-agent-safety-launcher-and-clusters. Issues: #1172, #3783.Predicted file set:
host-setup/agent-safety/claude/install.pyhost-setup/agent-safety/claude/install.shhost-setup/agent-safety/claude/test_install.pyhost-setup/agent-safety/claude/README.mdhost-setup/agent-safety/README.mdhost-setup/agent-safety/guard files includinggh-write-guard.pytests/test_guard_size.pyNo other group may edit these files while this claim stands. The orchestrator releases it at cleanup.
ptr727 commentedon Nov 10, 2026
Stopped for the maintainer (burndown round 1, 2026-11-10). PR #4032 carries this fix, at head
6818c267.host-setup/agent-safety/. The run's merge grant does not reach it.ptr727 commentedon Nov 10, 2026
Maintainer go-ahead (2026-11-10), for PR #4032 only: squash-merge it into
developonce #4033's fix lands and its checks are green. The Merge Gate must otherwise hold with no new findings. A change to the diff before then comes back to the maintainer first.Run the Hook Launcher Before Trusting It and Read Short-Option Cluste…
ptr727 commentedon Nov 10, 2026
Released (2026-11-10): PR #4041 merged into
developat a735c0a on the maintainer's go-ahead, and its branch and worktree are removed, so this claim holds no files.Backlog burndown claim (attended run 2026-11-10, promotion fix for #4039, group G14). Branch:
burndown/4039-agent-safety-launcher-probe-fixes. Issues: #1172.This fixes three findings Copilot raised on promotion #4039 against the launcher probe #4032 added. The merge waits on the maintainer's go-ahead after reading the diff.
Predicted file set:
host-setup/agent-safety/claude/install.pyhost-setup/agent-safety/claude/install.shhost-setup/agent-safety/claude/test_install.pyhost-setup/agent-safety/claude/README.mdNo other group may edit these files while this claim stands. The orchestrator releases it at cleanup.
ptr727 commentedon Nov 10, 2026
Maintainer go-ahead (2026-11-10), for PR #4041 only: squash-merge it into
developat headda99c18f, after reading its diff. It fixes two of promotion #4039's findings against #4032's launcher probe, and the third is deferred to #4040.