From 132f9f74670b33cf6cf08500e6af4ff18acacadd Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 23 Sep 2026 23:21:06 +0200 Subject: [PATCH 1/2] 24 - the conformance gates live in src/conformance/ --- .oxlintrc.json | 2 +- AGENTS.md | 2 +- package.json | 2 +- src/{ => conformance}/adf-property.test.ts | 6 +-- src/{ => conformance}/adf-schema.test.ts | 12 +++--- src/{ => conformance}/commonmark-spec.test.ts | 8 ++-- src/{ => conformance}/corpus.test.ts | 14 +++---- src/{ => conformance}/flavour.test.ts | 12 +++--- .../markdown-property.test.ts | 38 +++++++++---------- src/{ => conformance}/property-harness.ts | 18 ++++----- todo-history.md | 7 ++++ todo.md | 5 +-- tsconfig.build.json | 2 +- 13 files changed, 66 insertions(+), 62 deletions(-) rename src/{ => conformance}/adf-property.test.ts (80%) rename src/{ => conformance}/adf-schema.test.ts (96%) rename src/{ => conformance}/commonmark-spec.test.ts (98%) rename src/{ => conformance}/corpus.test.ts (95%) rename src/{ => conformance}/flavour.test.ts (92%) rename src/{ => conformance}/markdown-property.test.ts (95%) rename src/{ => conformance}/property-harness.ts (94%) diff --git a/.oxlintrc.json b/.oxlintrc.json index 36c12b6..6274a39 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -1,7 +1,7 @@ { "$schema": "./node_modules/oxlint/configuration_schema.json", "categories": { "correctness": "off" }, - "ignorePatterns": ["src/**/*.test.ts", "src/property-harness.ts"], + "ignorePatterns": ["src/**/*.test.ts", "src/conformance/property-harness.ts"], "rules": { "eslint/max-lines-per-function": ["error", { "IIFEs": true, "max": 52, "skipBlankLines": false, "skipComments": false }] } diff --git a/AGENTS.md b/AGENTS.md index 0a4b23a..395b425 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -265,7 +265,7 @@ editor wrote; the CommonMark spec suite against `markdownToAdf` and `markdownToH Beside the corpus, properties run over documents generated from the node tables and over generated markdown, on a fixed seed in the gate; `PROPERTY_RUNS=` raises the runs and randomizes the seed for local digging, and a counterexample found becomes a round-trip fixture. The generators and -run parameters properties share live in `src/property-harness.ts`, outside the build and coverage. +run parameters properties share live in `src/conformance/property-harness.ts`, outside the build and coverage. `spec/flavour.md` is read as a source too, so the node tables cannot drift from the prose they copy: each `- ` bullet in `## Block nodes`, `## Inline nodes` and `## Marks` declares the nodes diff --git a/package.json b/package.json index cab9c6e..be69669 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "scripts": { "build": "tsc -p tsconfig.build.json", "size-ratchet": "oxlint --deny-warnings -c .oxlintrc.json src", - "test": "node --test --experimental-test-coverage --test-coverage-exclude=\"src/**/*.test.ts\" --test-coverage-exclude=src/property-harness.ts --test-coverage-branches=98 --test-coverage-functions=100 --test-coverage-lines=100 \"src/**/*.test.ts\"", + "test": "node --test --experimental-test-coverage --test-coverage-exclude=\"src/**/*.test.ts\" --test-coverage-exclude=src/conformance/property-harness.ts --test-coverage-branches=98 --test-coverage-functions=100 --test-coverage-lines=100 \"src/**/*.test.ts\"", "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.build.json" }, "devDependencies": { diff --git a/src/adf-property.test.ts b/src/conformance/adf-property.test.ts similarity index 80% rename from src/adf-property.test.ts rename to src/conformance/adf-property.test.ts index f52789e..31c777a 100644 --- a/src/adf-property.test.ts +++ b/src/conformance/adf-property.test.ts @@ -3,9 +3,9 @@ import fc from 'fast-check' import test from 'node:test' import { adfDocument, propertyRuns, propertyTimeout } from './property-harness.ts' -import { adfToMarkdown } from './markdown/emit/adf-to-markdown.ts' -import { markdownToAdf } from './markdown/parse/markdown-to-adf.ts' -import { toEditorNormal } from './adf/editor-normal.ts' +import { adfToMarkdown } from '../markdown/emit/adf-to-markdown.ts' +import { markdownToAdf } from '../markdown/parse/markdown-to-adf.ts' +import { toEditorNormal } from '../adf/editor-normal.ts' const gateRuns = 1600 diff --git a/src/adf-schema.test.ts b/src/conformance/adf-schema.test.ts similarity index 96% rename from src/adf-schema.test.ts rename to src/conformance/adf-schema.test.ts index 839a041..60b345e 100644 --- a/src/adf-schema.test.ts +++ b/src/conformance/adf-schema.test.ts @@ -5,11 +5,11 @@ import { fileURLToPath } from 'node:url' import { readFileSync } from 'node:fs' import test from 'node:test' -import type { AttributeKind, AttributeVocabulary } from './adf/attribute-vocabulary.ts' -import { blockArgument } from './markdown/block-directive.ts' -import { blockNodes } from './adf/block-nodes.ts' -import { inlineNodes } from './adf/inline-nodes.ts' -import { markAttributes } from './adf/mark-attributes.ts' +import type { AttributeKind, AttributeVocabulary } from '../adf/attribute-vocabulary.ts' +import { blockArgument } from '../markdown/block-directive.ts' +import { blockNodes } from '../adf/block-nodes.ts' +import { inlineNodes } from '../adf/inline-nodes.ts' +import { markAttributes } from '../adf/mark-attributes.ts' type Held = Map> type Properties = Map @@ -21,7 +21,7 @@ const definitionReference = '#/definitions/' const gaps: string[] = [] const grammarOwn = ['doc', 'text'] const readKeywords = ['$ref', 'additionalProperties', 'allOf', 'anyOf', 'enum', 'items', 'maxItems', 'maximum', 'minItems', 'minLength', 'minimum', 'pattern', 'properties', 'required', 'type'] -const root = join(dirname(fileURLToPath(import.meta.url)), '..', 'spec', 'adf-schema') +const root = join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'spec', 'adf-schema') const schemaFiles = ['full.json', 'stage-0.json'] test('the ADF JSON Schemas are @atlaskit/adf-schema 57.4.9, vendored byte-exact', () => { diff --git a/src/commonmark-spec.test.ts b/src/conformance/commonmark-spec.test.ts similarity index 98% rename from src/commonmark-spec.test.ts rename to src/conformance/commonmark-spec.test.ts index 6026c62..6c6bb85 100644 --- a/src/commonmark-spec.test.ts +++ b/src/conformance/commonmark-spec.test.ts @@ -5,11 +5,11 @@ import { fileURLToPath } from 'node:url' import { readFileSync } from 'node:fs' import test from 'node:test' -import type { AdfDocument, AdfNode } from './adf/document.ts' -import { adfToMarkdown } from './markdown/emit/adf-to-markdown.ts' -import { markdownToAdf } from './markdown/parse/markdown-to-adf.ts' +import type { AdfDocument, AdfNode } from '../adf/document.ts' +import { adfToMarkdown } from '../markdown/emit/adf-to-markdown.ts' +import { markdownToAdf } from '../markdown/parse/markdown-to-adf.ts' -const root = join(dirname(fileURLToPath(import.meta.url)), '..', 'corpus', 'commonmark-spec') +const root = join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'corpus', 'commonmark-spec') const checks = ['count', 'fixpoint', 'text'] as const type Check = (typeof checks)[number] diff --git a/src/corpus.test.ts b/src/conformance/corpus.test.ts similarity index 95% rename from src/corpus.test.ts rename to src/conformance/corpus.test.ts index 6f0d122..22ff052 100644 --- a/src/corpus.test.ts +++ b/src/conformance/corpus.test.ts @@ -4,14 +4,14 @@ import { fileURLToPath } from 'node:url' import { readFileSync, readdirSync } from 'node:fs' import test from 'node:test' -import { adfToMarkdown } from './markdown/emit/adf-to-markdown.ts' -import { isAdfDocument } from './adf/document.ts' -import { isJsonValue } from './json-value.ts' -import { markdownToAdf } from './markdown/parse/markdown-to-adf.ts' -import { serializeCanonicalJson } from './canonical-json.ts' -import { toEditorNormal } from './adf/editor-normal.ts' +import { adfToMarkdown } from '../markdown/emit/adf-to-markdown.ts' +import { isAdfDocument } from '../adf/document.ts' +import { isJsonValue } from '../json-value.ts' +import { markdownToAdf } from '../markdown/parse/markdown-to-adf.ts' +import { serializeCanonicalJson } from '../canonical-json.ts' +import { toEditorNormal } from '../adf/editor-normal.ts' -const corpusRoot = join(dirname(fileURLToPath(import.meta.url)), '..', 'corpus') +const corpusRoot = join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'corpus') const errorsRoot = join(corpusRoot, 'errors') const normalizationRoot = join(corpusRoot, 'normalization') const realPayloadsRoot = join(corpusRoot, 'real-payloads') diff --git a/src/flavour.test.ts b/src/conformance/flavour.test.ts similarity index 92% rename from src/flavour.test.ts rename to src/conformance/flavour.test.ts index 4577df7..3e8d818 100644 --- a/src/flavour.test.ts +++ b/src/conformance/flavour.test.ts @@ -4,15 +4,15 @@ import { fileURLToPath } from 'node:url' import { readFileSync } from 'node:fs' import test from 'node:test' -import type { AttributeKind, AttributeVocabulary } from './adf/attribute-vocabulary.ts' -import { blockNodes } from './adf/block-nodes.ts' -import { inlineNodes } from './adf/inline-nodes.ts' -import { markAttributes } from './adf/mark-attributes.ts' -import { textDirectiveName } from './markdown/text-directive.ts' +import type { AttributeKind, AttributeVocabulary } from '../adf/attribute-vocabulary.ts' +import { blockNodes } from '../adf/block-nodes.ts' +import { inlineNodes } from '../adf/inline-nodes.ts' +import { markAttributes } from '../adf/mark-attributes.ts' +import { textDirectiveName } from '../markdown/text-directive.ts' type Declared = { attributes: AttributeVocabulary } -const specPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'spec', 'flavour.md') +const specPath = join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'spec', 'flavour.md') const introducer = 'Attributes: ' const codeFence = /^`{3,}/ const directiveName = /`([a-z][A-Za-z0-9]*)`/g diff --git a/src/markdown-property.test.ts b/src/conformance/markdown-property.test.ts similarity index 95% rename from src/markdown-property.test.ts rename to src/conformance/markdown-property.test.ts index acbb8d2..580dce9 100644 --- a/src/markdown-property.test.ts +++ b/src/conformance/markdown-property.test.ts @@ -2,16 +2,16 @@ import assert from 'node:assert/strict' import fc from 'fast-check' import test from 'node:test' -import type { AdfDocument } from './adf/document.ts' +import type { AdfDocument } from '../adf/document.ts' import type { Arbitrary, DepthIdentifier } from 'fast-check' -import type { AttributeVocabulary } from './adf/attribute-vocabulary.ts' -import type { JsonValue } from './json-value.ts' -import type { Result } from './result.ts' +import type { AttributeVocabulary } from '../adf/attribute-vocabulary.ts' +import type { JsonValue } from '../json-value.ts' +import type { Result } from '../result.ts' import { adfDocument, attributes, jsonKey, jsonValue, markdownPieces, propertyRuns, propertyTimeout, textOf } from './property-harness.ts' -import { adfToMarkdown } from './markdown/emit/adf-to-markdown.ts' -import { blockArgument, listBreakName, marksAttribute } from './markdown/block-directive.ts' -import { blockNodes } from './adf/block-nodes.ts' -import { carryName } from './markdown/opaque-carry.ts' +import { adfToMarkdown } from '../markdown/emit/adf-to-markdown.ts' +import { blockArgument, listBreakName, marksAttribute } from '../markdown/block-directive.ts' +import { blockNodes } from '../adf/block-nodes.ts' +import { carryName } from '../markdown/opaque-carry.ts' import { directivePrefix, spellAttributes, @@ -22,17 +22,17 @@ import { spellJsonAttribute, spellStringAttribute, spellVocabulary, -} from './markdown/directive-syntax.ts' -import { fencedCodeBlock } from './markdown/commonmark/backtick-runs.ts' -import { inlineNodes } from './adf/inline-nodes.ts' -import { markAttributes } from './adf/mark-attributes.ts' -import { markSpelling } from './markdown/mark-spellings.ts' -import { markdownToAdf } from './markdown/parse/markdown-to-adf.ts' -import { nodeContent, nodeMarks } from './adf/document.ts' -import { serializeCanonicalJson } from './canonical-json.ts' -import { textDirectiveName } from './markdown/text-directive.ts' -import { toEditorNormal } from './adf/editor-normal.ts' -import { vocabularyPairs } from './adf/attribute-vocabulary.ts' +} from '../markdown/directive-syntax.ts' +import { fencedCodeBlock } from '../markdown/commonmark/backtick-runs.ts' +import { inlineNodes } from '../adf/inline-nodes.ts' +import { markAttributes } from '../adf/mark-attributes.ts' +import { markSpelling } from '../markdown/mark-spellings.ts' +import { markdownToAdf } from '../markdown/parse/markdown-to-adf.ts' +import { nodeContent, nodeMarks } from '../adf/document.ts' +import { serializeCanonicalJson } from '../canonical-json.ts' +import { textDirectiveName } from '../markdown/text-directive.ts' +import { toEditorNormal } from '../adf/editor-normal.ts' +import { vocabularyPairs } from '../adf/attribute-vocabulary.ts' type Choice = { arbitrary: Arbitrary; hostile?: true; weight: number } diff --git a/src/property-harness.ts b/src/conformance/property-harness.ts similarity index 94% rename from src/property-harness.ts rename to src/conformance/property-harness.ts index 9b09bdf..832e74a 100644 --- a/src/property-harness.ts +++ b/src/conformance/property-harness.ts @@ -2,16 +2,16 @@ import assert from 'node:assert/strict' import { env } from 'node:process' import fc from 'fast-check' -import type { AdfAttributes, AdfDocument, AdfMark, AdfNode } from './adf/document.ts' +import type { AdfAttributes, AdfDocument, AdfMark, AdfNode } from '../adf/document.ts' import type { Arbitrary } from 'fast-check' -import type { AttributeKind, AttributeVocabulary } from './adf/attribute-vocabulary.ts' -import type { JsonValue } from './json-value.ts' -import { blockArgument } from './markdown/block-directive.ts' -import { blockNodes } from './adf/block-nodes.ts' -import { directivePrefix } from './markdown/directive-syntax.ts' -import { inlineNodes } from './adf/inline-nodes.ts' -import { markAttributes } from './adf/mark-attributes.ts' -import { toEditorNormal } from './adf/editor-normal.ts' +import type { AttributeKind, AttributeVocabulary } from '../adf/attribute-vocabulary.ts' +import type { JsonValue } from '../json-value.ts' +import { blockArgument } from '../markdown/block-directive.ts' +import { blockNodes } from '../adf/block-nodes.ts' +import { directivePrefix } from '../markdown/directive-syntax.ts' +import { inlineNodes } from '../adf/inline-nodes.ts' +import { markAttributes } from '../adf/mark-attributes.ts' +import { toEditorNormal } from '../adf/editor-normal.ts' type Positions = { block: AdfNode; inline: AdfNode } diff --git a/todo-history.md b/todo-history.md index b806d93..cfe132f 100644 --- a/todo-history.md +++ b/todo-history.md @@ -1038,6 +1038,13 @@ The done `todo.md` items in full, as they were written. `todo.md` keeps a one-li attribute and the `listBreak` spelling — what the block directive spells of a node that the grammar does not — and `src/markdown/` drops from 15 entries to 12. +- [x] **24 — The conformance gates have a directory (`0.2.0`).** Six root tests with no sibling + source (`adf-property`, `adf-schema`, `commonmark-spec`, `corpus`, `flavour`, + `markdown-property`) plus `property-harness.ts` are the machinery that makes the docs + executable, and they read as leftovers. Give them one, so `src/` root shows what it holds. + **Done** (2026-09-23): `src/conformance/` holds the six gate tests and the property harness, + so `src/` root is the four primitives and the entrypoint. + ## 5 — Ship `0.1.0` - [ ] **5 — Ship `0.1.0`.** Only the maintainer's own acts are left (§15): make the Gitea repo diff --git a/todo.md b/todo.md index 99419ed..e20cedb 100644 --- a/todo.md +++ b/todo.md @@ -56,10 +56,7 @@ chunk clearing a §11 seam. upward, so the first raise to the measured figure reddens a run that changed nothing. Make the measurement repeatable, or state the number the floor may be raised to and why it is not the measured one. -- [ ] **24 — The conformance gates have a directory (`0.2.0`).** Six root tests with no sibling - source (`adf-property`, `adf-schema`, `commonmark-spec`, `corpus`, `flavour`, - `markdown-property`) plus `property-harness.ts` are the machinery that makes the docs - executable, and they read as leftovers. Give them one, so `src/` root shows what it holds. +- [x] **24 — The conformance gates have a directory (`0.2.0`).** - [ ] **25 — AGENTS.md §8 and §11 are findable (`0.2.0`).** Both are single unindexed paragraphs holding the answer to nearly every question the panel had, and six readers and both architects independently reported that finding the sentence cost more than reading the code diff --git a/tsconfig.build.json b/tsconfig.build.json index 98a04c3..86c95e9 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -27,6 +27,6 @@ "forceConsistentCasingInFileNames": true, "skipLibCheck": true }, - "exclude": ["src/**/*.test.ts", "src/property-harness.ts"], + "exclude": ["src/**/*.test.ts", "src/conformance/property-harness.ts"], "include": ["src"] } -- 2.52.0 From 2b15530a572ed30147f18e5120f05e4a22344a61 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 23 Sep 2026 23:24:09 +0200 Subject: [PATCH 2/2] 24 - the history line says what src/ root holds --- todo-history.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/todo-history.md b/todo-history.md index cfe132f..b3bf277 100644 --- a/todo-history.md +++ b/todo-history.md @@ -1043,7 +1043,7 @@ The done `todo.md` items in full, as they were written. `todo.md` keeps a one-li `markdown-property`) plus `property-harness.ts` are the machinery that makes the docs executable, and they read as leftovers. Give them one, so `src/` root shows what it holds. **Done** (2026-09-23): `src/conformance/` holds the six gate tests and the property harness, - so `src/` root is the four primitives and the entrypoint. + so `src/` root holds the primitives and the entrypoint. ## 5 — Ship `0.1.0` -- 2.52.0