Skip to content

devBenches/base-image: re-vendor openRepoShape at 3d46ab5 — --doctor renamed --preflight, a new --doctor [<path>] compliance check, bare usage, --install's machine report - #42

Merged
brettheap merged 1 commit into
mainfrom
chore/revendor-openreposhape-3d46ab5
Sep 11, 2026
Merged

brettheap merged 1 commit into
mainfrom
chore/revendor-openreposhape-3d46ab5

Conversation

@brettheap

@brettheap brettheap commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openreposhape-2 (openRepoShape-2)
Claim: #41 (comment)

Closes #41.

What lands. devBenches/base-image/upstream-pin.yaml's openreposhape source moves from 0fa73b7df704266589dcc27afca020c0127fa36f (pinned in #34, carried by #39) to 3d46ab590351797f7570946aab422a940b44fded — gh api repos/opensoft/openRepoShape/compare/main...3d46ab590351797f7570946aab422a940b44fded -q .status says identical, so it is the commit main carries (PR opensoft/openRepoShape#96, merged as this exact sha, closing opensoft/openRepoShape#95). The tool does not change — one apply run and nothing else.

Upstream, between the two commits (opensoft/openRepoShape#96, squash-merged to one commit on main, seven commits on its own branch per the PR's account):

  • The machine check's variable and flag are renamed DOCTOR/--doctor -> PREFLIGHT/--preflight, freeing --doctor for the next point.
  • --doctor [<path>] is a new mode: shape-doctor.py answers whether an arbitrary repository is compliant with the shape and prints one verdict (COMPLIANT / COMPLIANT, SHAPE BEHIND / DRIFTED / INVALID / NOT A SHAPE ROOT / CANNOT ANSWER). The shim runs it from beside itself when there is a checkout there, else clones the standard into a temporary directory first (deliberately not --depth 1 — the shape-currency row needs more than one commit to compare against). A set_mode guard REFUSES --doctor <path> --install typed together rather than silently dropping one (a review-round fix).
  • --install ends with a read-only machine: report — git, gh (and whether it's logged in), python3, git-filter-repo — each present/MISSING, pointing at --preflight when something is short. It installs nothing and never changes --install's exit code.
  • A bare openRepoShape (no arguments at all) now prints usage and exits 1, instead of falling through into the scaffold path and refusing "no organisation." Any scaffold argument at all keeps today's behaviour, refusals included; --help still exits 0.
  • README, handbook, AGENTS.md and a 23-test suite document and cover all of the above, plus two review rounds (Copilot findings, then an adversarial pass) fixing nine and five defects in shape-doctor.py — none of it reaches the shim surface further.

The apply run, verbatim:

$ python3 devBenches/base-image/update-upstream.py apply --source openreposhape --at 3d46ab590351797f7570946aab422a940b44fded --yes
source      openreposhape (opensoft/openRepoShape)
pinned      0fa73b7df704
target      3d46ab590351 (on main)
vendor      files/openreposhape

  take      openRepoShape  6efcd6142eed
  unchanged templates/assembly-root/project.yaml
  re-pin    commit 0fa73b7df704 -> 3d46ab590351

  wrote     files/openreposhape/openRepoShape  0755
  wrote     files/openreposhape/templates/assembly-root/project.yaml  0644
  re-pinned devBenches/base-image/upstream-pin.yaml  2 row(s) at 3d46ab590351

NEXT  python3 devBenches/base-image/update-upstream.py check

templates/assembly-root/project.yaml comes back unchanged — confirmed from a run, not from reasoning: it is byte-identical to the source at both the old and the new pinned commit (diff <(git -C ~/projects/openRepoShape show 0fa73b7:templates/assembly-root/project.yaml) <(git -C ~/projects/openRepoShape show 3d46ab5:templates/assembly-root/project.yaml) is empty). Only openRepoShape itself changed upstream, and only it is taken.

No stale --doctor text. --doctor meant "check this machine" in this repository's own words before opensoft/openRepoShape#96 renamed that to --preflight upstream. A full-repo search — grep -rn -- '--doctor\|--preflight' setup.sh devBenches/base-image/Dockerfile devBenches/devcontainer.test/*.sh README.md docs, and again over scripts/setup-estate-commands.sh and devcontainer.test/*.sh (the host-install script and its test, #40) — found no matches anywhere outside the vendored copy itself, both before and after this branch's apply. Nothing in this repository's own scripts, Dockerfile, tests or docs names either flag, so there is no text to fix beyond the vendored file apply already replaced.

Proofs, all run on this branch's HEAD.

Run Result
update-upstream.py check exit 0, 5 rows across 2 sources (openreposhape: openRepoShape, templates/assembly-root/project.yaml; openrepotools: openRepoTools, park, resume)
update-upstream.py list exit 0, both sources named with their commits and vendor dirs
test-speckit-git-feature.sh 56/56 GREEN, exit 0
test-speckit-git-compat.sh 22/22 GREEN, exit 0
test-openspeckit-bootstrap.sh 742 PASS / 0 FAIL, GREEN, exit 0
devcontainer.test/test-setup-estate-commands.sh (setup.sh's host install, #40) 76/76 GREEN, exit 0
git diff --stat 2 files: upstream-pin.yaml, files/openreposhape/openRepoShape — no tool change, no Dockerfile change, templates/assembly-root/project.yaml untouched

The vendored shim diffs clean against the source at the pinned commit (local mirror clone ~/projects/openRepoShape at 3d46ab5, clean):

  • diff <(git -C ~/projects/openRepoShape show 3d46ab5:openRepoShape) devBenches/base-image/files/openreposhape/openRepoShape — empty
  • diff <(git -C ~/projects/openRepoShape show 3d46ab5:templates/assembly-root/project.yaml) devBenches/base-image/files/openreposhape/templates/assembly-root/project.yaml — empty (byte-unchanged, as apply itself reported)

Not proven here: the image. dev-bench-base carries the new shim only after its next rebuild — not run in this PR. The command that proves it, per #34/#39's precedent:

cd devBenches/base-image && ./build.sh
docker run --rm <tag build.sh printed> sh -c \
    'for c in openRepoShape openRepoTools park resume; do command -v "$c"; done
     openRepoShape --help | head -5'

Not here. The base-image rebuild above, and the Eagle host reinstall — already done per Brett Heap's word (2026-09-10: "merge it when green, then re-vendor and reinstall on Eagle").

🤖 Generated with Claude Code

Summary by Sourcery

Re-vendor openRepoShape at the current upstream commit to expose its expanded compliance and diagnostics behavior.

New Features:

  • Update the vendored openRepoShape utility to provide repository compliance checks, renamed preflight checks, installation diagnostics, and clearer bare-command usage.

Bug Fixes:

  • Prevent conflicting doctor and install modes from being silently combined.

Enhancements:

  • Re-vendor openRepoShape at commit 3d46ab590351 and update its recorded checksum while retaining the unchanged assembly template.

Tests:

  • Validate the updated vendored tool and upstream pin against the repository's existing integration and compatibility test suites.

…` renamed `--preflight`, `--doctor [<path>]` becomes the compliance check, bare usage, `--install`'s machine report (#41)

`update-upstream.py apply --source openreposhape --at 3d46ab590351797f7570946aab422a940b44fded --yes`, taking opensoft/openRepoShape#96 (closes opensoft/openRepoShape#95) from the previously pinned `0fa73b7df704266589dcc27afca020c0127fa36f`.

- `files/openreposhape/openRepoShape` — taken; byte-identical to `git -C ~/projects/openRepoShape show 3d46ab5:openRepoShape`. The machine check's variable and flag are renamed `DOCTOR`/`--doctor` -> `PREFLIGHT`/`--preflight`; `--doctor [<path>]` is a new mode running `shape-doctor.py` (beside the shim when there is a checkout, else a temporary clone) with a `set_mode` guard refusing two modes typed together; `--install` ends with a read-only `machine:` report (git/gh/python3/git-filter-repo, each present/MISSING, never changing the exit code); a bare run with no arguments now prints usage and exits 1 instead of falling into the scaffold path.
- `files/openreposhape/templates/assembly-root/project.yaml` — unchanged (`apply` reports it `unchanged`; also confirmed byte-identical against the source at both the old and new pinned commit).
- `devBenches/base-image/upstream-pin.yaml` — re-pinned to `3d46ab590351797f7570946aab422a940b44fded`.

`update-upstream.py check` — exit 0, 5 rows across both sources. A full-repo search for this repository's own `--doctor`/`--preflight` text (setup.sh, the Dockerfile, both devcontainer test trees, README, docs, `scripts/setup-estate-commands.sh`) found nothing outside this vendored file, so no other text changes.

Lane: openreposhape-2 (openRepoShape-2)
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 11, 2026 01:17
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@sourcery-ai

sourcery-ai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR updates the base-image vendor of openRepoShape from 0fa73b7 to 3d46ab5, replacing only the shim and corresponding pin metadata; the upstream shim adds compliance diagnostics, renames the machine preflight mode, reports install prerequisites, and handles bare invocation explicitly. Repository-level checks and vendored-file comparisons pass, but the base-image rebuild and resulting container verification remain outstanding.

Sequence diagram for openRepoShape doctor compliance check

sequenceDiagram
    participant User
    participant Shim as openRepoShape
    participant Checkout as LocalCheckout
    participant Temp as TemporaryClone
    participant Doctor as shape-doctor.py

    User->>Shim: --doctor [path]
    alt checkout beside shim exists
        Shim->>Checkout: run shape-doctor.py
        Checkout-->>Doctor: repository path
    else no checkout beside shim
        Shim->>Temp: clone standard shape
        Temp-->>Doctor: repository path
    end
    Doctor-->>Shim: COMPLIANT / COMPLIANT, SHAPE BEHIND / DRIFTED / INVALID / NOT A SHAPE ROOT / CANNOT ANSWER
    Shim-->>User: verdict
Loading

Flow diagram for openRepoShape mode selection

flowchart TD
    Start["openRepoShape invocation"] --> Args{"Arguments present?"}
    Args -->|No| Usage["Print usage and exit 1"]
    Args -->|Yes| Mode{"Selected mode"}
    Mode -->|--help| Help["Print help and exit 0"]
    Mode -->|--doctor path| Doctor["Run repository compliance check"]
    Mode -->|--preflight| Preflight["Check machine prerequisites"]
    Mode -->|--install| Install["Install shape and print machine report"]
    Mode -->|Scaffold arguments| Scaffold["Run scaffold behavior"]
    Doctor --> Guard{"--install also supplied?"}
    Guard -->|Yes| Refuse["Refuse conflicting modes"]
    Guard -->|No| Verdict["Print one compliance verdict"]
Loading

File-Level Changes

Change Details Files
Re-vendor the openRepoShape shim and update its pinned upstream metadata to commit 3d46ab5.
  • Replace the vendored executable with the upstream version containing the renamed --preflight check, new --doctor compliance mode, install machine report, and bare-invocation behavior.
  • Update the upstream commit and executable checksum while retaining the unchanged template checksum.
devBenches/base-image/files/openreposhape/openRepoShape
devBenches/base-image/upstream-pin.yaml

Assessment against linked issues

Issue Objective Addressed Explanation
#41 Re-vendor openRepoShape from commit 0fa73b7df704266589dcc27afca020c0127fa36f to 3d46ab590351797f7570946aab422a940b44fded, updating the recorded checksum while leaving templates/assembly-root/project.yaml unchanged. ✅
#41 Include the upstream behavior changes in the vendored openRepoShape shim: rename the machine check from --doctor to --preflight, add the --doctor [] compliance mode with mode-conflict protection, add the --install machine report, and make bare invocation print usage and exit with failure. ✅
#41 Search repository-owned scripts, Dockerfiles, tests, and documentation for uses of --doctor in its former meaning and update any stale references. ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@brettheap
brettheap merged commit c38f9d0 into main Sep 11, 2026
12 checks passed
@brettheap
brettheap deleted the chore/revendor-openreposhape-3d46ab5 branch September 11, 2026 01:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Address the repeated --doctor argument handling and update the doctor help text.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Re-vendors openRepoShape at upstream commit 3d46ab5 and updates its integrity pin.

Changes:

  • Updates the upstream revision and SHA-256 digest.
  • Adds upstream doctor, preflight, usage, and install-report behavior.
File summaries
File Summary Review findings
devBenches/base-image/upstream-pin.yaml Records the new upstream revision and digest. None.
devBenches/base-image/files/openreposhape/openRepoShape Provides the updated CLI behavior. Moderate: repeated --doctor arguments overwrite the earlier path. Nit: help omits the CANNOT ANSWER verdict and its exit behavior.
Review details

Suppressed comments (1)

devBenches/base-image/files/openreposhape/openRepoShape:430

  • A second --doctor is accepted without any duplicate-argument check, so openRepoShape --doctor first --doctor second silently overwrites DOCTOR_PATH and diagnoses only second. Reject repeated doctor options (or at least a second path) instead of discarding the first repository requested.
		if [ $# -gt 0 ]; then
			case "$1" in
			-*) ;;
			*) DOCTOR_PATH="$1"; shift ;;
			esac
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +92 to +95
one row per check and ONE verdict: COMPLIANT, COMPLIANT SHAPE BEHIND, DRIFTED,
INVALID or NOT A SHAPE ROOT. It writes nothing, and every finding names the
command that fixes it. Exit 0 compliant, 1 findings, 2 not a shape root, 3
usage. Run beside a checkout of the standard it uses that one; run from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants