Compare commits

..

12 Commits

Author SHA1 Message Date
lilleman a581e454ae 4.2: the review's generator, runner and pattern fixes
CI / gate (push) Successful in 23s
CI / publish (push) Has been skipped
2026-09-14 23:25:13 +02:00
lilleman 342c2027d8 4.2: a link target's would-be directive escapes inside a directive's content 2026-09-14 23:25:13 +02:00
lilleman fade9f51ea 4.2: generated keys avoid V8's JSON.parse key fault 2026-09-14 23:25:13 +02:00
lilleman b6930b45a4 4.2: an autolink holding a backtick gives way inside a directive's content 2026-09-14 23:25:13 +02:00
lilleman e166e969cb 4.2: the ADF property 2026-09-14 23:25:13 +02:00
lilleman 507f68aa13 4.2: a link target's backtick escapes where it would open a code span inside a directive's content 2026-09-14 23:25:13 +02:00
lilleman a2672bdc5b 4.2: a list whose item holds a whitespace-only line takes the directive form 2026-09-14 23:25:13 +02:00
lilleman 9303235434 4.2: a link's brackets balance inside a directive's content 2026-09-14 23:25:13 +02:00
lilleman eafd863a32 4.2: an empty link destination beside a title spells <> 2026-09-14 23:25:13 +02:00
lilleman 1125715371 Record the autolink backtick answer and the accepted V8 JSON.parse fault in 4.2
CI / publish (push) Successful in 4s
CI / gate (push) Successful in 19s
2026-09-14 22:34:05 +02:00
lilleman 31156f4914 Settle 4.2's generator mix and how the breaks it finds get fixed
CI / publish (push) Successful in 3s
CI / gate (push) Successful in 18s
2026-09-14 20:50:17 +02:00
lilleman 0185879943 Tick 4.1, moving its text to todo-history.md, and record where 4.4's payloads land
CI / publish (push) Successful in 3s
CI / gate (push) Successful in 18s
2026-09-14 20:23:41 +02:00
2 changed files with 28 additions and 11 deletions
+11
View File
@@ -416,6 +416,17 @@ The done `todo.md` items in full, as they were written. `todo.md` keeps a one-li
and 3h landed their answers and emptied it. The permanent ones — a link destination or and 3h landed their answers and emptied it. The permanent ones — a link destination or
title no escape spells, a paragraph opening with a code span — are the exceptions, named title no escape spells, a paragraph opening with a code span — are the exceptions, named
by AGENTS.md §2. by AGENTS.md §2.
- [ ] **4 — Round-trip property tests (`0.2.0`).**
- [x] **4.1 — Editor-normal and the node accessors.** `toEditorNormal(doc)` in
`src/adf/editor-normal.ts`, on 3i's merging: adjacent text nodes carrying identical marks and
no attributes merged, an empty `attrs`, `marks` or `content` the absent key, `-0` read as `0`
(§2); the round-trip tests compare the parser's output through it, and `serializeCanonicalJson`
beneath it walks iteratively. `nodeContent`/`nodeAttrs`/`nodeMarks` replace the 46 inline
`?? []`/`?? {}` reads in `src/` (23 `content`, 12 `marks`, 11 `attrs`) and the `attrs?.[key]`
reads, and the branch floor rises to the integer floor of what the suite then measures.
**Settled** (the maintainer, 2026-09-14): a text node carrying attributes never merges —
`0.1.0` merged a carried one into its neighbour on read-back — and the fix lands here, as does
the iterative serializer.
- [x] **5a — Rename to `@larvit/adf-codec` (`0.1.0`).** Before the first publish, the name being - [x] **5a — Rename to `@larvit/adf-codec` (`0.1.0`).** Before the first publish, the name being
the published identity: `package.json` `name` and `repository`, the Gitea repo and its the published identity: `package.json` `name` and `repository`, the Gitea repo and its
remote, the README title, §6's published-as line, the checkout directory. remote, the README title, §6's published-as line, the checkout directory.
+17 -11
View File
@@ -54,27 +54,33 @@ proves 12, 13 spells 11's gaps in 12's grammar, and 12 rewrites code 4b and 4c c
enters the tests. `toEditorNormal` stays internal. 2e5's collision test goes, since a enters the tests. `toEditorNormal` stays internal. 2e5's collision test goes, since a
collision already fails the round-trip on the same fixtures; the fixture-duplicate test collision already fails the round-trip on the same fixtures; the fixture-duplicate test
stays. stays.
- [ ] **4.1 — Editor-normal and the node accessors.** `toEditorNormal(doc)` in - [x] **4.1 — Editor-normal and the node accessors.**
`src/adf/editor-normal.ts`, on 3i's merging: adjacent text nodes carrying identical marks and
no attributes merged, an empty `attrs`, `marks` or `content` the absent key, `-0` read as `0`
(§2); the round-trip tests compare the parser's output through it, and `serializeCanonicalJson`
beneath it walks iteratively. `nodeContent`/`nodeAttrs`/`nodeMarks` replace the 46 inline
`?? []`/`?? {}` reads in `src/` (23 `content`, 12 `marks`, 11 `attrs`) and the `attrs?.[key]`
reads, and the branch floor rises to the integer floor of what the suite then measures.
**Settled** (the maintainer, 2026-09-14): a text node carrying attributes never merges —
`0.1.0` merged a carried one into its neighbour on read-back — and the fix lands here, as does
the iterative serializer.
- [ ] **4.2 — The ADF property.** `fast-check` joins `devDependencies`, AGENTS.md §5 naming what - [ ] **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 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` 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 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. nothing throws, under Node, Deno and Bun alike. 2e5's collision test is deleted.
**Settled** (the maintainer, 2026-09-14): about half the block positions draw attribute-less
CommonMark shapes — single-type lists, headings, blockquotes, pipe-table-shaped tables — where
the escaping lives. A round-trip break the property finds is fixed inside 4.2, one commit per
break with its round-trip fixture seen red first, and 4.2 lands when a deep run of about
10,000 per engine passes clean; a break needing design goes to the maintainer. The first two,
both shipped in `0.1.0`: an empty `href` with a title spelled `[a]( "")`, which reads back as
the href `""`, and a `[` or `]` in a link's destination or title inside a directive mark,
refused as the emitter's own output or, with `]`, losing the link. Later, settled the same
day: an autolink whose href holds a backtick takes the `[text](url)` form inside a
directive's content; and a V8 fault the deep runs hit — once `JSON.parse` has read a key
holding an escaped backslash, a later escaped quote or newline key comes back as that
backslash, on Node and Deno but not Bun — is accepted rather than worked around, since the
library only refuses such a document, so the generators' JSON keys avoid those characters and
the maintainer reports the fault upstream.
- [ ] **4.3 — The markdown property.** Generated markdown through `markdownToAdf` never throws, - [ ] **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 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). spelling parses and emits to itself byte for byte (§2).
- [ ] **4.4 — The real payloads.** `corpus/real-payloads/` holds the maintainer's sanitized - [ ] **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 payloads, each round-tripped ADF→markdown→ADF with no expected markdown. It waits on the
maintainer placing the files. maintainer dropping the `.json` files untracked into the main checkout's
`corpus/real-payloads/` (the maintainer, 2026-09-14); the chunk moves them onto its branch.
- [ ] **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: