Skip to content

Read an Unrecognized env Option as an Undetermined Repository in the Write Guard #3725

Closed

Description

@ptr727

Raised by the second review round of promotion #3715 (P1 thread) on the change #3722 made.

_env_option in host-setup/agent-safety/claude/gh-write-guard.py looks a long option up in _ENV_LONG by its exact name and maps any name it does not know to an empty letter, which the launcher reader then ignores. GNU env accepts a unique abbreviation of a long option, so a constructed command such as

env --ch=/srv/other GIT_DIR=.git git push origin main

runs git in /srv/other while the guard reads --ch as a no-op and resolves GIT_DIR and the remote from the working directory, the shape #3716 closed for the full spelling.

Fix: read an env option the guard does not recognize, long or short, as leaving the repository undetermined, which blocks main, master and develop the way #3709 and #3722 treat a shape they cannot resolve, rather than matching prefixes. That also covers an option a future env adds.

Backlog burndown claim. Branch: feature/burndown-guard-env-abbrev. Predicted file set: host-setup/agent-safety/claude/gh-write-guard.py, host-setup/agent-safety/README.md.

Activity

  1. ptr727 commented on Oct 31, 2026

    @ptr727
    OwnerAuthor

    Claim released: feature/burndown-guard-env-abbrev merged to develop as #3727 and its branch and worktree are cleaned up. It joins promotion #3715, which closes this issue when it merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions