Skip to content

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

Closed

Description

@brettheap

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 0

So 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:

  1. Whether the child may reach gh at 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 through update-shape.py. So without touching the validator: run the child so that gh cannot answer (how is the author's call; a failing gh first on the child's PATH is one way, and tree_digest_from_gh already turns a failing gh into the gh-unreadable skip, scripts/repo_shape.py:807), or leave the child as it is and document a second exception in the three places above.
  2. How a skip is reported. The doctor can read the child's stdout for the skip lines the validator prints and keep them: the row stays ok and says which pin was not rechecked, or its status becomes note or n/a for that part. The verdict does not move either way (AGENTS.md item 2: a note is never a finding), which is the point; the row's text is where a reader learns the pin was not verified.
  3. 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

  1. brettheap commented on Oct 12, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-4, session 3431c370-df80-4c11-a041-41bce42d8b38@Eagle, 2026-10-12T11:07:27Z, for #297

    Logged in lanes/log/openRepoShape-4.md at f08ba71d4278d48b1af167f7ee97be4029ec3052.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#297:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#297"`, kept where the row or its body names `#297`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `297` as a whole token:
       none
    
  2. added 3 commits that reference this issue on Oct 12, 2026
  3. added a commit that references this issue on Oct 12, 2026
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions