oficina / docs Public

BUILDING.md: how the snapshot gate is enforced, and the bugs its baselines hold

Hub CI skips the gate (baselines are exact only on macOS 27.0.0, Xcode
27.2, runtime 24A434), so: every rendering branch pastes compare all in
its discussion and the reviewer re-runs it; on an environment change,
re-record from main in its own commit first, never on a rendering branch.
Lists the known renderer bugs baked into the editor baselines, and fixes
the push guidance.

Review: Fable on #161, findings 2, 7 and 8.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 7ccdd2cc44b53cb60b0960a57d6e13da159fa8cc parent 1530a71
2 files changed, +62 −3
  • .amadan/ci.d/20-native +5 −0
  • native/BUILDING.md +57 −3
diff --git a/.amadan/ci.d/20-native b/.amadan/ci.d/20-native
index d6f6c9e..ba17e8b 100755
--- a/.amadan/ci.d/20-native
+++ b/.amadan/ci.d/20-native
@@ -1,5 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
+# The screenshot gate (native/scripts/snapshots.sh) is not run here: its
+# baselines are exact only on the macOS, Xcode and simulator runtime that
+# drew them. swift test builds its tests and skips them without
+# RASTRILLO_SNAPSHOTS. A rendering branch runs it by hand and pastes the
+# output in its discussion: native/BUILDING.md, "The screenshot gate".
if [[ "$(uname -s)" == Darwin ]]; then
native/scripts/check-native.sh
else
diff --git a/native/BUILDING.md b/native/BUILDING.md
index b4034f3..7c62482 100644
--- a/native/BUILDING.md
+++ b/native/BUILDING.md
@@ -164,6 +164,60 @@ re-recorded only with a reason in the branch's discussion.
It is not in `.amadan/ci.d`:
baselines are exact only on the OS and simulator runtime that drew them
-(`ENVIRONMENT` beside them). After an intended change, `record`, read the
-contact sheet, and commit the pictures in pushes under about 700 KB: the hub
-drops a push whose pack is over about 1 MB.
+(`ENVIRONMENT` beside them; today macOS 27.0.0, Xcode 27.2, and the iOS
+27.0 runtime 24A434 on an iPhone 18 Pro). Hub CI builds the snapshot tests
+but skips them, since they need `RASTRILLO_SNAPSHOTS`. After an intended
+change, `record`, read the contact sheet, and push the pictures one commit
+per push with `git -c http.postBuffer=209715200 push`: without it the hub
+drops a pack over about 1 MB ("unexpected disconnect while reading sideband
+packet"), and pushes back to back trip its per-IP limit. Batch
+re-recordings: every one stays in the hub's history.
+
+A screen that hangs the main thread never reaches the kit's own 3 s limit,
+so the script stops the Mac test run after `SNAPSHOT_MAC_LIMIT` seconds
+(default 300) and gives each iPhone test XCTest's 120 s allowance.
+
+### Enforcing it
+
+Nothing but this procedure holds a branch to the gate, so:
+
+- **Every branch that can change rendering** (the redesign's S1a, S1b and
+ later, and any fix to the renderer) pastes the whole output of
+ `native/scripts/snapshots.sh compare all` into its discussion before it
+ asks for review. The script prints the environment each half drew on.
+- **The reviewer re-runs it** on their own checkout (about a minute a
+ platform once built) and says so in the review.
+- **When the environment no longer matches the baselines** (the script says
+ "ENVIRONMENT DIFFERS": a macOS, Xcode or simulator runtime update), the
+ failures are drift, not a regression, and can't be told apart from one.
+ Re-record from `main`, on a branch of its own whose only change is the
+ baselines, have the contact sheet reviewed, and land it first. Never
+ re-record on a rendering branch: that would bless whatever the branch
+ changed along with the drift.
+- A rendering fix re-records only the screens it means to change, and its
+ discussion names them.
+
+### Known rendering bugs in the baselines
+
+The editor baselines are today's pixels, bugs included, so that rendering
+work can't fix (or break) them by accident. Each fix is its own branch and
+re-records only the screens it changes:
+
+- Lists draw no bullet or number, on the Mac or iOS: `NSTextList` is set
+ and the items are indented, but no marker is drawn.
+- Arabic paragraphs are left-aligned: `NativeTextProjection` sets `.left`,
+ not `.natural`.
+- iPhone and iPad width, paged: the text sits about 72 pt above where the
+ page's top margin puts it, so it starts at the paper's top edge and stops
+ well above the page's foot. A paragraph's lines can split across pages
+ (iOS paginates by line).
+- The page label differs: the Mac draws "Page 2" at the first break, iOS
+ "Page 1" at the foot of page 1.
+- iOS draws no bar beside a blockquote; the Mac does.
+- In Mac light appearance the desk around the paper is as white as the
+ paper, so only the dark pictures show the paper's edges and the bands
+ between pages.
+- The iOS editor never finishes opening a document with a list or an
+ attachment through the real selection binding (an update loop), so
+ `EditorSnapshots.swift` pins the iOS selection. When that is fixed, the
+ iOS screens go back to `$model.selection` with their baselines unchanged.