From 12b57a06a905f45712556594736b3523804fa406 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 6 Sep 2026 21:58:58 +0200 Subject: [PATCH] Pin the suite run, gate the exception list, and trim the corpus README --- corpus/README.md | 9 +++------ src/commonmark-spec.test.ts | 4 ++-- src/corpus.test.ts | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/corpus/README.md b/corpus/README.md index 8ef9d40..91b1f01 100644 --- a/corpus/README.md +++ b/corpus/README.md @@ -12,12 +12,9 @@ One directory per contract kind, each landing with its milestone: pins which error. - `real-payloads/` — `.json`: sanitized live ADF, round-tripped ADF→markdown→ADF. No expected markdown. -- `commonmark-spec/` — `spec.json` (the pinned CommonMark suite, read as corpus data per - AGENTS.md §1) and `exceptions.json` (examples a documented divergence exempts, keyed by - `check` and `example` with a `reason`). Three checks an example must pass: the §2 canonical - fixpoint — a named error, or markdown that parses and emits back to itself; the reference HTML's - text, tags stripped and entities decoded, against the parsed document's concatenated text; and a - count of the CommonMark subset's elements against the nodes and marks they map to. +- `commonmark-spec/` — `spec.json` (the CommonMark 0.31.2 suite, vendored byte-exact) and + `exceptions.json` (the examples a known divergence exempts, keyed by `check` and `example` with + a `reason`). JSON is editor-normal (AGENTS.md §2), two-space indent, keys sorted. `spec.json` is the vendored, upstream machine-readable suite (CommonMark 0.31.2, CC-BY-SA-4.0, © John MacFarlane) and is not diff --git a/src/commonmark-spec.test.ts b/src/commonmark-spec.test.ts index 0793be1..9ed996d 100644 --- a/src/commonmark-spec.test.ts +++ b/src/commonmark-spec.test.ts @@ -56,8 +56,8 @@ const spec = readSpec() const exceptions = readExceptions() const exceptionIndex = new Map(exceptions.map((entry) => [`${entry.example}:${entry.check}`, entry.reason])) -test('the CommonMark spec suite is the version the parser names', () => { - assert.ok(spec.length > 600, `spec.json holds ${spec.length} examples, not a full suite`) +test('the CommonMark spec suite is the pinned 0.31.2 run', () => { + assert.equal(spec.length, 652) }) test('the exception list is unique per example and check', () => { diff --git a/src/corpus.test.ts b/src/corpus.test.ts index 7884e1a..180eb16 100644 --- a/src/corpus.test.ts +++ b/src/corpus.test.ts @@ -53,7 +53,7 @@ function pairedNames(root: string, first: string, second: string): string[] { function corpusJsonPaths(): string[] { return readdirSync(corpusRoot, { encoding: 'utf8', recursive: true }) .filter((name) => name.endsWith('.json')) - .filter((name) => !name.startsWith(`commonmark-spec${sep}`)) + .filter((name) => name !== `commonmark-spec${sep}spec.json`) .map((name) => join(corpusRoot, name)) .sort() }