From 5be1bf677a48e8cdbe4d8d54f11c805b44266bb6 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 25 Aug 2026 15:43:30 +0200 Subject: [PATCH] Narrow the error-code rule to what it forbids, and name the fence rule instead of quoting it --- AGENTS.md | 3 ++- src/corpus.test.ts | 3 +-- todo.md | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 6677d43..aca7e6a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -76,7 +76,8 @@ The error surface is a contract too. `ConvertError` is `{ code, message, path }` closed list a consumer may switch exhaustively, the message free text, the path the node's position from the document root. Adding, removing or renaming a code is breaking, so a milestone meeting a new failure cause reuses a code where one fits; the list is complete at `0.1.0`. A code names the -cause, never the node — `path` and `message` carry that. +cause; where one cause recurs across node types, one code covers them all and `path` and `message` +say which. ## 9. Release automation diff --git a/src/corpus.test.ts b/src/corpus.test.ts index 762408f..3084dd1 100644 --- a/src/corpus.test.ts +++ b/src/corpus.test.ts @@ -72,8 +72,7 @@ for (const directory of emittingDirectories) { } } -// The rule spec/flavour.md states as "a container's fence is longer than every directive fence line -// in its body", checked against the emitted bytes: a hand-written fixture cannot be its own witness. +// spec/flavour.md, Directives: the container fence rule, checked against the emitted bytes. function fenceNestingFault(markdown: string): string | undefined { const open: number[] = [] let codeFence: string | undefined diff --git a/todo.md b/todo.md index 99d1f6e..e0c511d 100644 --- a/todo.md +++ b/todo.md @@ -82,6 +82,8 @@ detail is settled at its own milestone. attribute canonicalization, a pipe cell's whitespace edges and `\u007c` for a `|` inside a quoted attribute value, documents combining nodes rather than isolating one, and a paragraph line inside a container body shaped like a closing fence (`:::`, `::: x`). + Guard `fenceNestingFault`'s bare-run pop here too — a run shorter than the open fence is a + fault, not a close — which today's emitter cannot reach. The gate gains the collision property here: no two corpus documents may emit the same bytes — one spelling for two documents is a round-trip break no parser can undo, and it is provable without one. It also settles the emitter's one known approximation: delimiter @@ -114,7 +116,9 @@ detail is settled at its own milestone. here too (§10), in `corpus/real-payloads/`: an ADF→markdown→ADF check with no expected markdown, the payloads supplied by the maintainer. - [ ] **5 — Release pipeline, ship `0.1.0`.** Publish-on-version-change (§9), `NPM_TOKEN` secret, - the repo made public first (§6). `0.1.0` is the markdown round-trip: both markdown + the repo made public first (§6). The `ConvertErrorCode` freeze (§8) is checkable here: every + `corpus/unspellable/` document is one of 1d's decisions, so the directory empties as they land + and whatever survives is permanent. `0.1.0` is the markdown round-trip: both markdown directions, the types, `isAdfDocument`. The build lands here: a build tsconfig emitting JS and `.d.ts` to `dist/` (the dev config's `allowImportingTsExtensions` forces `noEmit`, so the build config needs `rewriteRelativeImportExtensions`), plus `exports`/`files` in