Skip to content

docs(adr): expand numeric §N to section names in cross-ref link text - #605

Merged
alpergundogdu merged 1 commit into
mainfrom
claude/adr-expand-section-names
May 19, 2026
Merged

alpergundogdu merged 1 commit into
mainfrom
claude/adr-expand-section-names

Conversation

@alpergundogdu

@alpergundogdu alpergundogdu commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #600. Numeric section refs (§7, §2) silently break when sections get renumbered — #590's ADR 026 split already caused some. This expands the §N token in link display text to the target section's real name.

  • 146 links across 25 files rewritten: [ADR 026 §7](…#7-operator-economics-and-minimum-stake) → [ADR 026 § Operator economics and minimum stake](…#7-operator-economics-and-minimum-stake).
  • URL/anchor is untouched — the section name is resolved from the heading the existing anchor points to (anchor = source of truth), so every rewritten link still resolves. Pure display-text change.
  • Conservative & mechanical: only links whose text is exactly [ADR N ]§num (no trailing prose, ranges, or doc-top anchors).

Deferred to PR-B (stacked)

43 cases the script intentionally skipped + the rest of the policy:

  • trailing/range/multi (§7-§8, §2 Foo) — 27
  • lazy doc-top anchors (link points at the H1, not the subsection) — 15
  • one broken anchor (pre-existing)
  • bare prose §N, intra-doc §N, 27 §N inside code blocks
  • swap check-section-spacing → check-no-section-numbers (bans §\d corpus-wide including code blocks, since the drift fragility is identical there and a section name works in code even though a markdown link cannot)

Test plan

  • make -C adr check-refs → all green (anchors unchanged → md-anchors green; § Name is the blessed named form → section-spacing green)
  • markdownlint 0 errors on changed files
  • URLs byte-identical pre/post (only link text changed)
  • CI green

Numeric section refs (§7, §2) silently break when sections are
renumbered (#590 already caused some). Replace the §N token in link
DISPLAY TEXT with the target section's actual name, resolved from the
heading the link's anchor already points to — so the URL is untouched
and every rewritten link still resolves. 146 links across 25 files.

Conservative/mechanical: only links whose text is exactly
"[ADR N ]§num" (no trailing prose, ranges, or doc-top anchors). The
43 deferred cases (trailing/range/multi, lazy doc-top anchors, one
broken anchor) plus bare/intra/code-block §N and the guard swap to
ban §N corpus-wide are PR-B.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates cross-references across multiple Architecture Decision Records (ADRs) to use descriptive link text instead of generic section numbers, improving documentation readability. I have no feedback to provide.

@alpergundogdu
alpergundogdu merged commit fe35b87 into main May 19, 2026
13 checks passed
@alpergundogdu
alpergundogdu deleted the claude/adr-expand-section-names branch May 19, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant