Repository navigation
Pins the ADR guard's two-line citation window - #455
Merged
Merged
Conversation
The ADR guard clears a finding when an ADR citation (or, for the ADR-0018 check, the ADR-0018-exempt marker) sits on the flagged line or on the line directly above it in the same hunk. Nothing pinned the upper edge of that window, and the moduledocs said only "on or above the line", which reads as any line above. - Mix.Statifier.AdrGuard's moduledoc and analyze/1's doc, and Mix.Tasks.Adr.Check's moduledoc, now state the window and where a citation must sit: a citation two or more lines above the flagged line, such as one above a defp head whose first body line is the flagged call, clears nothing. The window stays as it is; widening it changes what the gate accepts, which ADR-0011 leaves to a human (decided by the conductor under a standing consent, 2026-10-10). - Adds two tests to test/mix/statifier/adr_guard_test.exs: an ADR-0003 citation two lines above a receive does not clear the effects finding, and the ADR-0018-exempt marker two lines above a bead-id comment does not clear that finding. Carrying every earlier hunk line in parse_line/2's previous (a wider window) turns both red; restored from a copy, byte-equal. No guard behaviour changes. Gate tooling docs and tests; no changelog fragment. After the rebase onto main, full mix quality (mix gate.verify) and mix quality --profile merge ran green on this commit's tree (write-tree ef02975). Refs: st-djjm
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.
What
The ADR guard (
Mix.Statifier.AdrGuard) clears a finding when an ADR citation, or for the ADR-0018 check theADR-0018-exemptmarker, sits on the flagged line or on the line directly above it in the same hunk. This PR keeps that window exactly as it is, states it plainly in the guard's documentation, and pins its upper edge with tests.Mix.Statifier.AdrGuard's moduledoc andanalyze/1's doc, andMix.Tasks.Adr.Check's moduledoc, now say where a citation must sit: on the flagged line or the line directly above it. A citation two or more lines above clears nothing, for instance one written above adefp ... dohead whose first body line is the flagged call. The old wording, "on or above the line", read as any line above.test/mix/statifier/adr_guard_test.exsgains two tests: an ADR-0003 citation two lines above areceive dodoes not clear the effects finding, and theADR-0018-exemptmarker two lines above a bead-id comment does not clear that finding.No guard behaviour changes: the
lib/diff touches doc text and one comment only.Decision
The window stays at two lines. Widening it would change what the gate accepts, and ADR-0011 leaves that to a human (decided by the conductor under a standing consent, 2026-10-10: keep the window, document it, pin it with a test).
Sabotage
Each new test carries its
# sabotage:line. Mutation:parse_line/2carries every earlier line of the hunk inprevious, which widens the window to the whole hunk. Both new tests failed on their assertions (each returned[]instead of the finding), and no other test failed. The file was restored from a copy, byte-equal, and the suite is green again.Gate
Full
mix quality(mix gate.verify) andmix quality --profile mergeran green on the rebased head. The ADR judge skipped, because no file in this diff is in a judged ADR scope.No changelog fragment: gate tooling documentation and tests (
changelog.d/README.md).Review
Tier: gate (tooling docs and tests, under the size threshold, no contract surface). In-turn review: I checked each documentation claim against
cited?/1,bead_cited?/1andparse_line/2, and the ADR-0011 cite against that record's "human call" paragraph. No record underdocs/adr/is edited.