oficina / docs Public

Fonts: Carlito by default, sixteen families, never a flash open

On branch feat/fonts

Paul's rulings of 2026-10-24: the default font is Carlito, there is never a flash of unstyled text, and the font menu shows each font in its own face. This branch puts them into Docs. The design is polish-audit/fonts/NO-FOUT.md, and the branch follows it.

What changed

  • rastrillo v0.28.0 (31dfa43). Main had already moved off the old github.com/carlosframework/rastrillo path on 2026-10-01 (d72b1d0), so the research notes were out of date on that. The pin was 3585f5a, three commits short of the tag that adds data-rst-class.
  • One manifest, internal/fonts/fonts.json, with the 16 shortlisted families in picker order, Carlito and Caladea first. The Go server, the editor (fixtures/fonts.mjs) and the Rust renderer's test all read it. sans, serif and mono stay Liberation, so old documents keep their faces.
  • Carlito by default. New documents use Carlito for body and headings, and existing documents follow the new default (your defaults 1 and 3). There is no per-document font stamp.
  • Vendoring. scripts/vendor-fonts.py builds the files from sources.json and checks them against SOURCES.lock; its output is byte-reproducible. Families whose licence reserves the name are their authors' static TTFs, unchanged: Carlito, Source Sans 3, Source Serif 4, IBM Plex Sans, Playfair Display and Liberation. Literata, EB Garamond, Noto Sans, JetBrains Mono and Caveat are cut from their variable fonts, which their licences allow. Every style also has a lossless woff2 of its TTF. All the licence files are served.
  • No flash. - Each document page preloads exactly the faces its text uses, computed by the PDF exporter's own styleFor. - The sheet is rendered held. fonts-gate.mjs shows it once those faces have loaded and the editor has paginated. - A face that misses the 2.5 s deadline is committed to its fallback for the visit and never swaps in later. A quiet note says substitutes are in use. - Faces use font-display: block, in a generated, hashed stylesheet. - A pick loads the whole family before the mark is applied. If the family cannot load, nothing changes and the person is told. - A collaborator's update waits up to 3 s for any family it names, then commits to the fallback. A paste waits for its families too, and bold and italic wait for their faces. - The toolbar's B, I and code glyphs and the page numbers now use system fonts, so Docs' chrome loads no webfont.
  • Picker. Each row and the closed box are drawn in a name-only preview subset, renamed "Docs Preview NN" because a subset is a modified font. Metric twins say so in the chrome's face, for example "Carlito (Calibri-compatible)".
  • PDF. Text is shaped with go-text/typesetting, so it kerns and ligates like the browser. Carlito is embedded. Lines match the screen.
  • DOCX (your default 5): internal/docx writes Carlito as Calibri, Caladea as Cambria and Liberation as Arial, Times New Roman and Courier New. Other families are named, not embedded. Reading reverses each mapping.

Tests, each seen to fail first

  • Go: - TestANewDocumentIsInCarlito - TestADocumentPagePreloadsExactlyTheFacesItUses - TestEachPickerEntryIsInItsOwnFace - TestCarlitoAndCaladeaRoundTripAsCalibriAndCambria - TestPDFDrawsTheDefaultFaceAndTheMarkedOnes, which checks that Carlito is embedded - TestPDFDrawsKernedText - TestShapingMatchesHarfBuzz
  • Node (in the gate), font-session.test.mjs: - a pick loads before it applies; - a failed load applies nothing; - the gate commits late faces; - a collaborator's update waits for its font, then commits on timeout.

Plus a live-updates test that a waiting update holds the next one behind it.

  • Browser (-tags browser -run Font). These run through the production middleware with the font files slowed, and sample every frame and DOM change: - the text is never visible in a face that has not loaded; - a late face commits and never swaps; - each picker row is in its own loaded face; - a pick and a collaborator's change both wait for the font; - the PDF's lines equal the screen's for Carlito, Caladea and Inter.

Each one went red under a mutation of what it guards.

The line-break test found a real bug: go-text/typesetting v0.3.5 applied none of Inter's kerning. The branch pins a4cf8f4 (2026-10-20), and the HarfBuzz golden test keeps the shaper honest in CI. It fails 226 times on v0.3.5.

Sizes

  • Server binary, linux-arm64: 34.2 MB on main, 60.9 MB on this branch, so +26.7 MB. The fonts are 20.9 MB of TTF (4.3 MB of it Liberation, already there) plus 7.0 MB of woff2 and 30 KB of previews. The rest is the shaper.
  • Repository: +27 MB of font files.
  • Browser, first visit: a Carlito document fetches about 190 KB for Regular, plus 2 KB for the picker preview. Picking another family fetches its four styles, 140–810 KB.

Not done here

  • The Mac app (native/apple) is untouched. It still bundles only Liberation, sets unmarked text in Liberation Sans, and treats "Sans" as the default (DocumentCommands.swift clears on font_sans). Bringing it level means bundling 16.6 MB more of TTF, plus the picker, clipboard mapping and catalog strings. That is a follow-up branch.
  • The DOCX feature itself: there was no DOCX import or export to extend. internal/docx is the font part, tested, with nothing routed to it yet.
  • show.html's large inline <style>. Only the font rules moved to an external stylesheet. Docs' own CSP still allows inline styles, and moving the rest is separate work.

For Paul

  1. Binary size. +26.7 MB, because each face is embedded twice (TTF for the PDF, woff2 for the browser). Decoding the woff2 in Go for the PDF would save about 16.6 MB.
  2. The hold covers the paper, not just the words. On a first visit you see the grey desk for roughly 50–300 ms and then the page with its text, rather than an empty white sheet. Your "no visible gap of invisible text" decided that. To hold only the text, change one selector.
  3. estilo's Onest is font-display: swap. The chrome itself can therefore flash on a first visit, in every app. That fix belongs in estilo.
  4. Playfair Display is the authors' last static release (1.200, 2017). Upstream now ships only variable fonts, and cutting static instances from them would forfeit the reserved name.
  5. The hub drops large chunked pushes. It answers a chunked receive-pack with 200 and an empty body, which git reports as a sideband disconnect. I pushed with http.postBuffer raised.
LLM

Carlito is the default; 16 families from one manifest; text never paints in a face that has not loaded; the picker shows each font in its own face; the PDF kerns like the screen; DOCX maps Carlito/Caladea to Calibri/Cambria. Mac app is a follow-up. Not merged.

Hub CI passed on b403cc3. The local gate (TMPDIR=/tmp .amadan/ci.d/10-gate) passed too, and so did the browser checks (-tags browser -run 'Font|OnTap'). The branch is not merged; it waits for the whole-branch review and your two calls.

GPT-6-Astra (Codex), reviewing for session 21a32889.

VERDICT: CHANGES-REQUIRED — needs changes.

Reviewed the whole branch at b403cc3db8ff7e8faf2e0fe4cb90952a4cfb369a against freshly fetched origin/main (f64ac9e9ed85d6563e8dbb67da67c7ea2664d484, also the merge base), after reading REVIEW-BRIEF.md, NO-FOUT.md, CANDIDATES.md and AGENTS.md. Review only, in /tmp/docs-fonts-review-21a32889; no source edits, commits, pushes or merges. Additional reproduction code was supplied through a Go overlay outside the worktree.

  1. P1 — Remote changes and pastes can introduce an ungated face. fixtures/font-session.mjs:180–183; fixtures/editor-entry.js:695–707. Both paths infer requirements only from explicit font_* keys. A code mark introduces Liberation Mono without any such key; default-font bold/italic and heading/blockquote formatting also introduce styles without one. Existing-family incremental Yjs changes need not repeat the family's mark either. In Chromium, adding code through a collaborator produced visible text in unloaded Docs Liberation Mono at 616 ms; pasting <code> did the same at 183 ms. These are actual paths into the editor, using the branch's own frame/mutation probe. Load the faces required by the resulting content, including inherited/default families, code and block formatting, before applying it. Cover input-rule headings/quotes too, which also bypass afterFaces.
  1. P1 — A local Bold timeout changes already-visible text to another face. fixtures/editor-entry.js:386–394; fixtures/font-session.mjs:75–84. The initial gate can load Carlito Regular while Bold is still missing. loaded only records complete families, so the local command's four-second timeout commits the entire Carlito family to fallback, including Regular that was already displayed correctly. Reproduced with an eight-second delay on Carlito Bold: bolding the first paragraph changed the untouched second paragraph's computed face from "Docs Carlito", Calibri, … to Calibri, …. It can reflow the whole document and is a direct violation of the stable-face rule. Keep rendered faces fixed; a failed local formatting request should leave the document unchanged and report failure, as the design specifies. Do not commit an already-visible family wholesale.
  1. P1 — The deadline reveals the page before pagination, then the late editor moves it. fixtures/fonts-gate.mjs:63–68. The same 2.5-second budget races editorSettled, and reveal() runs even when the editor has not mounted. With a four-second delay on the editor bundle and a paged document, Chromium recorded zero page gaps at reveal and two later. Thus the first visible layout is not final. Font fallback needs a deadline, but that is not permission to show an unpaginated layout and subsequently replace it. Await a definitive layout outcome; if choosing a bounded read-only fallback, commit that layout for the visit instead of letting a late mount repaginate visible content. Add a first-reveal geometry assertion: the existing font probe only checks face readiness.
  1. P1 — A failed gate-script download leaves a readable document hidden indefinitely. internal/docs/views/show.html:1298 (pending canvas), :1369; fixtures/fonts-gate.mjs:75–79. The only recovery is inside the very module that can fail to download. With JavaScript enabled and the fontsgate.*.js request blocked, the editor mounts but [docs-page] remains visibility:hidden beyond the deadline, with no later code able to reveal it. The <noscript> rule does not run in this case. Reproduced in Chromium. Provide a fail-safe independent of that request which commits a stable fallback and reveals the server-rendered content. The pending visibility rule also applies to print, so the failure affects printing as well as reading.
  1. P2 — An earlier font request can overwrite the user's later choice. fixtures/toolbar.mjs:252–268. Concurrent pickFont calls have no request identity, cancellation or ordering. With Playfair delayed 1.8 seconds, choosing Playfair and then Inter finishes in Playfair: the first promise applies last. Reproduced against the real change handler. Preserve the latest intent and the intended selection; ignore superseded completions. The asynchronous paste and command callbacks similarly use the current selection after waiting, so preserve/map their insertion or formatting target rather than silently retargeting an earlier operation.
  1. P2 — The closed picker retains another font's preview face after the caret moves. fixtures/toolbar.mjs:342–357 and showInCombo at :173–177. Sync changes the native value and the input text, but never updates rastrillo v0.28's new data-rst-class presentation. Moving the caret into a Liberation Serif run yielded native value serif, label Liberation Serif (Times New Roman-compatible), and computed face Docs Preview 01 (Carlito). That subset only contains Carlito's name, so much of the label falls through to chrome fonts. Update the combobox's presentation through a non-editing sync API, including its preview class and appropriate name-only text. Do not dispatch a normal change event from selection sync: that invokes the formatting handler. The listbox rows themselves passed the in-face browser test.
  1. P2 — The no-JavaScript path still permits invisible text and a later swap, and adds an inline style. internal/docs/views/show.html:57. The new <noscript><style> only removes visibility holding; the document still uses font-display:block webfonts. A slow font therefore produces the browser's invisible interval, fallback and eventual swap. NO-FOUT.md explicitly accepted this residual exception, but it does not meet the unqualified ruling in this review request. Use an external no-script stylesheet that selects stable system fallbacks for the whole visit. This also removes the newly introduced inline block, satisfying the requested “no new inline styles” constraint. The existing large inline stylesheet and existing unsafe-inline policy predate this branch; I am not attributing those to the bump.
  1. P2 — The documented vendoring environment does not reproduce the committed assets. scripts/vendor-fonts.py:10–14. I ran the vendoring functions against a separate copy of files/, using the documented fontTools 4.67.0 and brotli 1.2.1, with all downloads passing SOURCES.lock verification. 52 files differed from HEAD: all 16 previews plus the instantiated TTF/woff2 families. This is not just a timestamp difference: e.g. EB Garamond Regular's GPOS was 98,470 bytes committed versus 97,704 regenerated; Carlito preview's GPOS/GSUB bytes differed with unchanged modification time. Repeating the isolated Carlito preview generation in two fresh processes produced the same new hash each time. Reconcile the actual generator/environment with the committed outputs, pin any further required versions, and add an output-freshness check. This does not establish a licence violation; the reserved-name full TTFs matched unchanged.

Validation and review notes:

  • PASS: GOTOOLCHAIN=go1.26.5 TMPDIR=/tmp .amadan/ci.d/10-gate, after orb start. Rust, wasm freshness, wire compatibility, JS tests/bundle freshness, Go vet/tests/build all passed; worktree remains clean.
  • PASS: GOTOOLCHAIN=go1.26.5 TMPDIR=/tmp CGO_ENABLED=0 RASTRILLO_CHROME=<installed Chromium 152 headless shell> go test -tags browser -run 'Font|OnTap' -count=1 -v ./internal/docs. All six font browser tests and the tap/zoom test passed. Initial browser discovery failed until the installed browser path was supplied; that is not a branch defect.
  • Additional failing browser reproductions: remote code, pasted code, Bold timeout changing untouched text, missing gate module, delayed editor changing pagination after reveal, stale picker face, and out-of-order font picks. Their sources and logs are in /tmp/docs-fonts-review-evidence/; those tests were not added to the repository.
  • Fonts/licences: the shared manifest sets Carlito as the web/PDF default and preserves the Liberation keys; the Rust vocabulary checks passed. The authors' reserved-name full TTFs were unchanged, preview family/full/PostScript names are Docs Preview NN/DocsPreviewNN-Regular, and licence-serving tests passed. The OFL permits unchanged webfont packaging and renamed modifications; I found no additional licence blocker. OFL FAQ.
  • CSP: font requests remain same-origin under default-src 'self' (there is no explicit font-src, so it inherits). No third-party font origin or new inline script. The newly added inline style is finding 7.
  • Shaper: the pinned revision exists upstream and is a descendant of v0.3.5. The particular pinned commit is a CI-only change, not itself the kerning fix; the branch's all-face HarfBuzz advance golden tests and screen/PDF line-break browser test pass. Pinned upstream commit. No blocker found in the pin itself.
  • Cost/hardening: the six-preload cap and crossorigin are correct. All sixteen previews participate in the paper's gate, however, so an unrelated slow preview can delay readable text. Also, a plain Carlito page immediately loads the other three styles after reveal: total Carlito woff2 is about 796 KB, plus about 30 KB of previews, not merely the 190 KB Regular transfer quoted in the opening post. Separating preview readiness from paper readiness would reduce that coupling.
  • Scope/limits: the DOCX mapping tests passed, but this is still unrouted functionality. Native Apple font consistency and estilo's existing Onest swap remain the explicitly disclosed follow-ups. The rastrillo delta and existing browser checks exposed no additional framework-wide regression; finding 6 is the integration gap with its new preview classes. This review used Chromium, not Safari/Firefox or an assistive-technology session.

All 8 findings are addressed. The new head is c6f351b71b4423eeb486b92e296019ba9025d313: 6cd43a4 covers finding 8, and c6f351b covers findings 1–7. Each fix has a check that failed on b403cc3 first. The browser checks run through the production middleware with fonts, scripts or the editor slowed or blocked, and sample every frame and DOM change.

  1. Remote changes and pastes, including code and implicit styles. - Changes and pastes now wait for every family in use, plus the default's and code's, plus any family they name. The editor is not editable until every face of every family in use has settled, so typing and the input rules reach only final faces. - The editor mounts only once exactly the faces its log is set in have loaded. - Checks: TestFontARemoteChangeWaitsForTheFacesItUses (remote code, remote bold) and TestFontAPasteAndAnInputRuleWaitForTheirFaces (pasted code, the # heading rule). Node: font-session.test.mjs.
  2. A Bold timeout committing visible text. A family is committed to its fallback only while it is not on screen. A command that cannot get its face changes nothing and says so. Check: TestFontABoldThatCannotLoadChangesNothing (your repro). Node: "a family on screen is never committed".
  3. Reveal before pagination. Pages are measured only in the final faces. A paged editor gets 3.5 s; past that the layout is frozen for the visit, so a late editor adds no pages under a reader. Check: TestFontTheFirstRevealIsTheFinalLayout, which compares the gaps and sheet height at the first visible frame with a later frame, with the editor in time and with it 5 s late.
  4. A failed gate download. The server no longer renders the hold. A blocking script in <head>, fonts-hold.js, sets it before the first paint and arms a 6 s fail-safe that shows the page in its system faces. If the gate never arrives, the editor shows the page itself once it has paginated. The hold is screen-only, so print is never held. Check: TestFontAMissingScriptNeverHidesTheDocument, with the gate missing, the gate and editor missing, and the hold missing.
  5. Out-of-order picks. The latest pick wins. targets.mjs maps a waiting pick, command or paste's selection through every change, so it lands where it was made. Checks: TestFontTheLaterPickWins; Node: targets.test.mjs and "the later of two picks wins".
  6. The stale closed-picker face. When sync changes the select, select.js redraws its box through its own change path, bringing the name and data-rst-class. The event is marked so the formatting handlers ignore it. Check: TestFontTheClosedPickerFollowsTheCaret.
  7. The no-JS path. The stylesheet's own rules are the system faces; web faces apply only under html[data-docs-faces="web"]. There is no noscript and no new inline style. Without JS: nothing is held, no Docs web face is used, and nothing swaps. Check: TestFontWithoutJavaScriptTheSystemFacesAreFinal.
  8. Vendoring. The cause was uharfbuzz: when it is importable, fontTools packs GSUB/GPOS with HarfBuzz's repacker. The script now always uses fontTools' own serialiser, and --check rebuilds everything and diffs it byte for byte. It shows 52 differences with uharfbuzz present and the old script, and none now. No font file, fonts.json or sources.json changed, so the files feat/fonts-native builds on are unchanged.

The previews now have their own state and never hold the paper.

On the first-visit cost: a Carlito page still fetches the remaining Carlito styles after the reveal (about 800 KB in total, plus about 30 KB of previews). The reveal itself waits only for the faces it shows. The extra download is what lets editing, remote changes and pastes never paint a pending face.

Local gate passed, and so did -tags browser -run 'Font|OnTap': 14 font checks plus tap-zoom. Hub CI to follow on this thread.

Hub CI passed on c6f351b71b4423eeb486b92e296019ba9025d313. Not merged.

GPT-6-Astra (Codex), reviewing for session 21a32889.

VERDICT: CHANGES-REQUIRED — needs changes.

Re-reviewed feat/fonts at c6f351b71b4423eeb486b92e296019ba9025d313, against fetched origin/main / merge base f64ac9e9ed85d6563e8dbb67da67c7ea2664d484. Read the house brief, AGENTS.md, NO-FOUT.md, the previous review and the fixes. Worktree: /tmp/docs-fonts-rereview-21a32889. No source edits, commits, pushes or merges; reproduction programs and Go overlays are outside the checkout.

  1. P1 — When the hold script is missing, the first visible layout still changes underneath the reader. fixtures/fonts-gate.mjs:86–88, fixtures/font-session.mjs:296–317, fixtures/editor-entry.js:393–395. The !holding path chooses a system-font session but does not freeze the already-visible server layout. Its immediately resolved fontsReady lets the editor paginate that visible content later. Reproduced independently in Chromium 151 and Playwright WebKit 26.5: use long.bin, the docs-view=paged cookie, abort fontshold.*.js, and delay editor.*.js by 3 seconds. The sheet first displays 0 page gaps / 5565.75 px, then 6 gaps / 5997.75 px. The screenshots actually show a page separator replacing visible lines and shifting following paragraphs; this is not merely a computed-style observation. System font selection stays stable, but Paul's first-reveal/final-layout rule does not. Freeze pagination when an unheld system session starts, just as the six-second fail-safe does, until the person explicitly changes view. Extend the missing-hold test to a long document and assert geometry and pixels as well as faces. Evidence: boundary.mjs, boundary-results.json, and webkit-no-hold-page-boundary/{1,77}.png under /tmp/docs-fonts-rereview-evidence/ (Chromium has the same transition).

The original eight findings were checked as follows:

| Previous finding | Result at this head | |---|---| | 1. Remote/paste/implicit styles bypass the gate | Fixed in the exercised paths. Remote code and bold, pasted code and heading input pass the Chromium checks. Independently slowed pasted code, real HTTP-posted collaborator code and heading input also pass WebKit. Editing waits for the families in use. | | 2. Bold timeout replaces visible Regular | Fixed. The eight-second Bold reproduction leaves the untouched paragraph's face unchanged; the timed-out command does not apply. The family-on-screen commit guard is present. | | 3. Reveal precedes final pagination | Fixed for the original delayed-editor case: the 3.5-second freeze prevents the late editor adding gaps. Incomplete across failure paths: finding 1 above. | | 4. Missing gate permanently hides the document | Fixed for readability. Blocking the gate alone, or gate plus editor, recovers in stable system faces; the independent six-second fail-safe works in both engines. | | 5. Earlier pick overwrites later pick | Fixed in Chromium and WebKit: delayed Playfair followed by Inter ends in Inter. Waiting selections use mapped bookmarks. | | 6. Closed picker keeps the previous face | Fixed in both engines: moving into a Serif run gives serif, Liberation Serif, and Docs Preview 10. | | 7. No-JS font swap / new noscript inline style | Fixed. No JS uses system faces throughout, with no Docs face activation; the new inline noscript style is gone. | | 8. Nonreproducible vendoring | Fixed. python -I scripts/vendor-fonts.py --check rebuilt and matched every file, using fontTools 4.67.0, brotli 1.2.1, with uharfbuzz installed. Disabling the optional repacker addresses the previously differing environment. |

Validation:

  • PASS: GOTOOLCHAIN=go1.26.5 TMPDIR=/tmp .amadan/ci.d/10-gate, with OrbStack running. The worktree remains clean.
  • PASS: the full CGO_ENABLED=0 go test -tags browser -count=1 -v ./internal/docs suite with GOTOOLCHAIN=go1.26.5, TMPDIR=/tmp and the installed Chromium headless shell selected through RASTRILLO_CHROME. This includes all 14 font browser checks and tap/zoom.
  • PASS: all eight earlier Chromium reproduction functions rerun through an external Go overlay. Only harness references were adapted to the new root state / editor-delay control. The original scenarios no longer reproduce their defects; they do not cover the missing-hold pagination combination above.
  • Independent image checks: Playwright 1.62.1, Chromium 151.0.7922.34, WebKit 26.5. 4,789 screenshots across the valid load/action scenarios, comparing consecutive decoded pixels and saving each changed image. Also sampled face readiness on animation frames and DOM mutations. Scenarios include cold/warm, fonts below/above deadline, delayed editor, missing scripts, no JS, slow previews, mixed-font content, Bold delay, paste, collaborator update, heading input, competing picks and caret movement. Except for the pagination failure above, these captures showed no unexpected face swap or disappearance after text appeared. Screenshot capture is sampled, not a guarantee that every display refresh was recorded; the readiness probe runs on every animation frame. Playwright WebKit is evidence for WebKit, not a run of the shipping Safari application.

All evidence and logs: /tmp/docs-fonts-rereview-evidence/. remote-action-results.json is the valid collaborator image run: it posts through the real update endpoint and verifies the new code reached the screen. The earlier direct-store attempt in action-results.json did not notify the live subscriber and is excluded from the screenshot count and conclusions.

Both items from the re-review are fixed. The new head is a8a9f3e3dd88e5c1743e086f91133a587eefc19a.

P1: a missing fontshold let visible text repaginate.

  • The fix: if the sheet is already in view when the editor could first paginate, the editor now freezes pagination for the visit. That covers no hold at all, and a gate that found none (which now freezes it too). A view the person chooses still unfreezes it.
  • The test, TestFontEnginesFirstRevealIsTheFinalLayout, uses pinned Playwright in fixtures/engines and runs Chromium and WebKit against the production middleware, on long.bin with docs-view=paged. It covers four cases: - nothing missing; - fontshold aborted with the editor delayed 3 s (your scenario); - the gate aborted with the editor delayed 3 s; - the editor past the layout deadline.
  • It captures the sheet about every 50 ms. From the first capture with text on it, the pixels, page-gap count and sheet height must never change.
  • On c6f351b it failed in both engines on your scenario. Chromium showed changed pixels. WebKit went from 0 gaps and 5566px to 6 gaps and 5998px. It now passes in both.

From the native review: pasted font names.

  • fonts.mjs familyForStack uses the native resolver's rule. It reads the stack in order and the first name that maps wins. A name maps by its Word name (Calibri → Carlito, Cambria → Caladea), then the family's own name, then a name in a family's fallback stack, in picker order. Anything else is the default, Carlito, with no mark. Georgia, "Times New Roman", serif → Caladea; Menlo, "Courier New", monospace → JetBrains Mono.
  • One addition: Docs' private name ("Docs Inter") maps first, for runs copied out of Docs itself. The native app should do the same, since HTML copied from the web carries those names.
  • The schema reads each pasted run's font-family through this rule.
  • No shared file changed. The rule reads the fonts.json fields the native resolver already reads. The cases both sides can test, 18 of them including the native tests' own, are in a new file, fixtures/vectors/font-stacks.json.
  • Tests: the fonts.test.mjs stack case failed under the native app's earlier two-pass rule, and TestFontAPastedFontStackMapsLikeTheNativeApp failed before the schema read styles.

The local gate passed, and so did all browser checks (-tags browser -run 'Font|OnTap'). Hub CI to follow.

Hub CI passed on a8a9f3e3dd88e5c1743e086f91133a587eefc19a. Not merged.

GPT-6-Astra (Codex), reviewing for session 21a32889.

VERDICT: CHANGES-REQUIRED — needs changes.

Reviewed the whole branch at a8a9f3e3dd88e5c1743e086f91133a587eefc19a against freshly fetched origin/main / merge base f64ac9e9ed85d6563e8dbb67da67c7ea2664d484. Read the house brief, AGENTS.md, font design and both earlier reviews. Review only in /tmp/docs-fonts-review3-21a32889; no source edits, commits, pushes or merges. Additional harnesses, generated test documents and Go overlays are outside the checkout; the worktree is clean.

  1. P1 — A font used only by spaces bypasses the initial gate and still moves visible text later. internal/export/pdf.go:975–978 drops every whitespace piece when collecting FacesUsed. A whitespace-only run therefore contributes neither a count nor an entry, although its font affects spacing and line-box geometry. Reproduced through production middleware in Chromium and WebKit: 30 paragraphs of ordinary Carlito words, with only their separating spaces marked font_caveat; abort the editor bundle and delay Caveat-Regular by eight seconds. The sheet reveals around 3.5 seconds with data-docs-layout="frozen" and zero page gaps. At the late font arrival, Chromium's height changes 1595.4375 → 1535.4375 px and WebKit's 1647 → 1546.6875 px; the captured pixels show the already-visible words moving. No edit or resize occurs. Freezing page decorations cannot prevent this font-driven layout change. Include whitespace-only faces in the gate, even if they receive a zero count for preload ranking, so they load or commit before reveal. Add a slow whitespace-font case with the editor unavailable. Evidence: make-spaces.mjs, spaces.mjs, spaces-verdict.json, and *-styled-spaces/ under the evidence directory below.
  1. P2 — Pasting an explicit default or unknown face inside another font keeps the outer font. fixtures/editor-entry.js:103–110 adds style rules only for nondefault families. The absence of a matching rule does not clear an inherited ProseMirror font mark. Through the actual paste handler in both engines, <p style="font-family: Inter">Outer <span style="font-family: Calibri">Inner</span></p> produces one docs-font-inter span covering both words. An inner font-family: Wingdings also remains Inter; an inner Cambria correctly becomes Caladea. Thus the resolver's flat vectors pass, but the resulting document violates Calibri → Carlito and unknown → Carlito. Clear inherited font-family marks for an explicit style resolving to the default or no mapping, while preserving inheritance when no font-family style is present. Cover nested styles through the paste/schema path. Evidence: interactions.json, *-nested-paste.png.
  1. P2 — The new first-reveal test ignores a disappearance after reveal. fixtures/engines/first-reveal.mjs:68–76 skips hidden sheets and zero-ink screenshots even after first is established. I ran an external copy of the test with a deliberate one-second visibility:hidden interval starting after the first reveal: both engines still pass with changed:null, and the harness confirms the hide and restore occurred. This is a test mutation, not a claim that this injection exists in production. Once text has appeared, a hidden/blank sample must fail. Also capture without Playwright's default document.fonts.ready wait: the committed WebKit no-hold run's first recorded text was at 3094 ms, whereas the independent capture saw it at 163 ms, before the delayed editor. A test for first reveal must observe that earlier interval. Evidence: test-blindspot.mjs, test-blindspot.log, engines.log, boundary-results.json.

The previous missing-hold P1 is fixed. I reran the exact long.bin, docs-view=paged, blocked fontshold, three-second editor-delay scenario independently in both engines, with screenshots that do not wait for fonts. From the first actual text image onward, the sheet remains zero gaps / 5565.75 px, with unchanged text pixels. WebKit's initial uniform-black capture was excluded as a pre-text capture. This conclusion is separate from the newly discovered whitespace-font hole in finding 1.

Frozen layout behavior: it disables page-gap insertion; it does not fix the content's dimensions. In both engines, resizing from 1280 to 390 px rewraps the text normally, and a real insertion from a second browser context grows the document and moves following content normally. Neither action clears the freeze or adds gaps; after each action settles, subsequent captures stay unchanged. The exercised paragraphs remain inside the sheet without overlap or clipping. Print-media emulation works in both engines and returning to screen restores the prior screen geometry/pixels. Chromium's actual printed PDF contains all 60 paragraphs in order across seven pages. Explicitly choosing Paged clears the freeze and adds six gaps in both engines. WebKit printing here means print-media emulation, not the shipping Safari print dialog.

Validation:

  • PASS: GOTOOLCHAIN=go1.26.5 TMPDIR=/tmp .amadan/ci.d/10-gate, with OrbStack running.
  • PASS: TestFontEnginesFirstRevealIsTheFinalLayout, after npm ci and npx playwright install chromium webkit in fixtures/engines.
  • PASS: the rest of the full -tags browser suite, using the installed Chromium headless shell and CGO_ENABLED=0. The engine test ran separately above.
  • PASS: all eight earlier Chromium reproduction functions through an external Go overlay. The original remote/paste/implicit-face, Bold-timeout, script-failure, delayed-editor, picker-order and picker-preview cases remain fixed in those checks. The no-JavaScript test also passes.
  • PASS: /tmp/fontvenv/bin/python -I scripts/vendor-fonts.py --check, using fontTools 4.67.0 and brotli 1.2.1: every committed font file matches.
  • The shared stack vectors and simple pasted-stack browser test pass. The mapping still produces only known schema marks, not arbitrary pasted CSS or font URLs; finding 2 concerns the resulting formatting.

Evidence, scripts, screenshots and logs: /tmp/docs-fonts-review3-evidence/. The new P1 is observable despite a green gate and green committed browser tests. The previous review's fix should remain; the face collector and coverage need the additional corrections above.

All three review-3 findings are fixed, and the native agent's five stacks are added. The new head is 66662d318043dd48b913b1538f2ddedc2518d3d6. Each new test failed first.

  1. P1: a font used only by spaces skipped the gate. - The fix: export.FacesUsed now counts every face the marks and blocks use. That includes whitespace-only runs, marked hard breaks, and each block's own strut face (for example, an empty heading's bold). Only glyphs rank the preloads. The editor's walk over its log adds the struts too. - The tests: your scenario is a new spaces.bin vector: Carlito words whose spaces alone are Caveat, with Caveat delayed 8 s and the editor aborted. It is now a case in the engines check. It failed in Chromium and WebKit before the fix (pixels changed at about 3.5 s) and passes now. TestFacesUsedCountsEveryFaceTheMarksAndBlocksUse failed first in Go.
  2. P2: a nested pasted font kept the outer font. - The fix: the default family's mark has a font-family parse rule with clearMark. A stack mapping to the default, or to nothing, clears an inherited font mark, so Calibri or Wingdings inside Inter becomes Carlito with no mark. Cambria inside Inter is Caladea. A span with no font-family still inherits. - The test: TestFontANestedPastedFontWinsOverItsParent failed on a8a9f3e with your result (Inter).
  3. P2: the engines check was blind to a disappearance. - The fix: every capture must be either "nothing painted yet", before the first text, or exactly the final picture, page gaps and height. A hidden or blank capture after text fails. Captures no longer wait for document.fonts.ready. - The control: in each engine, a page hides its sheet for a second after showing it. That must be caught, or the check fails as blind. - The mutation check: restoring the old skip made the check fail as blind in both engines.

Shared file: fixtures/vectors/font-stacks.json changed, so the native branch should rebase onto it.

  • It gains the five copied-out stacks: "Docs Source Sans 3", "Docs IBM Plex Sans", "Docs Source Serif 4", "Docs Literata" and "Docs JetBrains Mono", each followed by its family's fallback list.
  • Each maps to the wrong family without the private-name check, which I confirmed by removing that check here.
  • The file is re-indented, one value per line.
  • fonts.json, sources.json and the font files are unchanged.

The local gate passed, and so did all browser checks (-tags browser -run 'Font|OnTap', including the Chromium and WebKit engines check). Hub CI to follow.

Hub CI passed on 66662d318043dd48b913b1538f2ddedc2518d3d6. Not merged.

GPT-6-Astra (Codex), reviewing for session 21a32889.

VERDICT: CHANGES-REQUIRED — needs changes.

Reviewed the whole branch at 66662d318043dd48b913b1538f2ddedc2518d3d6 against freshly fetched origin/main / merge base f64ac9e9ed85d6563e8dbb67da67c7ea2664d484, including the house brief, AGENTS.md, font design, and the three previous reviews. Review only in /tmp/docs-fonts-review4; no source changes, commits, pushes or merges. Test harnesses and Go overlays are outside the checkout, which is clean.

  1. P1 — Inline font wrappers still bypass the gate and move already-visible text when their face arrives. internal/export/pdf.go:982–993 records only the final face after applying all of a text run's marks. fixtures/editor-entry.js:303–311 makes the same assumption. But the rendered inline ancestors have font metrics too. A normal paragraph containing a run marked font_caveat and strong becomes <span class="docs-font-caveat"><strong>…</strong></span>. The inner text uses Caveat Bold, while the outer span uses Caveat Regular, and that outer inline box contributes to line height. The collector includes Carlito Regular and Caveat Bold, but omits Caveat Regular.

Reproduced in Chromium and WebKit with the editor loading normally: 30 paragraphs of bold Caveat text; delay only Caveat-Regular by eight seconds. The sheet reveals promptly, with one page gap and the bold glyphs already loaded. At the delayed regular face's arrival, its height changes 1667.4375 → 1607.4375 px in Chromium and 1719 → 1618.6875 px in WebKit; saved screenshots show visible text moving. No edit, resize or view switch occurs. Keeping the editor noneditable until every style arrives does not protect the text already revealed.

Also reproduced with the editor bundle aborted: the sheet reveals around 3.5 seconds with frozen pagination and zero gaps, then changes 1595.4375 → 1535.4375 px in Chromium and 1647 → 1546.6875 px in WebKit. The text-node readiness probe records no violations because the glyph-drawing Bold face is ready throughout. This is the same class of omission as the space-only finding, at an inline ancestor rather than a whitespace run.

Suggested fix: gate every effective face used by the rendered inline boxes as well as the text and block boxes, including intermediate combinations of font/strong/em/code marks. Conservatively settling all styles of each used family before reveal is another way to cover this, provided the deadline commits missing families before anything is shown. Apply the same rule to the editor's content check. Add the all-bold Caveat / delayed-Regular case with the editor present and absent. I fed this vector to an external copy of the current engines test, retaining its verdict logic: it correctly fails in both engines on changed pixels and height. The assertion is now capable of seeing this bug; the committed vectors do not exercise it.

Round-3 fixes verified:

  • Space-only run: the original spaces.bin reproduction from review 3 now stays pixel-stable after reveal in both engines with Caveat delayed eight seconds and the editor aborted. The new block/break/space face-collection unit test passes. The remaining P1 above is a separate inline-box case.
  • Nested paste: through the actual paste handler in both engines, Calibri and Wingdings inside Inter clear to the default, Cambria becomes Caladea, and a span without font-family inherits Inter. Also verified slow-font paste, undo and redo: the committed fallback stays stable after the late font arrives. All seven private-name stacks, including the five additions, pass through the real paste/schema path in both engines.
  • Invisible-text detection: the committed engines test detects the deliberate one-second disappearance in both engines. In an external copy, restoring the old skip of blank samples makes the test fail as blind in both engines. Captures use PW_TEST_SCREENSHOT_NO_FONTS_READY=1. The prior missing-hold / late-editor reproduction remains fixed.

Other exercised paths: independent image captures covered first and cached visits, fonts below and above the deadline, failed font fetches, missing scripts, delayed editor, slow picker previews, code paste, collaborator updates through the real HTTP update endpoint, competing font picks, caret/picker synchronization, heading input, and JavaScript disabled. These checks found no further flashing path beyond the inline-wrapper case above. The earlier direct-store remote-action probe does not notify live subscribers and is excluded; remote-action-results.json is the valid remote-update run.

In both engines, resizing a frozen document to 390 px, receiving a real insertion from a second browser context, switching explicitly to Paged, and entering/leaving print media behaved as expected. Content reflows for the explicit resize/edit and then stays stable, without overlap or clipping in the exercised paragraphs. Returning from print restores the screen geometry; explicit Paged adds six gaps. Chromium's printed PDF contains all 60 paragraphs across seven pages. WebKit printing here is print-media emulation, not the shipping Safari print dialog. Screenshot sampling is not a recording of every display refresh.

Validation:

  • PASS: GOTOOLCHAIN=go1.26.5 TMPDIR=/tmp .amadan/ci.d/10-gate, with OrbStack running.
  • PASS: TestFontEnginesFirstRevealIsTheFinalLayout, after npm ci and npx playwright install chromium webkit in fixtures/engines.
  • PASS: the remaining full -tags browser suite, and all eight earlier Chromium reproduction tests via an external Go overlay.
  • PASS: scripts/vendor-fonts.py --check: every committed font file matches.
  • EXPECTED FAIL: current engines assertion with the new inline-wrapper vector, in Chromium and WebKit.
  • EXPECTED FAIL AS BLIND: the control test with blank-frame skipping restored externally.

Evidence, scripts, screenshots, logs and the new vector: /tmp/docs-fonts-review4-evidence/. Start with inline-verdict.json, inline-editor-verdict.json, inline-engines.log, make-inline.mjs, and the *-inline-* screenshot directories. One P1 remains, so this branch is not ready to merge despite the green committed checks.

Review 4's P1 is fixed by changing the gate to work on whole fonts (families), not individual faces. The new head is 6a925850615af7900adcf03c001632185894ad77.

Families, not faces.

  • A family counts as used if the document references it anywhere: the default, a font mark on any run, wrapper or line break, and code's if any run is code (export.FamiliesUsed).
  • The page gate waits for every style of each used family before the reveal. The editor's log waits the same way, and so do pastes and collaborators' changes, which add code's family when they carry a code mark.
  • A family still missing at the deadline is committed before anything is shown. After the reveal, a family on screen is never committed.
  • The faces that draw the most text are still preloaded first, up to the cap of six.

Cost, from the committed woff2. A plain Carlito page now waits for 796,164 bytes (all four styles) before its first reveal, instead of 190,256 for Regular alone: 605,908 bytes more, once, since the files are cached as immutable. A page using Carlito, Caladea and code waits for 1.41 MB.

Tests, each failing first.

  • Your reproduction: the engines check now includes bold Caveat with Caveat Regular 8 s late, with the editor and without. It failed in both engines with your numbers (Chromium 1667.5→1607.5px, WebKit 1719→1618.75px) and passes now.
  • The generative test: TestFontTheGateCoversEveryFaceTheDocumentUses builds 40 seeded random documents from every mark, wrapper and block the schema allows (fixtures/generate-random-docs.mjs; set DOCS_FONT_SEED to vary the seed). For each one it checks two things: - the gate's families equal the families the rendered DOM computes on every element and text node; - every face the DOM draws in is one the gate waited for.

It reported 144 uncovered faces on 66662d3, and none now; a second seed also passes.

  • Go: TestFamiliesUsedCountsEveryFamilyReferenced.

Older checks moved to the new rule. A Bold that misses the deadline now commits Carlito before the reveal, and the test holds that nothing on screen changes face afterwards. Two slowdowns were shortened, because the chromedp test server is HTTP/1.1: twelve held font files take all six of its connections, including the one the gate's own script needs. Production serves HTTP/2, so this is a test-rig limit.

Shared file: fixtures/vectors/font-stacks.json is now the native branch's version from 4acce21, which adds the eight nested cases. I checked out the file alone rather than merging the branch; it is the only difference.

  • The nested-paste browser test pastes each case through the real paste handler. Removing the clearMark rule fails four of them.
  • fonts.json, sources.json and the font files are unchanged.

The local gate passed, and so did all browser checks (-tags browser -run 'Font|OnTap', including both engines). Hub CI to follow.

Hub CI passed on 6a925850615af7900adcf03c001632185894ad77. Not merged.

GPT-6-Astra (Codex), reviewing for session 21a32889.

VERDICT: CHANGES-REQUIRED — needs changes. Two P1 findings remain.

Reviewed the whole branch at 6a925850615af7900adcf03c001632185894ad77 against freshly fetched origin/main / merge base f64ac9e9ed85d6563e8dbb67da67c7ea2664d484, including the house brief, AGENTS.md, font design and previous reviews. The remote still names that head. Review only in /tmp/docs-fonts-review5; no source edits, commits, pushes or merges. Additional harnesses and mutations are external files supplied through Go overlays. The worktree is clean.

  1. P1 — A pasted code block bypasses the family gate and makes text invisible. fixtures/editor-entry.js:782–785 collects marks, but <pre>…</pre> parses as the supported code_block node, whose text has no code mark. ProseMirror renders it as <pre><code>…</code></pre>, so the CSS selects Liberation Mono without preparing that family. The initial-log collector at fixtures/editor-entry.js:300–311 and server collector at internal/export/pdf.go:263–278 also omit the node type.

Reproduced in Chromium and WebKit, in separate fresh documents, with the editor fully editable and Liberation Mono delayed eight seconds. Paste <pre>const answer = 42;\nsecond line of code</pre> at the start of the first paragraph. The paste inserts immediately; the code background appears with invisible glyphs, including the existing “First paragraph.” text that joins the code block. The second paragraph remains visible. Screenshots show the hole and its later filled state; the computed family initially names the unloaded webfont, then commits to the system stack around 3.5 seconds. This violates the no-invisible-gap rule even though the eventual fallback stays stable.

Generator mutation: an external copy adding a 20% code_block branch, with otherwise unchanged generation and the committed assertion, fails on 12 uncovered element/text faces across six of the 40 documents. It reports Docs Liberation Mono in the DOM when the gate listed only the other families. Explicitly waiting for the mounted editor yields the same failures. Include implicit families from node types in every relevant collector, cover code-block paste and initial mount in both engines, and make the generator cover the actual schema. Evidence: codeblock.mjs, codeblock-results.json, *-codeblock-{2,15,45}.png, generate-codeblocks.mjs, generator-only.log, generator-codeblocks.log.

  1. P1 — HTML drag-and-drop bypasses preparation entirely. fixtures/editor-entry.js:767–807 installs handlePaste but no corresponding gate for ProseMirror's drop path. transformPasted also runs during a drop, but it only normalizes blank lines; it does not wait for fonts.

Reproduced in Chromium and WebKit through the real ProseMirror drop handler, dispatching an HTML DataTransfer at a position in an editable paragraph: <p style="font-family: Caveat">Dropped text in Caveat</p>, with Caveat delayed eight seconds. The new docs-font-caveat span is inserted immediately while its font is pending. Screenshots show a selected, empty-looking gap between the existing words; the dropped text appears later. Chromium's frame probe independently records the unloaded face. Gate drops before insertion, preserving the drop position and move/copy semantics across the wait, or enforce readiness at a common transaction boundary. Add a slow, previously unused-family drop case. Evidence: drop.mjs, drop-results.json, *-drop-{2,15,45}.png.

Round 4's inline-wrapper P1 is fixed. The committed engines test passes the delayed Caveat Regular / bold Caveat cases with and without the editor, in both engines. Whitespace-only faces and missing/late-script cases remain stable. The deliberate disappearance control is detected in both engines.

The generative assertion is useful, but its coverage claim is too broad. The stock 40-document run and a second seed (99173) pass. Replacing only the server gate with the previous face-based version makes the stock assertion fail for actual uncovered faces (126 element/text reports in this run). However, the generator never creates code blocks, images, horizontal rules, links, marked breaks, or recursive block nesting, and samples only four size marks. The code-block mutation above finds a real omission immediately. Also distinguish the server-rendered DOM from the mounted editor DOM when checking coverage. No separate finding is needed for the generator: it is the missing regression coverage for finding 1.

Rewritten tests: the late-Bold expectation is appropriate for whole-family commitment before reveal; the independent eight-second Bold check remains stable in both engines. The shortened HTTP/1.1 delays do not remove the long-delay coverage in the engines suite. These passing tests do not cover the two insertion paths above.

Slow first visits: the 796,164-byte Carlito cost is real, and the 2.5-second font deadline is not an end-to-end page-render bound. I measured Chromium against the production middleware on a TLS HTTP/2 test server, with CDP bandwidth/latency limits. With an external gzip wrapper for HTML/CSS/JS (woff2 unchanged):

| Connection | Visit | First chrome paint | Text available | Editable | |---|---|---:|---:|---:| | 1.6 Mbps, 150 ms latency | Cold | 2.76 s | 3.51 s | 4.96 s | | Same | Fully cached | 0.32 s | 0.73 s | 0.73 s | | 400 kbps, 400 ms latency | Cold | 9.47 s | At first paint | 17.39 s | | Same | Fully cached | 0.73 s | 1.91 s | 1.91 s |

At 1.6 Mbps, the user first sees chrome and the gray desk, then the sheet in committed fallback with the substitute-font note. At 400 kbps, the first paint already contains the system-font document; the hold fail-safe has fired before rendering, so the later gate leaves it in system mode. Editing becomes available later. No subsequent face or sheet-height change was recorded in these plain-document runs. Thus it stays stable, but the cold slow-connection experience is a substantial wait, not “chrome immediately, text within 2.5 s.”

The uncompressed test server paints much later: approximately 7.8 s / 29.4 s at those two rates. Restoring only the previous server gate/preload list gives 4.8 s / 17.8 s there, demonstrating the additional font downloads competing with critical resources. These are controlled local measurements, not a benchmark of the deployed proxy's compression or HTTP/2 prioritization. Evidence: load-times*.json, corresponding scripts/overlays, and network-*.png. Paint timings come from the browser's Paint Timing entries; screenshot requests can themselves wait for rendering and were not used as exact first-paint timestamps.

Validation:

  • PASS: GOTOOLCHAIN=go1.26.5 TMPDIR=/tmp .amadan/ci.d/10-gate, with OrbStack running.
  • PASS: TestFontEnginesFirstRevealIsTheFinalLayout in Chromium and WebKit; remaining full -tags browser suite with the installed Chromium headless shell and CGO_ENABLED=0.
  • PASS: independent two-engine checks for initial reveal, under/over-deadline fonts, failed fetches, delayed/missing scripts, slow previews, JavaScript disabled, nested/private-name paste, slow paste followed by undo/redo, and real HTTP collaborator updates. The new code-block and drop reproductions are the exceptions above.
  • PASS: resize to 390 px, collaborator insertion, explicit Paged switch, print-media entry/exit and subsequent stability in the exercised documents. Chromium also produced the printed PDF; WebKit coverage is print-media emulation, not Safari's shipping print dialog. Sampling does not capture every display refresh.
  • PASS: scripts/vendor-fonts.py --check; every committed font file matches.
  • EXPECTED FAIL: stock generator with the old server gate; generator extended with code blocks against the new head.

Evidence, scripts, screenshots and logs: /tmp/docs-fonts-review5-evidence/. Keep the family-wide fix; complete the coverage of node-derived families and document insertion paths before merging.

Both review-5 P1s are fixed, by closing the whole class: every document change now goes through one gate. The new head is bb02b67b048d38b1cdec85d479132856e6335748.

One gate. fontGatePlugin is a ProseMirror filterTransaction on every local transaction.

  • What it checks: the families a transaction would put text in, meaning the content its steps insert, the marks they add, and the stored marks it sets.
  • Holding: if any of those families is not settled, the transaction is held and nothing is drawn. When the family arrives, or is committed to its fallback because it is new and late, the held steps are rebased over every change since (the prosemirror-collab algorithm) and applied.
  • Paths covered: paste, drop, input rules, typing, commands and picks all go through it.
  • Per-path waits deleted: handlePaste's wait, the afterFaces command wrapper, and the editor's not-editable-until-loaded hold.
  • Yjs-origin changes (collaborators, undo, redo) cannot be held at that boundary without the editor falling out of step with Yjs. They are checked before they reach Yjs, by the same family rule.
  • Picks still load first, so the latest pick wins.

Families come from the schema.

  • fixtures/schema.mjs is the editor's schema, loadable in Node. familyOfNode and familyOfMark read families off it: a font_<key> mark is its own family, and any node or mark with code: true (the code mark, code_block) is code's.
  • The editor's log walk, the transaction gate and the collaborator byte scan all use those two functions.
  • Go's export.CodeNodes is held to the schema by a test that runs node.
  • Code blocks count in FamiliesUsed and are set as code in the PDF.
  • The Rust renderer now draws code_block as <pre><code>, the same as the editor. Without that, the server's read view showed it in the body face and the editor changed the face when it mounted.

Tests, each failing first.

  • Engines check: your paste-<pre> and HTML-drop cases, with the font delayed 8 s. After the action, every capture must be the picture before it or the final one, and the final face must have loaded or been committed. The per-frame font probe now runs in both engines. - Chromium failed both before the gate and passes now. - WebKit did not reproduce in my harness. It drew both in a stable face from the first frame, before and after the change, with no probe violation. Its Caveat and Mono requests were confirmed slowed at the route. Your WebKit run may have differed in setup.
  • TestFontEveryInputPathWaitsForItsFamily: one table of input paths, each given a cold, slowed family: paste a code block, paste a font, drop, toggle code and type, a list input rule after a code toggle, paste then undo and redo, and a collaborator's code block. The code-block paste and the drop failed before the gate.
  • Generator: it now walks the schema's own content expressions with every mark the parent allows, and fails unless every node type and mark appears across the set. The generative test checks both the server-rendered DOM (editor bundle refused) and the mounted editor's DOM. Before the fix it reported code blocks drawn in Liberation Mono that the gate had not waited for. It passes now, with a second seed (99173) too.
  • Rust: renders_a_code_block_as_the_editor_does.

Slow networks: behaviour is unchanged, as you measured it.

Shared files: none of fonts.json, sources.json, the font files or font-stacks.json changed.

The local gate passed, and so did all browser checks (-tags browser -run 'Font|OnTap', both engines). Hub CI to follow.

Hub CI passed on bb02b67b048d38b1cdec85d479132856e6335748. Not merged.

GPT-6-Astra (Codex), reviewing for session 21a32889.

VERDICT: CHANGES-REQUIRED — needs changes. I would not approve this head. Two P1 editing regressions and three P2 findings remain.

Reviewed the whole branch at bb02b67b048d38b1cdec85d479132856e6335748 against fetched origin/main / merge base f64ac9e9ed85d6563e8dbb67da67c7ea2664d484, with the house brief, AGENTS.md, font design and previous review evidence. Review only in /tmp/docs-fonts-review6; additional harnesses are external files, supplied through a Go overlay or browser request interception. The worktree is clean. No source edits, commits, pushes or merges.

  1. P1 — Any collaborator edit can silently discard an unrelated held local edit. fixtures/editor-entry.js:340–341, 374–379 maps held steps through every applied transaction, including Yjs transactions. The pinned y-prosemirror binding represents a remote change as a replacement of the entire ProseMirror document (sync-plugin.js:629), even when the collaborator changed a different paragraph. Mapping the held insertion through that replacement returns null, and reapply silently drops it.

Reproduced in Chromium and WebKit: on a fresh two-paragraph document, hold Caveat for 2.3 seconds, paste PASTE at the start of paragraph one, and have a second signed-in browser type REMOTE at the end of paragraph two. The remote text appears; the paste never appears after the font settles. No conflicting edit was necessary. These are real editor changes propagated through the HTTP update endpoint and live subscriber.

Fix: preserve pending targets through the CRDT's relative positions, or otherwise derive meaningful correspondence across the Yjs whole-document replacement. Do not silently treat its replacement map as deletion of every pending local target. Cover disjoint collaborator edits, undo/redo replacements, actual conflicts and editor resync while an edit is held. Evidence: holds-extra.mjs, holds-extra.json, cases remote-delete (the label is historical; the actual remote action is an insertion).

  1. P1 — Continuing to edit during a hold corrupts input and lets network completion order become edit order. fixtures/editor-entry.js:355–358, 366–389 rejects the transaction without advancing the editor's logical state, then independently replays it after subsequent local edits. Subsequent typing therefore targets the pre-paste selection, while the replay later operates on that changed content.

Reproduced in both engines: select exactly First in First paragraph., paste PASTE in cold Caveat, and type typed during the 2.3-second hold. The early document is typed paragraph.; when the paste lands it becomes PASTEyped paragraph., silently deleting the t. At an empty caret, paste then type produces typedPASTE…. Paste FIRST in Caveat and then SECOND in Inter, delaying Inter less, and the final order is SECONDFIRST…. Cmd+Z during a held paste does not cancel it; it appears later.

Composition is affected too: in Chromium, start a CDP IME composition にほん during the hold, let the paste land, then commit 日本. The result retains the preedit text and inserts the commit after the paste: にほんPASTE日本…. The same composition/commit sequence without a held paste produces only 日本…. This is a controlled Chromium composition reproduction, not a claim to have exercised the native macOS IME or WebKit composition.

Fix: maintain one coherent logical edit sequence, including selection, composition, pending actions and undo history, while withholding unsafe rendering. Independent rejected transactions rebased later are insufficient. Test edits during the hold, rather than only waiting for the eventual insertion. Preserve the user's operation order and undo boundaries, and handle composition explicitly. Evidence: holds.mjs, holds.json, holds-extra.json, ime.mjs, ime-control.log.

  1. P2 — A delayed stored-mark change applies at whichever caret is current. fixtures/editor-entry.js:384 unconditionally installs the old stored marks whenever the current selection is empty; it does not verify that this is the original caret or typing context.

Both engines: toggle Code at the start of paragraph one with Mono delayed, then move to the end of paragraph two. Once the font settles, typing Z in paragraph two unexpectedly produces <code>Z</code>. Typing immediately after the original toggle is unformatted; only later typing receives code. The committed input-path test explicitly accepts either formatting, so it cannot catch this regression.

Fix: retain and validate the originating caret/context, cancel stale stored-mark intentions when it changes, and preserve the formatting intention for typing that belongs to the command. Evidence: holds.json, cases code-caret and code-toggle.

  1. P2 — The WebKit insertion regressions are tested against documents already modified by Chromium, and the shared font probe cannot recognize WebKit's unquoted family names. fixtures/engines/first-reveal.mjs:128–155 creates fresh browser contexts but reuses config.docs.simple across both mutating scenarios and both engines. Chromium's paste/drop are saved. WebKit consequently opens a document already using Mono/Caveat, so the initial page gate commits its slowed family before the action. This is no longer a cold, newly introduced family.

Confirmed explanation of the author's discrepancy: I served the round-5 editor bundle through request interception while retaining the current engine assertion. With shared documents, Chromium fails both cases and WebKit passes both. The logged WebKit initial gate includes Mono and Caveat and has already committed the slowed family. Giving each engine/action its own fresh document makes both old cases fail in both engines. This reproduces my earlier WebKit result; it is a fixture-isolation difference, not evidence that WebKit was inherently safe.

Separately, internal/docs/fonts_browser_test.go:157 recognizes only a quoted "Docs …" family. WebKit reports stacks such as Docs Caveat, Segoe Print, Bradley Hand, cursive, so that probe skips its readiness check. Pixel captures still catch the isolated failures. Fix the family parser and require a deliberate unloaded-face control to fail in each engine.

Fix: create independent documents per engine and mutating scenario. Port the full input table and generated-DOM assertion to WebKit as requested: presently TestFontEveryInputPathWaitsForItsFamily and TestFontTheGateCoversEveryFaceTheDocumentUses use chromedp only. Evidence: engine-old-control.mjs, engine-old-shared.log, engine-old-isolated.log.

  1. P2 — The generator's coverage assertion counts construction attempts, not the documents it actually emits. fixtures/generate-random-docs.mjs:58, 102–106 records marks before Yjs conversion and checks those records after writing the updates. Conversion drops the marks attached to inline leaf nodes, but those marks still count as covered.

Reproduced: the advertised second seed, 99173, generates 40 updates and exits successfully, although none of the 40 binary updates contains font_carlito. Decoding all updates back through the real schema likewise reports that mark missing. With the default seed, every node and mark name does survive; I counted 59 code blocks and recursive nesting to depth five. However, neither emitted set contains a marked hard break, despite the generator constructing marked inline leaves. The schema walk is a substantial improvement, but its current assertion does not guarantee its stated coverage in the exercised DOM.

Fix: assert coverage by walking the successfully serialized/decoded documents that the browser will receive, and explicitly exercise supported marked-leaf cases at the appropriate boundary. Failed generation attempts must not contribute either. Evidence: audit-generator.mjs, generated-default.json, generated-second.json, and both generated update directories.

The round-5 flashing P1s are fixed in the isolated reproductions. I reran my original code-block paste and HTML-drop harnesses against this head, using fresh documents per engine and eight-second font delays. Both now leave the original document intact until the family is committed, then insert visible text in the stable fallback. Screenshots and state captures are in codeblock-results.json, drop-results.json, and the corresponding PNGs. I found no additional font-reveal violation in the exercised paths. That does not excuse the lost or corrupted edits above.

Yjs-side readiness: the live subscriber awaits prepareRemote before applyServerLog, and initial mount/resync walks the decoded fragment before mounting. An independently exercised collaborator code block, with Mono delayed eight seconds in the receiving browser, is held and then appears in committed fallback in both engines (remote-code.json). Undo/redo are not actually passed through an explicit preparatory check: their commands call Yjs directly and the filter exempts their transactions. Their font safety relies on the monotonic session invariant that previously rendered families remain settled. I found no font bypass in those exercised operations; the demonstrated problem is their whole-document replacement mapping destroying pending local edits.

Other hold checks: a new family's request held for 100 seconds still releases its pending paste into committed fallback after the three-second deadline in both engines. Six same-family holds all eventually appear in request order. Differing font completion times do not preserve order, as finding 2 demonstrates. A passing deadline test therefore establishes liveness for this case, not safe deferred editing.

Validation:

  • PASS: GOTOOLCHAIN=go1.26.5 TMPDIR=/tmp .amadan/ci.d/10-gate, with OrbStack running.
  • PASS: TestFontEnginesFirstRevealIsTheFinalLayout in Chromium and WebKit, including its deliberate disappearance control.
  • PASS: the committed Chromium input table and schema-generated DOM test, and the remaining full -tags browser suite, with CGO_ENABLED=0 and the installed Chromium headless shell.
  • PASS: independent fresh-document checks of the two previous flashing failures and collaborator code insertion, in both engines.
  • EXPECTED FAIL: old-editor controls with the current pixel assertion; both engines detect both insertion bugs when documents are isolated.
  • REPRODUCED: the editing failures above despite the green committed suites. The external interaction harnesses record states for review; their Go PASS only means the recording completed, not that those states are correct.

Evidence and the full review: /tmp/docs-fonts-review6-evidence/. The font assets and manifest are unchanged from round 5. Screenshot sampling does not observe every display refresh. Keep the structural coverage improvements, but make the held-edit model safe before merging.

Review 6, the design change, is pushed: feat/fonts is now at e7a4ac3ebc829672e1edaf8301dd67d62c0320a7 (it was bb02b67). It sits on top of the current main (f64ac9e). Hub CI is running.

Block the input, not the transaction

  • If a user action would put text in a family whose styles haven't all loaded, fontGatePlugin cancels it before anything changes. That covers typing, paste, drop, input rules, commands, font picks and the code toggle.
  • While the family loads, the editor is non-editable with the selection kept, and the toolbar and menus are inert. Then the same action runs again as a fresh dispatch, at the selection as it is then (unchanged).
  • Keys, pastes and drops that arrive during the wait are caught at the document and queued. They replay in order after the action, and none of them reaches the document early. Drop positions are mapped through what happened in between.
  • If the wait passes 650 ms, a "Loading the font…" note appears ([docs-fonts-busy]). All three font notes now float (position: fixed), so showing one doesn't move the page. If the family fails, the action is cancelled and the unavailable note says so.
  • Nothing blocks in the middle of an IME composition.
  • Undo and redo (Mod-z, Mod-y, Mod-Shift-z) wait while any family in use is cold, and queue while something else is blocked.
  • Remote updates are still checked before they reach Yjs, in arrival order (FIFO, never reordered or dropped). A waiting remote update doesn't block typing in families that are already loaded. It is applied after a blocked local action finishes.
  • The hold-and-rebase machinery is gone. So are fixtures/targets.mjs and pickFont: a font pick is now a plain command through the same check.

Tests that failed first on bb02b67 TestFontABlockedActionLosesNothing has seven rows, each run while a paste waits for its font:

  • typing: was "typedPASTE…"
  • replacing a selection, then typing: was "PASTEyped paragraph."
  • two pastes, the first one slower: were "SECONDFIRST"
  • a collaborator's edit elsewhere: the paste was lost
  • undo: didn't cancel
  • a code toggle: the "Z" landed at the wrong caret
  • an IME composition: was "にほんPASTE"

All seven pass now. Nothing reaches the document before the blocked action runs.

Tests that passed on old and new code, so I mutation-checked them

  • Undo grouping, TestFontUndoAfterABlockedPasteUndoesThePaste: it fails when the replay is taken out of history.
  • A composition in a loaded family, TestFontACompositionInALoadedFamilyNeverBlocks: it times out when blocking is allowed during composition.

Item 4

  • Each engines scenario now gets its own fresh document (2×16 per kind).
  • The probe now reads unquoted family names (WebKit's).
  • There is a new probe control, "text in a face that has not loaded". The probe catches it in both Chromium and WebKit.
  • The flash control is still caught in both engines.
  • The action scenarios now also require the wait to be announced: the busy note must be visible after the action. Their captures leave the floating notes out, as they are chrome, not document text.

Item 5 The generator now checks coverage on the documents it actually wrote. It decodes each update with yXmlFragmentToProseMirrorRootNode, keeps going until every node and mark appears, and exits 2 otherwise.

Checks

  • Local .amadan/ci.d/10-gate: ok.
  • All -tags browser tests (fonts and the rest): pass.
  • Engines check: passes in both engines.
  • Shared font files are unchanged this round: internal/fonts/* and fixtures/vectors/font-stacks.json. feat/fonts-native doesn't need to rebase.

Not merged.

Hub CI passed at e7a4ac3ebc829672e1edaf8301dd67d62c0320a7. Not merged.

GPT-6-Astra (Codex), reviewing for session 21a32889.

VERDICT: CHANGES-REQUIRED — needs changes. Two P1 editing defects remain, plus two P2 findings.

Reviewed the whole branch at e7a4ac3ebc829672e1edaf8301dd67d62c0320a7 against fetched origin/main / merge base f64ac9e9ed85d6563e8dbb67da67c7ea2664d484, using the house brief, AGENTS.md, font design, discussion and previous evidence. Review only in /tmp/docs-fonts-review7; additional harnesses live outside the worktree and enter through a Go overlay. No source edits, commits, pushes or merges.

  1. P1 — A second cold-font action starts a competing queue drain, releases the editor early, and silently loses the action when typing or a remote edit intervenes. fixtures/editor-entry.js:373–374, 458–496.

A queued paste dispatched by next() can re-enter the filter and call block() again. The inner loop consumes wanted and awaits its font, while the outer loop continues replaying later input, exits, sets blocking = false, removes the capture listeners and resolves free() waiters. The second action is still waiting. When it resumes, view.state.doc === tr.before fails and its paste is silently discarded.

Reproduced in Chromium and WebKit, with fresh documents: paste PASTE in Caveat (1.5-second delay), queue SECOND in Inter (2.4-second delay from its request), then type typed. Final text is PASTEtypedFirst paragraph., missing SECOND, instead of PASTESECONDtypedFirst paragraph.. At 1.8 seconds the editor is already editable, although Inter is still loading. Typing LATE at that point also discards SECOND.

The remote interleaving is independently reproduced without local typing: queue the two pastes, then have another signed-in browser append REMOTE in paragraph two. That remote update gets past free() during the second wait; SECOND disappears. With neither intervening typing nor a remote edit, both pastes survive. This explains why the new two-paste test passes: it checks eventual text with no subsequent edit, not whether the second wait remains exclusive.

Fix: give the queue one drain owner. A cold action encountered during replay must become the next awaited action in that same loop; it must not launch another block(). Keep the editor blocked and remote waiters pending until the entire sequence has finished. Cover a cold second action followed by queued typing, new typing during its wait, undo and a disjoint collaborator edit. Evidence: queue.mjs/json, nested.mjs/json, correctness.log.

  1. P1 — Raw-key replay does not preserve editing intent: native deletion/navigation are lost, and committed IME input during the wait is dropped. fixtures/editor-entry.js:391–405, 444, 813–815.

Replay calls only ProseMirror handleKeyDown hooks and, if none handles the event, inserts a single unmodified character. Browser-native editing is never replayed. Normal Backspace inside text and Left Arrow are among the operations those hooks leave to the browser. The capture listener nevertheless prevents them immediately. There is also no buffered beforeinput/composition/text-input path, and the original editable surface has been made non-editable.

Both engines, compared with loaded-font controls: paste PASTE, type ab, press Backspace, type X during the wait. The result is PASTEabX…, versus PASTEaX… without the wait. Replace Backspace with Left Arrow and the blocked result is again PASTEabX…, versus PASTEaXb…. These are changes to the user's text, not just a missing caret animation.

Chromium CDP composition/commit reproduction: during the blocked paste, send Input.imeSetComposition("にほん"), then Input.insertText("日本"). After release the result contains only PASTE…; the same composition/commit sequence with the font loaded yields PASTE日本…. This is controlled browser input, not a claim to have exercised a native macOS IME or WebKit composition. The committed IME regression row asserts that the preedit text is absent; it never commits and checks the intended text, so it accepts this loss.

Ordinary repeated a keydowns preserved their count in both engines. That does not establish complete keyboard equivalence: replay omits composition/repeat/location/keyCode information, excludes Alt-modified text, and native/page shortcuts have no fallback execution path. Undo's explicit binding is exercised successfully by the committed suite.

Fix: preserve native editing operations and text/composition commits on an appropriate buffering input surface, or use another design that retains their semantics. A partial raw-key emulator cannot promise that nothing is lost. Add loaded-versus-blocked differential tests for deletion, selection movement, modified input, shortcuts and composition commits. Evidence: queue.mjs/json, check-recordings.py, correctness.log.

  1. P2 — The document-wide trap redirects input from unrelated focused controls into the document and forcibly takes focus back. fixtures/editor-entry.js:391–415, 444–455.

Capture listeners are installed on document without checking the event target or focus owner. Only the editor toolbar and menubar become inert; the title input remains available. In both engines, after starting a blocked paste, programmatically focusing the real Document title input and typing TITLE leaves that input unchanged and inserts PASTETITLE into the document when the wait ends. setBlocked(false) then focuses the editor regardless of where the person moved focus. This explicitly exercises a focus change; it is not a native screen-reader session.

Chromium also blurs the editor to BODY when contenteditable becomes false. During the wait, Escape and Tab are captured and deferred along with editing keys, so they cannot provide an immediate keyboard exit. The busy note is a role="status" outside the page's aria-busy subtree, which is a sensible placement, but does not fix the focus ownership problem. I have not verified spoken announcements with VoiceOver.

Fix: retain an accessible focus model for the pending editor action, scope editing capture to that context, allow navigation to other controls, and restore focus only if the user has not moved it. Never replay another control's input into the document. Evidence: queue.json, focus cases.

  1. P2 — The floating notes obscure document text, and the substitute-font note stays there indefinitely. internal/docs/views/show.html:455–470, 1296–1298.

All three notes are opaque, fixed at the viewport's bottom centre, with no reserved space or dismissal. At 390×640 in both engines, the busy note overlaps document lines; the substitute-font note is approximately 102 px tall, covers several lines, and remains after the font has arrived because the family is committed for the visit. The failure note also covers text. The engine screenshot assertion explicitly hides these notes (fixtures/engines/first-reveal.mjs:92, 209), so its green result does not establish that the visible document is unobscured.

Fix: place the status in chrome with space reserved before reveal, or provide a non-obscuring/dismissible presentation that does not change document layout. Include the real notes in viewport and focus-visibility checks. Evidence: fresh per-scenario note.mjs/json, chromium-substitute.png, webkit-substitute.png and busy/failure screenshots.

The earlier fixture-isolation, unquoted-family probe and serialized-coverage fixes are present. I independently regenerated seed 99173: it now emits 96 documents and decoding all emitted updates finds every schema node and mark. Inline-leaf marks still do not survive the Yjs conversion, but they no longer falsely contribute to coverage. The font files and shared font-stack vectors are unchanged from round 6, and the vendoring check reproduces every file.

The remote subscriber still serializes updates. Independently, an eight-second Mono request delays a collaborator's code while ordinary local LOCAL typing appears immediately and survives, in both engines. The local/remote loss above specifically arises when the nested drain releases free() too early.

Ordinary waits terminate in the exercised cases: a failed font cancels the action, shows the unavailable alert and restores editability; a new font delayed 15 seconds commits to fallback after the three-second deadline and releases the action in both engines. I did not reproduce a permanently non-editable editor from those network failures. The nested-drain defect instead releases it too early, and can even display the busy note while editing is already enabled.

Validation:

  • PASS: GOTOOLCHAIN=go1.26.5 TMPDIR=/tmp .amadan/ci.d/10-gate, with OrbStack running.
  • FAIL: full -tags browser suite (Go 1.26.5, CGO_ENABLED=0, installed Chromium headless shell). Its only failing test is TestFontEnginesFirstRevealIsTheFinalLayout: WebKit's “editor later than the layout deadline” scenario records a probe violation at editor mount, approximately 5.17 seconds after navigation: Carlito reported as not loaded. A targeted rerun reproduces it at 5.19 seconds. Screenshot hashes stay stable; this probe failure alone does not establish a visible flash. A third run with external diagnostic instrumentation passed, so the timing-sensitive failure remains unresolved; I am not reporting the suite as green. See engines.log, engines-late-rerun.log and engine-diagnostic.log.
  • PASS: every other test in the full browser run, including all seven blocked-action rows, undo grouping, loaded-family composition, the generated-DOM test and all Chromium engine scenarios. Both engines detect both deliberate controls; their isolated code-block-paste and HTML-drop scenarios pass.
  • PASS: scripts/vendor-fonts.py --check; serialized generator audit for seed 99173.
  • EXPECTED FAIL: independent correctness assertions on the recorded interactions: 13 failures, covering both engines' lost second paste and incorrect deletion/navigation, plus Chromium's lost IME commit. Loaded-font controls and repeated-character controls pass. The recording harnesses' Go PASS means recording completed; correctness.log records the actual correctness verdicts.

Evidence and full review: /tmp/docs-fonts-review7-evidence/. No source changes. The two P1s prevent approval under Paul's rule that preserving edits comes before avoiding a flash.

Review 7, with the coordinator's new design, is pushed. feat/fonts is now at c159e6805e68e5b97f967c15aa9521d7a65ba1f1 (it was e7a4ac3), on top of main f64ac9e. Hub CI is running.

There is no queue and no replay any more.

  • When an action needs a font family that isn't loaded, the gate cancels it before anything changes.
  • The editor, the formatting bar and the menu bar go inert at once. A status strip over the formatting bar says "Loading a font…" in a polite live region.
  • When the family arrives, the original transaction is dispatched once.
  • If the font fails or misses the existing 3 s deadline, the action is dropped, editing comes back and the strip says the font couldn't be loaded.
  • Only one wait runs at a time. Anything else that would change the document during it is refused, and the strip says so. So nested waits can't happen and can't release early.
  • Nothing captures input across the whole page any more. The title, dialogs and comments keep their own input. Focus goes back to the document only if it was there before and nobody has moved it.
  • A wait never begins during an IME composition. If a change in a cold family arrives during one, that family is drawn in its fallback instead.
  • Undo and redo go through the same wait.
  • Remote updates are unchanged: FIFO, checked before Yjs, never dropped. They wait for a local wait to end.
  • act, the key/paste/drop trap and the replay code are all removed.

The notes (P2).

  • [docs-fonts-status] sits over the formatting bar and takes no space of its own, so showing it moves nothing and never covers text.
  • The substitute note goes after 10 s and the unavailable note after 8 s, and both can be dismissed.
  • The floating notes are gone.

Prefetch.

  • On an editor page, once the page is shown and the default's faces are in, every picker family's faces are fetched one at a time when the page is idle, using fetch(..., {priority: 'low'}). Each face is then loaded from the HTTP cache.
  • Measured: 5.91 MiB beyond the page's own faces, once. All 62 faces together are 6.67 MiB.
  • Skipped with Save-Data or on 2G.
  • It never commits a family to its fallback. data-docs-fonts-prefetch="done" marks the end.

WebKit root cause.

  • The cause was the engines check itself. Playwright's screenshot style option (NOTES_HIDDEN, added in round 6) inserts and removes a stylesheet around every capture. WebKit rebuilds its @font-face set on each change. Traced from the page, the Docs Carlito faces were reported unloaded at editor mount (all four faces), so document.fonts.check() failed.
  • Controlled run at e7a4ac3's code: without the injection, 20 of 20 passed; with it, 2 of 8 failed.
  • That option is gone, since the notes now sit outside the captured area. On the final code, the WebKit "editor later than the layout deadline" scenario passed 20 times in a row.
  • A related WebKit behaviour I saw: after its FontFace wrappers are recreated, WebKit can report a face loaded through document.fonts.load() as unloaded. A new engines scenario, "pick a prefetched font", checks that a prefetched family is used with no wait and is never drawn unloaded. It passes in both engines.
  • The engines check now compares an action's pictures by their ink (dark pixels). WebKit paints a selection highlight a frame after the text it covers, and that changes the background, not the text. Mutation-checked: letting cold transactions through fails both scenarios in both engines.

Tests, each failing first on e7a4ac3:

  • TestFontAWaitIsAShortModal. Every row checks that the wait is visible at once, the bars are inert and the document doesn't change before the action runs. Rows and what they caught on e7a4ac3: - Keys during the wait (ab, Backspace, Left, X, Cmd-Z): e7a4ac3 replayed the Cmd-Z, which undid the paste. After the wait, the same keys give the loaded result, PASTEXa…. - An IME commit during the wait. - Typing in the title: e7a4ac3 gave PASTETITLE. - A second action plus typing during the wait: e7a4ac3 gave PASTEtyped, and nothing said it was refused. - A collaborator's edit during the wait. - A font that 404s. - A font past its deadline: e7a4ac3 committed the fallback and applied it.
  • TestFontTheStatusNeverCoversText, which checks rect intersection with every text run, at 390×640 and 1280×1000, for loading, unavailable and substitute. On e7a4ac3 the notes covered "Paragraph 3/4/11" and had no dismiss.
  • TestFontPrefetchFollowsTheReveal: - nothing beyond the page's faces is fetched before it is shown - every face is fetched after - fetch priority is Low - each file comes over the network once - no fetches with Save-Data
  • TestFontAWaitDuringThePrefetch: Caladea is slowed and in flight from the prefetch; a paste in Caladea waits and lands in Caladea, not committed.
  • TestFontACompositionNeverStartsAWait: a drop in cold Caveat during a composition. e7a4ac3 showed 日本 and DROPPED in an unloaded face. Now the editor is never inert and Caveat is committed.
  • TestFontASecondPickDuringAWaitIsRefused: this replaces "the later pick wins", which contradicts one-wait-at-a-time.
  • Existing tests were adjusted to the new design: the input-path rows type after the wait, the substitute check reads the strip, and the loaded-IME test also checks inert.

Checks.

  • Local .amadan/ci.d/10-gate: ok.
  • Every -tags browser test: pass.
  • Engines: pass in both engines; both controls caught in both.
  • Shared font files are unchanged (internal/fonts/*, fixtures/vectors/*), so no rebase is needed for feat/fonts-native.

For Paul.

  • The substitute note sits over the formatting bar for up to 10 s, or until dismissed.
  • A refused action and a timed-out font both simply don't happen; the strip says why.

Not merged.

Hub CI passed at c159e6805e68e5b97f967c15aa9521d7a65ba1f1. Not merged.

GPT-6-Astra (Codex), reviewing for session 21a32889.

VERDICT: CHANGES-REQUIRED — needs changes. One P1 remains, plus two P2 findings. The previous queue/replay defects are removed, but the inert wait exposes a WebKit Backspace navigation path that abandons the original pending action.

Reviewed the whole branch at c159e6805e68e5b97f967c15aa9521d7a65ba1f1 against freshly fetched origin/main / merge base f64ac9e9ed85d6563e8dbb67da67c7ea2664d484, following REVIEW-BRIEF.md, AGENTS.md, the font design, #83 and prior review evidence. Review-only worktree: /tmp/docs-fonts-review8. Additional test harnesses and mutations are outside the worktree, supplied through Go overlays or browser instrumentation. No source edits, commits, pushes or merges.

  1. P1 — Backspace during an inert wait navigates away in WebKit and abandons the original paste. fixtures/editor-entry.js:425–432 (also the pending action at :383–389).

Reproduced twice with trusted Playwright keyboard input in WebKit. Start at the document list, open a fresh two-paragraph document, delay Caveat by 1.5 seconds, paste PASTE in Caveat at the first caret, then type ab and press Backspace while the loading strip is visible. Making the editor inert leaves focus on body. Backspace then performs browser history navigation: the URL changes from /d/<id> to /. Returning after the font delay shows the original document, with no PASTE. This is an ordinary editing key unexpectedly leaving the editor, not an explicit navigation action by the person.

The loaded-font control stays on the document and ends with PASTEaXFirst paragraph. after the same ab, Backspace, X sequence. Chromium stays on the page during the wait. The new design intentionally refuses subsequent editing input, but it promises to perform the original action after loading; here subsequent input causes that original action to be silently abandoned. The beforeunload saver cannot rescue it because the cancelled transaction has not reached Yjs or the save queue.

Suggested fix: give the short modal a stable focus target outside the inert subtree and handle editing keys there so Backspace cannot become browser navigation. Scope that handling to the wait's focused surface, retain Tab/explicit navigation and other controls' own input, and keep the no-queue/no-replay design. Add this case to the WebKit tests with a real preceding history entry. The committed key-during-wait rows use Chromium; the engines scenarios do not type Backspace during a wait.

Evidence: webkit-backspace.mjs/log, webkit-backspace-control.mjs/log/json. The recording/control harness passes because it records the navigation and verifies the loaded result; the separate product assertion in correctness.log fails on Backspace leaving the document. This is a Playwright WebKit reproduction, not a claim to have driven the Safari application.

  1. P2 — The completed-wait strip covers keyboard-focused formatting controls. internal/docs/views/show.html:771–788; fixtures/editor-entry.js:403–415, 425–432.

Reproduced in Chromium and WebKit with a real font timeout: editing and the toolbar become active again, but the opaque unavailable strip remains for eight seconds. Pressing Escape in the editor uses its ordinary toolbar-exit binding and focuses the Style combobox underneath the strip. Its focused control is covered, and hit-testing its centre returns the status paragraph. The substitute strip has the same problem for up to ten seconds. This fixes the previous document-text obstruction but introduces a temporary focus-visibility defect in the chrome.

Suggested fix: clear a dismissible strip when focus enters the toolbar, or keep the covered toolbar out of the focus order and provide a visible route to dismiss and enter it. Do not keep the document inert merely to retain the note. Evidence: accessibility.mjs/json, *-timeout-actual-overlay.png.

  1. P2 — The substitute explanation is clipped at the required 320 px reflow width. internal/docs/views/show.html:771–784, 790–794.

In both engines, delaying Carlito produces the real substitute note. At 320×900, its paragraph is 63 px high inside a 46 px strip. Vertical centring puts it 8.5 px beyond each edge, and overflow: hidden clips both the first and last lines, including the reload instruction. This is visible without any injected status or stylesheet; the reproduction uses delayed font responses. The committed overlap test starts at 390 px and checks document-text intersections, so it does not catch clipped status text.

Suggested fix: make the message fit the reserved chrome at 320 px and text zoom, or reserve sufficient room before reveal. Preserve the no-layout-shift rule. Evidence: accessibility.mjs/json, *-accessibility-actual-overlay.png.

The round-7 queue/replay mechanisms have been removed under the explicitly changed interaction contract; the new WebKit failure is described above. There is no queue or raw-key replay, so there is no nested drain to release early and no emulation to reorder Backspace, arrows or IME input. Input directed at the inert editor is intentionally refused, rather than promised for later replay. Other controls retain their input. On the normal completion path the original action is dispatched once; a second mutating transaction is refused. The committed checks cover typing after release, undo grouping, title input and compositions, including a cold family arriving during an active composition. Independent Chromium cases preserve the original paste with Backspace, arrows, a refused second action, title input and a browser IME commit during the wait. The corresponding WebKit run exposed finding 1. A separate WebKit run passes the arrow-key, refused-second-action and title-focus cases.

Wait lifecycle and collaboration: independent Chromium and WebKit cases passed for a three-second timeout, a rejected font-wait promise, navigation away/back, and Tab leaving during a wait. Both engines held two real collaborator edits while a local paste waited; closing the collaborator did not discard them. The local paste and both edits appeared after release, and a fresh reload matched exactly. The subscriber awaits prepareRemote and free() before applying bytes, and advances its cursor after the awaited application; local acknowledgement cannot skip an intervening remote sequence. Its existing resync identity/divergence guards remain in place. Code inspection also confirms the action-error catch reports failure and the finally releases remote waiters. I found no stuck-inert or remote-update loss in these checks; the unintended-navigation loss is finding 1. These are bounded exercised cases plus code inspection, not a proof of every possible browser scheduling interleaving.

WebKit root cause confirmed: restoring the removed per-screenshot style injection on this head reproduced the same late-editor probe failure in 9/20 fresh-document runs: at about 5.2 seconds, all four Carlito FontFace statuses were reported unloaded. Screenshot pixels remained stable. With the option absent, 20/20 passed. This isolates the screenshot stylesheet manipulation as the trigger for the reported readiness failure; it does not show an application flash.

Ink comparison mutation-check: for each of the code-block-paste and Caveat-drop scenarios, in both Chromium and WebKit, the pixel verdict rejected all three deliberate mutations: bypassing readiness and allowing cold text, hiding text for 800 ms after the action, and shifting text 8 px after the action. 12/12 expected pixel failures. I logged the pixel-only verdict before consulting the font probe and disabled the busy-note expectation for the bypass mutation, so these failures demonstrate image detection rather than merely a missing status or the readiness probe. The normal suite retains its deliberate hidden-page and unloaded-font controls. This supports the revised check for the tested font, invisible-text and layout failures; it is still a sampled, clipped-view test.

Accessibility: the live role=status paragraph is present before its text changes and sits outside the inert toolbar and busy sheet. Title input and keyboard exit work during the wait, with focus preserved outside the editor on completion. The two P2 findings above concern the persistent post-wait/substitute presentation. I did not run VoiceOver or a native macOS IME; composition verification uses browser automation.

Validation:

  • PASS: GOTOOLCHAIN=go1.26.5 TMPDIR=/tmp .amadan/ci.d/10-gate, with OrbStack running.
  • PASS: full go test -tags browser ./internal/docs -count=1 -timeout=30m -v with Go 1.26.5, CGO_ENABLED=0, TMPDIR=/tmp and installed Chromium. This includes the engines test: all 24 Chromium/WebKit scenarios passed, including their deliberate controls.
  • PASS: independent lifecycle/collaborator/navigation checks in Chromium and WebKit.
  • FAIL: independent WebKit Backspace-during-wait product assertion (correctness.log); the loaded-font control passes.
  • EXPECTED FAIL: all 12 pixel mutations, for the intended pixel reasons.
  • EXPECTED FAIL: reintroduced screenshot-style WebKit control, 9/20 cases; corrected control: 20/20 passed.

Evidence, harnesses, logs and screenshots: /tmp/docs-fonts-review8-evidence/. The scratch worktree remains clean. Finding 1 prevents approval: it loses the pending action through an unintended navigation.

Review 8 is fixed and pushed. feat/fonts is now at 85431efe73ac174e4a018b065f9a78e625af7616 (it was c159e68), on top of main f64ac9e. Hub CI is running.

P1: Backspace navigated away in WebKit and the waiting paste was lost.

  • During a wait the editor is inert, so focus is on the page. Backspace, Space, the arrow keys, Page Up/Down, Home and End now do nothing when they would reach the page (the body or an inert element).
  • The title, dialogs and comments still get those keys, and Tab is untouched.
  • While an action is waiting, leaving the page shows a beforeunload prompt first.
  • New test: TestFontEnginesAWaitKeepsThePage (fixtures/engines/wait-keys.mjs), run in Chromium and WebKit. It opens the documents list and then a long document, so there is a real page to go back to. With every font except the default 2 s late, it: - pastes in Caveat, then types ab, Backspace, Space, PageDown, ArrowDown, End, ArrowLeft, Home and Backspace during the wait. The page must stay on the document at the top, and the paste must land. - pastes in Playfair, then types in the title with Backspace during the wait. The title must change. - tries to navigate away during that wait. A beforeunload dialog must appear; dismissing it keeps the page, and the paste lands.
  • Failed first on c159e68: - WebKit: "a key during the wait left the document for /". - Chromium: no beforeunload prompt, and the navigation went through.

P2: the strip covered focused toolbar controls.

  • [docs-fonts-status] now hangs just under the bars, over the gray area around the page and the page's top margin. It doesn't sit over the formatting bar any more.
  • It takes no space of its own, so showing it moves nothing.
  • It sits underneath the bars' own menus, so an open File menu draws over it.
  • The gray area above the page keeps room for one line of it at every width. Before the page is shown, the gate makes extra room for the longer substitutes note when it needs it.

P2: the substitutes note was clipped at 320 px.

  • The strip now wraps instead of clipping.
  • The copy is shorter: - substitutes: "Some fonts are shown as substitutes. Reload to try again." - unavailable: "That font could not be loaded." - refused: "A font is still loading."

Status test. TestFontTheStatusNeverCoversText now runs at 320×900, 390×640 and 1280×1000, for each of loading, refused, unavailable and substitutes. It checks with rectangles:

  • no overlap with any text run or the editor
  • no overlap with any reachable control (closed menu items and inert controls are skipped)
  • the focused element isn't covered, including after Escape moves focus from the editor into the toolbar
  • the note's text isn't clipped and stays inside the viewport
  • the dismiss button is visible

Failed first on c159e68: the unavailable and substitutes notes covered the Style, Font and Size boxes at every width, Escape put the focus under the note, and at 320 px the substitutes note was clipped. Loading and refused passed on c159e68 too, because the toolbar is inert during a wait.

Engines check. The captured area now starts at y=200, below the strip, which is chrome and not text.

Checks.

  • Local gate: ok.
  • Every -tags browser test: pass, including both engines checks in Chromium and WebKit, with both deliberate controls caught.
  • Shared font files are unchanged, so no rebase is needed for feat/fonts-native.

For Paul.

  • On phones (≤36rem), the gray area above the page is now 2rem instead of 1rem, to make room for one line of the strip.
  • A page that shows substitutes gets a taller gap above the page for that visit when the note wraps.

Not merged.

Hub CI passed at 85431efe73ac174e4a018b065f9a78e625af7616. Not merged.

GPT-6-Astra (Codex), reviewing for session 21a32889.

VERDICT: APPROVE-WITH-NITS — ready to merge. No P0 or P1 finding remains. I approve under the requested threshold; the known scrolled-text overlap is a nonblocking P2.

Reviewed the whole branch at 85431efe73ac174e4a018b065f9a78e625af7616 against freshly fetched origin/main / merge base f64ac9e9ed85d6563e8dbb67da67c7ea2664d484, following REVIEW-BRIEF.md, AGENTS.md, the font design, #83 and earlier review evidence. Scratch worktree: /tmp/docs-fonts-review9. No source edits, commits, pushes or merges. Additional harnesses live in the evidence directory and run through a Go overlay or browser instrumentation.

  1. P2 — The sticky strip still covers document text after scrolling. internal/docs/views/show.html:778 (absolute placement below sticky chrome); internal/docs/fonts_browser_test.go:1534 (geometry test).

Confirmed in Chromium and WebKit at 320, 390 and 1280 px, with genuine substitute and unavailable messages. After scrolling 500 px, text-run rectangles intersect the opaque strip and hit-testing returns the status paragraph. For example, at 320 px the substitute strip occupies approximately y=130–181 and covers paragraph 3. The committed test checks the initial scroll position only. This is the acknowledged gap, not a new data-loss defect. Dismissal works in both engines; the notes also have bounded lifetimes.

My view: acceptable for this merge as a temporary, dismissible P2 tradeoff, but it is not a fulfillment of “never over text.” A permanent empty row is not the only design available. A compact status control occupying a stable slot inside the existing bars, with the longer explanation available on activation, can preserve layout and avoid covering the document. Keep the live announcement outside the inert subtree and provide an immediately visible loading state. Any such design needs the same narrow-width and focus checks. Add scrolled cases to the geometry test and correct the stronger comments if the present presentation is retained.

The round-8 fixes hold in the exercised cases:

  • Backspace and scrolling keys: trusted input during a cold-font wait stays on the document and preserves the original paste in both engines. Tab still exits immediately. The new committed engines test passes in Chromium and WebKit, including its title-editing and navigation-cancellation cases.
  • Toolbar focus and wrapping: independent checks at all three widths show the substitute/unavailable text fully visible, a visible usable dismiss button, and no overlap with toolbar controls. Escape moves focus to the Style combobox without covering it. The committed test also covers loading and refused states.
  • Other input: real typing, selection, Backspace and spaces work in an input, textarea and nested contenteditable within a native modal dialog in both engines while the document waits. Focus stays in that dialog after release. Chromium CDP composition followed by a committed 日本 also survives there. These dialog controls were added by the external harness; this tests the guard's targeting rather than claiming an existing product dialog contains those fields.
  • beforeunload: in both engines, dismissing the prompt keeps the page, and accepting a subsequent prompt during the same wait allows navigation. After a font timeout releases the wait, navigation produces no font-wait prompt. Inspection confirms that setInert(false) removes the listeners before dispatching the action. I found no user trap.

Assistive-technology limit: I did not run native VoiceOver or a native macOS IME. The listener matches e.key without checking modifiers or composition: synthetic page-targeted Ctrl+Alt+Arrow and composition-marked Space/Arrow events are canceled, while the same events directed at the tested editable controls are not. Consequently I would not claim universal screen-reader shortcut compatibility from these tests. Explicit modifier/composition exemptions would be sensible hardening; I have not established a native screen-reader failure and am not reporting one as a reproduced defect.

Validation:

  • PASS: GOTOOLCHAIN=go1.26.5 TMPDIR=/tmp .amadan/ci.d/10-gate, with OrbStack running.
  • PASS: full go test -tags browser ./internal/docs -count=1 -timeout=30m -v, with Go 1.26.5, CGO_ENABLED=0, TMPDIR=/tmp and RASTRILLO_CHROME pointing to the installed Chromium headless shell. This includes both engines suites and their deliberate flash/unloaded-font controls.
  • PASS: 20 independent interaction/lifecycle/geometry cases across Chromium and WebKit. The geometry harness records the known scrolled overlap separately; its PASS does not claim those intersections are absent.
  • PASS: hub CI, independently queried for 85431ef.
  • EXPECTED FAIL: suppressing beforeunload registration makes the committed navigation assertions fail in both engines because navigation proceeds without a prompt. Suppressing the page-key listener exposes WebKit navigation again. That latter mutation times out looking for the title on the list page; Chromium passes it, so the committed final-scroll assertion should be strengthened to check each scrolling key before a later Home can reset the position.

The initial browser invocation failed browser discovery; the configured full rerun above is the validation result. No additional P0/P1 regression was found in the manifest, schema/CRDT, gate, collaboration, rendering or export changes. Font assets and shared vectors are unchanged since round 8. Evidence, scripts, logs and screenshots: /tmp/docs-fonts-review9-evidence/. The scratch worktree remains clean.