feat(610): generated where-did-it-go index on each stripped file

Live docs point into the corpus BY DATE -- "see `decisions.md` 2026-07-10" --
about 32 such references across 12 files, plus the same form in historical issue
comments. The split would dangle every one of them.

Each stripped file now ends with a generated "Records formerly in this file"
index: date, title, and a link to the record's new path. A reader following a
date pointer lands on the file it names and resolves from there. That is far
cheaper and less error-prone than rewriting 32 references by hand, and it also
covers the issue-comment breadcrumbs, which cannot be rewritten at all.

Caught while verifying it: the generated `## Records formerly in this file`
heading is itself an H2, so the record parser counted one legacy-unmigrated
record per stripped file -- the notice went 0 -> 6. Same treatment as the
existing `## Index` section: skip it by name. SKIP_HEADINGS moved to
decisions_lib as the single source of truth, since three modules now need it.

Found by reading the validator's notice output on a trial migration, not by
inspection -- the corpus still validated OK, so nothing else would have flagged it.
This commit is contained in:
2026-07-25 19:08:58 +02:00
parent 8ec1f527e4
commit 64b65fd2db
4 changed files with 38 additions and 4 deletions
+4
View File
@@ -30,6 +30,10 @@ TOPIC_DIR = REPO_ROOT / "docs" / "decisions"
ARCHIVE_DIR = TOPIC_DIR / "archive"
RECORDS_DIR = TOPIC_DIR / "records" # split layout (#610): one YAML-frontmatter record per file
# H2 headings that are document structure, not decision records. "Records formerly in this file"
# is the generated where-did-it-go index the #610 split appends to each stripped file.
SKIP_HEADINGS = {"Index", "Active catalog", "Contents", "Records formerly in this file"}
STATUSES = {"active", "superseded", "retired", "legacy-unmigrated"}
KEY_RE = re.compile(r"^[a-z0-9]+(\.[a-z0-9-]+)+$")
_HEADING_RE = re.compile(r"^##\s+(.*\S)\s*$")