Give every trail a permanent number in trail-numbers.txt, and check it is only appended to

The Saved page's short links will be bit sets over these numbers, so a number
must never change or be reused. The registry is one id per line, seeded
alphabetically; build_index appends new records; the validator fails on a
record with no line, a repeated id or a malformed line; check_history fails
when an earlier line is changed, moved or removed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-19 15:19:50 -07:00
1 parent 6440e43176
commit 358f0c4928
10 files changed
+580 -7

No files matched your search

+6
View File
@@ -53,6 +53,11 @@ spec = importlib.util.spec_from_file_location(
trail_history = importlib.util.module_from_spec(spec)
spec.loader.exec_module(trail_history)
spec = importlib.util.spec_from_file_location(
"trail_numbers", os.path.join(ROOT, "tools", "trail_numbers.py"))
trail_numbers = importlib.util.module_from_spec(spec)
spec.loader.exec_module(trail_numbers)
spec = importlib.util.spec_from_file_location(
"check_datafiles", os.path.join(ROOT, "tools", "check_datafiles.py"))
check_datafiles = importlib.util.module_from_spec(spec)
@@ -928,6 +933,7 @@ def main():
check_left_out(ROOT, trails, errors)
check_datafiles.check_datafiles(ROOT, trails, errors)
trail_numbers.check(ROOT, trail_ids, errors)
for dirpath, dirnames, filenames in os.walk(ROOT):
if ".git" in dirpath: