From 6691a58284e1daa3fd027b4ee31e955bea330a94 Mon Sep 17 00:00:00 2001 From: Rafael Richards Date: Sun, 10 May 2026 20:17:11 -0400 Subject: [PATCH] chore: refresh check-repo-meta.py docstring (Phase 0 closed) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Track A's canonical validator is live and stable, so the "while Track A is in flight; for now it carries an inline copy" framing in the docstring is stale. Reframe as "self-contained mirror — keeps make check-manifest runnable without an extra checkout or network detour while CI/smoke runs the canonical script against the published manifests." Same code, accurate framing. Also tightens the fallback-load message wording. --- tools/check-repo-meta.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tools/check-repo-meta.py b/tools/check-repo-meta.py index 4449273..d3ea0bb 100755 --- a/tools/check-repo-meta.py +++ b/tools/check-repo-meta.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Phase 0 manifest drift gate for dist/repo.meta.json. +"""Per-repo manifest drift gate for dist/repo.meta.json. Validates that: 1. The given manifest file parses as JSON and conforms to its @@ -9,10 +9,11 @@ Exits 0 on success; non-zero with structured stderr output on failure. -This is the per-repo local mirror of `.github/profile/build/validate-repo-meta.py` -(Track A / Phase 0 plan §2). Once the org-level validator is published, -this script may delegate to it via URL; for now it carries an inline -copy so the gate is self-contained. +Self-contained mirror of the canonical validator at +`.github/profile/build/validate-repo-meta.py`. Self-containment keeps +`make check-manifest` runnable without an extra checkout or network +detour while CI / smoke tests run the canonical script against the +published manifests. """ from __future__ import annotations @@ -30,15 +31,17 @@ def _load_schema(schema_uri: str, repo_root: Path) -> dict: - """Load the schema from URL or, if the canonical URL is unreachable, - fall back to a sibling .github checkout under the org parent dir.""" + """Load the schema from `schema_uri`. If the network is unavailable, + fall back to a sibling `.github` checkout under the same parent dir + (the canonical layout for a dev box with multiple m-dev-tools repos + checked out side by side).""" try: with urllib.request.urlopen(schema_uri, timeout=5) as resp: return json.load(resp) except Exception as e: # noqa: BLE001 sys.stderr.write( f"NOTE: could not fetch schema from {schema_uri} ({e}); " - "trying local fallback at ../.github/profile/repo.meta.schema.json\n" + "falling back to sibling .github checkout\n" ) fallback = repo_root.parent / ".github" / "profile" / "repo.meta.schema.json" if not fallback.exists():