Skip to content

Route install._shield_git through verify.git_bytes now that #377 has landed #389

Description

@pbean

install._shield_git is a bare subprocess.run git spawn, which AGENTS.md's chokepoint invariant
otherwise forbids ("All git subprocess calls go through the _run_git chokepoint in verify.py").
It stands outside deliberately, and its docstring names the reason: _run_git returned
CompletedProcess[str] and raised on a non-zero rc, neither of which the shield can use.

#377 removed that blocker. verify.git_bytes now returns CompletedProcess[bytes] with the rc
intact, inheriting the LC_ALL=C pin (#236) and the _git_timeout_s bound (#156). The shield's two
stated requirements are both met.

Why this was not folded into #385

Absorption is not a pure swap — the exception guards move underneath it:

So each of the 8 call sites needs its guard re-derived from what it actually wants to tolerate,
which is review work of its own rather than a mechanical substitution.

Scope

  • Replace _shield_git with verify.git_bytes; install currently imports no verify, so this
    adds that edge (nothing structural forbids it — the docstring already says so).
  • Re-derive the exception guards at all 8 sites; add GitError where the intent is "tolerate git
    being unavailable".
  • _SHIELD_GIT_TIMEOUT_S becomes dead once the chokepoint's limits.git_timeout_s bound applies —
    note that this is a behavior change: the shield would start honouring the operator's configured
    timeout instead of a hardcoded 120s mirror.
  • A test that the shield's git calls carry LC_ALL=C, which standing outside the chokepoint costs
    today.

Follow-up to #384 / #385 and #377.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions