Repository navigation
docs: repair the ADR-to-ADR citations the link gate could not see - #1524
Merged
Merged
Conversation
clean. It was clean only of the spelling it matched: an ADR cites a sibling as `(0530-slug.md)`, with no `adr/` segment, and one under `docs/adr/by-tag/` as `(../0530-slug.md)`. 237 of those resolved to no file. Making the segment optional finds them; admitting the bare form only for files under `docs/adr/` keeps `docs/research/`, which names its digests `NNNN-slug.md` too, from being read as broken ADR citations. The population inverts inside `docs/adr/`. For the qualified links the slug was usually the surviving half; here 196 of 237 carry a slug that names no ADR at all, leaving only the number -- and for 56 of those the number had been reallocated by the collision sweeps. Repairing them from the number would have pointed `[ADR-0033](0033-hip-applicability.md)`, cited in ADR-0315 as the precedent for fork-side GPU ports, at `codeql-config-moved-to-github`, and `[ADR-0009](0009-batch-a-upstream-port-strategy.md)`, cited there as the fork's demand-pull pattern, at the MCP server tool surface. That is the failure #1522 exists to prevent, arriving from the other direction. So a by-number repair now has to be corroborated by the target's own title and abstract, and the corroboration weighs the words that identify a decision over the words a family shares. The measurement that forces that weighting: `[ADR-0138 -- PSNR-HVS SIMD bit-exactness]` cited `0138-psnr-hvs-simd-bitexact`, and `0138-iqa-convolve-avx2-bitexact-double` does say "simd" and "bitexact" -- it is a sibling in that family, not the same decision, and it says nothing about PSNR-HVS. Counting shared words admits it; ranking `hvs` (3 ADRs) above `simd` does not. A third rule resolves a reordered slug from the slug half: `0335-sycl-adaptivecpp-second-toolchain` is `0407-adaptivecpp-second-sycl-toolchain` with two words swapped, and 0335 now belongs to an ADR about hardware capability priors. 181 links were repaired mechanically -- 35 by exact slug, 2 by reordered slug, 144 by corroborated number -- and 56 by hand: * 26 repaired against evidence. Some from the target's own text (ADR-0164 discusses the EOTF and cbrt LUT the citation names; ADR-0269 carries the barrier pattern; ADR-0161 is the only ADR that discusses the SSIMULACRA2 IIR blur). Some from `git log`: `0371-cambi-sycl-port.md` is now `0415-cambi-sycl-port.md`, and `0199-tiny-ai-netflix-training-corpus.md` is now `0242-...`, so those citations named the right decision before it moved. * 30 de-linked, because the cited ADR was never written under any number and the number now belongs to something else. The visible text is kept exactly, so the rendered prose is unchanged and only the hyperlink goes. ADR-0864, ADR-0867 and ADR-0979 are the clearest case: all three are cited as in-flight or proposed, and none landed. Two more were left de-linked rather than guessed -- ADR-0509 in ADR-0542, because that file already cites ADR-0514 on the next line, so the author meant a second ADR; and the PSNR-HVS citation in ADR-0918, because 0159 (AVX2) and 0160 (NEON) both carry the FP_CONTRACT pragma and the citation does not say which. Tests go from 16 to 24, covering the sibling form from both `docs/adr/` and its subdirectory, the research-digest exclusion, corroborated and uncorroborated number repairs, the filler-word floor, and reordered slugs beating both the number and each other. Two pre-existing MD013 violations in `0691-vmafx-drop-legacy-build-paths.md` and `0646-dnn-attached-multi-output.md` are wrapped: the files are touched here, and ADR-0141 makes a touched file lint-clean. Not fixed here, and recorded in `docs/state.md`: fifteen ADR numbers are cited for decisions nobody wrote. Writing them, or recording them as abandoned, is a separate job. Still unchecked by any gate: a citation where both halves agree and both name the wrong decision.
lusoris
force-pushed
the
fix/adr-sibling-links
branch
from
September 23, 2026 11:56
31ce609 to
e7c2cb1
Compare
#1524 left 30 citation sites as plain text on the finding that the cited ADR "was never written under any number". That finding was reached from the two halves of the filename -- a slug naming no ADR, a number naming an unrelated one -- and from a text match against the ADR that carries the number today. Both are too shallow, and 12 of the 30 were wrong. Searching the git history of the CITING commit settles what the filename cannot. ADR-0122 is the sharpest case and it was in this branch's own "never written" list: the citing sentence reads "fork PR #60 CUDA framesync hardening", and `d3b6fad62` is both PR #60 and the commit that created `0122-cuda-gencode-coverage-and-init-hardening.md`. The number was never reallocated. The slug had been minted from a docs/state.md bug-row label ("CUDA framesync segfault on null cubin"), and the ADR itself never uses the word "framesync" -- which is exactly why grepping the target for the slug's words dismissed it. Relinked, each from evidence rather than from either half of the name: * ADR-0122 x3 -> 0122-cuda-gencode-coverage-and-init-hardening.md (0156 x2, 0157). Number right, slug minted from a bug-row label. * ADR-0287 x2 -> 0293-vmaf-tune-saliency-aware.md (0326). The ADR is titled "vmaf-tune saliency-aware ROI tuning"; the citation calls it "saliency-aware encoding". * ADR-0568 -> 0569-sdk-version-bumps-2026-05-18.md (0603). The minted slug was `sdk-audit-2026-05-18` and the ADR's own title carries that date; it names ORT 1.26.0, vvenc and AMF seven times, which is what the citing sentence says it introduced. * ADR-0509 x2 -> 0514-dev-container-full-backend-exposure.md (0541, 0542). It is the only ADR that discusses unsetting VK_ICD_FILENAMES in the entrypoint, with 13 mentions. 0542 now cites 0514 twice, for two different aspects; that is redundant but true, which beats a dangling reference. * ADR-0125 -> 0127-vulkan-compute-backend.md (0216). The citation reads "<X> / ADR-0175 -- Vulkan backend framework"; ADR-0175 opens by naming ADR-0127 as the decision it implements, and ADR-0127 is the sole owner of Research-0004, the digest the sentence says already covers these patterns. * ADR-0125 -> 0125-ms-ssim-decimate-simd.md (0219). Same list shape as ADR-0918's, where the same number is used correctly for the same ADR. Number right, slug fabricated. * ADR-0138 -> 0138-iqa-convolve-avx2-bitexact-double.md (0584). * ADR-0138 -> 0159-psnr-hvs-avx2-bitexact.md (0918), keeping the descriptive label. 0160 is the NEON sibling and the citation does not disambiguate, but that harness is x86 by 4 mentions to 1. Nine citations stay plain text on purpose: their decision exists only in a commit message, a PR title or a docs/state.md row, and there is no ADR to point at -- linking them would invent an authority. ADR-0864 stays plain for a different reason: ADR-0980 explicitly distinguishes it from ADR-0866, so repointing there would erase the distinction the citing ADR is drawing. Found on the way and NOT fixed, because it is prose rather than a link: 0156-cuda-graceful-error-propagation-netflix-1420.md:215 credits the `is_cudastate_empty()` null-guards to ADR-0122 / ADR-0123, but those guards are upstream (b9309779f, 3071d7e) and are in no fork PR.
Merged
9 of 19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#1522 shipped a gate for
adr/NNNN-slug.mdlinks and reported the tree clean.It was clean only of the spelling it matched. An ADR cites a sibling as
(0530-slug.md), and one underdocs/adr/by-tag/as(../0530-slug.md)—neither carries the
adr/segment the pattern required, so 237 brokensibling links were invisible to it. Making the segment optional finds them;
admitting the bare form only for files under
docs/adr/keepsdocs/research/,which names its digests
NNNN-slug.mdtoo, from being read as broken ADRcitations.
The more important finding is what repairing them by number would have done.
Inside
docs/adr/the population inverts: 196 of the 237 carry a slug thatnames no ADR at all, leaving only the number — and for 56 of those the number
had been reallocated by the collision sweeps. Repairing from the number would
have pointed
[ADR-0033](0033-hip-applicability.md), cited in ADR-0315 as theprecedent for fork-side GPU ports, at
0033-codeql-config-moved-to-github.md,and
[ADR-0009](0009-batch-a-upstream-port-strategy.md), cited there as thefork's demand-pull pattern, at the MCP server tool surface. That is the failure
#1522 exists to prevent, arriving from the other direction: it resolves, reads
as authoritative, and is worse than the dead link it replaced.
So a by-number repair now has to be corroborated by the target's own title and
abstract, and the corroboration weighs the words that identify a decision over
the words a whole family shares. The measurement that forces that weighting:
[ADR-0138 — PSNR-HVS SIMD bit-exactness]cited0138-psnr-hvs-simd-bitexact,and
0138-iqa-convolve-avx2-bitexact-doubledoes say "simd" and "bitexact" — itis a sibling in that family, not the same decision, and says nothing about
PSNR-HVS. Counting shared words admits it; ranking
hvs(3 ADRs) abovesimddoes not.
A third rule resolves a reordered slug from the slug half:
0335-sycl-adaptivecpp-second-toolchainis0407-adaptivecpp-second-sycl-toolchainwith two words swapped, and 0335 nowbelongs to an ADR about hardware capability priors.
What was repaired
181 mechanically — 35 by exact slug, 2 by reordered slug, 144 by
corroborated number.
56 by hand, split:
discusses the EOTF and cbrt LUT the citation names; ADR-0269 carries the
barrier pattern; ADR-0161 is the only ADR that discusses the SSIMULACRA 2 IIR
blur). Some from
git log:0371-cambi-sycl-port.mdis now0415-cambi-sycl-port.mdand0199-tiny-ai-netflix-training-corpus.mdis now0242-…, so those citations named the right decision before it moved.the number now belongs to something else. The visible text is kept exactly, so
the rendered prose is unchanged and only the hyperlink goes. Two were left
de-linked rather than guessed: ADR-0509 in ADR-0542, because that file already
cites ADR-0514 on the next line so the author meant a second ADR; and the
PSNR-HVS citation in ADR-0918, because 0159 (AVX2) and 0160 (NEON) both carry
the FP_CONTRACT pragma and the citation does not say which.
Type
docs— documentation onlyChecklist
make format && make lintis green locally.meson test -C build. — n/a for a docs +scripts/ci/change; the checker's own suite is green (24 tests)./cross-backend-diffand the worst ULP is ≤ 2. — n/a, no code path touched..c/.cpp/.cu/.h/.hpp, it has the appropriate license header (seeCONTRIBUTING.md). — n/a, no new source file.!orBREAKING CHANGE:and the migration path is documented below. — not breaking.docs/adr/_index_fragments/<NNNN-slug>.md. — no ADR added; this implements the gate ADR-0221 and ADR-0386 already require.Bug-status hygiene (ADR-0165)
docs/state.mdupdated in this PR with a row —T-DOCS-ADR-SIBLING-LINK-DRIFT-2026-09-23, closed, recording the measurement,the fifteen ADR numbers cited for decisions nobody wrote, and what the gate
still does not check.
Netflix golden-data gate (ADR-0024)
assertAlmostEqual(...)score in the Netflix golden Python tests.Deep-dive deliverables (ADR-0108)
from the checker itself (the command below prints the same counts) and is
recorded in the module docstring and the
docs/state.mdrow.sees the sibling spelling or it does not; the one real choice — whether to
auto-apply an uncorroborated by-number repair — is settled by the 56 measured
mislinks and written up in the docstring.
AGENTS.mdinvariant note — no rebase-sensitive invariants: thistouches
docs/prose and onescripts/ci/checker, neither upstream-mirrored.changelog.d/fixed/adr-sibling-link-repair.md.no rebase impact: fork-local documentation and a fork-local CI script; no upstream-mirrored file is touched.Reproducer
Known follow-ups
0026, 0033, 0040, 0122, 0125, 0127, 0287, 0358, 0379, 0460, 0568, 0864, 0867,
0979. Several were cited as "in-flight" and never landed; their numbers now
belong to other decisions. Their citations are plain text here. Writing them,
or recording them as abandoned, is a separate job.
still unchecked by any gate. That needs review, not a parser — tracked as
T-STALE-ADR-CITATIONS-2026-09-16.