copy check: assets/contracts/ files equal their contracts source
/ crosscheck (push) Successful in 1s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDwfd6Ki8UfG4hK6W5YpJz
This commit is contained in:
2026-10-13 11:12:43 +09:00
parent 667678b9ae
commit 2e65f7550a
2 changed files with 19 additions and 1 deletions
+18 -1
View File
@@ -19,6 +19,8 @@ Exit status 1 when anything is found. Checks, and the source each one trusts:
binaries REPOS.md's row for a repo names every deployed [[bin]] in its Cargo.toml;
ORIN-RUNTIME.md names every service a repo deploys
frontmatter every docs/**/*.md starts with front matter whose type is known
copy a file under assets/contracts/<path> in any repo is byte-identical to
contracts' <path> (bundled copies, e.g. the app's checklists)
"""
import json
@@ -246,6 +248,21 @@ def check_frontmatter(ws: Workspace) -> None:
find(f"{repo}/{rel}", 1, "frontmatter", f"type '{t.group(1)}' is not one of {sorted(DOC_TYPES)}")
# ── bundled copies of contracts files ────────────────────────────────────────
def check_copies(ws: Workspace) -> None:
for repo in ws.repos:
for rel in ws.files[repo]:
if not rel.startswith("assets/contracts/"):
continue
src = rel.removeprefix("assets/contracts/")
if src not in ws.files["contracts"]:
find(f"{repo}/{rel}", 1, "copy", f"contracts has no {src} to copy")
elif (ws.root / repo / rel).read_bytes() != (ws.root / "contracts" / src).read_bytes():
find(f"{repo}/{rel}", 1, "copy", f"differs from contracts {src}; run tool/sync-contracts.sh")
def main() -> int:
root = Path(sys.argv[1] if len(sys.argv) > 1 else ".").resolve()
ws = Workspace(root)
@@ -253,7 +270,7 @@ def main() -> int:
if missing:
print(f"crosscheck: {root} lacks {', '.join(sorted(missing))}; nothing to check against", file=sys.stderr)
return 2
for check in (check_decisions, check_topics, check_docrefs, check_binaries, check_frontmatter):
for check in (check_decisions, check_topics, check_docrefs, check_binaries, check_frontmatter, check_copies):
check(ws)
for f in findings:
print(f)