Design 4: fast-check generators on a fixed seed, in four sub-items #64
@@ -223,8 +223,7 @@ functions, and a branch floor that only ever moves upward. It sits below 100 bec
|
|||||||
compared against `undefined` — have a half no valid document reaches.
|
compared against `undefined` — have a half no valid document reaches.
|
||||||
|
|
||||||
The corpus, all checked in: hand-built fixtures per node and combination; real sanitized ADF from
|
The corpus, all checked in: hand-built fixtures per node and combination; real sanitized ADF from
|
||||||
live Atlassian APIs; property-generated ADF trees; the CommonMark spec suite against
|
live Atlassian APIs; the CommonMark spec suite against `markdownToAdf` and `markdownToHtml`.
|
||||||
`markdownToAdf` and `markdownToHtml`.
|
|
||||||
|
|
||||||
`spec/flavour.md` is read as a source too, so the node tables cannot drift from the prose they
|
`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
|
copy: each `- ` bullet in `## Block nodes`, `## Inline nodes` and `## Marks` declares the nodes
|
||||||
|
|||||||
@@ -44,23 +44,33 @@ proves 12, 13 spells 11's gaps in 12's grammar, and 12 rewrites code 4b and 4c c
|
|||||||
- [x] **3j — The carry and the combinations.**
|
- [x] **3j — The carry and the combinations.**
|
||||||
- [x] **3k — The CommonMark spec suite.**
|
- [x] **3k — The CommonMark spec suite.**
|
||||||
- [ ] **4 — Round-trip property tests (`0.2.0`)**, widening 3j's corpus round-trip past the
|
- [ ] **4 — Round-trip property tests (`0.2.0`)**, widening 3j's corpus round-trip past the
|
||||||
documents a human wrote — the thing that proves 2 and 3 beyond them. Editor-normal (§2) is
|
documents a human wrote — the thing that proves 2 and 3 beyond them.
|
||||||
finished here, on 3i's merging — `toEditorNormal(doc)` and the equality the round-trip
|
**Settled** (the maintainer, 2026-09-13): `fast-check` generates and shrinks. The gate runs a
|
||||||
asserts, which over normalized input is the canonical serializer's compact spelling —
|
fixed seed, the properties together adding about five seconds per engine; an environment
|
||||||
rather than staying spelled inline as `?? []` at every reader. The
|
variable raises the runs and randomizes the seed for local digging, and a counterexample
|
||||||
reading half is `nodeContent`/`nodeAttrs`/`nodeMarks` over the ~28 sites spelling it
|
found becomes a round-trip fixture. The generators draw from the node tables — each node's
|
||||||
inline today, which also lifts the branch floor §10 keeps below 100 for exactly those
|
content model and attribute vocabulary as `adf/` records them, which 11 holds to Atlassian's
|
||||||
halves.
|
schema — and misplace a share of nodes so the carry (§3) is exercised; no JSON Schema walker
|
||||||
Generators emit editor-normal ADF (§2). Real sanitized ADF from live Atlassian APIs lands
|
enters the tests. `toEditorNormal` stays internal. 2e5's collision test goes, since a
|
||||||
here too (§10), in `corpus/real-payloads/`: an ADF→markdown→ADF check with no expected
|
collision already fails the round-trip on the same fixtures; the fixture-duplicate test
|
||||||
markdown, the payloads supplied by the maintainer. This subsumes 2e5's collision property —
|
stays.
|
||||||
a document that round-trips proves no other document shares its spelling — so decide here
|
- [ ] **4.1 — Editor-normal and the node accessors.** `toEditorNormal(doc)` in
|
||||||
whether that gate stays as the parser-free, faster-failing signal or goes; the half holding
|
`src/adf/editor-normal.ts`, on 3i's merging: adjacent text nodes carrying identical marks
|
||||||
no fixture duplicates is hygiene rather than a round-trip claim, and stays either way.
|
merged, an empty `attrs`, `marks` or `content` the absent key (§2), and the round-trip
|
||||||
**Settled** (the maintainer, 2026-09-13): the generators draw from the node tables — each
|
tests compare through it. `nodeContent`/`nodeAttrs`/`nodeMarks` replace the 49 inline
|
||||||
node's content model and attribute vocabulary as `adf/` records them, which 11 holds to
|
`?? []`/`?? {}` reads in `src/` (27 `content`, 12 `marks`, 10 `attrs`), and the branch floor
|
||||||
Atlassian's schema — and misplace a share of nodes so the carry (§3) is exercised; no JSON
|
rises to what the suite then measures.
|
||||||
Schema walker enters the tests.
|
- [ ] **4.2 — The ADF property.** `fast-check` joins `devDependencies`, AGENTS.md §5 naming what
|
||||||
|
it earns — shrinking a failing document to the nodes that break it — and §10 the properties
|
||||||
|
beside the corpus. A generated editor-normal document either refuses in `adfToMarkdown`
|
||||||
|
with a `ConvertError` or reads back through `markdownToAdf` to an equal document, and
|
||||||
|
nothing throws, under Node, Deno and Bun alike. 2e5's collision test is deleted.
|
||||||
|
- [ ] **4.3 — The markdown property.** Generated markdown through `markdownToAdf` never throws,
|
||||||
|
and the runs fit the budget; where it parses and `adfToMarkdown` spells the result, that
|
||||||
|
spelling parses and emits to itself byte for byte (§2).
|
||||||
|
- [ ] **4.4 — The real payloads.** `corpus/real-payloads/` holds the maintainer's sanitized
|
||||||
|
payloads, each round-tripped ADF→markdown→ADF with no expected markdown. It waits on the
|
||||||
|
maintainer placing the files.
|
||||||
- [ ] **4b — The block walk's retry (`0.2.0`).** `emitBlock` walks a subtree twice wherever
|
- [ ] **4b — The block walk's retry (`0.2.0`).** `emitBlock` walks a subtree twice wherever
|
||||||
`readableBlock` reads it whole and then gives up — a list item whose first line reads back
|
`readableBlock` reads it whole and then gives up — a list item whose first line reads back
|
||||||
as a thematic break — and the walk below does the same, so the cost doubles per level:
|
as a thematic break — and the walk below does the same, so the cost doubles per level:
|
||||||
|
|||||||
Reference in New Issue
Block a user