Repository navigation
shape-doctor.py: the pins row says "ok ... the project's own scripts/validate-pins.py passes" for a project that pins a neutral product though that validator SKIPPED the product's digest after a real gh api call, so the command documented to fetch nothing fetched from GitHub, and a digest nobody rechecked reads as ok under a COMPLIANT verdict #297
Description
Lane: openreposhape-4 (openRepoShape-4)
Found by this lane's adversarial review of the #272 fix (PR #274, head d7d6237; its out-of-scope item O2, where a doctor run over a scaffolded descendant logged three shim lines, one of them a gh api from the project's own validate-pins.py), and re-verified on main d94d155 (#232's squash) with a fresh scaffold, a clone and a doctor run, gh a shim that logs its argv and exits 97. It is pre-existing and not caused by any open branch. Not claimed: what a logged-in gh does here (the shim refuses; with a login the call would succeed, the digest would be recomputed from the forge's tree, and the row's text would be the same ok, but that was not run), and the other runners of the validator (below).
What is wrong. The doctor runs a project's own scripts/validate-pins.py with --root and nothing else (check_pins, shape-doctor.py:1126-1129). For a project that declares a neutral product (neutral_product_pins:) the validator looks for the product's tree offline (resolve_neutral_pin_source: --pin-source, SHAPE_PIN_SOURCE_<PRODUCT>, a checkout beside the assembly root; the doctor passes no --pin-source), and when none answers it runs gh api (validate-pins.py:494, tree_digest_from_gh, scripts/repo_shape.py:807); when that fails it prints a skip line and exits 0 (Report.skip, validate-pins.py:95-99). The doctor reads the exit code and throws the output away (code, quoted, _ = run_validator(...), shape-doctor.py:950; if code == 0: return Row(..., OK, f"{which} passes", ...), :953-954), so the skip cannot reach the row:
# $U: a clean checkout at d94d155. $A: the one commit of a stand-in for `openGlass` at $R/standin/openGlass, which is NOT beside the clone.
# gh is a shim first on PATH that appends its argv to $LOG and exits 97. The git environment is isolated.
python3 $U/scaffold-project.py --org MedxSoft --project MedxGlass --elected-by "Test Human" --elected-on 2026-09-02 \
--pin openGlass@$A --pin-source $R/standin/openGlass --local-remote-dir $R/remotes --work-dir $R/work
# exit 0, and $LOG still empty
git -c protocol.file.allow=always clone -q --recurse-submodules $R/remotes/MedxGlass.git $C
cd / && python3 $U/shape-doctor.py --root $C
# ok naming every leg name classifies, and each declared role agrees with its form
# ok manifest the project's own scripts/validate-manifest.py passes
# ok pins the project's own scripts/validate-pins.py passes
# ...
# n/a machine this machine is missing something the fixes above may need (setup-project.py --preflight, exit 1): [!!] this machine is not ready yet (see above).
# COMPLIANT (exit 0)
cat $LOG
# api repos/opensoft/openGlass/git/trees/4f258a8fef0a80b50aec88ce8d328be65917f48b?recursive=1 <- the project's own validate-pins.py
# --version <- the machine row (the other issue)
# auth status <- the machine row
cd $C && python3 scripts/validate-pins.py # the same validator, by hand: this is what the row threw away
# ok spec: gitlink == contracts/spec-pin.yaml commit 9378139459cd
# ...
# skip openGlass: pin commit 4f258a8fef0a digest NOT rechecked — no local checkout (gh-unreadable: `gh api` could not read opensoft/openGlass @ 4f258a8fef0a80b50aec88ce8d328be65917f48b: ). A --pin-source, SHAPE_PIN_SOURCE_OPENGLASS, or a checkout at ../openGlass beside this assembly root would verify it offline.
# pins ok exit 0So the one row the doctor is documented to keep offline made a network call, and the same row reports the pin as passing under a COMPLIANT verdict when its digest was not recomputed.
Why. Three statements say otherwise. The module docstring: it "never fetches", "runs the project's own validators, which are offline by their own contract", and machine is "THE EXCEPTION AND IT IS NAMED" (shape-doctor.py:21-33); check_machine: "THIS IS THE ONE ROW THAT CAN REACH A NETWORK ... nothing else in this command leaves the disk" (:3491-3495); AGENTS.md: the doctor "writes nothing into the repository and fetches nothing" (AGENTS.md:191). The validator's own docstring is the one that disagrees with "offline by their own contract" for neutral pins: "OFFLINE from a local checkout when one is findable (--pin-source, SHAPE_PIN_SOURCE_<PRODUCT>, or a checkout sitting beside this assembly root), else from gh api when gh is authenticated. Neither is available, this is a SKIP with a named notice, never a failure" (templates/assembly-root/scripts/validate-pins.py:29-38). The skip is by design and rightly never a failure for the validator; the doctor is the one that reads it as a pass and lets the child reach gh.
What it should do. The doctor makes no network call outside the machine row, and says when a pin was not rechecked. The decisions are the author's:
- Whether the child may reach
ghat all. The doctor cannot pass a flag the validator lacks (there is no--offline), and it runs the PROJECT's own pinned copy, which an older standard's copy would not have; that file changes only throughupdate-shape.py. So without touching the validator: run the child so thatghcannot answer (how is the author's call; a failingghfirst on the child's PATH is one way, andtree_digest_from_ghalready turns a failingghinto thegh-unreadableskip,scripts/repo_shape.py:807), or leave the child as it is and document a second exception in the three places above. - How a skip is reported. The doctor can read the child's stdout for the
skiplines the validator prints and keep them: the row staysokand says which pin was not rechecked, or its status becomesnoteorn/afor that part. The verdict does not move either way (AGENTS.md item 2: anoteis never a finding), which is the point; the row's text is where a reader learns the pin was not verified. - Whether the validator's exit-0-with-a-skip contract is itself what to change. It was ruled a skip on purpose ("this check must never punish the absence of what would answer it").
bootstrap.py, bump-leg.py and update-shape.py apply also run the validator with no source (the #272 review's O2); that is documented for the validator and is not claimed here.
How to test. The repro above under the shim. Today the log holds the api repos/... line and the row says passes. After the change the log has no api line (decision 1), or the row's text names the unrechecked pin (decision 2). In the suite: scaffold a descendant the way tests/test_scaffold_pin_and_reuse.py does (--pin openGlass@<sha> --pin-source <stand-in>), clone it, run the doctor with a stub gh that records its calls, and assert on the stub's log and on the row.
Related: #272 (PR #274: the same silent skip in two scaffold tests; its review's O2 is this), #296 (the doctor's tests reaching gh through the machine row: that one is about the tests, this one about the command), #275 and #295 (a --pin-source path holding =) (the other ways a pin's source is silently not found).
Activity
brettheap commentedon Oct 12, 2026
CLAIMED — lane openRepoShape-4, session 3431c370-df80-4c11-a041-41bce42d8b38@Eagle, 2026-10-12T11:07:27Z, for #297
Logged in
lanes/log/openRepoShape-4.mdatf08ba71d4278d48b1af167f7ee97be4029ec3052.The three reads (lane-collision-protocol Rule 1):
shape-doctor.py: the CANNOT ANSWER block prints `Remediation:` only f…
Merge origin/main (doctor A, #354) into fix/doctor-validator-cannot-run
Merge #357's head e44d860 (fix/doctor-validator-cannot-run) into fix/…
Merge origin/main dd8d0ea into fix/adopt-root-kept-symlinks: #261's `…