chore: upgrade the neckbeard baseline from v0.1.1 to v0.3.1
Three minor releases at once. Byte-identical surface: only WORKFLOW.md actually changed (+128/-2); CLAUDE.md and the four templates are untouched. AGENTS.md takes the new upstream prefix (+22/-2) and keeps our project section unchanged. The two declared-extended files were reconciled by hand, because nothing compares them: validate.py gains upstream's check_vendored_portable, and schema.yaml gains vendored, project_section_marker, the judged link field and the ledger and verdict types. gen_status.py needed nothing — upstream did not touch it. Recorded in the new HERKUNFT.md, including that this reconciliation has no contradictor and will be forgotten next time. Newly adopted: check_harvest.py and judge.py, plus docs/ledger/ and docs/verdict/ with their templates. Deliberately not adopted: check_locked.py — pruefe_sperrliste.py has done that job here since 2026-08-20, and two tools for one rule is maintenance without gain. The v0.1.1 baseline stays where it is; docs/sources is immutable.
This commit is contained in:
@@ -161,6 +161,32 @@ def check_body_links(path: Path, body: str, root: Path, inbound: set) -> None:
|
||||
inbound.add(target)
|
||||
|
||||
|
||||
def check_vendored_portable(root: Path, vendored: list, marker: str) -> None:
|
||||
"""Files adopters hold byte-identical must carry no repo-relative link.
|
||||
|
||||
They are copied into repositories without this repo's docs/, so such a
|
||||
link resolves here and nowhere else — and the adoption path in
|
||||
AGENTS.md §5 asks for a byte-for-byte copy, which makes the dead link
|
||||
the adopter's problem and unfixable without breaking the copy.
|
||||
"""
|
||||
for rel in vendored or []:
|
||||
path = root / rel
|
||||
if not path.is_file():
|
||||
continue
|
||||
body = path.read_text(encoding="utf-8")
|
||||
if marker and marker in body:
|
||||
# Everything below the marker is the adopting project's own
|
||||
# section: never copied elsewhere, so its links are fine.
|
||||
body = body.split(marker, 1)[0]
|
||||
body = re.sub(r"```.*?```", "", body, flags=re.S)
|
||||
body = re.sub(r"`[^`\n]*`", "", body)
|
||||
for link in (m.group(1) for m in INLINE_LINK_RE.finditer(body)):
|
||||
if link.startswith(EXTERNAL_PREFIXES) or link.startswith("#"):
|
||||
continue
|
||||
err(path, f"vendored file carries a repo-relative link: {link} "
|
||||
f"— name the target instead of linking to it")
|
||||
|
||||
|
||||
def apply_rules(path: Path, rel: str, meta: dict, spec: dict) -> None:
|
||||
for rule in spec.get("rules", []):
|
||||
if rule == "superseded_requires_pointer":
|
||||
@@ -184,6 +210,9 @@ def main() -> int:
|
||||
link_fields = schema.get("link_fields", [])
|
||||
types = schema.get("types", {})
|
||||
inbound: set = set()
|
||||
|
||||
check_vendored_portable(root, schema.get("vendored", []),
|
||||
schema.get("project_section_marker", ""))
|
||||
wiki_pages: list[tuple[Path, dict]] = []
|
||||
|
||||
# Root documents: inline links must resolve; no frontmatter required.
|
||||
|
||||
Reference in New Issue
Block a user