Repository navigation
The assembly root's scripts/validate-pins.py ends in a FileNotFoundError traceback, exit 1, a finding's code, when git is not on PATH, because recorded_gitlink reaches repo_shape.git_out and nothing catches OSError, where the file's own exit codes give 1 to drift and 2 to a question that could not be asked: the sibling of #368, whose fix is ruled into validate-family.py only #412
Description
Lane: openreposhape-4 (openRepoShape-4)
The sibling of #368. When this lane filed #368 (validate-family.py), it named this one and left it: "The assembly root's validate-pins.py does the same through git_out (named, not part A's)". The fix for #368 in progress in this lane is ruled into validate-family.py alone, not into git_out, so this file keeps the traceback. Re-verified on main 3ae0109, with a PATH that holds python3 and no git. Local bare remotes, an empty global git config, GIT_ALLOW_PROTOCOL=file and a gh that exits 97 (never called). The exposure is small: CI runs git, and an assembly root is a git repository. What this is about is the exit code. The file's own docstring makes 1 "a FINDING: drift a reviewer can act on" and 2 "a REFUSAL: the question could not be asked ... never an implicit pass", and a traceback that exits 1 reads as drift.
What is wrong.
U=<openRepoShape checkout> # a clean checkout at 3ae0109
# Runs in bash on Linux (GNU coreutils). Nothing leaves the machine: every repository is a local bare one under $R, git
# reads an empty global config, GIT_ALLOW_PROTOCOL=file makes any accidental https/ssh clone fail, and a `gh` that exits
# 97 stands first on PATH.
R=$(mktemp -d); mkdir $R/bin; printf '#!/bin/sh\nexit 97\n' > $R/bin/gh; chmod +x $R/bin/gh; touch $R/gitconfig
export PATH=$R/bin:$PATH GIT_CONFIG_GLOBAL=$R/gitconfig GIT_CONFIG_NOSYSTEM=1 GIT_ALLOW_PROTOCOL=file \
GIT_AUTHOR_NAME=t [email protected] GIT_COMMITTER_NAME=t [email protected]
python3 $U/scaffold-project.py --org testorg --project Atlas --elected-by 'Test Human' --elected-on 2026-10-12 \
--local-remote-dir $R/remotes --work-dir $R/work >/dev/null
git clone -q --recurse-submodules $R/remotes/Atlas.git $R/Atlas; cd $R/Atlas
mkdir $R/nogit && ln -s "$(command -v python3)" $R/nogit/python3 # a PATH with python3 on it and no git
python3 scripts/validate-pins.py | tail -1; echo "validate-pins.py, git on PATH: exit ${PIPESTATUS[0]}"
env PATH=$R/nogit python3 scripts/validate-pins.py > $R/out.txt 2>&1; echo "validate-pins.py, no git: exit $?"
grep -E '^ File "' $R/out.txt | grep -v subprocess.py | sed -E 's|"[^"]*/scripts/|"scripts/|'
tail -1 $R/out.txt
env PATH=$R/nogit python3 scripts/validate-manifest.py 2>&1 | tail -1; echo "validate-manifest.py, no git: exit ${PIPESTATUS[0]}"Output at 3ae0109:
pins ok
validate-pins.py, git on PATH: exit 0
validate-pins.py, no git: exit 1
File "scripts/validate-pins.py", line 834, in <module>
File "scripts/validate-pins.py", line 825, in main
File "scripts/validate-pins.py", line 761, in _run_all_checks
File "scripts/validate-pins.py", line 279, in _check_leg
File "scripts/validate-pins.py", line 187, in _check_gitlink_matches_pin
File "scripts/repo_shape.py", line 1015, in recorded_gitlink
File "scripts/repo_shape.py", line 832, in git_out
FileNotFoundError: [Errno 2] No such file or directory: 'git'
manifest ok: Atlas (atlas), 3 legs
validate-manifest.py, no git: exit 0
Why.
_check_gitlink_matches_pin(templates/assembly-root/scripts/validate-pins.py:181at 3ae0109) asksrecorded_gitlink, which runsgit_out(scripts/repo_shape.py:831, the root's pinned copy).git_outcallssubprocess.run(["git", ...]), which raisesFileNotFoundErrorwhen there is no git to run.recorded_gitlinkcatches onlyRefusal(scripts/repo_shape.py:1016), and so does the validator'smain(validate-pins.py:826), so the exception leaves as a traceback, exit 1.validate-manifest.pyruns no git and passes.- The doctor on such a machine quotes the traceback in its
pinsrow:reports a finding (exit 1): FileNotFoundError: ...on main, andcrashed before reaching a verdict (exit 1): FileNotFoundError: ...at PR shape-doctor.py: a validator that crashed says it crashed instead of "reports a finding", and is CANNOT ANSWER when it is the standard's template, which a standard whose path holds thePYTHONPATHseparator no longer runs at all; a neutral product's digestvalidate-pins.pyskipped is anotenaming the product, from a child that can no longer reachghor a proxy; and a root whose manifest does not load and whosescripts/repo_shape.pyis gone is told to restore that file before its gate (#278, #297, #298) #357's head 8ad856f (both run).
What it should do. validate-pins.py never exits 1 because git could not be run. The decisions are the author's:
- Where.
- In this validator, catching
OSErroraround its git-reading checks and refusing with exit 2, as validate-family.py's default and--pinsmodes end in aFileNotFoundErrortraceback, exit 1 (a finding's code), when git is not on PATH: on main for every holder with a member (recorded_gitlinkthroughrepo_shape.git_out), and after #317 still for a holder whose.gitmodulesis gone, though #317's own check answersgitmodules-unreadable, exit 2, whenever the file is there #368's fix does invalidate-family.py. - Or in
git_out, which fixes every caller in every tool at once.recorded_gitlink'sexcept Refusal: continuewould then read a missing git as "no gitlink recorded" and report a falsepin-gitlink-absent, so the refusal has to get past that clause (a code it re-raises, or a type of its own). That is validate-family.py's default and--pinsmodes end in aFileNotFoundErrortraceback, exit 1 (a finding's code), when git is not on PATH: on main for every holder with a member (recorded_gitlinkthroughrepo_shape.git_out), and after #317 still for a holder whose.gitmodulesis gone, though #317's own check answersgitmodules-unreadable, exit 2, whenever the file is there #368's own decision 2.
- In this validator, catching
- One code for the two gates, the one validate-family.py's default and
--pinsmodes end in aFileNotFoundErrortraceback, exit 1 (a finding's code), when git is not on PATH: on main for every holder with a member (recorded_gitlinkthroughrepo_shape.git_out), and after #317 still for a holder whose.gitmodulesis gone, though #317's own check answersgitmodules-unreadable, exit 2, whenever the file is there #368's fix chooses, so that a project and a holder say the same thing. - Landing. Both files are pinned copies, so the change reaches existing roots through
update-shape.pyasupstream-changed. Lane 2's open PR update-shape.pyread_pinrefusesupdate-pin-row, and the pinned validate-pins.py and validate-family.py reportshape-pin-row, when a shape pin'sfiles:is not a list, sofiles: 5,trueor1.5no longer endscheck,apply, shape-doctor.py and the project's own validator inTypeError: ... is not iterable(#290) #343 edits this file (_check_shape_pin), so it is a textual neighbour.
How to test. In process, as #368's test does: patch the validator module's git runner to raise FileNotFoundError, changing no PATH, so the test means the same on every OS. Assert exit 2, the refusal's code, and no traceback.
Verified at main 3ae0109 (templates/assembly-root/scripts/validate-pins.py sha256 cc3484bf…, scripts/repo_shape.py 80de36c9…).
Related: #368 (validate-family.py, in progress in this lane), lane 2's PR #343 (edits this file), #359 (this file's other traceback, on a workflow that is not UTF-8), #292 (the same git_out, decoding strictly), #278 / PR #357 (how the doctor reports a validator that crashed).
Activity
brettheap commentedon Oct 12, 2026
CLAIMED — lane openRepoShape-4, session bf1c72df-1c56-4ac9-aace-3ddd139d7ea3@Eagle, 2026-10-12T18:08:25Z, for #412
Logged in
lanes/log/openRepoShape-4.mdat5dde99dbfaef7464c461009aead24ff2ae009e6f.The three reads (lane-collision-protocol Rule 1):
validate-pins.py: a `git` that exists but cannot be executed (`ENOEXE…
validate-family.py: a gitlink in `members/` or a `.gitmodules` sectio…
Merge origin/main 75052cb into fix/adopt-root-kept-symlinks: #188's r…
Merge main 75052cb into fix/adopt-plan-quote-yaml-keywords (#181)