Mapa editor spike: markup.mjs, the schema, the corpus and gate L4
Spec §12 Phase 1 step 0, §6.2, §6.3, §7. - editor/: ProseMirror pinned exactly (Docs' versions, plus history, gapcursor and dropcursor), esbuild 0.28.2, and Docs' bundle shape: build-bundles.mjs writes internal/mapa/static/editor.<sha256/16>.js, removes stale ones, and logs the gzipped size against L12's 120KB (11.3KB now; the entry only builds the schema, and no template loads it yet). - markup.mjs (+ safeurl.mjs): Parse, Plain and Spans ported line for line, with the parity hazards spelled out: ASCII \s, Go's TrimSpace set, UTF-8 byte offsets, tabs as four spaces, emphasis over escaped text, net/url's answers for SafeURL. - schema.mjs, chips.mjs, fromMarkdown.mjs: §6.3's schema, whose toDOM is the server's markup; a list item holds its paragraph and any number of nested lists, since a kind change nests a second one. - The corpus (internal/mapa/markup/testdata/corpus): the CommonMark 0.31.2 examples (CC BY-SA 4.0, recorded in LICENSE.commonmark), SeedSynthetic's pages, written-for-purpose notes and §7's edge cases. TestGolden writes golden.json (make golden) and fails when it is stale; parity.test.mjs holds markup.mjs and toDOM to it byte for byte, the four pinned emphasis outputs and the trailing paragraph included. All 758 bodies agree. - make editor (npm ci, rebuild, fail on drift against the index, node --test) is part of make ci and .amadan/ci.d/05-editor. make corpus-local DIR=... runs L4 over Markdown read in place: 5,537 files under oficina/ agree, nothing committed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 files changed,
+8,876
−5
.amadan/ci.d/05-editor+4 −0Makefile+39 −2editor/.gitignore+1 −0editor/build-bundles.mjs+45 −0editor/bundles.mjs+16 −0editor/chips.mjs+90 −0editor/domhtml.mjs+96 −0editor/editor-entry.js+6 −0editor/fromMarkdown.mjs+169 −0editor/markup.mjs+372 −0editor/package-lock.json+645 −0editor/package.json+26 −0editor/parity.test.mjs+131 −0editor/safeurl.mjs+152 −0editor/schema.mjs+181 −0internal/mapa/markup/golden_test.go+318 −0internal/mapa/markup/testdata/.gitattributes+1 −0internal/mapa/markup/testdata/corpus/LICENSE.commonmark+11 −0internal/mapa/markup/testdata/corpus/commonmark-0.31.2.json+5,218 −0internal/mapa/markup/testdata/corpus/edge.json+306 −0internal/mapa/markup/testdata/corpus/notes/brightwater-labs.md+31 −0internal/mapa/markup/testdata/corpus/notes/daily-2026-11-12.md+16 −0internal/mapa/markup/testdata/corpus/notes/handbook-unicode.md+24 −0internal/mapa/markup/testdata/corpus/notes/onboarding.md+9 −0internal/mapa/markup/testdata/corpus/notes/preview-samples.md+8 −0internal/mapa/markup/testdata/corpus/notes/weekly-ops.md+38 −0internal/mapa/markup/testdata/corpus/synthetic.json+98 −0internal/mapa/markup/testdata/golden.json+760 −0internal/mapa/static/editor.9c9edc5536b1d844.js+2 −0internal/mapa/synthetic.go+13 −3internal/mapa/synthetic_corpus_test.go+50 −0
.amadan/ci.d/05-editorLoading diff…
MakefileLoading diff…
editor/.gitignoreLoading diff…
editor/build-bundles.mjsLoading diff…
editor/bundles.mjsLoading diff…
editor/chips.mjsLoading diff…
editor/domhtml.mjsLoading diff…
editor/editor-entry.jsLoading diff…
editor/fromMarkdown.mjsLoading diff…
editor/markup.mjsLoading diff…
editor/package-lock.jsonLoading diff…
editor/package.jsonLoading diff…
editor/parity.test.mjsLoading diff…
editor/safeurl.mjsLoading diff…
editor/schema.mjsLoading diff…
internal/mapa/markup/golden_test.goLoading diff…
internal/mapa/markup/testdata/.gitattributesLoading diff…
internal/mapa/markup/testdata/corpus/LICENSE.commonmarkLoading diff…
internal/mapa/markup/testdata/corpus/commonmark-0.31.2.jsonLoading diff…
internal/mapa/markup/testdata/corpus/edge.jsonLoading diff…
internal/mapa/markup/testdata/corpus/notes/brightwater-labs.mdLoading diff…
internal/mapa/markup/testdata/corpus/notes/daily-2026-11-12.mdLoading diff…
internal/mapa/markup/testdata/corpus/notes/handbook-unicode.mdLoading diff…
internal/mapa/markup/testdata/corpus/notes/onboarding.mdLoading diff…
internal/mapa/markup/testdata/corpus/notes/preview-samples.mdLoading diff…
internal/mapa/markup/testdata/corpus/notes/weekly-ops.mdLoading diff…
internal/mapa/markup/testdata/corpus/synthetic.jsonLoading diff…
internal/mapa/markup/testdata/golden.jsonLoading diff…
internal/mapa/static/editor.9c9edc5536b1d844.jsLoading diff…
internal/mapa/synthetic.goLoading diff…
internal/mapa/synthetic_corpus_test.goLoading diff…