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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user