docs: REUSE.md introduced — reuse map (hub+website+scripts+manifests) + reuse_refs_check.py gate + consolidated cross-repo REPORT
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PSK5g6qYLknKj8u3QAFEr6
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
# Felhom scripts — Changelog
|
||||
|
||||
## reuse_refs_check.py — new gate: REUSE.md citation checker (2026-07-03)
|
||||
|
||||
Staleness defense for the new per-repo `REUSE.md` reuse maps. Takes repo roots as argv, extracts
|
||||
every cited `*.go/*.py/*.html/*.css/*.yml/*.yaml/*.sh` path (slash-containing tokens only — bare
|
||||
filenames are conventions, not citations), verifies each exists; prints offenders, non-zero exit on
|
||||
any missing path. Symbols are spot-verified by the reviewer, not this script.
|
||||
Usage: `python scripts/reuse_refs_check.py <repo-root> [...]`.
|
||||
|
||||
## felhom-host-install.sh v1.8.0 — install the guarded-mkfs wrapper (Impl-1 Part B) (2026-07-01)
|
||||
|
||||
Companion to felhom-agent v0.54.0 (format-safety foundation). During agent install, fetch + install the
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""REUSE.md refs check — staleness defense for the per-repo reuse maps.
|
||||
|
||||
Usage: python scripts/reuse_refs_check.py <repo-root> [<repo-root> ...]
|
||||
|
||||
For each repo root given, parses <root>/REUSE.md, extracts every cited file path
|
||||
(*.go, *.py, *.html, *.css, *.yml, *.yaml, *.sh) and verifies the file exists in
|
||||
the tree. Only slash-containing (repo-relative) tokens are checked — bare filenames
|
||||
are conventions, not citations. Prints offending lines; exits non-zero if any cited
|
||||
path is missing. Symbols are NOT checked here — those are spot-verified by the
|
||||
reviewer at file:line.
|
||||
"""
|
||||
import io, os, re, sys
|
||||
|
||||
# path-looking tokens ending in a checked extension; globs (*) are conventions, not refs
|
||||
PATH_RE = re.compile(r'[A-Za-z0-9_][A-Za-z0-9_./\-]*/[A-Za-z0-9_./\-]*\.(?:go|py|html|css|yml|yaml|sh)\b')
|
||||
|
||||
fails = 0
|
||||
|
||||
|
||||
def check_repo(root):
|
||||
global fails
|
||||
root = os.path.abspath(root)
|
||||
reuse = os.path.join(root, "REUSE.md")
|
||||
name = os.path.basename(root)
|
||||
if not os.path.isfile(reuse):
|
||||
print("FAIL [%s]: no REUSE.md at %s" % (name, reuse))
|
||||
fails += 1
|
||||
return
|
||||
seen, missing = set(), 0
|
||||
with io.open(reuse, encoding="utf-8") as f:
|
||||
for lineno, line in enumerate(f, 1):
|
||||
for m in PATH_RE.finditer(line):
|
||||
p = m.group(0)
|
||||
if "*" in line[max(0, m.start() - 2):m.end() + 2]:
|
||||
continue # glob like scripts/*.py — a convention, not a file ref
|
||||
if p in seen:
|
||||
continue
|
||||
seen.add(p)
|
||||
if not os.path.isfile(os.path.join(root, p)):
|
||||
print("FAIL [%s] line %d: cited path missing: %s" % (name, lineno, p))
|
||||
missing += 1
|
||||
if missing:
|
||||
fails += missing
|
||||
else:
|
||||
print("OK [%s]: %d cited paths, all exist" % (name, len(seen)))
|
||||
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print(__doc__)
|
||||
sys.exit(2)
|
||||
for r in sys.argv[1:]:
|
||||
check_repo(r)
|
||||
sys.exit(1 if fails else 0)
|
||||
Reference in New Issue
Block a user