oficina / mapa Public

Spec: phase 1's build notes B10-B12 (File menu, Fable's two rounds, the gates)

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

CI passed — run details

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

added 16 packages in 318ms
cd editor && node build-bundles.mjs
wrote internal/mapa/static/editor.f6564510471eef37.js (354434 bytes, 111.4KB gzipped; L12 budget 120KB)
cd editor && node --test
✔ a badge is named for what it does, starting with its visible word (2.866942ms)
✔ first words stop at five words or forty characters (0.194138ms)
✔ the field keeps one trimmed line, without brackets (0.351279ms)
✔ the field holds at most MaxAlt bytes, cut at a character (0.931199ms)
✔ days and weeks move across months and years (1.191359ms)
✔ a month keeps the day, or takes the month's last (0.273705ms)
✔ the grid is six weeks from Monday, as the month calendar draws it (0.627498ms)
✔ the grid starts the week where the locale does (1.760389ms)
✔ the keys move a day, a week, a month and a year (0.255602ms)
✔ the picked day is the chip [[ makes for a date (13.308145ms)
✔ Insert → Today's date still puts today in at once (1.954889ms)
✔ / offers Date, the picker, and Today's date beside it (0.231097ms)
✔ after a ! the chip goes in after a space, never as an embed (2.30196ms)
✔ where the Markdown would read the chip differently, it is refused (2.769883ms)
✔ over a selection the chip goes after it and the words stay (1.86867ms)
✔ today is the day in the viewer's zone (16.558074ms)
✔ every offered locale has cases (1.104399ms)
✔ dates.mjs writes every date Go writes, byte for byte (3.961381ms)
✔ a chip, the month and the week, in three locales (0.61206ms)
✔ dates.json is what ICU gives, byte for byte (518.961494ms)
✔ L1: mounting then serialising gives cleanBody(body), byte for byte (81.490294ms)
ℹ 871 bodies
✔ L1: mounting a stored body adds nothing, and saving it writes nothing new (90.48076ms)
✔ L2: one edited block changes only that block's bytes; undo gives the body back (135.445718ms)
ℹ 858 single-block edits
✔ L2: inserting or deleting a block changes bytes only at the new seams, by Join (144.047308ms)
ℹ 866 inserts, 817 deletes
✔ L3: seeded edits keep the document and its Markdown saying the same thing (4367.004083ms)
ℹ 20904 edits over 871 bodies
✔ L3: Link to a page makes exactly one chip, and changes nothing else (1037.040171ms)
ℹ 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 (1222.150087ms)
ℹ over 871 bodies: {"inserted":5158,"spaced":23,"refused":45,"unstable":9}
✔ linear: trailing spaces (52.288219ms)
✔ linear: trailing whitespace (16.820208ms)
✔ linear: unclosed web links (16.427966ms)
✔ linear: web links with no address (23.412587ms)
✔ linear: unclosed wiki links (31.371329ms)
✔ linear: unclosed embeds (31.709562ms)
✔ linear: closes only (12.065783ms)
✔ the selected words become the chip's shown text (12.725289ms)
✔ words that are the title make a plain [[Title]] (3.988983ms)
✔ spaces at the selection's edges stay outside the chip (2.054523ms)
✔ a date makes a date link, in a heading, an item and a quote (9.039316ms)
✔ bold words lose their bold: a chip carries no marks in Mapa's Markdown (1.253584ms)
✔ only the linked block's bytes change, and undo gives the body back (2.296378ms)
✔ a selection across blocks, over a chip or a break, or of brackets is refused (1.420031ms)
✔ a target the words cannot be linked to as typed is refused (0.375673ms)
✔ ⌘L: over a selection it opens Page link; with none it types [[; in code it does nothing (2.537284ms)
✔ web-linked words are refused: the address would be lost (review M4) (1.907581ms)
✔ words whose Markdown would read otherwise are refused (review M3) (1.605113ms)
✔ ⌘A then ⌘L says why, instead of doing nothing (review low 1) (0.360706ms)
✔ linkCheck says why it refuses (review low 2) (2.023365ms)
✔ golden file has bodies (1.15343ms)
✔ markup.mjs parses every body into Go's blocks, byte offsets and all (26.769013ms)
✔ markup.mjs strips and spans every block as Go does (88.512887ms)
✔ the schema's toDOM draws every body as Go renders it (65.526145ms)
✔ emphasis draws the four pinned outputs (21.81033ms)
✔ a body ends in the editor's empty paragraph (0.326322ms)
✔ the editor labels date chips as Go does, in every locale L4 holds (10.803573ms)
✔ a POST that never answers is aborted after the timeout (21.277336ms)
✔ a keepalive POST carries no signal, and an answer clears the timer (1.143311ms)
✔ autosave sends only what differs, and the tab owns the draft it wrote (12.398767ms)
✔ an offered draft never commits by itself; Save commits it (1.46844ms)
✔ reload, then close: sessionStorage says the draft is this tab's own (0.710321ms)
✔ closing carries text not yet sent, and the cap leaves it out (43.45257ms)
✔ clean rebase: applied, the caret survives, the base moves by the rebase POST (4.456356ms)
✔ the block under the caret is the teammate's too, and undo brings back yours (3.9553ms)
✔ typing mid-flight: the merge is not applied and the base does not move (2.112489ms)
✔ a merge the editor cannot represent stops after three tries (9.427192ms)
✔ a conflict is shown, locks the editor's own commits, and Resolve settles it (1.367946ms)
✔ leaving: a conflict stays with the choice; a failed flush offers Leave anyway; a stored draft leaves (1.730304ms)
✔ a stale tab shows the newer draft, offered, and never overwrites it (11.374315ms)
✔ the first scratch commit: empty creates nothing, then one page, then drafts on it (1.329514ms)
✔ noBase and gone lead to the existing choices (1.647962ms)
✔ a commit that merged is applied when nothing was typed since (1.761642ms)
✔ back from the cache: nothing unsaved reloads, unsaved text autosaves at once (13.61371ms)
✔ an own draft committed meanwhile goes on as a new draft (1.243285ms)
✔ a reload keeps a stored draft; unsent text still commits (0.560564ms)
✔ a page deleted mid-edit: what is typed is still stored as the draft, and nothing commits (H1) (1.08901ms)
✔ an offered draft committed in another tab: typing goes on as a new draft (H1) (4.396945ms)
✔ a commit reply without a revision is not a commit; an emptied day starts afresh (H2) (1.302664ms)
✔ Resolve stores what was typed first, and takes no typing until its answer is applied (M1) (11.43026ms)
✔ closing with a choice open, or commits held, still writes the text, never commits (M2) (1.41918ms)
✔ closing inside the settling window sends the loaded version with settling=1 (M3) (0.321053ms)
✔ a clean merge not applied because of typing still ends the choice on show (M4) (1.38684ms)
✔ settling finds the draft committed with a teammate's text: a close still writes (M-A) (0.755695ms)
✔ settling finds another tab's newer draft: the tab shows it before any typing (0.957818ms)
✔ a page deleted before the first autosave: the text is offered as a scratch page, and a close makes one (M-B) (0.735869ms)
✔ an autosave that never answered but landed: its 409 keeps the typing since (L3) (0.636645ms)
✔ marks: em outside strong, bold reopened around italics, edges outside (6.93918ms)
✔ marks close before code, links and atoms, and reopen after (0.537792ms)
✔ untouched blocks and atoms re-emit their source; edited atoms are written from attributes (7.590301ms)
✔ empty blocks are written as nothing (2.594279ms)
✔ an unclosed fence that is no longer last gets its closing fence (1.775577ms)
✔ the structure check puts Join's seam where a kept one would merge two blocks (2.176838ms)
✔ prepareSave adopts the parse when no seam or rewrite can save the document (3.716481ms)
✔ reparse: typed emphasis becomes a mark, "- " after a break becomes an item (3.420234ms)
✔ a trailing hard break stays on screen and is written as nothing (1.481064ms)
✔ the reparse waits while an IME is composing (1.411826ms)
✔ copied blocks paste with their bytes and seams; a cut and paste gives the body back (5.71563ms)
✔ a forged x-mapa slice is refused, and text from outside is read as Markdown (0.810236ms)
✔ rebuild changes origins only, outside undo history (2.352553ms)
✔ applyBody takes a teammate's block, keeps the caret, and ends untouched (2.159686ms)
✔ a block whose context changed is written again: a task toggled, a bullet, a quote (4.848109ms)
✔ a duplicate ^id typed above its holder never takes the id from it (1.478078ms)
✔ a copy-dragged block is reparsed, and says what its Markdown says (1.26786ms)
✔ a history command that throws is refused, never thrown (5.177608ms)
✔ an image re-emits its source, and an edited alt changes only its span (9.693585ms)
✔ a paste whose image copy is refused says why and pastes nothing (19.945898ms)
✔ a line of image openers reads in linear time (114.596725ms)
✔ a line of shared link address reads in linear time (14.156741ms)
✔ a line of shared web address reads in linear time (56.912756ms)
✔ one rename at a time, from either field (2.318029ms)
✔ an empty or unchanged title sends nothing (0.201472ms)
✔ a refusal keeps what was typed, and the title (0.236446ms)
✔ the pending state holds for the busy rule (6.9287ms)
✔ a failed POST says so and keeps the title (0.711613ms)
✔ Update links posts the confirm page's POST (0.294904ms)
✔ clean is CleanTitle's whitespace rule (0.190031ms)
✔ the saver's base follows a rename made over it, and only that (0.268044ms)
✔ closing sends the rename as one keepalive POST (1.422506ms)
✔ the port answers every shared case as typeddate.go does (15.88344ms)
✔ numbers follow the locale: 12/11 is November in en-IE, December in en-US (0.269157ms)
✔ M6: several files land in the order they were chosen (46.548534ms)
✔ M5: one Backspace before the box keeps the image where the box is (12.081703ms)
✔ M5: undoing text typed just before the box keeps the upload (12.473304ms)
✔ L12: a failed upload an undo takes away does not stall the next (14.47502ms)
✔ M4: Replace… keeps the old image until the new one is in, and its alt (13.835929ms)
✔ M3 and N1: text wins, except over a picture copied from a page (1.380218ms)
✔ N2: a JPEG over 10 MB is scaled before its size is checked (14.167483ms)
✔ a drag whose anchor the document no longer reaches selects to its end (7.132036ms)
ℹ tests 126
ℹ suites 0
ℹ pass 126
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 7222.994076
=== 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	3.442s
ok  	amadan.net/oficina/mapa/internal/mapa/emoji	(cached)
?   	amadan.net/oficina/mapa/internal/mapa/icons	[no test files]
ok  	amadan.net/oficina/mapa/internal/mapa/imagefile	(cached)
ok  	amadan.net/oficina/mapa/internal/mapa/locale	(cached)
ok  	amadan.net/oficina/mapa/internal/mapa/markup	(cached)
ok  	amadan.net/oficina/mapa/internal/mapa/notionmd	(cached)
ok  	amadan.net/oficina/mapa/internal/mapa/seal	(cached)
ok  	amadan.net/oficina/mapa/internal/mapatest	14.233s
?   	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
index c2d2c62..a07b211 100644
--- a/docs/superpowers/specs/2026-11-22-mapa-columns-icons.md
+++ b/docs/superpowers/specs/2026-11-22-mapa-columns-icons.md
@@ -1,6 +1,6 @@
# Mapa: columns, page icons, banners, and pins from the import
-**Status:** revision 4, 2026-11-22. **APPROVED.** 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; nothing is built yet.
+**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; nothing is built yet.
- 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.
@@ -754,3 +754,7 @@ Fable found every round-1 finding answered in substance, and five mediums and si
- **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.
+