Repository navigation
Block ADRs that cite tickets, repo files or history - #312
Merged
thrawn01 merged 5 commits intoNov 22, 2026
Merged
Conversation
Rewrite this repo's ADRs to pass it, and have build workers review an ADR before committing it.
Catch relative and line-numbered paths, scheme-less repo links, PR numbers in words and Status lines naming a missing ADR. Stop flagging hex words, the repo's home page and images beside the ADRs. Keep Accepted on the two amending ADRs.
Read ./ paths in prose from the repo root, check footnote lines as prose, stop reading backticked numbers and the repo's home page as history, report a PR once, and catch raw file links. Tighten messages and comments, and record that ADR 0006 amends 0001 on both Status lines.
Report PR#14 and a backticked #12, allow the repo home page with a trailing slash, and stop reporting a lone ../ or an absolute path outside the repo.
A typo in -root made the check pass with nothing checked. A link definition for an image beside the ADRs was refused although the inline image passed.
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.
Intent
An ADR is for someone reading a decision years later. Ticket numbers, repo file paths, PR and commit citations and amendment history go stale or mean nothing to that reader. The rule against them existed only in writing, and ADRs committed during a build skipped the step that reviewed them. This PR adds a blocking check that a managed repo calls from CI, runs it on this repo, cleans up this repo's ADRs so they pass, and has build workers review an ADR before they commit it.
Fixes ENG-862
Surfaces
Workflow
.github/workflows/adr-check.yml(reusable,workflow_call)Command
make adr-check(runsgo run ./cmd/adrcheck)It exits 0 when every ADR under
<repo>/docs/adrpasses, 1 with one line per problem, and 2 on bad arguments.Skill
skills/build/SKILL.md, the "Leave existing ADRs alone" rule: before a worker commits a new ADR, a fresh sub-agent reviews it for history, implementation detail, whether the code meets it yet, references in any form, and a decision a test could prove.Behavior changes
An ADR like this one now fails the pull request:
It also fails an ADR that shares its number with another, links to an ADR that doesn't exist, or has a Status naming one.
ADR 0007,ADR-0008, relative links to other ADRs, outside URLs, the repo's home page, images beside the ADRs,SHA-256andUTF-8stay allowed. A Status may hold several lines, each an allowed form (AcceptedthenAmends ADR 0006).This repo's
testworkflow gains anadrjob that calls the reusable workflow at the commit under test, with keysENG,LOC.ADRs rewritten to pass, with no decision changed:
Amended by ADR 0006.linear.ticket/ENG-1/statusbecamelinear.ticket/<id>/status.Accepted,Amends ADR 0001,Amended by ADR 0019.Accepted. Amends ADR 0006, ...becameAcceptedandAmends ADR 0006, with the reason moved into Context.Concerns and risks
labels.go), a ticket or PR named in words ("pull request 5"), a second commit incommits a1b2c3d and e4f5a6b, andapi.github.comURLs. Known false positive:#1in prose ("the Launch a Claude build worker when a ticket moves to In Progress #1 cause").dispatch ask", and the "known holdout" and "debt" lines in 0011 and 0017. Telling an identifier that is the decision from one that isn't needs judgment, so I left them for you.adr-writeskill writesADR-NNNNand forbids ADR cross-references in prose. The check accepts bothADR 7andADR-0007and allows cross-references, as the ticket says, so the two disagree on cross-references.dispatch-refatmainruns the workflow and the check from different versions. The workflow's comment says to pass the same tag.adrjob is its first run. A fork PR's checkout of dispatch atgithub.shais untested. The build skill change was reviewed by a sub-agent but not run in a worker, since evals are paused.🤖 Generated with Claude Code