oficina / mapa Public

Spec: columns, page icons, banners, and pins from the import (revision 1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 4879ec7d8319c8c1efbe71cd70c5d78b4800b7bb parent 2510b47
1 file changed, +628 −0
  • docs/superpowers/specs/2026-11-22-mapa-columns-icons.md +628 −0

CI passed — run details

CI log
=== editor ===
cd editor && npm ci --no-audit --no-fund --loglevel=error

added 16 packages in 541ms
cd editor && node build-bundles.mjs
wrote internal/mapa/static/editor.115ddee5d3f54787.js (354112 bytes, 111.2KB gzipped; L12 budget 120KB)
cd editor && node --test
✔ a badge is named for what it does, starting with its visible word (2.6216ms)
✔ first words stop at five words or forty characters (0.163725ms)
✔ the field keeps one trimmed line, without brackets (0.2307ms)
✔ the field holds at most MaxAlt bytes, cut at a character (0.826408ms)
✔ days and weeks move across months and years (2.045217ms)
✔ a month keeps the day, or takes the month's last (0.410865ms)
✔ the grid is six weeks from Monday, as the month calendar draws it (0.61794ms)
✔ the grid starts the week where the locale does (0.789529ms)
✔ the keys move a day, a week, a month and a year (0.507264ms)
✔ the picked day is the chip [[ makes for a date (15.794481ms)
✔ Insert → Today's date still puts today in at once (3.164581ms)
✔ / offers Date, the picker, and Today's date beside it (0.304787ms)
✔ after a ! the chip goes in after a space, never as an embed (3.518519ms)
✔ where the Markdown would read the chip differently, it is refused (2.332622ms)
✔ over a selection the chip goes after it and the words stay (2.872376ms)
✔ today is the day in the viewer's zone (17.588109ms)
✔ every offered locale has cases (1.283008ms)
✔ dates.mjs writes every date Go writes, byte for byte (5.161588ms)
✔ a chip, the month and the week, in three locales (0.602642ms)
✔ dates.json is what ICU gives, byte for byte (700.021667ms)
✔ L1: mounting then serialising gives cleanBody(body), byte for byte (128.204004ms)
ℹ 871 bodies
✔ L1: mounting a stored body adds nothing, and saving it writes nothing new (126.150962ms)
✔ L2: one edited block changes only that block's bytes; undo gives the body back (220.140318ms)
ℹ 858 single-block edits
✔ L2: inserting or deleting a block changes bytes only at the new seams, by Join (163.848352ms)
ℹ 866 inserts, 817 deletes
✔ L3: seeded edits keep the document and its Markdown saying the same thing (6545.864922ms)
ℹ 20904 edits over 871 bodies
✔ L3: Link to a page makes exactly one chip, and changes nothing else (1576.782159ms)
ℹ 4532 links over 871 bodies; refused: {"A page link can’t hold another link or a line break. Select plain words.":918,"A page link can’t show [ or ]]. Select words without them.":404,"Select some words to link them to a page.":174,"Linked here, the Markdown around these words would read differently: a ! before them makes an embed, and a stray ` or * pairs up. Select other words.":18}
✔ L3: a picked date is one more date chip, or refused where a letter would be too (1552.900666ms)
ℹ over 871 bodies: {"inserted":5158,"spaced":23,"refused":45,"unstable":9}
✔ linear: trailing spaces (66.805674ms)
✔ linear: trailing whitespace (46.490078ms)
✔ linear: unclosed web links (27.926574ms)
✔ linear: web links with no address (34.458614ms)
✔ linear: unclosed wiki links (31.055888ms)
✔ linear: unclosed embeds (42.148686ms)
✔ linear: closes only (9.054244ms)
✔ the selected words become the chip's shown text (18.294203ms)
✔ words that are the title make a plain [[Title]] (8.521924ms)
✔ spaces at the selection's edges stay outside the chip (13.789428ms)
✔ a date makes a date link, in a heading, an item and a quote (20.528973ms)
✔ bold words lose their bold: a chip carries no marks in Mapa's Markdown (1.104095ms)
✔ only the linked block's bytes change, and undo gives the body back (7.975456ms)
✔ a selection across blocks, over a chip or a break, or of brackets is refused (2.226805ms)
✔ a target the words cannot be linked to as typed is refused (2.12735ms)
✔ ⌘L: over a selection it opens Page link; with none it types [[; in code it does nothing (7.669798ms)
✔ web-linked words are refused: the address would be lost (review M4) (1.499862ms)
✔ words whose Markdown would read otherwise are refused (review M3) (5.862673ms)
✔ ⌘A then ⌘L says why, instead of doing nothing (review low 1) (0.409963ms)
✔ linkCheck says why it refuses (review low 2) (1.094538ms)
✔ golden file has bodies (1.054393ms)
✔ markup.mjs parses every body into Go's blocks, byte offsets and all (38.02435ms)
✔ markup.mjs strips and spans every block as Go does (69.231351ms)
✔ the schema's toDOM draws every body as Go renders it (91.737434ms)
✔ emphasis draws the four pinned outputs (25.613118ms)
✔ a body ends in the editor's empty paragraph (0.357565ms)
✔ the editor labels date chips as Go does, in every locale L4 holds (15.396349ms)
✔ a POST that never answers is aborted after the timeout (22.111168ms)
✔ a keepalive POST carries no signal, and an answer clears the timer (1.115577ms)
✔ autosave sends only what differs, and the tab owns the draft it wrote (12.476535ms)
✔ an offered draft never commits by itself; Save commits it (1.945371ms)
✔ reload, then close: sessionStorage says the draft is this tab's own (0.747161ms)
✔ closing carries text not yet sent, and the cap leaves it out (41.009417ms)
✔ clean rebase: applied, the caret survives, the base moves by the rebase POST (5.566351ms)
✔ the block under the caret is the teammate's too, and undo brings back yours (4.904189ms)
✔ typing mid-flight: the merge is not applied and the base does not move (1.865914ms)
✔ a merge the editor cannot represent stops after three tries (5.310334ms)
✔ a conflict is shown, locks the editor's own commits, and Resolve settles it (1.878205ms)
✔ leaving: a conflict stays with the choice; a failed flush offers Leave anyway; a stored draft leaves (1.958615ms)
✔ a stale tab shows the newer draft, offered, and never overwrites it (1.3541ms)
✔ the first scratch commit: empty creates nothing, then one page, then drafts on it (1.710003ms)
✔ noBase and gone lead to the existing choices (1.604226ms)
✔ a commit that merged is applied when nothing was typed since (1.292506ms)
✔ back from the cache: nothing unsaved reloads, unsaved text autosaves at once (17.920849ms)
✔ an own draft committed meanwhile goes on as a new draft (2.062118ms)
✔ a reload keeps a stored draft; unsent text still commits (0.530397ms)
✔ a page deleted mid-edit: what is typed is still stored as the draft, and nothing commits (H1) (1.239718ms)
✔ an offered draft committed in another tab: typing goes on as a new draft (H1) (4.740454ms)
✔ a commit reply without a revision is not a commit; an emptied day starts afresh (H2) (1.613424ms)
✔ Resolve stores what was typed first, and takes no typing until its answer is applied (M1) (6.39881ms)
✔ closing with a choice open, or commits held, still writes the text, never commits (M2) (1.209462ms)
✔ closing inside the settling window sends the loaded version with settling=1 (M3) (0.342687ms)
✔ a clean merge not applied because of typing still ends the choice on show (M4) (0.95649ms)
✔ settling finds the draft committed with a teammate's text: a close still writes (M-A) (0.475195ms)
✔ settling finds another tab's newer draft: the tab shows it before any typing (0.669466ms)
✔ a page deleted before the first autosave: the text is offered as a scratch page, and a close makes one (M-B) (0.600338ms)
✔ an autosave that never answered but landed: its 409 keeps the typing since (L3) (0.604686ms)
✔ marks: em outside strong, bold reopened around italics, edges outside (14.996275ms)
✔ marks close before code, links and atoms, and reopen after (0.541689ms)
✔ untouched blocks and atoms re-emit their source; edited atoms are written from attributes (9.060246ms)
✔ empty blocks are written as nothing (2.354132ms)
✔ an unclosed fence that is no longer last gets its closing fence (1.481528ms)
✔ the structure check puts Join's seam where a kept one would merge two blocks (2.142317ms)
✔ prepareSave adopts the parse when no seam or rewrite can save the document (4.317568ms)
✔ reparse: typed emphasis becomes a mark, "- " after a break becomes an item (3.222859ms)
✔ a trailing hard break stays on screen and is written as nothing (0.65539ms)
✔ the reparse waits while an IME is composing (9.561427ms)
✔ copied blocks paste with their bytes and seams; a cut and paste gives the body back (4.39912ms)
✔ a forged x-mapa slice is refused, and text from outside is read as Markdown (0.725961ms)
✔ rebuild changes origins only, outside undo history (2.869321ms)
✔ applyBody takes a teammate's block, keeps the caret, and ends untouched (6.288305ms)
✔ a block whose context changed is written again: a task toggled, a bullet, a quote (3.06176ms)
✔ a duplicate ^id typed above its holder never takes the id from it (0.751599ms)
✔ a copy-dragged block is reparsed, and says what its Markdown says (1.085581ms)
✔ a history command that throws is refused, never thrown (8.770415ms)
✔ an image re-emits its source, and an edited alt changes only its span (1.1067ms)
✔ a paste whose image copy is refused says why and pastes nothing (27.52147ms)
✔ a line of image openers reads in linear time (139.291855ms)
✔ a line of shared link address reads in linear time (17.045189ms)
✔ a line of shared web address reads in linear time (64.021572ms)
✔ one rename at a time, from either field (2.930104ms)
✔ an empty or unchanged title sends nothing (0.277377ms)
✔ a refusal keeps what was typed, and the title (0.325476ms)
✔ the pending state holds for the busy rule (8.034988ms)
✔ a failed POST says so and keeps the title (0.572896ms)
✔ Update links posts the confirm page's POST (0.35979ms)
✔ clean is CleanTitle's whitespace rule (0.281634ms)
✔ the saver's base follows a rename made over it, and only that (0.390357ms)
✔ closing sends the rename as one keepalive POST (7.984022ms)
✔ the port answers every shared case as typeddate.go does (7.136333ms)
✔ numbers follow the locale: 12/11 is November in en-IE, December in en-US (0.340173ms)
✔ M6: several files land in the order they were chosen (50.028455ms)
✔ M5: one Backspace before the box keeps the image where the box is (13.442663ms)
✔ M5: undoing text typed just before the box keeps the upload (21.828193ms)
✔ L12: a failed upload an undo takes away does not stall the next (16.550738ms)
✔ M4: Replace… keeps the old image until the new one is in, and its alt (16.82561ms)
✔ M3 and N1: text wins, except over a picture copied from a page (2.331469ms)
✔ N2: a JPEG over 10 MB is scaled before its size is checked (11.535383ms)
✔ a drag whose anchor the document no longer reaches selects to its end (6.184242ms)
ℹ tests 126
ℹ suites 0
ℹ pass 126
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 10507.935493
=== vet ===
go vet ./...
go vet -tags browser ./internal/mapatest/
=== fmt ===
=== code ===
go tool rastrillo budget code
The base has no .rastrillo/code.txt: skipping the check that records only go down.
budget code: within the limits.
=== test ===
CGO_ENABLED=0 go test ./...
?   	amadan.net/oficina/mapa/cmd/mapa	[no test files]
ok  	amadan.net/oficina/mapa/internal/mapa	4.435s
?   	amadan.net/oficina/mapa/internal/mapa/icons	[no test files]
ok  	amadan.net/oficina/mapa/internal/mapa/imagefile	0.187s
ok  	amadan.net/oficina/mapa/internal/mapa/locale	0.007s
ok  	amadan.net/oficina/mapa/internal/mapa/markup	0.164s
ok  	amadan.net/oficina/mapa/internal/mapa/notionmd	0.385s
ok  	amadan.net/oficina/mapa/internal/mapa/seal	0.003s
ok  	amadan.net/oficina/mapa/internal/mapatest	17.022s
?   	amadan.net/oficina/mapa/scripts/mutate	[no test files]
?   	amadan.net/oficina/mapa/scripts/preview	[no test files]
=== migration-check ===
go tool rastrillo migration check
rastrillo migration check: models and migrations agree
=== credits-check ===
python3 scripts/credits.py --check
credits: checked
diff --git a/docs/superpowers/specs/2026-11-22-mapa-columns-icons.md b/docs/superpowers/specs/2026-11-22-mapa-columns-icons.md
new file mode 100644
index 0000000..14f9e27
--- /dev/null
+++ b/docs/superpowers/specs/2026-11-22-mapa-columns-icons.md
@@ -0,0 +1,628 @@
+# Mapa: columns, page icons, banners, and pins from the import
+
+**Status:** revision 1, 2026-11-22, for review. Nothing is built.
+
+**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 D16 (§0). Its gates are COL1–COL11, LOOK1–LOOK11, 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, Quarto, remark-directive and Markdig read them the same way. Everywhere else they read as text and 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. A clean merge that would not parse back 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 that starts with `:::`. Layouts come from Insert, `/`, paste and the textarea | The editor adopting the parse, which would let one typed `:::` tear a layout apart | §1.7 |
+
+---
+
+## 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.
+
+| 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 starts with three colons. That rules out nesting, a stray `:::`, 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.
+
+**What Mapa writes.** The layout opener with four colons, columns with three, and the seams shown above (§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 its siblings' fence length.
+
+**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, it makes the structure visible in the textarea, and with exact-length closers Pandoc's own rule (a bare fence closes the innermost div) reads every layout Mapa recognises exactly as Mapa does.
+
+### 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 and before its closer;
+- 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).
+
+**Other consumers of blocks:**
+- **`Plain`** of a fence is the empty string. Search, snippets, unlinked mentions and the word index never see the word `columns`.
+- **`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.
+- **`sameStructure`** compares `Column` as well as kind, level and source.
+
+### 1.5 Rendering
+
+```html
+<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). The empty column's paragraph is the editor's own empty paragraph, pinned in L4 like the trailing one.
+- **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 `div`s. 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.
+
+**Typed fences (D16).** Mapa has no escapes (level-up D11), and a typed `:::` inside a column would close it. So **the settle plugin puts U+200B before any line, in any textblock, whose text starts with `:::`.** That is the importer's neutraliser (Notion import §11.4) applied to one more pattern. The line looks the same, the stored text parses as text, and no layout is ever made or broken by typing. An untouched block is never rewritten; this changes only blocks being edited.
+
+**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. **A clean result must parse back.** After the first pass, `Merge3` joins the settled blocks and checks the structure (`sameStructure`). If the result breaks, the merge runs again, widening every stretch that touches a fence on any side 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.
+
+For example, 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.
+
+**`Settle`** keeps bytes as before, and its existing fallback to `Join` still applies to seams. Rule 2 is checked before `Settle` runs, so `Settle` is never handed fences that do not balance.
+
+**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.
+
+---
+
+## 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.
+
+### 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 512 KiB and 1,024 px a side. Refusals name the figure, written in the reader's locale (§7).
+- **With script,** the picker crops the picture to a centred square and scales it to 256 × 256 px on a canvas before upload, as PNG, so a phone photo fits the limits. A picture that fails to decode is sent as it is.
+- **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).
+
+### 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.
+
+**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"). Choosing it shows that revision with **its own** icon and banner, read from its record, while their images are still kept (§4.3).
+- **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, and `renamedTo`'s base-following covers it. The editor follows a `styled` revision exactly as it follows a `renamed` one.
+ - A post that changes nothing writes nothing (level-up §6.4, step 7).
+- **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":
+- **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. Someone else's pending id, or an image attached to another page, is refused with the app's 404, as if it did not exist.
+- **`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.
+ - **Page → Put inside…** opens a `[[`-style field and writes or replaces the line as the page's first block, an ordinary attributed edit (`edited`).
+ - **Page → Take out of <P>** removes the line.
+ - 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's Links panel. `<n>` is the viewer's own count, written with `{{number L n}}`.
+- **State:** the cookie `mapa-open` holds the public ids of the rows the person opened, space-separated, at most 64, newest kept.
+ - 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}` answers 404 for a page the viewer may not open, and for a private page, exactly as for one that does not exist.
+
+---
+
+## 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), downscaled by the server's limits only. Mapa never decodes pixels, so a custom emoji over 512 KiB or 1,024 px is refused and counted.
+- **`file`** (an uploaded icon): the same as `custom_emoji`.
+- **`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:** 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:** the pages **this run created** (`ImportCreate`) that are **roots**: written with no `In:` line, because their Notion parent is not imported.
+- **Whose sidebar:** the person who pressed Start or Resume, only. Pins are per person and sealed (level-up Q1). Nobody else's sidebar changes.
+- **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 not pinned, and the report says so: "Pinned 9 of your 14 top-level pages. Your sidebar holds 20 pins."
+- **When:** once, when the run reaches `done`, in one lease-checked write that logs `pins` with the member as its object (level-up §8), exactly as `POST /p/{id}/pin` does. It is a person's write, never bookkeeping. The pinned pages carry their icons because pins draw icons (§2.4).
+- **Never again:** a re-run creates no page that exists, so it pins nothing it pinned before, and a page the person unpinned stays unpinned. A root newly shared later is created by that later run and pinned then, if there is a free slot.
+
+### 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 (§6.3).
+
+### 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 | 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 (`:::` at the start of a line) | 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".
+
+---
+
+## 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 512 KB and 1,024 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. 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 parses back (`sameStructure`), and Settle keeps the bytes outside mine's changes.
+- **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.
+- **`make mutate`** gains two mutations, each of which must be caught: the pre-pass accepts a one-column layout (COL2), and `Merge3` skips the second pass (COL4).
+
+### 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. Another person's pending id, and an image attached to another page, give the app's 404, and nothing attaches. 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 current icon is never swept. "Remove from Mapa" on an icon draws the page glyph everywhere.
+- **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.
+- **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.
+
+### 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 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}` 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 and depth.** 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.
+- **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 runner's pins change. Only roots this run created are pinned, in survey order, after the existing pins, up to the limit, with the report's sentence. A re-run pins nothing. A page the person unpinned stays unpinned.
+- **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.
+
+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
+
+*(Each review round is recorded here.)*