oficina / mapa Public

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>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 0deaac86d90d198216cb69c144d613d4eafc4e12 parent cc97bb3
31 files changed, +8,876 −5
  • .amadan/ci.d/05-editor +4 −0
  • Makefile +39 −2
  • editor/.gitignore +1 −0
  • editor/build-bundles.mjs +45 −0
  • editor/bundles.mjs +16 −0
  • editor/chips.mjs +90 −0
  • editor/domhtml.mjs +96 −0
  • editor/editor-entry.js +6 −0
  • editor/fromMarkdown.mjs +169 −0
  • editor/markup.mjs +372 −0
  • editor/package-lock.json +645 −0
  • editor/package.json +26 −0
  • editor/parity.test.mjs +131 −0
  • editor/safeurl.mjs +152 −0
  • editor/schema.mjs +181 −0
  • internal/mapa/markup/golden_test.go +318 −0
  • internal/mapa/markup/testdata/.gitattributes +1 −0
  • internal/mapa/markup/testdata/corpus/LICENSE.commonmark +11 −0
  • internal/mapa/markup/testdata/corpus/commonmark-0.31.2.json +5,218 −0
  • internal/mapa/markup/testdata/corpus/edge.json +306 −0
  • internal/mapa/markup/testdata/corpus/notes/brightwater-labs.md +31 −0
  • internal/mapa/markup/testdata/corpus/notes/daily-2026-11-12.md +16 −0
  • internal/mapa/markup/testdata/corpus/notes/handbook-unicode.md +24 −0
  • internal/mapa/markup/testdata/corpus/notes/onboarding.md +9 −0
  • internal/mapa/markup/testdata/corpus/notes/preview-samples.md +8 −0
  • internal/mapa/markup/testdata/corpus/notes/weekly-ops.md +38 −0
  • internal/mapa/markup/testdata/corpus/synthetic.json +98 −0
  • internal/mapa/markup/testdata/golden.json +760 −0
  • internal/mapa/static/editor.9c9edc5536b1d844.js +2 −0
  • internal/mapa/synthetic.go +13 −3
  • internal/mapa/synthetic_corpus_test.go +50 −0
.amadan/ci.d/05-editor

Loading diff…

Makefile

Loading diff…

editor/.gitignore

Loading diff…

editor/build-bundles.mjs

Loading diff…

editor/bundles.mjs

Loading diff…

editor/chips.mjs

Loading diff…

editor/domhtml.mjs

Loading diff…

editor/editor-entry.js

Loading diff…

editor/fromMarkdown.mjs

Loading diff…

editor/markup.mjs

Loading diff…

editor/package-lock.json

Loading diff…

editor/package.json

Loading diff…

editor/parity.test.mjs

Loading diff…

editor/safeurl.mjs

Loading diff…

editor/schema.mjs

Loading diff…

internal/mapa/markup/golden_test.go

Loading diff…

internal/mapa/markup/testdata/.gitattributes

Loading diff…

internal/mapa/markup/testdata/corpus/LICENSE.commonmark

Loading diff…

internal/mapa/markup/testdata/corpus/commonmark-0.31.2.json

Loading diff…

internal/mapa/markup/testdata/corpus/edge.json

Loading diff…

internal/mapa/markup/testdata/corpus/notes/brightwater-labs.md

Loading diff…

internal/mapa/markup/testdata/corpus/notes/daily-2026-11-12.md

Loading diff…

internal/mapa/markup/testdata/corpus/notes/handbook-unicode.md

Loading diff…

internal/mapa/markup/testdata/corpus/notes/onboarding.md

Loading diff…

internal/mapa/markup/testdata/corpus/notes/preview-samples.md

Loading diff…

internal/mapa/markup/testdata/corpus/notes/weekly-ops.md

Loading diff…

internal/mapa/markup/testdata/corpus/synthetic.json

Loading diff…

internal/mapa/markup/testdata/golden.json

Loading diff…

internal/mapa/static/editor.9c9edc5536b1d844.js

Loading diff…

internal/mapa/synthetic.go

Loading diff…

internal/mapa/synthetic_corpus_test.go

Loading diff…