Skip to content

feat(readme): enforce anchor-ID convention + document .adoc bootstrap (ADR-004)#476

Merged
hyperpolymath merged 2 commits into
mainfrom
feat/readme-derive-idprefix-bootstrap
Jul 9, 2026
Merged

feat(readme): enforce anchor-ID convention + document .adoc bootstrap (ADR-004)#476
hyperpolymath merged 2 commits into
mainfrom
feat/readme-derive-idprefix-bootstrap

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Follow-up to #475 (merged). A finding from verifying the Phase C pilot on boj-server's real README.

The finding

A machine md → adoc conversion of a README with an intra-doc TOC produces dead TOC links: Asciidoctor's default section IDs are _prefixed_underscored while GitHub Markdown anchors are lowercase-hyphenated. So [Features](#features)link:#features[] points at #features but the heading's real ID is _features. The vocabulary gate cannot catch this — it checks words, not link targets.

Fix

  • readme-derive-reusable.yml — new Anchor-ID convention guard step: if the canonical .adoc has link:#… anchors but doesn't set :idprefix: (empty) and :idseparator: -, fail-and-tell before deriving.
  • ADR-004 — new Bootstrapping a canonical .adoc section: the mandatory idprefix/idseparator convention + the one-time md→adoc bootstrap recipe.

Verified end-to-end on boj-server (via containerised pandoc 3.10 + asciidoctor 2.0.26)

With the convention applied: 11/11 TOC anchors resolve, 12/12 badges intact (incl. Glama), proper h2/h3 nesting, vocab 98.7% — and the only "lost" tokens are AsciiDoc scaffolding (cols, options, idprefix, filecopyrighttext…), i.e. zero real prose lost. Blockquote + inline code (boj_*, {error, hint}) round-trip clean.

Unblocks the boj-server + profile-repo pilot PRs (which will be un-armed pending owner visual-check on Glama / the profile page).

🤖 Generated with Claude Code

…ADR-004)

Discovered while verifying the Phase C pilot on boj-server's real README:
a machine md->adoc conversion of a README with an intra-doc TOC produces
dead TOC links, because Asciidoctor's default section IDs are
'_prefixed_underscored' while GitHub Markdown anchors are
'lowercase-hyphenated'. The vocabulary gate cannot catch this (it checks
words, not link targets).

- readme-derive-reusable.yml: new 'Anchor-ID convention guard' step —
  if the canonical .adoc has link:#… anchors but does not set ':idprefix:'
  (empty) and ':idseparator: -', fail-and-tell before deriving.
- ADR-004: new 'Bootstrapping a canonical .adoc' section — the mandatory
  idprefix/idseparator convention + the one-time md->adoc bootstrap recipe,
  both verified end-to-end on boj-server (11/11 TOC anchors resolve, 12/12
  badges intact, >=98% vocab with only AsciiDoc scaffolding tokens 'lost').

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@hyperpolymath
hyperpolymath enabled auto-merge (squash) July 9, 2026 06:20
…rivation

Make derivation reproducible so the freshness check is trustworthy:
- Install step pins pandoc 3.10 + asciidoctor 2.0.26 + asciidoctor-reducer
  1.1.1 (was: floating apt/gem latest). The committed README.md must be
  generated by the same versions CI runs, or cosmetic toolchain drift would
  be misreported as staleness. Bump deliberately + regenerate; never float.
- Freshness check normalises (strip banner, trim trailing WS, squeeze blank
  runs) before diffing — belt-and-braces so a harmless whitespace nudge is
  not flagged, while real prose/structure/anchor changes still show.

Verified against boj-server's real README end-to-end: normalised body
byte-identical on re-derive, vocab 98.7%, anchor guard satisfied.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath disabled auto-merge July 9, 2026 08:33
@hyperpolymath
hyperpolymath merged commit 0c20c92 into main Jul 9, 2026
19 of 20 checks passed
@hyperpolymath
hyperpolymath deleted the feat/readme-derive-idprefix-bootstrap branch July 9, 2026 08:33
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