oficina / mapa Public

Mapa images: revision 3, answering Fable's round 2

Attaching is an explicit tx.commit argument passed only by verbs that
carry the person's own text, so Revert and Restore cannot publish a
planted id (M1); draftToScratch's copy is a named exception (M2); the
unreferenced_at stamp is never moved (M3); earlier images can be
removed from History (M4); the importer commits as it goes and failed
writes free their copies (M5); the lows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev a2392bdd6068760156b9917c11275e505109db71 parent c27a292
1 file changed, +74 −23
  • docs/superpowers/specs/2026-11-17-mapa-images.md +74 −23

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.c25f62142895a785.js (318737 bytes, 99.5KB gzipped; L12 budget 120KB)
cd editor && node --test
✔ L1: mounting then serialising gives cleanBody(body), byte for byte (51.031818ms)
ℹ 760 bodies
✔ L1: mounting a stored body adds nothing, and saving it writes nothing new (56.085994ms)
✔ L2: one edited block changes only that block's bytes; undo gives the body back (98.24112ms)
ℹ 748 single-block edits
✔ L2: inserting or deleting a block changes bytes only at the new seams, by Join (113.344583ms)
ℹ 755 inserts, 715 deletes
✔ L3: seeded edits keep the document and its Markdown saying the same thing (3163.017701ms)
ℹ 18240 edits over 760 bodies
✔ L3: Link to a page makes exactly one chip, and changes nothing else (956.027674ms)
ℹ 4124 links over 760 bodies; refused: {"A page link can’t hold another link or a line break. Select plain words.":610,"A page link can’t show [ or ]]. Select words without them.":370,"Select some words to link them to a page.":163,"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.":17}
✔ linear: trailing spaces (32.625706ms)
✔ linear: trailing whitespace (17.133389ms)
✔ linear: unclosed web links (14.678941ms)
✔ linear: web links with no address (19.984145ms)
✔ linear: unclosed wiki links (22.001014ms)
✔ linear: unclosed embeds (14.224374ms)
✔ linear: closes only (8.072803ms)
✔ the selected words become the chip's shown text (9.718922ms)
✔ words that are the title make a plain [[Title]] (2.864522ms)
✔ spaces at the selection's edges stay outside the chip (1.16347ms)
✔ a date makes a date link, in a heading, an item and a quote (5.674962ms)
✔ bold words lose their bold: a chip carries no marks in Mapa's Markdown (0.873298ms)
✔ only the linked block's bytes change, and undo gives the body back (1.872462ms)
✔ a selection across blocks, over a chip or a break, or of brackets is refused (0.945363ms)
✔ a target the words cannot be linked to as typed is refused (0.172912ms)
✔ ⌘L: over a selection it opens Page link; with none it types [[; in code it does nothing (1.649725ms)
✔ web-linked words are refused: the address would be lost (review M4) (0.73487ms)
✔ words whose Markdown would read otherwise are refused (review M3) (1.351721ms)
✔ ⌘A then ⌘L says why, instead of doing nothing (review low 1) (0.297425ms)
✔ linkCheck says why it refuses (review low 2) (0.47155ms)
✔ golden file has bodies (0.722968ms)
✔ markup.mjs parses every body into Go's blocks, byte offsets and all (15.028113ms)
✔ markup.mjs strips and spans every block as Go does (23.57985ms)
✔ the schema's toDOM draws every body as Go renders it (50.039479ms)
✔ emphasis draws the four pinned outputs (12.4583ms)
✔ a body ends in the editor's empty paragraph (0.226772ms)
✔ a POST that never answers is aborted after the timeout (21.915034ms)
✔ a keepalive POST carries no signal, and an answer clears the timer (1.1048ms)
✔ autosave sends only what differs, and the tab owns the draft it wrote (11.354853ms)
✔ an offered draft never commits by itself; Save commits it (1.293882ms)
✔ reload, then close: sessionStorage says the draft is this tab's own (0.623623ms)
✔ closing carries text not yet sent, and the cap leaves it out (24.046039ms)
✔ clean rebase: applied, the caret survives, the base moves by the rebase POST (4.018504ms)
✔ the block under the caret is the teammate's too, and undo brings back yours (2.578077ms)
✔ typing mid-flight: the merge is not applied and the base does not move (0.828024ms)
✔ a merge the editor cannot represent stops after three tries (3.50676ms)
✔ a conflict is shown, locks the editor's own commits, and Resolve settles it (1.333647ms)
✔ leaving: a conflict stays with the choice; a failed flush offers Leave anyway; a stored draft leaves (1.225314ms)
✔ a stale tab shows the newer draft, offered, and never overwrites it (0.732075ms)
✔ the first scratch commit: empty creates nothing, then one page, then drafts on it (0.692972ms)
✔ noBase and gone lead to the existing choices (0.706688ms)
✔ a commit that merged is applied when nothing was typed since (0.743576ms)
✔ back from the cache: nothing unsaved reloads, unsaved text autosaves at once (6.455447ms)
✔ an own draft committed meanwhile goes on as a new draft (1.473998ms)
✔ a reload keeps a stored draft; unsent text still commits (0.522375ms)
✔ a page deleted mid-edit: what is typed is still stored as the draft, and nothing commits (H1) (1.064696ms)
✔ an offered draft committed in another tab: typing goes on as a new draft (H1) (3.425978ms)
✔ a commit reply without a revision is not a commit; an emptied day starts afresh (H2) (0.898566ms)
✔ Resolve stores what was typed first, and takes no typing until its answer is applied (M1) (1.982757ms)
✔ closing with a choice open, or commits held, still writes the text, never commits (M2) (1.188887ms)
✔ closing inside the settling window sends the loaded version with settling=1 (M3) (0.356725ms)
✔ a clean merge not applied because of typing still ends the choice on show (M4) (0.984356ms)
✔ settling finds the draft committed with a teammate's text: a close still writes (M-A) (0.515762ms)
✔ settling finds another tab's newer draft: the tab shows it before any typing (0.721065ms)
✔ a page deleted before the first autosave: the text is offered as a scratch page, and a close makes one (M-B) (0.625035ms)
✔ an autosave that never answered but landed: its 409 keeps the typing since (L3) (0.621158ms)
✔ marks: em outside strong, bold reopened around italics, edges outside (7.126819ms)
✔ marks close before code, links and atoms, and reopen after (0.49853ms)
✔ untouched blocks and atoms re-emit their source; edited atoms are written from attributes (7.414486ms)
✔ empty blocks are written as nothing (2.657024ms)
✔ an unclosed fence that is no longer last gets its closing fence (1.536705ms)
✔ the structure check puts Join's seam where a kept one would merge two blocks (2.220711ms)
✔ prepareSave adopts the parse when no seam or rewrite can save the document (3.629939ms)
✔ reparse: typed emphasis becomes a mark, "- " after a break becomes an item (1.949725ms)
✔ a trailing hard break stays on screen and is written as nothing (0.526552ms)
✔ the reparse waits while an IME is composing (0.734169ms)
✔ copied blocks paste with their bytes and seams; a cut and paste gives the body back (3.558727ms)
✔ a forged x-mapa slice is refused, and text from outside is read as Markdown (0.787879ms)
✔ rebuild changes origins only, outside undo history (1.377618ms)
✔ applyBody takes a teammate's block, keeps the caret, and ends untouched (1.394911ms)
✔ a block whose context changed is written again: a task toggled, a bullet, a quote (2.736794ms)
✔ a duplicate ^id typed above its holder never takes the id from it (0.77232ms)
✔ a copy-dragged block is reparsed, and says what its Markdown says (0.878659ms)
✔ a history command that throws is refused, never thrown (3.358812ms)
✔ one rename at a time, from either field (1.826205ms)
✔ an empty or unchanged title sends nothing (0.192589ms)
✔ a refusal keeps what was typed, and the title (0.207327ms)
✔ the pending state holds for the busy rule (5.022607ms)
✔ a failed POST says so and keeps the title (0.421847ms)
✔ Update links posts the confirm page's POST (0.245428ms)
✔ clean is CleanTitle's whitespace rule (0.102652ms)
✔ the saver's base follows a rename made over it, and only that (0.250607ms)
✔ closing sends the rename as one keepalive POST (1.200378ms)
✔ a drag whose anchor the document no longer reaches selects to its end (6.120613ms)
ℹ tests 90
ℹ suites 0
ℹ pass 90
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 4571.369115
=== 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	(cached)
?   	amadan.net/oficina/mapa/internal/mapa/icons	[no test files]
ok  	amadan.net/oficina/mapa/internal/mapa/markup	(cached)
ok  	amadan.net/oficina/mapa/internal/mapa/seal	(cached)
ok  	amadan.net/oficina/mapa/internal/mapatest	9.604s
?   	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-17-mapa-images.md b/docs/superpowers/specs/2026-11-17-mapa-images.md
index bf0667d..e2a86e1 100644
--- a/docs/superpowers/specs/2026-11-17-mapa-images.md
+++ b/docs/superpowers/specs/2026-11-17-mapa-images.md
@@ -1,8 +1,8 @@
# Mapa images
-**Status:** revision 2, 2026-11-17. For review. Nothing is built.
+**Status:** revision 3, 2026-11-17. For review. Nothing is built.
- Fable reviewed revision 1 (`4d40e4e`) and found CHANGES REQUIRED: 2 high, 9 medium and 16 low findings.
-- This revision answers all of them. §11 maps each finding to its change.
+- Revision 2 (`c27a292`) answered them. Fable's round 2 found no high and five mediums, which this revision answers. §11 maps every finding to its change.
**Asked for by Paul, 2026-11-17:** *"we should handle image uploads. CARLOS Platform has everything we need to handle that."* The Notion importer (specced separately) depends on this spec. It must bring Notion's images across as real Mapa images (§7).
@@ -97,7 +97,7 @@ This comes from `carlos store --help`, Slides' live store, carlos/platform `inte
> `images (id, public_id, owner, page_id, created_at, unreferenced_at, stored_bytes, object_key)` and `image_trash (object_key, queued_at)` | serving, scope, quota and retention without unsealing | **how many images each page holds, who uploaded each, when, when it was taken out of the text, and its size to within 64 KiB**, on private pages too. Two images of the same padded size are not thereby the same picture, but small images all pad to one size, and large ones narrow the field.
-That is the same shape as the existing rows "revision store" and "ciphertext sizes": counts, times and coarse sizes. It never shows content. It never shows that an image on one page came from another page.
+That is the same shape as the existing rows "revision store" and "ciphertext sizes": counts, times and coarse sizes. It never shows content. It does not by itself show that an image on one page came from another page.
### 1.4 Serving
@@ -121,7 +121,7 @@ That is the same shape as the existing rows "revision store" and "ciphertext siz
- Pages that carry the editor island stay `no-store` (level-up §6.8). Only the bytes are cached.
5. **Memory: one semaphore covers every blob operation.** That means uploads, serving, copies and the importer.
- It admits four at a time. Each holds at most about 30 MiB: the body, the sealed copy and the opened copy, for a 10 MiB image.
- - Waiters queue. A request that waits 10 s answers 503 with `Retry-After`. The importer's calls wait without a limit (§7).
+ - Waiters queue. An upload or copy that waits 10 s answers 503 with `Retry-After`. **`GET /i/{id}` waits up to 30 s**, because a 503 there is a broken image. The editor's NodeView reloads a failed image once after 2 s. The importer's calls wait without a limit (§7).
- So blob work costs at most about 120 MiB. The figure is measured on the instance's real memory size at build time and recorded in the build notes.
- Streaming, chunked sealing is the fix if that bound is ever too much (§9).
@@ -144,7 +144,7 @@ That is the same shape as the existing rows "revision store" and "ciphertext siz
- Paste and the importer turn external images into Mapa images or into links (§2.2, §7).
- **It is an inline span** (`markup.Image`) wherever links are parsed, and never inside code.
- Like a link, it is part of its block.
- - **When a block's text is only one image**, perhaps with a `^id`, both Go's `Render` and `toDOM` mark that image with the class `alone`. The CSS draws it as a block.
+ - **When a block's text is only one image**, perhaps with a `^id`, Go's `Render` marks that image with the class `alone`. The CSS draws it as a block. In the editor, the class comes from a node decoration that the settle plugin recomputes for each changed block, not from `toDOM`, so it is never an attribute. L4 compares the decorated DOM with Go's HTML.
- **The text index** reads alt text as body text. It does not read the address.
- So search and snippets find alt text, and never `i` or an id.
- **Unlinked mentions ignore alt text.** `linkFirstMention` edits only text spans, so it could never link one.
@@ -248,30 +248,45 @@ One rule, through the store's scoped accessor (`readrule.go`'s `MayRead`, `aroun
- It logs `uploaded`, with object kind `image`.
- It is a write by a person, so like any first write it creates their member row (build note 5).
- Upload needs no page. It works the same for an unwritten day, a new scratch page and a team page.
-2. **A commit attaches it.** `tx.commit` writes every revision; create, commit, resolve, restore, revert and Make team page all reach it. It attaches each image that is all three of:
+2. **A commit of the person's own text attaches it.** `tx.commit` writes every revision. **Attaching is an explicit argument to it,** and only the verbs that carry the person's own text pass it:
+ - create;
+ - saving or committing a draft, `commit=1` included, and a daily note's or a scratch page's first commit;
+ - Resolve;
+ - Make team page;
+ - `draftToScratch`.
+
+ **Every other verb passes "attach nothing":**
+ - Revert (restore from history), which still clears `unreferenced_at`;
+ - Restore of a deleted page, which still re-points (item 4);
+ - the bulk verbs: "Update links", "Link it" and markers.
+
+ With attaching on, `tx.commit` attaches each image that is all four of:
- **introduced by this commit:** referenced by the new body and not by the page's current body (for a new page, every reference is introduced);
- pending;
- - owned by the person committing.
+ - owned by the person committing;
+ - still a row inside its seven-day pending window (§3.3).
Notes on the rule:
- - Nothing else is attached. Bulk verbs ("Update links", "Link it", markers) introduce no image, so they attach nothing.
- - So if Bo types the id of Ana's pending image into a team page, Ana's later commit of that page cannot publish it, because her commit did not introduce it.
+ - Nothing else is attached.
+ - Suppose Bo types the id of Ana's pending image into a team page. Neither Ana's later commit of that page, nor her Revert to a revision that held Bo's text, nor her Restore of the page after Bo deletes it can publish the image. None of those introduced it from Ana's own text.
- The commit's own event covers the attaching. The body is never rewritten: the bytes sent are the bytes stored.
3. **A copy** (`POST /images/copy`, a paste, Make team page, the deleted-page draft below) makes a new pending image, owned by the person copying, with a new object.
- The source must be an image that person may read.
- Each copy logs `uploaded`.
- The object work happens before any transaction (§2.4).
+ - **When the write that was to use a copy fails** (Make team page, `draftToScratch`), that verb deletes its own copies at once: rows, then objects. So a failure holds no quota for seven days.
4. **Restoring a deleted page** (base §3.4) creates a new page id. Its images are re-pointed to that page in the restore's transaction.
-5. **A draft on a deleted page** becomes a new scratch page (base §5, `draftToScratch`). Before that write:
- - the deleted page's images that the draft references are copied for the person;
+5. **A draft on a deleted page** becomes a new scratch page (base §5, `draftToScratch`). This is **the one named exception to item 3's read rule.** The images on a deleted page answer 404 to everyone, so `CopyImage` would refuse them. Before that write:
+ - each image the draft references is copied for the person, **only when it is attached to the draft's own deleted page and the person passes that page's rule** (a team page, or a private page they own);
+ - an image attached anywhere else is left as typed, and renders as unavailable;
- the scratch body is written with the new addresses.
- So the person's own text keeps its pictures. The server writes that body itself.
+ The 90-day window does not cut this short: the sweep keeps an image a draft references (§3.3), so a draft never outlives its own pictures. The person's own text keeps its pictures, and the server writes that body itself.
### 3.3 Retention, removal and the sweep
**`unreferenced_at`:**
-- `tx.commit` stamps it on each of the page's images that the new body no longer references.
+- `tx.commit` stamps it, **only where it is null,** on each of the page's images that the new body no longer references. A later edit never moves an existing stamp, so an image removed from the text reaches its 90 days however often the page is edited after.
- It clears the stamp when a body references the image again, as Revert does.
- It is plaintext (§1.3). It leaks a time only.
@@ -311,7 +326,9 @@ So an image taken out of the text stays reachable from History and comes back wi
**Removing an image now:**
- **Where it is offered:**
- with script, "Remove from Mapa" in a selected image's bubble;
- - without script, the Markdown screen's **Images on this page** list. It names each image attached to the page, and the viewer's own pending images referenced in the text, by its alt text or "Image without a description". It links to **Open** and **Remove**.
+ - without script, the Markdown screen's **Images on this page** list. It names each image attached to the page by its alt text or "Image without a description", and the viewer's own pending images referenced in the text. It links to **Open** and **Remove**.
+ - **Images already taken out of the text** are in that list too, as "Earlier image, taken out on <date>". A photo deleted from the text can still be removed from History. That list is shown with script on as well, under History.
+ - History's drawn images link to the same confirm page.
- **The confirm page** is `GET /i/{id}/remove`, and the action is `POST /i/{id}/remove`.
- **Who may remove:**
- any member, for an image on a team page, as any member may delete a page;
@@ -343,6 +360,8 @@ So an image taken out of the text stays reachable from History and comes back wi
- Upload and copy are refused when the person is over their own allowance.
- They are also refused when the team pages are over the team's.
- Each refusal names its own figure: "You've used 1 GiB of images" or "Team pages hold 10 GiB of images".
+ - **Over the team's allowance, every upload is refused, private ones included,** because an upload does not know where it will go. The message says so: "Team pages hold 10 GiB of images, so Mapa takes no more uploads until some are removed."
+ - **The team's allowance is a soft cap.** It is checked at upload, against images already on team pages. Pending images committed later can carry the total past it, by at most what the members hold pending.
- **The account's plan** (§1.1) bounds everything.
- When CARLOS denies `PutObject`, upload answers: "Mapa's storage is full. Ask whoever runs your team's Oficina."
- That refusal depends on the whole account's use, across apps, which the person cannot see. It is the platform's signal and cannot be avoided. It is recorded here as a residual.
@@ -363,9 +382,14 @@ So an image taken out of the text stays reachable from History and comes back wi
- **Several files** upload in order, each into its own place.
- **The client checks type and size first,** for a quick message. The server's check is the one that counts (§5).
- **Large JPEGs are scaled down first** (decision Q3).
- - With script, a JPEG over 4,096 px on its long side is drawn to 4,096 px on a canvas and sent at quality 0.9.
+ - With script, a JPEG over 4,096 px on its long side is decoded with `createImageBitmap(file, {imageOrientation: 'from-image', resizeWidth, resizeHeight, resizeQuality: 'high'})`. An `<img>` on a `blob:` URL would be refused by the CSP.
+ - The bitmap is drawn to a canvas and sent as JPEG at quality 0.9. A canvas drops EXIF, so the orientation is applied while decoding and the result is upright with no tag.
+ - The scaling happens **before** the 10 MiB check, so a large photo is checked at its scaled size.
+ - If decoding fails, the original is sent as it is.
+ - Colour is converted to sRGB. A Display P3 photo loses some saturation (Q3).
- That is what makes a 48-megapixel phone photo usable, and readable on a phone.
- Other formats, and every scriptless or importer upload, go as they are, within §5's limits.
+ - A browser test sends a JPEG over 4,096 px with EXIF orientation 6. It must arrive at no more than 4,096 px and upright.
- **Upload** is `POST /images`, multipart with the field `file`, sent with `XMLHttpRequest` so progress events exist. The reply is `{id, src, width, height}`.
### 4.2 Progress and failure
@@ -520,11 +544,15 @@ The Markdown screen's form gains a file input and a second button, **Upload and
- `/links/resolve`;
- `GET /i/<Ana's id>` and `GET /i/<Ana's id>/remove`, which give the same status, headers and body as an id that never existed;
- `POST /images/copy`.
- - **Ana's own commit** of the team page that holds her typed pending id leaves the image unattached.
+ - **Bo has typed Ana's pending id into a team page.** Each of these leaves the image unattached:
+ - Ana's own commit of that page;
+ - Ana's Revert to the revision that held Bo's text, after Bo removed it;
+ - Ana's Restore of the page, after Bo deleted it.
- **Mutants** (`make mutate`), each of which must be caught:
- one drops the route's scope check;
- one resolves images attached to other pages;
- - one makes attach ignore "introduced".
+ - one makes attach ignore "introduced";
+ - one makes Revert or Restore pass "attach".
- **IMG2, the plaintext file scan.** This extends gate 4.
- **The setup:** a PNG and a JPEG are uploaded with canary strings:
- in `tEXt`, EXIF, XMP and a JPEG trailer after EOI;
@@ -565,6 +593,8 @@ The Markdown screen's form gains a file input and a second button, **Upload and
- **IMG7, lifecycle.**
- **Attaching:** a commit attaches only the committer's own pending images that it introduces. Bulk verbs attach nothing.
- **Copying:** only images the person can read are copied.
+ - **`draftToScratch`** copies only images attached to the draft's own deleted page, under that page's rule. A mutant that copies an image attached to another page must be caught.
+ - **A failed Make team page or `draftToScratch` write** deletes its own copies at once.
- **Make team page:**
- copies only images attached to its source;
- leaves pending copies when its write fails;
@@ -576,6 +606,7 @@ The Markdown screen's form gains a file input and a second button, **Upload and
- keeps an image that a draft or a revision in the window references;
- removes a pending image after seven days, and a deleted page's images after 90;
- unseals nothing when no candidate exists;
+ - sweeps an image taken out of the text after 90 days, even when the page has had commits through all 91 of them (the stamp is never moved);
- never fails boot when the bucket is down.
- **Failures:** a failed object delete stays queued. A failed transaction after `Put` deletes the object.
- **The page gates extend:**
@@ -611,6 +642,7 @@ func (image Image) Markdown(alt string) string
```
**How the importer uses them:**
+- **Commit as it goes.** Pending images count against the importing person's own allowance until a commit attaches them. So the importer commits each page before it adds the next page's images. Otherwise a large workspace would stop at the person's 1 GiB, however much of it was bound for team pages.
- **One image per place.**
- An `Image` attaches to the first page whose commit introduces it.
- When a Notion file appears on two pages, the importer calls `AddImage` once and `CopyImage` for each further page.
@@ -639,15 +671,15 @@ Paul runs these steps, or the agent runs them with his say-so, **after** the bui
```sh
carlos store create --app mapa --account oficina
```
-3. **Check that scanning is off:**
+3. **If step 2 left the store declared but not provisioned,** an operator (Paul) grants it:
```sh
- carlos store scan status --app mapa --account oficina
+ carlos store grant --app mapa --account oficina
```
- It should say "not requested". If scanning is on, stop and bring it to Paul. Do not upload anything until it is off: `carlos store scan revoke --app mapa --account oficina` is an operator verb.
-4. **If step 2 left the store declared but not provisioned,** an operator (Paul) grants it:
+4. **Check that scanning is off:**
```sh
- carlos store grant --app mapa --account oficina
+ carlos store scan status --app mapa --account oficina
```
+ It should say "not requested". If scanning is on, stop and bring it to Paul. Do not upload anything until it is off: `carlos store scan revoke --app mapa --account oficina` is an operator verb.
5. **Check what was delivered:**
```sh
carlos store status --app mapa --account oficina
@@ -688,7 +720,7 @@ Paul runs these steps, or the agent runs them with his say-so, **after** the bui
1. **SVG: refused or sanitised?** *Recommended: refused.* An SVG is a script-capable document on Mapa's own origin. Slides' sanitiser exists, but it would be a second copy to keep safe. Notion pages rarely hold SVG.
2. **Quotas.** *Recommended: 1 GiB per person, for pending images and images on private pages; 10 GiB for the team, for images on team pages; and 10 MiB per image.* A single team-wide total over everything would leak a count of private images.
-3. **Captions, sizing and scaling.** *Recommended:* no captions and no resizing in v1. With script, JPEGs over 4,096 px on the long side are scaled down before upload (§4.1). So a 48 MP photo becomes about 12 MP, and the original is not kept.
+3. **Captions, sizing and scaling.** *Recommended:* no captions and no resizing in v1. With script, JPEGs over 4,096 px on the long side are scaled down before upload (§4.1). So a 48 MP photo becomes about 12 MP, upright and in sRGB. The original is not kept, and a Display P3 photo loses some saturation.
4. **External image Markdown** (`![x](https://…)`). *Recommended: render as today,* a `!` and a link. It is never fetched.
5. **The oficina account's plan.** *Recommended:* keep it on a plan that does not force scanning, because a sealed store cannot be scanned. Turn on `--private-storage` for Mapa when it joins Alta.
6. **Who may remove an image on a team page.** *Recommended: any member,* as with deleting a page, with a confirm page and an event that names them.
@@ -729,3 +761,22 @@ Paul runs these steps, or the agent runs them with his say-so, **after** the bui
| **L14** Decision and gate ids collided | The gates are IMG1–IMG7 | throughout |
| **L15** Corpus gaps | Added: image in a heading and a task item, inside emphasis and a link label, and alt at the byte limit in multi-byte characters | §2.3 |
| **L16** History hid an image replaced under the same alt | The diff treats the span as one token, id included | §2.1 |
+
+### Round 2: Fable on revision 2 (`c27a292`), CHANGES REQUIRED, answered in revision 3
+
+There were no high findings. Fable said that once M1–M5 were applied as proposed, no further full round was needed, only a check of the diff.
+
+| Finding | Change | Where |
+|---|---|---|
+| **M1** "Introduced by this commit" still published a planted id. Bo plants Ana's pending id, then removes it; Ana reverts. Or Bo plants it and deletes the page; Ana restores | Attaching is an explicit `tx.commit` argument. Only the verbs that carry the person's own text pass it (create, draft commits, Resolve, Make team page, `draftToScratch`). Revert, Restore and bulk verbs attach nothing. Both cases are in IMG1, with a mutant | §3.2, IMG1 |
+| **M2** `draftToScratch` copied images that nobody may read | Named as the one exception. It copies only images attached to the draft's own page, under that page's rule. The 90-day window does not apply, because a draft keeps its images. A mutant was added | §3.2, IMG7 |
+| **M3** Every edit re-stamped `unreferenced_at`, so nothing ever reached 90 days | Stamped only where null. The IMG7 case has 91 days of commits | §3.3, IMG7 |
+| **M4** A photo deleted from the text could not be removed from History | "Images on this page" lists earlier images, "taken out on <date>", with Remove. History's images link to the confirm page | §3.3 |
+| **M5** Pending images capped the importer at 1 GiB, and failed copies held quota for seven days | The importer commits page by page. Failed writes delete their own copies. The team allowance is stated as a soft cap | §3.2, §3.4, §7 |
+| **L1** Downscale mechanism, orientation, order and colour | `createImageBitmap` with `imageOrientation`. Scaled before the size check. The original is sent if decoding fails. sRGB is in Q3. A browser test was added | §4.1, Q3 |
+| **L2** The `alone` class had no editor mechanism | A node decoration. L4 compares the decorated DOM | §2.1 |
+| **L3** §8's order | create, grant if needed, scan status, then store status | §8 |
+| **L4** "It never shows" overstated | "It does not by itself show" | §1.3 |
+| **L5** Attaching a pending image past its window | Attach needs the row still inside its seven days | §3.2 |
+| **L6** A 10 s wait made a broken image | Serving waits 30 s, and the NodeView retries once | §1.4 |
+| **L7** Over the team allowance, private uploads were refused without saying why | The message says so | §3.4 |