Skip to content

v0.11.6 — Fix cross-doc link integrity (H1 + H3 from MD audit)#102

Merged
jonathan-pap merged 1 commit into
mainfrom
fix/cross-doc-links
Apr 28, 2026
Merged

v0.11.6 — Fix cross-doc link integrity (H1 + H3 from MD audit)#102
jonathan-pap merged 1 commit into
mainfrom
fix/cross-doc-links

Conversation

@jonathan-pap
Copy link
Copy Markdown
Owner

Summary

Closes the two High-severity findings from the markdown-docs quality audit run via `/sc:analyze markdown docs`:

H1 — Broken `Sources.md` link in Model.md §3.3

The link href was the empty fragment `#`, scrolling to top-of-page on every render target (ADO Wiki, GitHub, dashboard) instead of jumping to the Sources companion doc.

Fix: `Sources.md` → `Sources.md` (`md-generator.ts:864`).

H3 — Index.md was a dead-end glossary

Every glossary entry rendered as bare `\code\\` text with no link to where the entity is fully documented. The Index doc is meant as a navigation hub.

Fix: every kind now wires through `xref()`:

Kind Links to Anchor source
Table / Calc group `DataDictionary.md` per-table heading (`### ${tbl.name}`)
Measure `Measures.md` existing `` (line 1212)
Column `DataDictionary.md` parent table (no per-column anchor today)
UDF `Functions.md` doc-level (no per-UDF anchor today)
Calc item `CalcGroups.md` parent calc group

Defence in depth

`xref(text, doc, "")` (empty anchor) used to silently emit `text` — same regression class as H1. Now emits `text` with no fragment.

Tests (267 → 276)

  • 8 new "no empty-fragment links" guards — one per generated doc (Model / Measures / Functions / CalcGroups / DataDictionary / Sources / Pages / Index). Catches `text` and `text` patterns.
  • 1 new Index cross-link assertion — asserts at least one link into `Measures.md` and one into `DataDictionary.md`. Without it the glossary regresses.

Test plan

  • `npm test` — 276/276 pass
  • `npm run build:browser` — `docs/index.html` rebuilt
  • After merge, hard-refresh the live demo, load the sample, open the Documentation tab → Index → confirm entries link to companion docs and tab-switch correctly

Out of scope

The audit's Medium / Low findings (Improvements `items` for Auto-Date and Field Parameters; anchor uniqueness for duplicate measure / page names; 300 lines of dead Mermaid helper code) are tracked but not in this PR.

🤖 Generated with Claude Code

Two findings from /sc:analyze on the generated MDs, shipped together
because the test extension covers both regressions.

H1 — Model.md §3.3 emitted [Sources.md](#) — link href was the empty
fragment '#', scrolling to top instead of jumping to Sources.md.
Now correctly emits [Sources.md](Sources.md).

H3 — Index.md was a dead-end glossary; entries rendered as bare
`code` text with no link to where the entity is fully documented.
Now wires through xref():
  Tables / Calc groups → DataDictionary.md#<table>
  Measures             → Measures.md#<measure> (existing <a id>)
  Columns              → DataDictionary.md#<parent-table>
  UDFs                 → Functions.md (doc-level)
  Calc items           → CalcGroups.md#<parent-cg>

Defence in depth — xref() now handles empty anchor as
"[text](Doc.md)" without "#"; previously it silently emitted
"[text](Doc.md#)" — same regression class as H1.

Tests: +9 (267 → 276)
  - 8 "no [text](#) or [text](Doc.md#)" guards, one per generated doc
  - 1 Index.md cross-link assertion (≥1 Measures.md, ≥1 DataDictionary.md)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jonathan-pap jonathan-pap enabled auto-merge (squash) April 28, 2026 05:17
@jonathan-pap jonathan-pap merged commit ecb8640 into main Apr 28, 2026
3 checks passed
@jonathan-pap jonathan-pap deleted the fix/cross-doc-links branch April 28, 2026 05:18
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