fix(521): reciprocity covers archive<->archive pairs; skip topic-file Contents heading

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-21 11:14:00 +02:00
co-authored by Claude Opus 4.8
parent 7bdb83fb16
commit ab2d80b47a
2 changed files with 45 additions and 2 deletions
+5 -2
View File
@@ -17,7 +17,7 @@ from pathlib import Path
import scripts.decisions_lib as dl # noqa: E402 (run with PYTHONPATH=. or as module)
SKIP_HEADINGS = {"Index", "Active catalog"}
SKIP_HEADINGS = {"Index", "Active catalog", "Contents"}
REQUIRED_META = ("key", "status", "since", "supersedes", "superseded_by")
EDIT_TOKEN = "[decisions-edit]" # noqa: S105 (a commit-message marker, not a credential)
@@ -77,11 +77,14 @@ def validate(
if r.key:
by_key[r.key] = r
# reciprocal supersession (successor may live in active OR archive)
# reciprocal supersession (successor/predecessor may live in active OR archive). Runs over the
# union of active + archive records so a twice-reversed decision (an archived record whose
# superseded-by points to ANOTHER archived record) is checked from both sides too.
for r in decision_recs:
if r.status == "active" and r.superseded_by not in (None, "", "none"):
errs.append(f"{r.heading}: active record cannot already be superseded (superseded-by set)")
for r in decision_recs + list(archive_records):
sk = _key_of(r.superseded_by)
if sk:
if sk not in known_keys: