#!/usr/bin/env python3 """The reading order of the decision records: its topics are written here, its records are not. A number identifies a record and never changes, so the reading order is not the order of the numbers. It is the six topics `02-DECISIONS/README.md` writes down, in order, and each record's own topic. The records live in the knowledge base (ADR 0290, issue 426), which reads these lines through the records module and refuses a record whose topic is not one of them; the list of records under a topic is its answer to `knowledge-base.holds` with that topic, never stored here (ADR 0248, hq issue 297). python3 00-META/checks/index.py check It fails when the README's reading order is missing or names a topic twice, and when the README stores a list of records again — the index markers, or a line of a generated list. The last one is what keeps the conflict of issue 297 from coming back. Whether every record's topic is one of the six is the knowledge base's rule `topic`, judged when a record is proposed. """ import io import re import sys README = "02-DECISIONS/README.md" # A topic in the README's reading order, e.g. # 1. **What the mesh is** — `topic: the mesh`. What it is for, ... # The knowledge base (mesh-knowledge, reference.go) reads the same line, so the form is a contract. TOPIC_LINE = re.compile(r"^\d+\.\s+\*\*(?P