Skip to content

One command answers whether a repository is compliant with openRepoShape, and what is missing when it is not #95

Closed

Description

@brettheap

Lane: openreposhape-2 (openRepoShape-2)

What was asked

Brett Heap, 2026-09-10, in session:

what tools do we have to check a repo to make sure it is compliant with openRepoShape?

The answer today is: several, and none of them is the answer. A person
holding an arbitrary repository has to know that validate-repository-naming.py
classifies the three names, that the project's OWN scripts/validate-manifest.py
and scripts/validate-pins.py are the pinned gate, that update-shape.py check
is what says whether the copies have fallen behind the standard, that a family
holder runs scripts/validate-family.py instead of the first two, and that a
directory carrying none of those is not a shape root at all and wants
adopt-project.py plan or setup.sh. Five commands, one order, and the order
is tribal knowledge.

add that

What this issue is for

ONE command that takes an arbitrary repository and answers one question —
is this compliant with openRepoShape, and if not, what is missing — by
running the existing checks in sequence and printing ONE verdict.

It REIMPLEMENTS NOTHING. Every row is an existing validator or
update-shape.py's own verdict machinery; this is the sequence, the table and
the verdict, and nothing else.

The design, as the record

check-shape.py at the repository root (Python 3 standard library, like
update-shape.py), run from a checkout of the standard:

./check-shape.py [--root <path>] [--json]        # default --root .

It never fetches, never writes, and needs no gh: the upstream it compares a
project's copies against is THE CHECKOUT IT IS RUN FROM, which is what makes
the whole run offline.

Detection. Read the root: project.yaml with kind: project-manifest ->
PROJECT; family.yaml with kind: family-manifest -> FAMILY; neither ->
NOT A SHAPE ROOT.

PROJECT rows, in this order.

  1. naming — validate-repository-naming.py --project project.yaml
    semantics, against the standard's own contracts/repository-naming.yaml.
  2. manifest — the PROJECT'S OWN scripts/validate-manifest.py when it is
    there (it is the pinned copy, and that is the point), else the standard's
    template copy against the tree; the row says which was used.
  3. pins — the project's own scripts/validate-pins.py likewise: the
    lockstep invariant and the shape-copy digests.
  4. shape currency — update-shape.py check's per-file verdicts,
    summarised (n unchanged / n upstream-changed / n locally-modified / n both
    / n upstream-added), with the standard's commit against the pinned commit.
  5. legs — for each leg in project.yaml: mounted (gitlink present,
    directory populated) or not, and whether the checked-out commit equals the
    pin. No fetch.
  6. agent files — AGENTS-shape.md, AGENTS.md, CLAUDE.md present or
    absent at the root. They are shape copies, so rows 3 and 4 already digest
    them; this row is for a reader.

FAMILY rows. The holder's own scripts/validate-family.py;
update-shape.py check; each member in family.yaml — pinned copy under
members/<Project> present and detached at the pin — and whether a working
clone sits beside the holder (family.py siblings is what places one).

NOT A SHAPE ROOT. Classify the directory name (and origin's repository
name, if there is one) under the naming policy with --explain; report what
IS there (a .gitmodules? spec//code/? a contracts/?); and name the way
in — adopt-project.py plan --source <path> --project <Name> for an existing
repository, setup.sh for a new one. Exit 2.

Output. A table of rows, each ok / FINDING / n/a with a one-line
reason, and for every FINDING the exact next command — the house rule that a
refusal names its fix. Then ONE verdict line:

verdict when
COMPLIANT every row ok and the shape is current
COMPLIANT, SHAPE BEHIND (n upstream-changed, m upstream-added) valid, but the standard has moved
DRIFTED (n locally-modified or both) the project edited its own copies
INVALID (<which validator>) a validator went red
NOT A SHAPE ROOT neither manifest is there

--json emits the same as one object (rows + verdict + exit).

Exit codes, documented in the module docstring the way update-shape.py
documents its own: 0 compliant and current · 1 findings (behind, drifted,
invalid, a leg off its pin) · 2 not a shape root · 3 usage or environment.

The shim. openRepoShape --check [<path>]. Run from a file inside a
checkout of the standard it execs check-shape.py --root <path>; run from
stdin or installed it fetches a checkout of $OPENREPOSHAPE_REPO@$OPENREPOSHAPE_REF
the way setup.sh self-bootstraps one and runs it there, then cleans up.
--check takes no other flags. --install is untouched.

templates/ is UNTOUCHED. Acceptance: git diff --stat origin/main -- templates/ is empty. Nothing here may give an existing project an
upstream-changed row.

Docs. A README subsection under an existing ## (no new ## heading —
the handbook guard's tables map ## headings), the Layout block gains
check-shape.py, docs/handbook.html gains the matching region and its
footer is re-cut to git hash-object README.md, and AGENTS.md gains a short
"Checking a repository's compliance" section: when to run it, how to read the
verdict, that a FINDING names its fix and the agent runs THAT rather than
improvising, and that NOT A SHAPE ROOT means adopt or scaffold — the human
decides.

House rules

Per #92: one governing issue, one claim, a pull request (never a push to
main), commits with the lane trailer, templates/ proved untouched, and the
caps in tests/test_repo_hygiene.py moved with a dated docstring entry naming
this issue.

Activity

  1. brettheap commented on Sep 10, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openreposhape-2 (openRepoShape-2), session 8fa66b30-4cf5-4b80-b40c-ac3640cf45ab, 2026-09-10T22:54:50Z, for the whole of this issue, branch feat/check-shape.

    Reads before claiming:

    • gh issue view 95 --comments — no comments, nobody else on it.
    • gh pr list --repo opensoft/openRepoShape --state open — empty; no open pull request touches this.
    • git ls-remote --heads origin | grep -i check — fix/private-leg-checkout and neutral-pin-recheck-and-leg-gitignores only, neither of them this work; no feat/check-shape on the remote.

    Work happens in a linked worktree off origin/main at 0fa73b7; the shared checkout is another lane's and is never switched.

  2. brettheap commented on Sep 11, 2026

    @brettheap
    ContributorAuthor

    RULING 2026-09-10, Brett Heap, in session, superseding two names in the design above:

    lets use doctor for this, it is better fit. use preflight for the preflight.

    So, in PR #96:

    Everything else in the design stands: same rows, same registry, same verdicts, same exit codes, same --json, templates/ untouched. The branch is still feat/check-shape — it was cut and claimed before the ruling, and renaming a pushed branch under an open claim buys nothing.

    Three later additions, also on Brett's word and also in #96:

    1. the checks are a registry (id, applies_to, run(ctx) -> Row, and a fix slot that is None in every one of them) so the repair mode hangs off a slot rather than a rewrite; manifest validation is a second registry keyed by kind:, so a contracts/*.yaml nothing validates is a FINDING by name; a leg shape files row; and --json rows carry id;

    2. a read-only machine row, n/a by status so it can never move the verdict;

    3. add the two shim behaviours too

      — a bare openRepoShape prints its usage and exits 1, and --install ends with a read-only machine: block that installs nothing and changes no exit code.

    Recorded here rather than edited into the body above, so the sequence of decisions stays readable.

    Lane: openreposhape-2 (openRepoShape-2)

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