oficina / mapa Public

Clone
git clone https://amadan.net/oficina/mapa

Plain git — no account needed to clone.

Download

Download this file

Mapa: columns, page icons, banners, and pins from the import

Status: revision 4, 2026-11-22. APPROVED. Phase 1 (icons and banners) is built and landing on main; phases 2 to 4 follow. Fable approved revision 3 (c3f0886) with four lows, which revision 4 applies. Paul, 2026-11-22: go — recommended answers taken for every question in §12. Building in the four phases of §10.

  • Fable reviewed revision 1 (4879ec7) and found CHANGES REQUIRED: 2 high, 7 medium and 12 low findings. Revision 2 (933e5a3) answered every one.
  • Fable re-reviewed revision 2 and found no high: five mediums and six lows, all in revision 2's own answers. Revision 3 (c3f0886) answered them.
  • Fable's narrow check of revision 3: APPROVE, with four lows. §13 maps every finding from all three rounds to its change.

Asked for by Paul, 2026-11-22, while moving his Notion workspace into Mapa:

  • "can we figure out a way to make multi column work? Is there a Markdown extension we can use?"
  • Page icons, an emoji or a small uploaded image, shown wherever a page's title is.
  • Banner (cover) images: a restrained band at the top of a page.
  • The import pins his top-level pages, with their icons, so Pinned looks like the top of his Notion sidebar. Pinned rows get an arrow that shows the pages inside, one level at a time.

He approved all four on 2026-11-22. This spec says how.

Branch: design/columns-icons (Mapa), from main 2510b47.

What still binds:

  • the base spec, 2026-11-12-mapa-design.md: §3's model and blocks, §4's seal boundary;
  • the level-up spec, 2026-11-14-mapa-level-up.md: §3.2's sidebar and pins, §6's editor and fidelity, §7's gates;
  • the images spec, 2026-11-17-mapa-images.md: storage, the read rule, the attach rule, retention;
  • the Notion import spec, 2026-11-17-notion-import.md: §9 to §15;
  • AGENTS.md's hard rules.

What it changes, in one list:

  • The body: one new syntax, the column layout (§1).
  • The sealed page record: two optional fields, icon and banner (§2, §3).
  • The event log: one new verb on team pages, styled (§4).
  • The attach rule: a page's record can reference images, as its body does (§4).
  • The index: one derived relation, "pages inside" (§5).
  • One cookie and one view POST for the sidebar's arrows (§5).
  • The importer: what it does with icons, covers and columns, and the pins it sets (§6).

It changes no trust property. §4's plaintext list is unchanged. No new table, no new plaintext column, no new network host unless Q5 says yes.

Names in this spec. Its decisions are D1 to D17 (§0). Its gates are COL1–COL13, LOOK1–LOOK12, IN1–IN8 and I20–I25 (§9). Its questions are Q1 to Q8 (§12).

---

0. Decisions

| # | Decision | Rejected | Section | |---|---|---|---| | D1 | Columns are Pandoc's fenced divs, in a strict form Mapa reads and writes: :::: columns, then two to four ::: column … :::, then ::::. Pandoc and Quarto are the reference, and a recorded Pandoc fixture holds Mapa to them (COL12). markdown-it-container reads ::: name containers too. remark-directive wants :::name with no space, so there, as in Obsidian and GitHub, the fences are text and the blocks are ordinary blocks | HTML (<div>), which Mapa never renders; a table hack; Obsidian plugin syntaxes (--- start-multi-column), which nothing else reads; a columns code fence, which hides its blocks from search and links | §1.1 | | D2 | A layout is recognised only when it is whole. Anything less is today's text, byte for byte and meaning for meaning. No existing page changes, and the corpus proves it | Partial recognition (an unclosed layout running to the end, as an unclosed code fence does) | §1.2 | | D3 | Fences are blocks. The layout's four kinds of fence line are blocks of their own kinds in Mapa's flat block list, and the blocks between them are ordinary blocks that know their column. The merge, Replace, Settle, block indices and the editor's side table keep working on one flat list | A nested block tree, which every one of those would have to learn | §1.4 | | D4 | Equal widths only. No width=, no nesting, 2–4 columns. Columns stack below a container width, not a viewport width | Pandoc's width="40%", until someone asks (Q2); nesting, which no phone can show | §1.1, §1.5 | | D5 | The merge never cuts a layout in a way that breaks it. Edits inside columns merge block by block, as now. A conflict whose hunk holds a fence widens to the whole layout. Whenever any side holds a fence, the settled sequence, conflicts included as opaque units, is checked; if its layouts would not be valid, the merge is redone with layouts as units | Treating a layout as one block, which would make two people's edits to different columns conflict | §1.8 | | D6 | Icons and banners are page metadata, in the sealed record, not body text. Team pages only | A first line in the body (icon: 🚀), which every reader of the Markdown would see; a plaintext column | §2.1, §3.1 | | D7 | Changing the look mints a revision, logged styled, holding the same body, as a rename does. History shows it, drafts are carried over it, and the importer counts it as an edit | Changing the record in place, which would let a re-run of the import undo a person's choice and leave History silent | §4.1 | | D8 | An icon is one RGI emoji or a Mapa image. RGI is Unicode's list of emoji every platform draws, vendored at one version | Any text; Notion's own icon set, which is SVG, which Mapa refuses (images Q1) | §2.2 | | D9 | Icon and banner images are ordinary Mapa images, attached to their page by the attach rule, which now reads the record as well as the body | A second image store; drawing them by URL | §4.2 | | D10 | The banner is a fixed-height band, cropped to cover, with a stored vertical position | A banner as tall as the picture; free cropping | §3.2 | | D11 | "Pages inside" is the In: [[Parent]] line. A team page whose first block is exactly that line is inside that page. The importer already writes it. Anyone can type it, or use Page → Put inside… | A stored parent field, which would be a second tree beside the text; the importer's map, which only importers can see and which Finish keeps sealed | §5.1 | | D12 | Only team pages are inside anything, and only team pages hold pages. | Private pages in the relation, whose first lines would then reach the sidebar (level-up build note 80) | §5.1 | | D13 | The arrow's state is a cookie, like the sidebar's fold. Scriptless, it is a view POST | A row in the database; a GET that writes | §5.3 | | D14 | The importer pins the roots it creates, for the person who ran it, once. A re-run never pins a page again | Pinning for every member; re-pinning on every run | §6.3 | | D15 | The importer carries icons, covers and columns through the forms above, under the untouched rule it already has | Leaving them counted and lost, as now | §6 | | D16 | Typed text never makes or breaks a layout. The editor and the importer put U+200B before a line whose text starts, after any spaces, with :::. A code block inside a column is always written closed, and a structural reparse inside a column is confined to that column. Layouts come from Insert, /, paste and the textarea | The editor adopting the parse, which would let one typed ::: or an unclosed fence tear a layout apart | §1.7 | | D17 | The block grammar has a version. The island carries it, and every route that posts block indices sends it back. A tab on an older bundle is refused and told to reload, so it never moves or marks blocks it counted differently | Trusting indices across a grammar change | §1.10 |

---

1. Columns

1.1 The syntax, exactly

:::: columns

::: column
The left column's blocks.

- Any ordinary block.

:::

::: column
The right column's blocks.

:::

::::

The four fence lines. Each is a whole line. None may be indented, and trailing spaces and tabs are allowed.

One predicate for "looks like a fence" (markup.FenceLike, ported): a line whose text, after any spaces and tabs, starts with :::. §1.1's rule 5, the editor's neutraliser (§1.7), its "entering a column" rule and the importer's §11.4 row all use this one predicate, so no two of them can disagree about a line.

| Line | Form | Mapa kind | |---|---|---| | the layout's opener | four or more colons, then one or more spaces or tabs, then the word columns | columns | | a column's opener | three or more colons, fewer than the layout's, then spaces or tabs, then column | column | | a column's closer | exactly as many colons as its opener | column_end | | the layout's closer | exactly as many colons as the layout's opener | columns_end |

When a layout is recognised. All of these must hold. If any fails, nothing is recognised, and every line parses exactly as it does today (§1.2).

  1. The opener starts a block. It is the body's first line, or the line before it is blank.
  2. Columns are explicit. Between the opener and the first column, between a column's closer and the next column's opener, and between the last closer and the layout's closer, there are only blank lines.
  3. There are two, three or four columns. One column, or five, is not a layout.
  4. Each column closes. A column ends at the first line, outside a code fence, that is exactly its closer. The code fences inside a column are found by the same rule Parse uses at the top level, so a ::: inside a fenced code block is code.
  5. Nothing inside a column looks like a fence. Outside a code fence, a column may hold no other line that is FenceLike. That rules out nesting, a stray :::, an indented fence another reader might take, and any closer of another length. An unclosed code fence in a column never lets the column close, so it fails rule 4.
  6. The layout's closer ends a block. It is the body's last line, or the line after it is blank.

The scan, exactly, so Go and the port agree (M2). The pre-pass reads the body's lines top to bottom, tracking code fences as Parse does. At a line outside a code fence that matches the layout opener and meets rule 1, it tries to read a whole layout by rules 2 to 6.

  • On success, the layout's lines are taken, and the scan resumes at the line after its closer.
  • On failure, that one opener line is ordinary text, and the scan resumes at the very next line. So a later opener, including one inside the failed candidate, is tried on its own terms. A nested layout therefore gives the inner layout as columns, with the outer fence lines as text around it.

What Mapa writes. The layout opener with four colons, columns with three, and the seams shown in §1.4. That is Quarto's own documented form without its braces. A layout typed by hand with longer fences keeps them. A column added to it copies the fence length of the column before it, or of the one after it when it is added first.

Recommendations inside the grammar:

  • Every column is explicit (rule 2). Pandoc would read text between the opener and the first column as part of the outer div. Mapa has nowhere to draw it.
  • Empty columns are allowed (::: column then :::). They render as an empty column holding the editor's empty paragraph, so there is somewhere to type, exactly as the trailing paragraph works (level-up §6.2). They serialise back to the two fence lines.
  • Widths: equal only (Q2). A column opener with anything after column (::: column width="40%", ::: {.column}) is not a column, so a Quarto layout with widths reads as text. Mapa never writes one.
  • The bare word only, never Pandoc's {.columns} brace form. One spelling keeps the grammar, the port and the neutraliser (D16) small. Q2 covers both.
  • Why the outer fence must be longer. It is Quarto's convention, and it makes the structure visible in the textarea. With exact-length closers, Pandoc's own rule (a bare fence closes the innermost div) gives the same divs for the form Mapa writes. A layout typed by hand in another shape Mapa still recognises is expected to read the same, and COL12 records what Pandoc makes of each case, but only the written form is promised.
  • Checked against real Pandoc at build (COL12). Pandoc is not on this machine, so the claim is not yet tested. The build installs Pandoc, renders every positive and negative COL2 case to its AST, and commits the result as a fixture. The test asserts agreement for the positive cases and for Join's output, and records the negatives without asserting, since Mapa refuses some of them on purpose (one column, five, {.column}, nesting). Cases where Pandoc might differ are named in it: a quote or a list item directly before a closer (lazy continuation), a line indented one to three spaces then ::: inside a column, ::: column :::, and an empty column. Where Pandoc reads Mapa's written form differently, Mapa's writer changes, not the fixture. Mapa always writes a blank line before a column's closer for this reason (§1.4).

1.2 A stray ::: in an old page

Rule: a layout is recognised only when §1.1's six rules all hold. In every other case the lines are what they are today: a ::: line continues a paragraph, or starts one after a blank line. So no body that is not a whole, well-formed layout changes meaning, and nothing is ever partly recognised.

The corpus, run on 2026-11-22:

  • Mapa's corpus (internal/mapa/markup/testdata/corpus/): 2,388 bodies across synthetic.json, edge.json, import.json, the CommonMark 0.31.2 examples and notes/. No line in any of them starts with :::.
  • Every Markdown file under ~/amadan.net/oficina (6,948 files), read in place as make corpus-local would. No line starts with :::.
  • The Notion importer writes no line starting with :::: notionmd has no such text, and §11.4's block-start row does not need one today.
  • So the live instance, whose pages are Paul's import and his own typing, can hold a layout only if someone typed a whole Pandoc layout by hand before this ships.

Gate COL1 holds this: every existing entry of golden.json and editor.json stays byte for byte, and no existing corpus body parses to a fence block. The new cases are additions.

1.3 With lists, code fences, quotes and markers

  • Lists are ordinary blocks inside a column. A list never runs across a fence, because a fence is a block and renderList stops at the first block that is not an item.
  • List continuation: continuesParagraph stops at a column's closer, inside a recognised layout only. Outside one, nothing changes.
  • Code fences inside a column work as at the top level, and hide fences (§1.1 rule 4). A layout inside a code fence is code.
  • Quotes: a fence line starting > is a quote line, never a fence. So a layout cannot sit inside a quote, and a quote can sit inside a column.
  • A layout inside a list item cannot happen: fence lines are never indented.
  • Block markers (^id) go on any content block in a column, as anywhere. A fence never carries one, so :::: columns ^x is not an opener, and §1.1 rule 1 makes it text.
  • Images in a column follow the images spec unchanged. An image alone in a column's paragraph gets the alone class.
  • Headings in a column work as anywhere. History's "Edited <nearest heading above>" looks up the flat block list, so it finds a heading above the layout, or one earlier in the same column (§1.9).

1.4 The model: fences are blocks (D3)

markup.Block gains one field and four kinds:

  • the kinds columns, column, column_end and columns_end, one per fence line;
  • Column: for a fence or content block inside a layout, the column it belongs to, 1 to 4; 0 everywhere else.
  • A columns block's Level is its number of columns, as a heading's is its level.

Parse first finds whole layouts with a pre-pass over lines, which tracks code fences as Parse already does, then parses each column's lines as a body of their own and offsets the results. A body with no layout takes no new path.

Join's rule for fences, which is how Mapa writes a new layout:

  • a blank line after the layout's opener, between a column's closer and the next opener, and before the layout's closer;
  • one newline after a column's opener;
  • a blank line before a column's closer, so no reader's lazy continuation can carry a quote or list item's line into it (§1.1);
  • an empty column's opener and closer on consecutive lines;
  • blocks inside a column are joined by today's rule.

Any seam parses the same way, because the parser does not need blank lines next to fences. Seams that already exist are kept byte for byte (level-up §6.4).

Column and a columns block's Level are derived, not identity (H2). They are positions, so a block keeps its source and kind when a column is added before it, but its Column changes. So:

  • align matches by source, as now;
  • sameStructure compares kind, source, and a content block's Level and Ordered, and never Column or a columns block's Level;
  • layout validity is a separate check, markup.ValidLayouts(blocks), over the kinds of the sequence: every opener followed by two to four columns, each column's fences in order, no content block between columns, no fence outside a layout. It renumbers Column and Level as it goes. The editor's structure check uses the same pair, ported.

Other consumers of blocks:

  • Plain and Words of a fence are empty. Search, snippets and the word index read markup.Words (words.go, snippet.go, search.go), so the word columns never reaches them, nor unlinked mentions.
  • Replace and block indices count fences as blocks. Make team page's indices come from the committed body parsed by markup.mjs (level-up §6.7), so they agree.
  • Strip, marker, chips and spans never run on a fence.

1.5 Rendering

<div mapa-columns="2">
  <div mapa-column>…the column's blocks, drawn as anywhere…</div>
  <div mapa-column>…</div>
</div>
  • The server draws it, and toDOM draws the same (L4). An empty column is <div mapa-column> holding exactly markup.EmptyParagraph, the editor's own empty paragraph, pinned in L4 like the trailing one. A scriptless reader sees an empty column of one line's height.
  • Side by side: a CSS grid of equal tracks (repeat(n, minmax(0, 1fr))), top-aligned, with a column gap of --rst-sp-5. No rule, border or fill: a layout is a way of placing blocks, not a box.
  • Stacked below a container width. A container query on the page column ([mapa-doc]), never the viewport, because the open sidebar and Links panel change the column's width (level-up §4.1). The columns stack below 36rem, in column order. Stacked, the gap between columns is the body's own block gap, so they read as consecutive blocks. Q3 asks Paul about the width.
  • Inside a column, the blocks keep the body's rhythm: the first block's top margin and the last block's bottom margin are zero, as in [mapa-body] (§8).
  • While editing, the layout the caret is in shows a faint dashed outline around each column (outline, so it never moves anything). Away from the caret, a layout looks exactly as it reads.
  • Accessibility: columns are plain divs. Reading order is the source order: column 1 top to bottom, then column 2. That order is how a screen reader, the stacked view and the textarea all present it.

1.6 Elsewhere

  • Pandoc and Quarto read a Mapa layout as columns. With --from markdown Pandoc's own columns class is honoured by its slide writers. Quarto honours it in HTML.
  • Obsidian, GitHub, plain CommonMark and the textarea show the fence lines as short lines of text and the columns' blocks one after another. Every block survives with its meaning.
  • S3 and memoria serve the body as it is (base §8), so memoria reads the fence lines as text. They hold no content.
  • S10's page payload (base §7.3, not built) will name the layout as a typed block when it is built.
  • Export (base decision 15, not built) writes the body as stored.

1.7 The editor

Schema:

  • columns: in group block; content column{2,4}; attributes fence (the opener's colon count) and the fences' origins (§6.4's side table).
  • column: content one or more of every block but columns, so a layout can never nest; isolating, so Backspace at a column's start never joins it to the column before; attributes fence and the fences' origins.
  • Fences are origins in the side table, like textblocks. An untouched fence re-emits its source. New fences are written in Mapa's form (§1.1) with the layout's own fence lengths. The seams beside a fence are recorded and kept like any other seam.

Moving between columns:

  • Arrow keys follow reading order. ↓ at the end of a column's last block goes to the start of the next column, ↑ from a column's first block to the end of the previous one. This is ProseMirror's own order for this schema, so it costs nothing.
  • Tab keeps its rule: it indents list items and otherwise leaves the editor (level-up §6.6). It does not move between columns.
  • ⌥⌘→ and ⌥⌘← (Ctrl+Alt elsewhere) move the caret to the start of the next or previous column. They are listed in Help.

Making, adding and removing:

  • Insert → Columns and / → Columns offer 2, 3 and 4 columns. - With the caret in an empty block, that block becomes column 1's paragraph and the others start empty. - Splitting: with a selection, or the caret in a block with text, the selected blocks (or the caret's block) move into column 1 of a new two-column layout, and column 2 starts empty with the caret in it. This is the "turn this into two columns" path. - Inside a layout, Insert → Columns is not drawn. Layouts do not nest.
  • With the caret in a layout, Insert gains Add a column (when there are fewer than four) and Remove this column, and the Page menu's block entries gain Undo columns. - Add a column adds an empty column after the caret's. - Remove this column moves its blocks to the end of the column before it (or the next, for the first). It never deletes text. Removing a column from a two-column layout leaves one, so it undoes the layout instead. - Undo columns puts every column's blocks at the top level, in reading order, in the layout's place.
  • Backspace in an empty column that holds only its empty paragraph removes the column, by the same rules.
  • A selection across columns deletes the selected blocks' text and never a column. A column left empty keeps its empty paragraph.
  • Each of these is an ordinary transaction: it is undone with ⌘Z and saves as an edit.

Paste:

  • Mapa's own slice (application/x-mapa) carries fences as blocks, with their sources and seams. Pasted at the top level, a layout arrives whole. Pasted inside a column, the layout's blocks arrive in reading order, without their fences (no nesting).
  • text/plain is parsed as Mapa Markdown, by the same rule.
  • text/html from outside maps blocks in document order. A side-by-side layout from another app arrives as its blocks, one after another.
  • Make team page (level-up §6.7) widens a selection that crosses a column, or touches a fence, to the whole layout. A selection inside one column moves just those blocks, and the link chip takes their place in that column. The server holds the same rule (§1.10).

Typed fences and the reparse (D16, M1). Mapa has no escapes (level-up D11), and a typed ::: inside a column would close it. Four rules keep typing from breaking a layout:

  1. The settle plugin puts U+200B before the first : of any FenceLike line (§1.1) in a changed textblock, code blocks excepted. Code is safe by rule 3, and a U+200B inside code would change it. This is the importer's neutraliser (Notion import §11.4) applied to one more pattern. The line looks the same and the stored text parses as text. It runs before the reparse rule in the same plugin pass, so no reparse ever sees a raw fence, and again over whatever a reparse adopts, until nothing changes. L3's idempotence covers that fixed point. As before, it reaches only blocks being edited: an untouched block keeps its source, so L2 holds.
  2. A block that enters a column counts as edited when any of its lines is FenceLike, so rule 1 reaches it. That covers a block moved in by Insert → Columns, by paste or by a drag. Every other block keeps its source.
  3. A code block inside a column is always written closed. Level-up §6.4 step 5 re-serialises an unclosed fence once it is no longer last; inside a column it is never last, so its closing fence is always written. A reparse that would open an unclosed fence (a typed ``` ` ``` after a hard break) gives a closed code block inside the column.
  4. No adopt ever turns a layout into text. When step 6 adopts a parse for a block in a column, it parses that column's own lines, as the grammar does (§1.4), and replaces that column's content only. Step 5's last resort, the whole-body adopt (fidelity.mjs, serialize.mjs), first re-serialises every column's content neutralised (rule 1) and with its code closed (rule 3). Those two rules make every column's text unable to close it early, so the body's parse keeps every layout the document holds. COL3 runs both adopts over layouts and asserts the layouts survive.

Edit as Markdown shows the fences as text. The textarea has no neutraliser: a person typing a whole layout there gets one, and Help's "Markdown in Mapa" documents the syntax. Scriptless, a page with columns reads as columns, and the textarea round-trips them.

1.8 The merge (D5)

Inside a column, blocks merge as they always have. Ana edits a paragraph in column 1 and Bo edits one in column 2: two stable fences between them, and two clean hunks. The same block in both: a conflict, offered as Yours, Theirs or Both, inside the column.

Fences are blocks to align. Repeated fence lines (::: column, :::) align by the same longest common subsequence as repeated paragraphs do, and the unchanged ones become stable anchors.

Two rules keep every result a valid body:

  1. A conflict never cuts a layout. When any side of a conflicting stretch holds a fence block, the stretch widens on all three sides to the nearest stable blocks that lie outside every layout it touches, or to the body's start or end. Every choice then yields whole layouts. Both gives two layouts, mine first (base build note 24).
  2. Every result must hold valid layouts, conflicts or not (H1). When any of the three sides holds a fence, Merge3 checks the first pass's hunks. Each conflict hunk is an opaque unit that rule 1 has made either fence-free or whole layouts, and the check places it exactly (round 2, M1): - A fence-free unit counts as one content block, and the check must also pass with it empty, since Keep theirs may choose nothing. So a fence-free conflict between a column's closer and the next opener fails: one of its choices would put content between columns. - A unit holding layouts counts as one top-level layout, so it fails anywhere but the top level. - The parse agrees. align matches by source, so a side whose layout was broken text can align its :::: columns paragraph with a real fence. So the check also joins the result, with each conflict taken as mine and then as theirs, and requires Parse of each to give the settled blocks' kinds and order.

If any of this fails, the merge runs again, widening every stretch that touches a fence on any side, clean or not, by rule 1's widening, and resolving each by diff3's rule. A layout one side reshaped and the other left alone is then taken whole from the side that changed it. A layout both sides changed, where at least one changed its shape, is one conflict. The second pass's result always passes the check, because every layout in it comes whole from one side.

Examples:

  • Ana undoes a layout while Bo adds a column to it. Each change is clean on its own, and together they leave a column with no layout. Rule 2 makes the whole layout one conflict.
  • The same, while both also edit one paragraph at the top. The paragraph is a conflict, so the merge is not clean. Rule 2 still runs, because sides hold fences, and the layout becomes a second conflict.
  • Ana adds a column after column 1 while Bo edits a paragraph in column 2. Bo's paragraph is in column 3 of the result. Column is derived (§1.4), so the result is valid and the merge is clean, with Ana's fences and Bo's bytes both kept.
  • Two people each remove a different column of a three-column layout. The result has one column, which ValidLayouts refuses, so rule 2 makes it one conflict.

Settle keeps bytes as before. Its structure check is sameStructure, which no longer compares Column (§1.4), so a merge that renumbers columns keeps its bytes and never falls back to Join for that. Rule 2 has run before Settle, so Settle is never handed fences that do not balance, whatever the choices.

The editor's rebase and inline choice (level-up §6.5) apply the merged body and rebuild the side table against it, fences included. A widened conflict shows its hunk around the whole layout.

1.9 History, the word diff and summaries

  • Summaries (level-up §4.5's edited row) gain: - "Added columns" or "Removed columns", for a layout that is new, or gone with its blocks kept; - "Added a column" or "Removed a column"; - otherwise the usual "Edited <the nearest heading above the first changed block>", "Added <n> blocks" or "Removed <n> blocks". <n> counts content blocks, never fences, and is written with {{number L n}}.
  • The diff draws the revision on screen with its own layout. Content blocks are diffed as now: block by block, then word by word. A new column or layout carries the inserted tint as an outline. A block removed since the version before is drawn struck, in its old column if that column still exists, and otherwise just after the layout, under a muted line, "Was in a column". Fences are never word-diffed.

1.10 Backlinks, search and the rest

  • Backlink context is the block that holds the link (base §3.2). In a column, that is the content block, drawn alone, with no column around it. The Links panel's "Linked from" therefore looks the same for a link in a column as for one anywhere else.
  • Unlinked mentions and Link it work on content blocks only. "Link it" edits that block in place, in its column.
  • Search, ⌘K snippets and the text index read content blocks. Fences add no words.
  • "Link to this block" marks content blocks in columns as anywhere. Fences cannot be marked.

The server holds these rules too (M3). The editor is not the only caller of a block-index route.

  • MarkBlock refuses the four fence kinds, as it refuses code and rules (markers.go).
  • LinkMention ("Link it") refuses them too. Fences hold no words, so the index never offers one, but a forged or stale post must not turn a ::: column line into a link and break the layout.
  • MakeTeamPage (share.go's splitBlocks) refuses indices that cut a layout: the chosen blocks must be whole layouts, or lie within one column. The editor widens first, so a refusal means a stale or foreign client.
  • The grammar version (D17). markup.Grammar is an integer, 2 from this change. Every route that posts a block index sends it back, as a field named grammar:

| Route | Handler | Where grammar comes from | |---|---|---| | POST /p/{id}/share (Make team page) | private.go, share.go | the island, in the editor's post; the scriptless form's hidden field | | POST /p/{id}/blocks (Link to this block) | handlers_history.go | the ¶ handle's post, from the island; the server-rendered form's hidden field | | POST /p/{id}/mentions (Link it) | handlers_edit.go | the Links panel's server-rendered form, a hidden field | | POST /p/{id}/resolve (the inline choice and the conflict page) | handlers_edit.go | the island; the conflict page's hidden field |

The build checks this list against every handler that reads a block or hunk index, and COL13 fails on one that does not check grammar. A post with another version, or none, is refused with 409. Its draft is kept. The reply's error carries the sentence "Mapa has been updated. Reload the page to keep editing.", because the tabs this refusal is for run the old bundle, which shows a reply's error (maketeam.mjs) and has no new bar. A scriptless form shows the sentence on the page it returns to. Autosave sends text, not indices, so it is not refused; a tab on the old bundle simply cannot make a layout, because the old editor has no command for one.

---

2. Page icons

2.1 Where an icon lives (D6)

  • The sealed record gains icon: either {"emoji": "🚀"} or {"image": "<public id>"}, never both. It is absent when the page has none.
  • Team pages only. Daily notes show their date and scratch pages their first line. Neither has a title row, a row in Pinned's tree, or a chip with a title, so an icon would have almost nowhere to show. Q1 asks Paul.
  • Sealed, so §4's list is unchanged. The emoji is content. An image icon's public id is sealed with it, and its row in images shows only that the page holds one more image, which §1.3 of the images spec already lists.
  • Changing it is a styled revision (§4.1).

2.2 Which emoji (D8)

  • Exactly one RGI emoji: a fully-qualified sequence from Unicode's emoji-test.txt, version 16.0, vendored as internal/mapa/emoji/emoji-test.txt with its licence. That covers skin tones, flags, keycaps and ZWJ sequences, and nothing that is merely a symbol.
  • Normalised before checking: a minimally-qualified or unqualified form from the same file (☺ without U+FE0F) is stored in its fully-qualified form (☺️), so every platform draws it as an emoji.
  • Anything else is refused: "Choose one emoji, or upload a picture." Two emoji, text, and a private-use character are all refused.
  • A newer emoji than the vendored version is refused until the file is updated. Updating it is a one-file change with its own test.
  • How the picker gets the list: a JSON file built from emoji-test.txt (each emoji, its group and its English name), served as a content-hashed static file, about 25 KB gzipped, fetched the first time the picker opens and cached. It is not in the editor bundle, so L12's size budget is untouched.

2.3 Image icons

  • An icon image is a Mapa image (images spec), attached to its page (§4.2). It counts against the team's allowance.
  • Limits: PNG, JPEG, GIF or WebP; at most 128 KiB and 512 px a side (M5). An icon is drawn at 16 to 40 CSS pixels, and is fetched wherever a title is, so it must be small. Refusals name the figure, written in the reader's locale (§7): "Icons can be up to 128 KB and 512 pixels a side."
  • With script, the picker crops the picture to a centred square and scales it to 256 × 256 px on a canvas before upload: PNG when the picture has transparency, otherwise JPEG at quality 0.9, and halved again if it is still over the limit. A phone photo therefore always fits. A picture that fails to decode is sent as it is, and the server's limit decides.
  • Scriptless, the file goes as it is, within the limits.
  • Drawn as a square, object-fit: cover, with Fiesta's small radius (--rst-radius-sm, 4px).
  • Serving them cheaply (M5). GET /i/{id} reads the bucket and unseals under the blob semaphore (images §1.4). A sidebar, All pages and ⌘K can ask for dozens of icons at once. So: - A small-image cache: GET /i/{id} keeps the opened bytes and content type of any image within the icon limits (§2.3), in a bounded in-memory LRU of 16 MiB keyed by public id. The handler cannot tell an icon from a small body picture, and need not. - Scope first, always. A hit is served only after images §1.4 step 1 has passed against the row, in the database, on every request: the row exists, and the viewer may read it (its page live and in scope, or the viewer's own pending image). The cache replaces only the bucket read and the unseal, never the read rule. So a deleted page, a removed image or a removed member answers 404 whether or not the bytes are cached. Eviction on removal and sweep is tidiness, not correctness. - Memory is not rest, so the seal's rule is unchanged; the index already holds titles and bodies in memory. - A miss takes the semaphore like any image. - Lists draw loading="lazy" for icons below the first screen. - The browser's own cache (private, max-age=3600, immutable) covers repeat views. - LOOK12 times All pages with 200 image icons against the bucket fake.

2.4 Where it shows, and at what size

Wherever a team page's title is drawn, the icon is drawn just before it. The icon is decoration (aria-hidden="true", alt=""), so no accessible name changes.

| Place | How | |---|---| | The page's title row | before the title, at the title's own size (1em: 2.5rem, or 1.875rem on a phone), with a gap of --rst-sp-3 | | Sidebar rows (Pinned, Recently edited, and the arrows' rows, §5) | in the row's 16px glyph cell, in place of the page glyph | | Chips (team, and through an alias) | in place of the chip's page glyph, at the glyph's size (1em of the chip's text). A pending chip has no page and keeps its glyph. Block and date chips keep their own glyphs | | The Links panel's lists (Linked from, Mentioned, Links out) | in each page's glyph cell | | ⌘K's Pages and In the text groups, the Search page and All pages | in each row's glyph cell | | The browser tab's <title> | an emoji icon prefixes the title ("🚀 Pilot plan · Mapa"). An image icon does not |

  • Not shown: in estilo's header title field, which holds text only; on the map's nodes, which are small circles with no room; in History's list.
  • Emoji are drawn by the system's emoji font. There is no webfont, so there is nothing to flash (level-up §6.9).
  • The chip's icon comes from its resolution, like its state: the island's resolutions, POST /links/resolve and the golden file's resolution table each gain icon. It is never a node attribute, so an icon change never makes a block count as edited (level-up §6.4, step 2).
  • An image icon that is unavailable (removed from Mapa, §4.3) is drawn as the plain page glyph. The server decides this at render, so nothing shifts.

2.5 Setting an icon

With script:

  • The look row: above a team page's title, a row holding Add icon and Add banner (or Change icon, Change banner). Its height is always reserved. Its buttons are transparent until the page head is hovered or holds focus, and always visible on coarse pointers. So the row never shifts anything.
  • The Page menu gains Icon… and Banner…, the keyboard path.
  • The icon picker is a popover: - a search field, matching the English names in emoji-test.txt (Mapa's interface is in English; its formats are localised, §7); - the emoji in Unicode's nine groups, as a grid. The grid is a listbox with arrow keys, ↵ to choose and Esc to close, focus returning to the button; - Upload a picture…, a file input with the four types; - Remove icon, when there is one. - A typed or pasted emoji in the search field, from the system's own picker (⌃⌘Space), is offered as the first result when it is valid.
  • Choosing posts POST /p/{id}/look and holds the busy rule's 650ms. Its reply carries the new revision and the one it was made over, as a rename's does, so the editor follows its base (§4.1).

Scriptless: Page → Icon and banner opens /p/{id}/look, a form page in the shell. It has an emoji field, a file input, Remove icon, the banner's fields (§3.3), and Save. The file is uploaded as a pending image (its own uploaded write) and the look is set in the same request.

---

3. Banners

3.1 Where a banner lives

  • The sealed record gains banner: {"image": "<public id>", "y": 50}. y is the vertical focal position, 0 (top) to 100 (bottom), in steps of 5.
  • Team pages only, for §2.1's reasons. Q1 covers both.
  • A banner is always a Mapa image. There is no colour or gradient banner, and no external one.

3.2 Height and crop (D10)

  • A fixed-height band: 10rem from 800px, 7.5rem below it. Sizes are not spacing, so they are not on Fiesta's spacing scale. They are the scale's 2.5rem step (--rst-sp-6) times four and three.
  • It spans the page's main area, the width between the sidebar and the window's edge, directly under the header, above the kicker line. The Links panel floats over it as it floats over the page.
  • Crop: object-fit: cover, object-position: 50% <y>%. The CSP allows no inline style, so y's 21 values are 21 attribute rules ([mapa-banner][data-y="35"]) in mapa.css.
  • Centre by default (y = 50). Reposition (with script) drags the picture up or down and stores the nearest step. Scriptless, the form offers Top, Centre and Bottom (0, 50 and 100), and keeps any other stored value as it is.
  • Decoration: alt="", no caption, no link.
  • Restrained: no overlap with the title, no gradient, no parallax. The icon stays in the title row.

3.3 Upload, replace and remove

  • Add banner and Change banner (the look row, or Page → Banner…) open a file input with the four types. The upload is POST /images, as any image (images §4.1), with its rules: JPEGs over 4,096 px are scaled down first.
  • When it finishes, POST /p/{id}/look sets it, centred.
  • The banner's own controls, shown over its corner on hover or focus, and always on coarse pointers: Reposition, Change, Remove.
  • Remove sets no banner. The image stays in Mapa for the history window like any image the page stopped referencing (§4.3). Removing the bytes themselves is "Remove from Mapa" on the Markdown screen's "Images on this page", as for any image.
  • Scriptless: the /p/{id}/look form's file input, its Top/Centre/Bottom choice and Remove banner.

3.4 Scope, and History

  • Who may set or remove a look: any member, on any team page, as with renaming (base §3.4).
  • Who sees it: whoever may read the page. Every team page is every member's, so scope is the page's own.
  • History (level-up §4.5): a styled revision's summary is one of "Added an icon", "Changed the icon", "Removed the icon", "Added a banner", "Changed the banner", "Moved the banner", "Removed the banner", or two of them joined ("Changed the icon and the banner"). When the revision before has aged out, so there is nothing to compare, it reads "Changed how the page looks". Choosing it shows that revision with its own icon and banner, read from its record, while their images are still kept (§4.3).
  • The kicker's "Edited by" reads the current revision's actor (lastedit.go), as it does after a rename. So after Bo changes the icon, the kicker says "Edited by Bo". That is honest, and the same as for a rename.
  • Restore this version restores the body, as it does today, and keeps the current title, icon and banner. A look is set by setting it.

3.5 No shift: L5

  • The band's height is fixed in CSS, so it is reserved before a byte of the picture arrives. A page with no banner has no band. The server knows which at render.
  • The server also draws width and height on the <img>, from the sealed record, as for any image.
  • An image the server cannot draw (removed, or not available) draws no band, decided at render. One that fails to load keeps its band, filled with --rst-surface-2.
  • L5 gains a page with a banner, an icon, and chips with icons, light and dark, at 1440, 1000 and 390px: every block's box is the same before and after mount and before and after the images load, and no layout-shift entry is recorded.

---

4. What icons and banners share

4.1 The styled revision (D7)

  • POST /p/{id}/look changes the record's icon and banner in one Store.write that mints a revision holding exactly the previous body, logged styled (object page). - It is a rename's shape (verbs.go): carryDrafts moves every draft on the old revision to the new one, so nobody's editor sees a merge. - The editor follows it as it follows a rename. renamedTo today answers only for verb = renamed (verbs.go), so a retried rename whose reply was lost can still tell the tab its new base. It is generalised to renamed or styled, so a retried look post whose reply was lost does the same (M6). LOOK9 holds it. - A post that changes nothing writes nothing (level-up §6.4, step 7), and answers with that follow, as a repeated rename does.
  • Why a revision: History must be able to say who changed a page's look and when. And the importer's untouched rule (Notion import D8) reads "any later revision": a person who changes an imported page's icon has chosen it, and a re-run must not put Notion's back.
  • The verb, in plaintext, says that someone changed a team page's look and when. Teammates can see that on the page and in its History, so it adds nothing. It is never logged on a private page, because private pages have no look (§2.1).
  • "Recently edited" does not count styled, as it does not count renamed (level-up §3.2).
  • Every other verb carries icon and banner forward in the record, as it carries origin (Notion import §14.2): commits, Revert, relink, markers and Restore of a deleted page. A test runs every verb on a styled page (LOOK9).
  • S3 does not change. It serves the title and body. memoria never sees an icon. The suite contract has no field for one.

4.2 The attach rule reads the record (D9)

The images spec's §3.2 gains one clause. A page's references are its body's /i/ addresses and its record's icon.image and banner.image. Everywhere the attach rule and the retention rule say "referenced by the body", they now say "referenced by the body or the record":

  • In code (M6): settleImages, stampImages and heldImages (images_attach.go) take the page's references, markup.ImageIDs(body) joined with the record's two, instead of the body. Every tx.commit caller and repointImages pass the record they write. A body edit after an icon is set must leave the icon's unreferenced_at null (LOOK5).
  • Attaching: styled is added to the verbs that pass attach. It attaches an icon or banner image that it introduces, that is pending, and that is owned by the person setting it.
  • Which images a look may name, checked inside the write (M6), in the same Store.write as the commit, before it. Today's attach skips a foreign pending id silently. styled checks first, and accepts exactly two cases: - the setter's own pending image, which the write attaches; - an image already attached to this page: a picture in its body, or its previous icon or banner still inside the window.

An icon is also checked against §2.3's icon limits, from the image's sealed record, so a large body photo cannot become an icon. Anything else, someone else's pending image or an image attached to another page, is refused with the app's 404, exactly as an id that does not exist, and nothing is written.

  • unreferenced_at is stamped when a new revision's body and record stop referencing the image, and cleared when either references it again.
  • The sweep keeps an image referenced by a page's current record, as it keeps one its body references.
  • Restore of a deleted page re-points icon and banner images with the rest (images §3.2, item 4).

4.3 Drawing someone else's icon

The images spec's rendering rule (§3.1) draws /i/<id> in page P's body only when the image is attached to P, or is the viewer's own pending image. That stays exactly as it is.

Icons are drawn by title, not by body. Wherever page Q's title is drawn for a viewer who may read Q, Q's icon image is drawn with it. The GET /i/{id} read rule already allows it (an attached image is readable by whoever may read its page). So:

  • a body on P that types Q's icon address renders "Image not available", as today (IMG1 holds);
  • a chip to Q on P shows Q's icon, because the chip is Q's title.

"Images on this page" (images §3.3) lists the icon and banner too, labelled "Icon" and "Banner", with Open and Remove. After "Remove from Mapa", the icon draws as the page glyph and the band is not drawn.

---

5. Pages inside, and the arrow

5.1 The relation (D11, D12)

  • A team page is inside team page P when its first block is a paragraph of exactly one line, In: [[P]] or In: [[P|shown]], with an optional ^id marker, and the link resolves to P by its title or an alias. Nothing else counts: not a date link, not a link to the page itself, not an In: line further down.
  • It is derived, in memory, in the index, from the body, like every other link (base §3.2). No new storage, no new plaintext, nothing in §4's list.
  • The importer writes this line already (Notion import §9.4), so every imported child is inside its parent from the day it was imported.
  • People set it the same way. - Typing the line works, with script or without. The scriptless floor is the textarea: typing or deleting the line there. No new route. - Page → Put inside… (with script) opens a [[-style field and writes or replaces the line as the document's first block, as an editor transaction, saved by autosave and committed like any edit. It is never a server edit under someone's open draft. - Page → Take out of <P> removes the line the same way. - Moving a page is an edit of the child only. The parent's text is never touched, so nobody's page changes without their edit.
  • Only team pages, both ways. A daily note or a scratch page with an In: line is not inside anything, and a private page cannot be a parent (it has no title). So the relation lists team pages only, which every member can open, and no private first line reaches the sidebar (level-up build note 80).
  • Renames: the line is typed text that resolves through the alias (base §3.2), so a parent's rename keeps its children. Delete makes the line pending, and the child is inside nothing until a page takes that title.

5.2 Order

  • The pages inside P come in P's own order: first those P links to in its body, in the order of their first link, which is where Notion put each child_page (Notion import §9.4).
  • Then the rest, by title, in All pages' order.
  • So an imported parent lists its children as Notion did. A child someone moved in by hand comes after them, until P links to it.

5.3 The arrow (D13)

  • Which rows: a Pinned row whose page has at least one page inside it that the viewer may open shows a disclosure arrow. Each row it opens has its own arrow on the same terms. So the arrow shows the pages inside, one level at a time. - Recently edited rows have no arrow. Below 800px the Menu sheet holds places only (level-up §3.3), so it has no arrows, and the rail hides Pinned.
  • The row grid for Pinned becomes 16px 16px 1fr: the arrow's cell, the icon's cell, the title. A row with no arrow keeps an empty first cell, so every icon in Pinned lines up.
  • Opened rows are indented one --rst-sp-4 per level, up to four levels. Deeper levels keep the fourth indent.
  • Cycles: a page that is already one of the row's own ancestors in this sidebar is listed without an arrow, so no row opens into itself.
  • Long lists: an opened row shows at most 50 pages inside, then All <n> pages inside, a link to /p/{id}/inside: a GET screen in the shell listing every page inside P, in §5.2's order, scoped like the arrow. <n> is the viewer's own count, written with {{number L n}}.
  • A total cap: the sidebar draws at most 200 opened rows in all. Past that, further opened rows are drawn closed, with their arrows, so the cookie can never make a sidebar of thousands of rows.
  • State: the cookie mapa-open holds the public ids of the pages the person opened, space-separated, at most 64, newest kept. It is keyed by page, not by path, so a page shown in two places is open in both. Each opened list's id includes its row's position (inside-<row>-<page>), so aria-controls never repeats an id. - The server renders opened rows from it, so first paint is already right. - With script, the arrow toggles at once (no busy rule; level-up L11's "switch at once" list), fetches GET /side/inside/{id} the first time, and sets the cookie. - Without script, the arrow is a POST /view/open form with id, open and a return path checked to be local, which sets the cookie and redirects back, as POST /view/sidebar does. - It is a view preference. It writes no row and logs no event (gate 10, L7).
  • aria-current: a row in an opened list counts as a row. Exactly one shown row carries it, the first in document order that is the page on screen (level-up build note 80).
  • Accessibility: the arrow is a <button aria-expanded aria-controls> named "Pages inside <title>". The opened list is a <ul role="group">. Keyboard: Tab reaches each arrow. → opens and ← closes when the arrow has focus.

5.4 Scope

  • Every list, every arrow and every count come from the index through the one scoped accessor (level-up §8). The pages inside P are team pages, which every member may open, so in practice every member sees the same lists. The accessor is still the only path, so a future rung cannot leak through this one.
  • The arrow's presence says only that at least one page the viewer may open is inside. "All <n> pages inside" counts only those.
  • GET /side/inside/{id} and GET /p/{id}/inside answer 404 for a page the viewer may not open, and for a private page, exactly as for one that does not exist. Both go through the accessor and write nothing.

---

6. The importer

These change the Notion import spec. Its §10 table, §9.1, §11.4 and §15 are amended as below, and those sections will say so when this spec is approved.

6.1 Icons and covers

Page icons, from the page object's icon:

  • emoji: the record's icon.emoji, after §2.2's check. An emoji Mapa's list does not have is not imported and is counted (icon).
  • custom_emoji: Notion's workspace emoji, a picture. It is downloaded through the file transport and becomes an image icon (§2.3). Mapa never decodes pixels, so it cannot scale one down: a custom emoji over 128 KiB or 512 px is refused and counted.
  • file (an uploaded icon): the same. Uploaded Notion icons are often full-size pictures, so many will be refused. The report names the reason, "too large for an icon (over 128 KB or 512 pixels)", and the person can upload a smaller one in Mapa, where the picker scales it.
  • external: Notion's own icon set and any other address. Notion's set is SVG, which Mapa refuses (images Q1), and other hosts are never fetched (Notion import D13). Not imported, counted (icon).

Covers, from the page object's cover:

  • file: downloaded, added with AddImage, and set as the banner, centred. The API gives no position.
  • external on Notion's own cover gallery (www.notion.so/images/page-cover/…): fetched only if Q5 adds that path to the file transport's pin. Otherwise not imported, counted (cover).
  • Any other external cover (Unsplash, any web address): not fetched (D13). Counted.

How they are written:

  • Downloads happen before the page's transaction, under the import spec's §12 rules: a fresh URL from the page object, the lease checked just before AddImage, failures as transient or permanent.
  • notion_images keeps them, with no new table: the icon's and the cover's rows use the place print of the pseudo-blocks icon: and cover: plus the Notion page id. The file's key decides whether it changed, as for an image block (import build note 17).
  • A failed icon or cover is not the page's failure. The page is written without it, and the report counts it by reason.
  • ImportCreate writes the record with icon and banner set. Its commit attaches them (§4.2).
  • The report replaces "Page icons" and "Page covers" (now losses) with "Icons imported", "Covers imported" and their counts of "not imported", by reason.

6.2 Columns

  • A column_list of two to four columns becomes a layout: :::: columns, each column as ::: column … ::: with its blocks inside, in order, then ::::, written by Join's rule (§1.4).
  • One column: its blocks, in place.
  • Five or more columns: each column's blocks in order, as today. Counted (columns).
  • A column_list inside a column, at any depth (directly, or hoisted out of a list item, toggle, quote or callout inside the column): its columns' blocks in order, inside the outer column. Counted (columns).
  • Hoisting: a column_list that the import spec's rules hoist out of a list item, a quote, a callout or a toggle lands at the top level, where it is a layout like any other.
  • Widths: Notion's width_ratio (unverified, §6.5) is not imported. Counted (column_widths) when the columns' ratios differ.
  • An empty column is written as its two fence lines.
  • The check (import D9) holds: the written body must parse back to exactly the blocks the mapper meant, fences and Column included. A child page in a column is [[Child]] in that column.

6.3 Auto-pins (D14)

  • Which pages (M4): the import's roots never yet offered for pinning: mapped pages, live in Mapa (not deleted), that this run surveyed with no imported parent, so they have no In: line, and whose sealed coordinate has no pin mark. Pages created by an earlier run count. So Paul's existing import is pinned by its next run, with no re-import, and each root is offered once.
  • The mark is a new field in the sealed coordinate (import §15), pin: the run that offered it and whether it was pinned or found no free slot. It is sealed, so §4's list is unchanged, and the report reads it to say what happened.
  • Whose sidebar: the run's actor at the time of the pin write: the person who pressed Start, or Resume if someone else resumed it. Pins are per person and sealed (level-up Q1). Nobody else's sidebar changes. A root offered to one importer is not offered again to another.
  • In what order: Notion's API does not give a workspace's sidebar order. The run pins roots in survey order (Notion's created_time, then id: import §9.2), which is Notion's own default sidebar order, since Notion adds a new page at the end of its section. The person's existing pins stay first. The roots follow them, in that order.
  • How many: as many as the person has free pin slots (Q4 asks to raise the limit from 12 to 20). The rest are marked as offered without a slot, and the report lists them by title, each a link to its page, where Page → Pin is one click: "Pinned 9 of your 14 top-level pages. Your sidebar holds 20 pins."
  • When and how (M4): after the fix-up pass (import §13.6) and before the run's done bookkeeping, in one Store.write: it checks the lease, writes the member's sealed pins, writes the pin mark on each offered root's coordinate, and logs one pins event with the member as its object (level-up §8), exactly as POST /p/{id}/pin does. It is a person's write, never bookkeeping. ImportCreate already writes coordinates inside a Store.write, so this is the same shape, and I19's fence on the bookkeeping function is untouched.
  • Crashes: a crash before the write leaves no mark, so Resume (or the next run) offers the same roots. A crash after it leaves the marks, so nothing is pinned twice. The done write that follows is the import's ordinary bookkeeping. I23 kills the run between each pair of statements, as I17 does.
  • When nothing is offered (every root already marked), the pin write does not run at all.
  • When there are offered roots but no free slot, the write still writes their marks and logs pins, though no pin changed. That is accepted: the event says only that the person's pins were considered, and it keeps the marks and the event in one transaction, which a bookkeeping write could not. The level-up spec's §8 "Pins" list gains this, so a reader of the log knows a pins event need not mean a change.
  • Start over (started_over) clears staged trees, not the map, so it keeps the marks. Only Forget clears them.
  • The report's count is read from the marks with this run's id, unsealed for importers as the report's titles are. No plaintext counter is added to notion_runs.
  • Never again: a root carries its mark for the life of the map, so a page the person unpinned stays unpinned. A root newly shared later is offered by the run that first surveys it. "Forget the import" deletes the marks with the map, so a new import offers its roots afresh.
  • The pinned pages carry their icons because pins draw icons (§2.4).

6.4 Re-runs (import §13)

  • "Changed" now includes the look. The rendered output the untouched rule compares (import §13.2) is the body, the title, the icon and the banner. A page whose Notion icon changed is updated if it is untouched.
  • ImportUpdate writes up to three revisions, in this order, each only when needed: renamed (the title), styled (the icon and banner, holding the previous body), and edited (the body). The coordinate records the last. styled and edited pass attach.
  • Kept pages stay whole. A person who changed an imported page's icon or banner made a styled revision, which is a later revision, so the page is kept (§4.1). The same holds for a person's edit anywhere.
  • The first re-run after this ships updates every untouched page that has columns, an icon or a cover in Notion, because those now render differently. That is the intended way to bring them across. The report's "updated" count will be large once. Pages Paul has edited in Mapa keep their flattened columns and no icon, as the untouched rule says.
  • Auto-pins are never repeated for a root (§6.3), and the first run after this ships pins the existing import's roots once.

6.5 The Notion module (oficina/notion)

The module reads three things it does not read today. Each goes in with a recorded fixture.

  • Page.Icon gains URL, for file, external and custom_emoji. A custom_emoji's picture is fetched by its URL. Unverified: that the URL's host is one of the file transport's pinned hosts. The first real run checks it against a recording, as import §19 step 4 did for files.
  • Page.Cover replaces HasCover with {Type, URL}.
  • Block.WidthRatio for column. Unverified: Notion's reference documents width_ratio on a column block. The recording checks whether reading a column returns it.

6.6 The import spec's §10 table: amended rows

| Notion block | Mapa | What is lost | |---|---|---| | column_list, column, two to four columns | a column layout (this spec §1): :::: columns, then each column as ::: column … ::: holding its blocks in order, then :::: | the widths, when they differ (counted) | | column_list with one column | its blocks, in place | — | | column_list with five or more columns | each column's blocks in order, left to right | side-by-side layout (counted) | | column_list inside a column, at any depth | its columns' blocks in order, inside the outer column | the inner layout (counted) | | a list item's children | as before. A column_list child is hoisted straight after the item, where it is a layout | as before |

§9.1's bullet "The page's icon and cover are not imported. They are counted" becomes: "The page's icon and cover are imported as its look (this spec §6.1). An icon or cover Mapa cannot hold is counted."

§11.4's table gains one row:

| Literal text that would be read as | Where it is checked | Written as | |---|---|---| | a fence line (markup.FenceLike: ::: after any spaces) | every line, the first and every hard-break continuation | U+200B before the first : |

§15's notion_images row gains: "and one row each for a page's icon and cover, whose place print is of the pseudo-block icon: or cover: and the Notion page id". §15's coordinate record gains the sealed pin mark (§6.3).

---

7. Locale

Paul's rule (2026-11-17): numbers, dates and sizes are written in the reader's locale from day one, through locale/ and rastrillo's number formatting. Storage stays canonical.

  • Numbers a person reads: "Added 3 blocks"; "All 57 pages inside"; "Pinned 9 of your 14 top-level pages"; the report's new counts; Insert → Columns' "2 columns", "3 columns", "4 columns". All through {{number L n}} or dates.mjs's number formatter.
  • Limits in refusals: "Icons can be up to 128 KB and 512 pixels a side." The figures through the same formatter, with the images spec's unit wording.
  • Dates: History's versions and "Earlier history has aged out" already use {{longDate}} and {{stamp}}. A styled revision's row is drawn by the same template.
  • Stored canonically: y as an integer; the emoji as its code points; widths and positions never as formatted text.
  • Names are not formats. The emoji picker searches Unicode's English names, because Mapa's interface is English. That is a language, not a format, and the rule does not reach it.
  • The In: word is stored text, not a label, and is recognised exactly. A team writing in another language would need its word added to the recogniser. §11 records that.

---

8. Spacing

Paul's rule (2026-11-22): spacing comes only from Fiesta's scale (--rst-sp-1 to --rst-sp-6: 0.25, 0.5, 0.75, 1, 1.5 and 2.5rem), and vertical rhythm from the rst-stack primitive on Fiesta's feat/stack-rhythm branch.

  • Every gap, margin and padding this spec adds is a scale step: the column gap --rst-sp-5; the icon's gap to the title --rst-sp-3; the opened rows' indent --rst-sp-4 per level; the banner's gap to the kicker line --rst-sp-5; the look row's buttons --rst-sp-2 apart (rst-actions).
  • Sizes are not spacing: the banner's height (10rem and 7.5rem), the icon's 1em, the 16px glyph cell and the 36rem stacking width. They are stated in rem and are not tokens.
  • The new screens use rst-stack: /p/{id}/look, the picker's popover and the import report's new rows, once Fiesta lands it and estilo is re-pinned. Until then they use the scale's steps by hand, with a comment naming the primitive that replaces them.
  • The page body and its columns keep today's block rhythm. Moving the editor's body to rst-stack (a flex column with zeroed margins, inside a contenteditable) is a page-wide change with its own L5 run, not part of this spec. Columns inherit whatever the body uses, so they never get a rhythm of their own.

---

9. Gates

Every existing gate keeps passing, unchanged: base 1–12, L1–L12, IMG1–IMG7 and I1–I19, and make mutate's mutations. New gates run in make ci unless marked "browser".

Columns

  • COL1, nothing changes. Every existing entry in golden.json and editor.json is byte for byte what it was. No existing corpus body parses to a fence block. make corpus-local over the Oficina repos finds no layout, and the count is recorded in the build notes.
  • COL2, the grammar. Corpus cases, each in Go and in the port, with kinds, Column, levels and byte offsets (L4): - layouts of 2, 3 and 4 columns; an empty column; longer fences; CRLF; - a list, a quote, a code fence, an image, a heading and a marked block in a column; a list running up to a column's closer; - ::: inside a fenced code block in a column; a layout inside a code fence; - not layouts, each parsing exactly as today: 1 and 5 columns; text before the first column; text between columns; an unclosed column; a closer of the wrong length; a nested layout; an indented fence; ::: column width="40%"; ::: {.column}; an opener with no blank line before it; a closer with text straight after it; a fence line inside a quote or a list item; a layout whose column holds an unclosed code fence.
  • COL3, fidelity L1–L3 over layouts. L1: untouched layouts round-trip byte for byte. L2: editing a block in a column changes only that block's bytes. L3's seeded edits gain: making a layout from a block and from a selection; adding and removing columns; Undo columns; Backspace in an empty column; deleting across columns; typing ::: in a column; pasting a layout at the top level and inside a column; undo after each. The structure check and the reparse rule hold, and no layout is ever left unbalanced.
  • COL4, the merge. Edits to different columns merge cleanly. A fence-free conflict placed between two columns, and a layout-holding conflict inside a column, each fail the first check and become whole-layout conflicts. A side whose layout is broken text, aligned against a real layout, is caught by the parse check. A fence-free conflict inside a column is resolved as Yours, Theirs and Both, and each result is valid. The same block in both sides conflicts inside its column. A shape change on one side, with the other untouched, is clean. Undo columns against Add a column is one conflict over the whole layout. Both gives two whole layouts. Every result, and every choice of every conflict, passes ValidLayouts, and Settle keeps the bytes outside mine's changes. And the two cases review round 1 found: - a broken clean hunk beside an unrelated conflict (H1): one side splits a column in the textarea, the other undoes the layout, and both edit one top paragraph. The layout is a conflict, whichever choice is made; - renumbered columns (H2): one side adds or removes a column, the other edits a block in a later column. Clean, with both sides' bytes kept and no fallback to Join.
  • COL5, rendering. Go's Render and the editor's toDOM agree on every layout, the empty column's paragraph included (L4).
  • COL6, no shift and stacking (browser). L5 gains a page with a two- and a four-column layout, at 1440, 1000 and 390px, light and dark, with and without a draft. At 390px the columns stack. Opening and closing the Links panel at 1000px moves a layout between side-by-side and stacked by the container rule, not the viewport.
  • COL7, the floor (browser). With JavaScript off, a layout renders as columns, and Edit as Markdown saves it unchanged.
  • COL8, History. The summaries of §1.9; the diff of a column added, removed and edited; a block removed with its column drawn after the layout.
  • COL9, typed fences. Typing :::, ::: column and :::: columns in a paragraph, in a column and at the top level stores them with U+200B, never changes a layout, and parses back as text in Go and in the port.
  • COL10, accessibility (browser). Reading order is source order. ⌥⌘→ and ⌥⌘← move between columns. Insert → Columns, Add a column, Remove this column and Undo columns work from the keyboard. axe-core finds nothing serious.
  • COL11, the importer (with §6.2's fixtures): 1, 2, 4 and 5 columns; nested; hoisted from a list item; a child page in a column; an empty column; unequal widths counted. The D9 check passes on every fixture. Re-rendering an untouched page with columns writes an edited revision once, then nothing.
  • COL12, Pandoc (recorded). Every positive and negative COL2 case, and Mapa's own Join output for each editor command, rendered by a pinned Pandoc to its AST and committed as a fixture. A test asserts Mapa's recognition agrees with Pandoc's divs for each. The fixture is regenerated only by make pandoc-fixture, which CI does not need.
  • COL13, the server's block routes. MarkBlock and LinkMention refuse each fence kind. MakeTeamPage refuses indices that cut a layout and accepts whole layouts or one column's blocks. Every route in §1.10's table refuses a missing or old grammar with the sentence in its reply's error, the draft kept; the scriptless forms carry the field and succeed. A test lists every handler that reads a block or hunk index and fails on one missing from the table. An old-bundle tab with an inline conflict open posts /p/{id}/resolve without grammar, is refused with the reload sentence, and keeps its draft.
  • make mutate gains four mutations, each of which must be caught: the pre-pass accepts a one-column layout (COL2); Merge3 skips the second pass (COL4); Merge3 runs the second pass only when clean (COL4, H1's case); MarkBlock accepts a fence (COL13).

Icons and banners

  • LOOK1, sealed. plaintext_test.go is unchanged. Gate 4's file scan, with a page whose icon is a canary emoji sequence and whose banner's public id is a canary, finds neither in plaintext anywhere on disk, WAL included.
  • LOOK2, events. POST /p/{id}/look logs exactly one styled event and mints one revision with the previous body. A post that changes nothing writes nothing. Gate 8's route test covers the route. It is refused on a daily note and a scratch page with the app's 404.
  • LOOK3, emoji. RGI sequences are accepted, skin tones, flags, keycaps and ZWJ families included. Unqualified forms are stored fully-qualified. Two emoji, text, a lone modifier, a private-use character and an emoji newer than the vendored list are refused.
  • LOOK4, attach and scope. An icon or banner image attaches only when the styled revision introduces it, it is pending, and it is the setter's own. An image already attached to the same page is accepted as a banner, and as an icon only within the icon limits. Another person's pending id, and an image attached to another page, give the app's 404, and nothing is written. A body on P that types Q's icon address renders "Image not available". A chip to Q shows Q's icon.
  • LOOK5, retention. A replaced or removed icon or banner image is stamped unreferenced_at, drawn when its revision is opened in History, and swept after the window. A body edit after an icon is set leaves the icon's unreferenced_at null. A current icon is never swept. "Remove from Mapa" on an icon draws the page glyph everywhere and evicts it from the icon cache.
  • LOOK6, everywhere a title is. The icon is drawn in the title row, sidebar rows, chips, the Links panel's lists, ⌘K, Search, All pages and the tab title. The accessible names are byte for byte those without icons.
  • LOOK7, no shift (browser). §3.5's L5 run, the look row included: hovering the page head moves nothing.
  • LOOK8, the floor (browser). With JavaScript off, /p/{id}/look sets an emoji, uploads an icon, uploads a banner, moves it to Top, and removes both.
  • LOOK9, carried forward. Every verb (commit, Revert, relink, markers, Restore of a deleted page, the importer's) keeps icon and banner. Restore this version keeps the current look. A draft open during a styled revision commits as Saved, not Merged. A look post repeated after a lost reply answers with the follow, and the tab's base moves to it.
  • LOOK10, accessibility (browser). The picker's listbox, its search and its Esc, Change and Remove from the keyboard, focus returning each time. The banner's controls by keyboard. axe-core finds nothing serious.
  • LOOK11, the busy rule. Setting and removing a look hold their spinner for 650ms.
  • LOOK12, icons at scale, and the cache's scope. All pages with 200 image icons, against the bucket fake with 50ms per read, fetches every icon within 10 seconds cold (the test forces every fetch, since list icons are lazy; two slots make it about 5 seconds), and a second view is served from the cache without the semaphore within 1 second. A cached icon answers 404 after its page is deleted, after "Remove from Mapa", and to a viewer outside its scope; a cached small picture on Ana's private page answers 404 to Bo.

Pages inside and the arrow

  • IN1, the relation. In: [[P]], In: [[P|shown]], through an alias, and with a marker count. A second-block In: line, a date link, a self-link, a pending link, a daily note or a scratch page with the line, and a private "parent" do not.
  • IN2, order. Linked children in P's body order, then the rest in All pages' order.
  • IN3, scope (extends L6). Every list and count, on the sidebar, /side/inside/{id} and /p/{id}/inside, is read through the scoped accessor. Bo's sidebar is byte for byte the same whether or not Ana's private notes hold In: lines. make mutate gains a mutation that lists children without the accessor's scope, and it must be caught.
  • IN4, nothing written (extends L7). GET /side/inside/{id}, GET /p/{id}/inside and POST /view/open leave every table's hash unchanged. return accepts local paths only.
  • IN5, first paint (browser). With mapa-open set, opened rows are on the server's HTML, and mounting moves nothing.
  • IN6, the floor (browser). With JavaScript off, the arrow opens and closes rows through POST /view/open.
  • IN7, cycles, depth and caps. A pair of pages inside each other opens one level each way and no further. Indents stop at four levels. 51 children show 50 rows and the link to /p/{id}/inside, which lists all 51. A cookie opening more than 200 rows draws the rest closed. A page shown twice gives distinct aria-controls ids.
  • IN8, accessibility (browser). aria-expanded, aria-controls, the arrow's name, → and ←, and exactly one aria-current.

The importer

  • I20, icons. Emoji, custom emoji and file icons are imported. External and Notion-set icons are counted. An emoji outside the list is counted. A failed download writes the page without its icon.
  • I21, covers. File covers become banners, centred. External covers are counted (and, if Q5 says yes, Notion's gallery path is fetched and nothing else is).
  • I22, columns. COL11.
  • I23, auto-pins. Only the run's actor's pins change. Roots without a pin mark are pinned, in survey order, after the existing pins, up to the limit, with the report's sentence; roots created by an earlier run count. A re-run pins nothing it has marked. A page the person unpinned stays unpinned. Killing the run between each pair of statements of the pin write and the done write, then resuming, pins each root at most once.
  • I24, re-runs. An untouched page whose Notion icon changed gets one styled revision. A page whose icon was changed in Mapa is kept. renamed, styled and edited land in that order in one transaction, and a crash between any two statements leaves no partial update (extends I17).
  • I25, no egress beyond the pin. The file transport refuses an icon or cover on a host it does not pin, and the run counts it. If Q5 says yes, only the cover gallery's path is added, and a test proves any other path on that host is refused.

---

10. Phasing

Each phase is its own branch from the latest origin/main, with main merged in before it lands. Each is red-first on its gates, green on make ci, make browser and make mutate, reviewed by Fable to no High and no Medium, with any new wording through Luna, then landed. Nothing is deployed by the build.

  1. Icons and banners: the record fields, styled, POST /p/{id}/look and its page, the attach rule's record clause, the picker, the banner, drawing icons everywhere, and LOOK1–LOOK11.
  2. Columns: the grammar in Go and the port, golden cases, rendering, the editor's schema and commands, the merge's two rules, History, the neutraliser, the importer's column mapping (§6.2), and COL1–COL11.
  3. Pages inside and auto-pins: the relation, the arrow, the cookie and view POST, Put inside…, the run's pins (§6.3), the pin limit if Q4 says so, and IN1–IN8 and I23.
  4. The importer's icons and covers: the module's fields (§6.5), §6.1, §6.4's styled revision in ImportUpdate, the report, and I20, I21, I24 and I25.

---

11. Deliberately not built

  • Column widths. Pandoc's width= is the syntax when someone asks (Q2).
  • Nested layouts, and layouts inside list items or quotes.
  • Drag handles for blocks and columns. Mapa has none for blocks either.
  • Icons and banners on daily notes and scratch pages (Q1).
  • Icons on the map's nodes, and in the header's title field.
  • A gallery of stock banners. Mapa holds only images someone uploaded.
  • Pages inside on phones. The Menu sheet holds places only.
  • A tree view in All pages. Mapa is not a tree (base decision 2). The arrow is a way of reaching a page, not a hierarchy pages live in.
  • Localised In: words. One word, English, recognised exactly.
  • A "pages inside" section in the Links panel. Linked from already lists every child, which links up with its In: line.

---

12. Open questions for Paul

The recommended answers are written in. Paul, 2026-11-22: go — recommended answers taken. Each answer below is ruled as recommended.

  1. Q1, icons and banners on private pages. Recommended: team pages only. Daily notes show their date and scratch pages their first line, and neither appears where an icon would show. A styled verb on a private page would also put one more fact about it in the plaintext log.
  2. Q2, column widths and the brace form. Recommended: equal widths only, and the bare word only. Add Pandoc's width="40%" and Quarto's {.column} together when someone asks: the grammar, the port, the merge and the corpus all grow, and Notion's own columns are equal by default.
  3. Q3, when columns stack. Recommended: when the page column is narrower than 36rem (576px), measured on the page column, not the window. Two columns are then at least 17rem each, about 35 characters of body text.
  4. Q4, the pin limit. Recommended: raise it from 12 to 20, so a Notion workspace's top level fits. The sealed list stays a fixed length (160 bytes), and old 12-slot lists are read and rewritten as 20 on the next pin.
  5. Q5, Notion's cover gallery. Recommended: yes, fetch it. Most Notion covers are from Notion's own gallery, served from www.notion.so/images/page-cover/. The file transport would pin that one host and path. Covers from Unsplash and elsewhere stay unfetched (import D13).
  6. Q6, the order of auto-pins. Recommended: Notion's creation order, after your existing pins. The API does not give a sidebar's order, and creation order is Notion's default.
  7. Q7, the banner's height. Recommended: 10rem from 800px and 7.5rem on a phone. That is about 160px and 120px, lower than Notion's 30vh, so the title stays above the fold on a laptop.
  8. Q8, who may set a page's look. Recommended: any member, as with renaming, logged as styled with their name.

---

13. Findings and what changed

Round 1: Fable on revision 1 (4879ec7), CHANGES REQUIRED, answered in revision 2

| Finding | What changed | |---|---| | H1 rule 2 checked clean merges only, so a broken clean hunk beside an unrelated conflict could be stored | §1.8 rule 2 now runs whenever any side holds a fence, with conflicts as opaque units, and the second pass widens every fence-touching stretch, clean or not. D5, COL4 and a mutation say so | | H2 comparing Column and the opener's Level failed legitimate merges and pushed Settle to Join | §1.4: both are derived. sameStructure no longer compares them; ValidLayouts renumbers and checks the sequence. COL4 gains the case | | M1 the reparse could still break a layout (unclosed fence, adopt order, blocks moved in with raw :::) | §1.7's four rules: neutralise before the reparse; blocks entering a column with a ::: line count as edited; code in a column is always written closed; a structural adopt is confined to its column. D16 updated | | M2 the scan after a failed opener was undefined, and COL2 contradicted the rules on nesting | §1.1 "The scan, exactly": resume at the next line. A nested layout gives the inner layout. COL2 corrected | | M3 server block-index routes were unguarded, and old bundles count blocks differently | §1.10: MarkBlock refuses fences, MakeTeamPage refuses cuts, and D17's grammar version is checked on every index route. COL13 | | M4 auto-pins never fired for the existing import; the write's order, crash rule, count and actor were unspecified | §6.3: roots without a sealed pin mark are offered once, in one Store.write before done, by the run's actor; the count is read from the marks. I23 extended | | M5 image icons would queue behind the blob semaphore | §2.3: icons capped at 128 KiB and 512 px; a 16 MiB in-memory icon cache; lazy list icons. LOOK12 | | M6 renamedTo, settleImages/heldImages and attach's silent skip disagreed with the spec; same-page images unspecified | §4.1 generalises renamedTo; §4.2 names the code changes and the explicit pre-write check, and allows same-page images within the icon limits. LOOK4, LOOK5, LOOK9 | | M7 remark-directive's form differs; Pandoc claims untested | D1 drops remark-directive; §1.1 adds the Pandoc fixture (COL12) and its named cases, and rule 5 covers indented fences | | Lows | Words empty for fences (§1.4); fence length copies the column before (§1.1); the empty column's HTML (§1.5); Put inside is an editor transaction with the textarea as its floor (§5.1); "All pages inside" goes to /p/{id}/inside (§5.3); the cookie is per page with unique ids and a 200-row cap (§5.3); the aged-out summary (§3.4); the kicker after a look change (§3.4); the report's wording for large Notion icons (§6.1); column_list at any depth (§6.2); how the emoji list reaches the picker (§2.2); COL4, COL13 and LOOK4 gain the cases |

Round 2: Fable on revision 2 (933e5a3), CHANGES REQUIRED with no high, answered in revision 3

Fable found every round-1 finding answered in substance, and five mediums and six lows in revision 2's own answers.

| Finding | What changed | |---|---| | M1 the opaque conflict unit's placement was undefined, and align could pair a broken layout's text with a real fence | §1.8 rule 2: a fence-free unit counts as one content block and must also pass empty; a layout-holding unit counts as a top-level layout; the joined result, each conflict taken both ways, must parse to the settled kinds. COL4 gains the placements | | M2 the neutraliser reached code, ran only before the reparse, and step 5's whole-body adopt could still lose a layout | §1.7 rule 1 excludes code, runs again over adopted blocks to a fixed point, and touches changed blocks only; rule 4 covers step 5's adopt too. COL3 | | M3 the grammar version missed Link it, the server-rendered forms, and the old bundle's way of showing a refusal; LinkMention could link a fence | §1.10's table of every index route and where grammar comes from; the sentence goes in the reply's error; LinkMention refuses fences. COL13 checks the table against the handlers | | M4 the icon cache had no scope rule and no admission rule | §2.3: any image within the icon limits is cached; the read rule runs against the database on every request before a hit is served. LOOK12 gains the 404 cases and figures | | M5 COL12 asserted agreement on negatives Mapa refuses on purpose | COL12 asserts the positives and Join's output only, and records the negatives. §1.1 promises only the written form | | Lows | one FenceLike predicate everywhere (§1.1); the example shows the blank line before a closer; the look's image check is inside the write (§4.2); the pin write's empty and full cases, and Start over keeping the marks (§6.3); /p/{id}/inside in §5.4, IN3 and IN4 |

Round 3: Fable's narrow check of revision 3 (c3f0886), APPROVE, four lows applied in revision 4

| Finding | What changed | |---|---| | The parse check tries mine and theirs, not Both | COL4 resolves a fence-free conflict in a column all three ways | | LOOK12's cold figure means nothing if lazy icons are never fetched | LOOK12 forces every fetch, and states the expected figure | | /p/{id}/resolve refuses an old-bundle tab mid-conflict | COL13 exercises it, draft kept | | A pins event with no change could mislead a reader of the log | §6.3 says the level-up spec's §8 "Pins" list records it |

Paul, 2026-11-22: go — recommended answers taken. The spec is approved, and the build starts at §10's phase 1.

14. Build notes

Phase 1: icons and banners (feat/icons-banners)

  • B1, a removal takes its image out of the look. "Remove from Mapa" on an image that is a page's current icon or banner also clears it from the look, in the removal's own write: a styled revision by the person removing it, with drafts carried (looks_images.go, dropFromLook). So a page's current record never names an image that is gone, the icon draws as the page glyph and the band is not drawn (§4.3), and drawing an icon needs no lookup of its image row. Older revisions still name it, and History draws it as not available, as for any removed image.
  • B2, LOOK1's canaries. Gate 4's file scan carries an emoji canary (🪼) set as a page's icon. The banner's public id is not a canary: public ids are plaintext in images by the images spec's §1.3, so it would be found by design. The record that names it is sealed, which the emoji canary already proves.
  • B3, one Page menu entry. The Page menu has one entry, "Icon and banner…", which opens /p/{id}/look, the keyboard and scriptless path. The look row's Add icon opens the picker, and Add banner the file chooser.
  • B4, after a change the page loads again. look.js holds the busy rule's 650ms, then reloads. A reload commits a draft as a close does (level-up §6.5), and the styled revision has already carried the draft's base, so nothing typed is lost and nobody's editor sees a merge.
  • B5, the chip's icon in L4. domhtml.mjs writes an empty attribute bare, so chips.go writes the chip icon's alt bare too (<img … alt …>), which HTML reads as alt="". The golden resolver gives one team target in eight an icon, an emoji or an image, so L4 covers both.
  • B6, the picker's list. Built at boot from the vendored emoji-test.txt (3,781 fully-qualified emoji, nine groups), served at /emoji.json?v=<hash> and kept by the browser. The search matches Unicode's English names and shows at most 400 results. A typed or pasted emoji is found with or without U+FE0F.
  • B7, the bundle. The editor's bundle is 111.4 KB gzipped (L12's budget is 120 KB). The picker is static/look.js, outside it.
  • B8, sizes. byteSize learned KB, so the icon's refusal reads "128 KB". The look page's hint writes its figures with {{number L n}}.
  • B9, the gates. LOOK2–LOOK5 and LOOK9 are internal/mapa/looks_test.go; LOOK3's list half is emoji/emoji_test.go; LOOK6, LOOK8 and LOOK12's scope half are internal/mapatest/looks_test.go; LOOK7 and LOOK10 are looks_browser_test.go, at 1440, 1000 and 390px, light and dark, scripts on and off. Gate 8 drives POST /p/{id}/look. make mutate gains three: the record's icon not a reference (LOOK5), a look naming any image (LOOK4), and a cached picture served before the read rule (LOOK12). All three are caught.
  • B10, the File menu. Main made Page the File menu while this phase was built (level-up build note 87). "Icon and banner…" sits after Rename… there, and filemenu_test.go's order says so.
  • B11, Fable on the build. Round 1 (2f10e0e): CHANGES REQUIRED, no high, five mediums: ⌘K drew no icons; an icon post naming no picture stored an empty icon; Reposition recentred a banner at the top, and a position post choosing none moved it to the centre; dragging was broken with a mouse and stuck on touch; History drew a broken image for an old icon gone from Mapa. All five are fixed with gates (7643c98), with the lows that matter: the busy rule on the look's controls, Reposition a real button with Esc to cancel, a refused script upload dropped only when it is the person's own pending picture, the emoji field trimmed, the live region served by the page. Round 2 (7643c98): APPROVE, with one medium-to-low (Reposition armed only by a keyup), fixed in 3c5f177 by arming after 400 ms too. Left as they are, with Fable's agreement: the picker's ↑ ↓ across uneven group rows, and LOOK12's 200-icon timing, replaced by TestSmallPicturesAreServedFromTheCache and the cache's scope gate.
  • B12, the gates at landing. make ci green; make browser green but for one known flake (a test's temporary directory still holding SQLite's WAL at cleanup, which passes on rerun); make mutate: all 141 mutations caught; hub CI green.

Phase 2: columns (feat/columns)

  • C1, fences are pseudo-blocks in the editor. serialize.mjs's docBlocks lists a layout's four kinds of fence line as blocks whose origins live on the columns and column nodes (openOrigin, closeOrigin), read through originAttr and originOf. An untouched fence re-emits its source; one written from its node is a layout's own colons (four or more) or, for a column, three, which is always fewer than its layout's, so a new column never fails to close. That is simpler than §1.1's "copies the column before it", and every layout it writes is one Mapa and Pandoc read.
  • C2, recorded nodes by origin. An empty column holds a paragraph to type in that is no block of the body, so recordBody matches nodes to blocks by origin, not by place, and bodyShapes leaves that paragraph out.
  • C3, the neutraliser is fenceRule. Rather than §1.7's four rules separately, one rule runs in the settle plugin: when the body the document writes would read fences the document does not hold (or miss one it does), every fence-like line of text, code excepted, takes U+200B before its first :. It covers typing a fence, a block moved into a column holding one, and an edit elsewhere that would complete a layout from lines of text (the corpus's columns/fence-like). It runs only when needed, so a stored body with such a line read as text is untouched on mount (L1). Code in a column is always written closed because it is never last: the column's closer follows it. L2's locality allows the one case where the rule rewrites other blocks.
  • C4, the merge. Fence alignment keys on the block beside each fence (alignKeys), and a stretch where one side only added whole columns at its edge is split (addedColumns), so a column added beside a teammate's edit merges cleanly. When any side holds a fence and a conflict holds one, or the result would not keep its layouts (layoutsHold: opaque conflicts placed as §1.8 says, the parse agreeing taken mine and theirs), the whole merge runs again with layouts as units. TestEveryMergeOfLayoutEditsHoldsValidLayouts merges every pair of twelve edits and settles every conflict every way; its check is that no fence-like line is ever left as text, which a broken layout parses as. Both COL4 mutations are caught by it.
  • C5, History's diff draws layouts flat. The summaries are §1.9's. The diff view draws runs of blocks, and a fence drawn apart from its layout draws nothing, so a changed page with columns shows its blocks marked, one after another, not in columns. Drawing the diff in its layout is left for later.
  • C6, menus. Insert gains 2, 3 and 4 columns, Add a column, Remove this column and Undo columns, always drawn in the page editor; outside a layout the last three do nothing. The / menu's Columns makes two. The labels' digits are written as they are: every offered locale writes 2 to 4 as ASCII digits.
  • C7, the grammar version. countedHere wraps the four routes of §1.10's table. The scriptless forms carry grammar, as do the editor's Make team page and Resolve posts; the old bundle's error path shows the sentence. The tests' harness adds the field where the app's own forms would.
  • C8, the importer. notionmd writes two to four columns as a layout, flattens one, five or more, and a list inside a column at any depth (counted, but one column is no loss), and neutralises fence-like text lines. Column widths are not read: the notion module does not yet expose width_ratio (§6.5), which phase 4 adds.
  • C9, COL12. Pandoc 3.14 reads every layout Mapa recognises, and Join's output for each, as Mapa does; the negatives are recorded. Fence-like text Mapa writes as text (no escapes) is divs to Pandoc; that is outside the promise.
  • C10, Fable on the build (bedb7ca): CHANGES REQUIRED, 2 high, 7 medium, answered. - H1: Insert → Columns over a selection that held a layout nested one. The layout now gives up its columns' blocks into column 1, and the nodes are built checked. - H2: a structural reparse in a column adopted the whole body, turning the layout into text. A structural reparse inside a column now parses that column's own lines, written with their sources and neutralised outside code, and replaces only that column's content, keeping the caret's distance from its end (§1.7 rule 4, adoptColumn). - M1, M2: a layout pasted into a column arrives as its blocks; copying inside one column puts no fence on the clipboard. - M3, M4: a selection across columns is deleted column by column, never deleting a column (Backspace, Delete, cut, typing and paste over it); Backspace after a layout and Delete before one move the caret into it and join nothing. - M5: History's diff leaves fences out, so it draws a layout's blocks one after another, marked, with no stray boxes (C5). - M6: Make team page's scriptless list offers a layout as one row, which shares the whole layout; Link to this block lists no fences. - M7: COL13 GETs the forms and checks each carries the grammar, and posts Make team page without it: refused, draft kept. - L5: one existing golden entry, import/columns, changed on purpose: the importer now writes that fixture as a layout. Every other existing entry is unchanged (COL1). - Not taken: L1 (fenceRule neutralises every fence-like text line when one would make a layout, untouched ones included: rare, and it errs safe), L3 (net counts in History's layout summary), L4 (an empty paragraph left above a removed column's blocks until reload), L6 (C6's menus).
  • C11, Fable's round 2 on the fixes (a768523): CHANGES REQUIRED, two mediums in adoptColumn, answered. The caret now keeps its place after a column's adopt (typing went into the next column), and the neutraliser skips code. A longer fence for code written from its node did nothing (the parser's fence is its first three characters) and is gone. Lows not taken: no test lists every handler that reads an index (the four routes are wrapped by name and COL13 posts to each); a paste over a cross-column selection deletes before the paste is known to succeed; drag and drop across columns is not confined.
  • C12, Fable's round 3 (eb7dc12): one medium, answered. The caret after a column's adopt could land at the start of the block after the edited one, since the whole column was replaced. adoptColumn now adopts the column by child, as adoptInto does at the top level (adoptInto takes a container): blocks the parse still has stay as they are, origins included, only the changed run is replaced, and the caret is measured against that run. The test now places the caret and checks the typed text lands in its block, as the top level does.

Phase 3: pages inside and the import's pins (feat/pages-inside)

  • P1, the relation. inTarget reads a team page's first block: exactly In: then one wiki link, no anchor, not a date; its folded target goes in the index's within map. Inside answers a team page's children in its own order (first links in its body, then by folded title), through the scoped view; private pages are neither children nor parents.
  • P2, the arrow. Pinned rows keep a 16px arrow cell. An arrow is a form (POST /view/open, the cookie, back to a checked local path), so it works with no script. With script, mapa.js sends the form in the background and puts every sidebar row above the foot in place from the page the server draws next, so open lists, their ids and the one aria-current always agree (a page shown twice included); the foot keeps its listeners, and row menus and Search are delegated. A later toggle's reply wins over an earlier one. → opens and ← closes when an arrow has focus. GET /side/inside/{id} (§5.3) was not needed. An open list's id is its row's path of public ids (inside-<ancestors>-<page>). Opened lists show 50 rows and a link to GET /p/{id}/inside; the sidebar draws at most 200 opened rows, and a list the cap cuts gets the link too; a closed row's arrow asks only whether anything is inside, unsorted; indents stop at four levels; a page that is one of its row's ancestors is listed without an arrow. The open list is a plain ul labelled "Pages inside <title>": role="group" made axe refuse its items.
  • P3, not built: Page → Put inside… and Take out of. Typing or deleting the In: line, with script or in the textarea, does it; a picker for it is left for later.
  • P4, pins. The limit is 20 (Q4). A list sealed when it held 12 is read and is written as 20 on the next pin.
  • P5, the import's pins. After the fix-up pass and before done, one lease-checked Store.write pins the roots with no pin mark (live, surveyed with no imported parent, that is with no parent in the set: a page whose parent failed or was deleted in Mapa is not a root, and is not marked; in survey order, after the runner's own pins, up to the free slots), marks each in its stored coordinate (read again inside the write, since the page's own transaction wrote it last), and logs one pins event by the runner. A root already in the runner's pins is marked pinned. Nothing to offer writes nothing. The report counts the marks with the run's id, with a sentence for one page and for a full sidebar. The level-up spec's §8 Pins list now says a pins event need not mean a change.
  • P6, gates. IN1 and IN2 (inside_test.go); IN3 (the private In: line, and /p/{id}/inside a 404 for a private or missing page), IN4, IN6 and IN7 (a cycle, 51 children, indents stopping at four levels, the 200-row cap with its link) in mapatest/inside_test.go, with IN8's server half (a page shown twice: three distinct list ids, each named by an aria-controls, one lit row); IN5 (no move and no shift on mounting, with the cookie set) and IN8 (→ and ←, a page shown twice toggled by script, focus on the arrow pressed, axe) in inside_browser_test.go; I23 (import_pins_test.go: the report, a full sidebar, an earlier run's roots with one already pinned, a failed parent's child, Resume by another member) and I17's crash list gaining pin:marked and write:pinned, each resumed run pinning every root once; gate 8 drives POST /view/open; two mutations (a private In: line counts; a root offered every run), both caught. Luna's wording applied (copy-review/inside).
  • P7, Fable on the build, round 1 (0b7cf66), CHANGES REQUIRED with no High. Answered: list ids that a script toggle could repeat (M1), the wrong row swapped for a page shown twice (M2), aria-current doubled or lost after a toggle (M3), → and ← (M4), the gates above (M5), a failed parent's children taken for roots (M6), a root already pinned reported as having no slot (M7); lows 8, 10 to 17. Not done: low 9, the report's "your" for an importer who is not the run's actor: the marks do not record whose sidebar took the pins, and Resume by another member is rare.
  • P8, Fable's round 2 (8585b08): APPROVE, no High or Medium. Its lows answered: arrow toggles go one after another, so two rows opened quickly both stay open (L1); a reply takes focus back only when it was not moved elsewhere (L2); a reply that is not a page back where the person is reloads instead (L3); the report's four sentences are gated (L4); an open row past the 200-row cap is drawn open with only its link to all its pages, so its arrow still closes it (L5); two loose assertions tightened (L6).

Phase 4: the importer's icons, covers and widths (feat/import-looks, and the notion module's feat/looks)

  • F1, the module. Icon.URL (file, external, customemoji), Page.Cover {Type, URL} in place of HasCover, and Block.WidthRatio, each read from Notion's documented shapes (notiontest.AddLooks, TestPageLooksDecode); no real recording was made, as §6.5's unverified points (a custom emoji's host, `widthratio on a column read, and whether the gallery answers without a redirect, which the fetcher refuses) await §19's first real run, listed in the module's AGENTS.md. Q5: the file transport pins www.notion.so to /images/page-cover/ and one plain name after it (a leaf pair: no %, no further /), and Files.Gallery` answers for that pair alone; M5 refuses every other path on that host, encoded slashes and backslashes included, and three mutations (the pair removed, the host pinned alone, the leaf rule removed) are caught.
  • F2, the staged tree. notionmd.Page holds the look under new keys (pageIcon, pageCover), so a tree staged before this decodes with none, and that page's look comes on its next run. The mapper writes nothing of the look and no longer counts it; it counts column_widths when a layout's columns' ratios differ (a column with none is an even share).
  • F3, the look before the write. import_looks.go prepares the icon and the cover after the page's images and before its transaction, under §12's rules: the page object read again for a fresh URL, the lease checked before each add, a refusal the page's count and never its failure. An emoji goes through EmojiIcon's check. An icon is fetched with a 128 KiB cap, and one over 512 pixels a side is discarded at once and remembered as refused. A cover is fetched when it is Notion-hosted or on the gallery's pair. The page object is read again once a page, and what it holds now is checked as Survey's was. A passing failure (not a permanent refusal) keeps the icon or banner the page has, so it costs no revision now and none to undo next run. The look's places are printed in a domain of their own (look, the page, the pseudo-block), so a look row shares no print with a block's. The look's added images and places join the page's images, so a kept or failed page discards them and a written page keeps their notion_images rows in its own transaction.
  • F4, the writes. ImportCreate writes the record with its icon and banner (centred, Y: 50), and its commit attaches them. ImportUpdate writes renamed, styled, edited, each only when needed, in one transaction (update:styled is a new crash point); the styled revision carries drafts as a rename's does. "Unchanged" compares the look too. A page this run prepared no look for (a fix-up after a Resume) keeps its own.
  • F5, the report. "Icons imported", "Icons not imported" by reason, "Banners imported" and "Banners not imported" (Luna: Mapa's word for what Notion calls a cover), and "Column widths" among the losses; the old "Page icons" and "Page covers" losses are gone (an old run's report shows them by key). Luna's wording applied (copy-review/import-looks).
  • F6, gates. I20 and I25 (TestI20IconsAreImported: emoji, custom emoji and uploaded icons imported; Notion's set, an emoji Mapa lacks, an icon too wide, a download that fails and a custom emoji on an unpinned host counted, the page written each time); I21 (TestI21CoversAreImportedFromThePinOnly); I22 is COL11 plus the width goldens; I24 (TestI24ALookChangedInNotionIsStyled, TestI24RenamedStyledEditedInOrder, and I17's re-run crash case now renaming, restyling and editing at every crash point). Seven mutations, all caught. The import spec's §9.1, §10, §11.4 and §15 say what this spec changed.
  • F7, Fable on the build (bd3ee46, module d36f6e0): APPROVE, no High, two Mediums, answered. M1: the gallery pin let an encoded / or \ follow its prefix; it is now a leaf pair. M2: an imported styled revision read "Updated from Notion · edited there <date>", a stale date; it now reads the look's own words with "(from Notion)". Lows: the redirect check added to the first-run list (L1); Files.Gallery for covers (L2); the fresh object's types checked (L3); look prints in their own domain (L4); width ratios compared with each other (L5); mutations for the 512-pixel discard, the 128 KiB cap and a fix-up keeping its look, with a Resume test (L6); a passing failure keeps the look (L7); the page object read once (L8); the module lands first and Mapa is pinned to its main before landing (L9). I24 gains the fix-up and passing-failure tests; I20 a 128 KiB icon.
  • F8, Fable's re-check (4a63cc3, module 9de0941): APPROVE, no High or Medium. Its lows answered: a passing failure keeps the look's notion_images row as it was, so a Notion that goes back to that file reuses it; a gallery name starts with a letter or digit; a test that a look's prints meet no block's. F7's L9 is the landing order.