Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions tools/substrate-claim-checker/fixtures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import { describe, expect, test } from "bun:test";
import { join } from "node:path";
import { checkFile as checkConvention } from "./check-convention.ts";
import { checkFile as checkCounts } from "./check-counts.ts";
import { checkFile as checkCrossSurface } from "./check-cross-surface.ts";
import { checkFile as checkExistence } from "./check-existence.ts";
Expand Down Expand Up @@ -107,3 +108,28 @@ describe("eval-set fixtures / path-form drift", () => {
]);
});
});

describe("eval-set fixtures / convention drift", () => {
test("convention-drift-no-reciprocal-marker.md — Supersedes-ADR claim with target lacking reciprocal '**Superseded by**' marker is detected", () => {
const result = checkConvention(join(fixtures, "convention-drift-no-reciprocal-marker.md"));
expect(result.ok).toBe(true);
// PR #3611 discipline applied to convention drift: pin exact
// finding count + claim line + target so a regression in either
// claim extraction or reciprocal-marker scanning cannot pass
// silently. The fixture pair is self-contained — the predecessor
// ADR support file lives as a sibling under fixtures/ so the
// 3-root resolution (fileDir / parentDir / repoRoot) finds it via
// fileDir without depending on any real repo ADR pair.
expect(result.findings.length).toBe(1);
const finding = result.findings[0]!;
// Body claim is on the line carrying `Supersedes ADR \`...\`` in
// the fixture; pinning the line catches regressions where the
// checker's logical-line scanner drifts off the physical line.
expect(finding.line).toBe(36);
expect(finding.target).toBe(
"tools/substrate-claim-checker/fixtures/_convention-drift-target-adr.md",
);
expect(finding.reason).toContain("not reciprocated");
expect(finding.reason).toContain("Superseded by");
});
});
1 change: 1 addition & 0 deletions tools/substrate-claim-checker/fixtures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ axis.
| existence drift | `existence-drift-missing-doc.md` | PR #1252 — verify-then-claim memo body table instance #8 (`future-domain memo references docs/courier-ferry-protocol.md` / doesn't exist) | backtick-quoted synthetic path resolves at no candidate root |
| path-form drift | `path-form-drift-bare-vs-qualified.md` | verify-then-claim memo **instance #15 / PR #1256** (adjacent ADR citations mixing fully-qualified with bare filename — path-form sub-class #6 of the 7-class list) — synthetic exemplar; instance #15's literal substance is captured in a follow-on fixture (B-0170.4.1) | same on-disk file referenced as both `check-counts.ts` and `tools/substrate-claim-checker/check-counts.ts` |
| cross-surface count drift | `cross-surface-drift-9-vs-15.md` | verify-then-claim memo **instance #19** — YAML frontmatter `description:` (and MEMORY.md index in the historical case) claimed "9 drift instances" while the body table already held 15 rows; check-cross-surface "any-table" semantics fire when zero body tables match the claim | frontmatter description claims "9 drift instances" vs 15-row body table — one finding |
| convention drift | `convention-drift-no-reciprocal-marker.md` (+ `_convention-drift-target-adr.md` support file) | PR #2512 (`feat(B-0170): add ADR supersession convention checker`) — synthetic exemplar covering the convention sub-class of the 7-class verify-then-claim taxonomy; the fixture pair makes the broken half of the bidirectional ADR convention reproducible without depending on any real ADR pair | "Supersedes ADR \`_convention-drift-target-adr.md\`" claim with target lacking the reciprocal "**Superseded by**" marker — one finding |

Add a new row when a new fixture lands.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
Eval-set fixture support file for substrate-claim-checker (B-0170.4).

This is the "predecessor ADR" half of the convention-drift fixture pair.
It is intentionally missing the top-of-file "**Superseded by**" marker
that `check-convention.ts` looks for when validating reciprocal ADR
supersession claims. The companion fixture
`convention-drift-no-reciprocal-marker.md` claims to supersede this
file; the absence of the reciprocal marker here is the convention
drift the checker is expected to surface.

The filename leads with `_` to signal "fixture support file, not a
top-level fixture itself" — same shape convention as a leading-dot
file but visible in `ls` output for review-thread legibility.
-->

# Predecessor ADR (fixture support file)

**Status:** Accepted.

## Decision

Synthetic ADR body — content is not meaningful; only the absence of a
"Superseded by" marker matters for the convention-drift fixture pair.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
Eval-set fixture for substrate-claim-checker (B-0170.4).

Reproduces the convention-drift pattern check-convention.ts surfaces —
a current ADR carries a "Supersedes ADR ..." claim but the predecessor
ADR file lacks the reciprocal top-of-file "Superseded by" marker. The
pair makes the broken half of the bidirectional ADR convention
empirically reproducible without depending on any real ADR pair in
the repo.

This is the fifth eval-set fixture (after count-drift-9-vs-15.md,
existence-drift-missing-doc.md, path-form-drift-bare-vs-qualified.md,
and cross-surface-drift-9-vs-15.md), extending B-0170.4 regression
coverage to the convention sub-class of the 7-class verify-then-claim
taxonomy.

Anchor PR: #2512 (`feat(B-0170): add ADR supersession convention
checker`) — the PR that shipped the check-convention.ts checker.
This fixture is a synthetic exemplar (no single historical drift
instance anchors the sub-class), same shape as path-form-drift's
synthetic exemplar.

The predecessor ADR lives as a sibling support file
`_convention-drift-target-adr.md` so check-convention.ts's 3-root
resolution (fileDir / parentDir / repoRoot) finds it via the
fileDir candidate without dragging in any real repo ADR.

NOTE: per PR #3611 review-thread discipline, this HTML comment
intentionally avoids restating the literal "Supersedes ADR ..."
claim from the body so a regression in body-claim detection
cannot be masked by a comment-side match.
-->

# Current ADR (eval-set fixture)

**Status:** Accepted. Supersedes ADR `_convention-drift-target-adr.md`.

## Decision

Synthetic ADR body — the body's substance is not material to the
fixture; only the supersession claim above matters. The predecessor
ADR pointed at by that claim is intentionally missing the reciprocal
"Superseded by" marker, which is the convention drift the checker
must surface.
Loading