Skip to content

fix(disk-hygiene): guard-launch detector shares the guard's interpreter, so it is blind to the interpreter fail-open #1504

Description

@kyle-sexton

Problem

plugins/disk-hygiene/hooks/hooks.json declares the same literal interpreter for both wired hooks:

  • :9 — the PreToolUse engine-gate guard (destructive_guard.py), "command": "python3"
  • :28 — the Stop guard-launch detector (guard_launch_monitor.py), "command": "python3"

One interpreter resolution, two hooks. When python3 is absent, broken, or resolves to the
zero-length WindowsApps\python3.exe App Execution Alias stub that
plugins/disk-hygiene/README.md documents, the guard process never starts — Claude Code treats the
non-blocking result as approval, so the destructive command runs ungated. The detector that exists
to make exactly that failure visible is launched the same way and dies the same way: the
hook_non_blocking_error record is written to the transcript and never read.

The detector therefore cannot observe the single fail-open vector this plugin's own README documents
most prominently.

Why this is deferred rather than fixed in #1465

The requested remedy — a launcher whose availability is independent of the guarded interpreter — is a
design decision #1465's diff does not settle. A Python detector has no launcher independent of a
Python interpreter. The candidate designs each carry distinct cross-platform trade-offs and none is
implied by the change under review:

  1. A shell/batch shim that resolves an interpreter and reports its own failure.
  2. Absolute-interpreter resolution mirroring what /disk-hygiene:setup check already does for this
    exact alias case.
  3. A non-Python detector.

#1465 now discloses the blind spot at all three coverage-disclosure sites (README, safety-model
reference, CHANGELOG), so the documented envelope matches what the code delivers. This issue owns
closing the gap itself.

Re-open / close trigger

Closed when both wired disk-hygiene hooks launch through a path whose availability does not depend
on the same unresolved python3 lookup, and the detector can report a guard launch failure
caused by interpreter resolution. Removing the disclosure sentences without shipping that is not a
close.

Source

Codex review finding (P1) on #1465, plugins/disk-hygiene/hooks/hooks.json:28.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.area: securitySecurity-relevant: vulnerability, hardening, or disclosure follow-up.priority: mediumReal value, no hard deadline; normal backlog flow.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions