Spec + plan review — Claude Fable (model id claude-fable-5-2), read-only, at 8354b32
Verdict: CHANGES NEEDED — narrowly. The UI half (§1–§5) implements Paul's five rulings and D1–D6 faithfully, and I found no ruling contradicted. The blockers are in §7 / S1 (two correctness holes and one vacuous acceptance check) and in the Mac header contract (§1 vs §6). Everything else is fix-in-place. I'd re-review only §7, §6 and S1 in revision 2.
Checked against: web views/show.html, partials/editor_bar.html, menu.go, brand/inspector.js, share_panel.go, delete.go, native.go; native DocsWorkspace, DocsModel, CRDTReplica, CRDTProjection, NativeDocumentTextView, DocsPagedTextView, DocumentPageLayout, DocsPaging; kit SyncStatus / NativeSyncStatusView / NativeOfflineBanner at the pinned 0254817; the audit and the probe branch d23f3ca; the mock-up page.
High
- §7.1–7.4: the delta is not safe to forward as specified.
project_deltais relative toCRDTReplica.presented, which advances on everyauthorityProjectioncall. But publications are routinely dropped or deferred after that base has moved: -publishCurrentdiscards the result wheneditingis non-empty, the selection moved, composing started or the epoch changed (DocsModel.swift:380); - the text view skips a render whilecanRenderis false or text is marked (applyRender); -replica.projection()has other callers (DocsModel.swift:301) that also advance the base.
A surface that applies "the change" to its cache after any of these patches the wrong base, and a block changed in a skipped publication is never reconciled. The spec lists nil-change only for open, fresh source, recovery and generation reset. Needed: each change carries base and result revisions; the surface accumulates a dirty-block set across deferred renders; any base mismatch falls back to a full per-block diff. Test it through the real text view, not the projection: optimistic typing, dropped and delayed publications, marked text (ja/zh/yue/hi/bn are shipped languages) with peer edits in the same and another block, then assert storage equals a full render at quiescence.
- §7 Incremental pagination: "recomputed arithmetically, no layout and no copy" does not hold against today's container. -
DocsPageTextContainer.blockStartsis keyed by character index, and setting it callstextContainerChangedGeometry, which invalidates all layout. Any keystroke before a break shifts every later key. So either every key re-keys and invalidates everything, or breaks go stale. The spec must re-key breaks (block id via the block index) and say how layout after a moved break is invalidated (from the first moved block, lazily). - Today's plan is not per-block heights: it uses absolute tops andused.maxYin an unpaginated layout (bottom − pageTop > 648). Reading "natural height" from the live paginated layout needs a stated reconstruction (fragment-rect height plus used-bottom offset per block;docsFirstMarginat index 0). - Withlayout()no longer forcing whole-container layout, the frame height can't come from the last glyph. Say it comes from the plan. - Keep today's full-measurement implementation in the test target as the oracle for the pagination property test, and have that test compare line-fragment origins, not only the plan. - Non-contiguous layout with a non-simple container whose rects depend on y is a known TextKit 1 trouble spot. Add an acceptance check: open p200h, jump to the end, caret-against-glyph there before any full layout.
- S1 acceptance "snapshot baselines are unchanged" proves nothing for the editor. The snapshot gate excludes the editor today (
DocsSnapshots.swift:20), and S1 changes only the editor. Land the §11 fixed-fixture editor snapshots (Mac paged and pageless, iPhone) on main first, from the old renderer, then require them unchanged after S1.
- §1 Header vs §6:
.navigationSubtitlecan't do what §6 requires. On macOS it is a plain window subtitle string: no negative colour, no semibold, no eye glyph, no.updatesFrequentlysingle element. §1 also allows a fallback title field, which then needs the window's own title hidden but still set (Window menu, Mission Control). Decide the header construction with a short spike at the start of S2 and write the one contract down. Related:NativeSyncStatusView.sameKindis internal to the kit, so "reuses the samesameKindcheck" needs a rastrillo/native change (make it public, or export an announcer) — a kit dependency the plan doesn't list.
Medium
- §1 Page centring: the formula and threshold are off. The web is
clamp(16, 16+P+2R−W, R)(show.html:1635). The spec drops the upper clamp, so below the threshold the padding exceeds the room and the page position is undefined. The threshold isW = P + 16 + R(web: 1108), notP + 2·16 + R. Also state coordinate spaces: the page lives in the scroll view's magnified document space (base magnification 4/3 × zoom, paper 612), while R is window points. A pure-formula unit test will pass while the window is wrong; measure page and inspector frames in a hosted window. And "appears without moving the text" contradicts the rule whenever the inspector needs the room. Because centring is baked intoDocsPageGeometry.paperX(container geometry), toggling the inspector or live-resizing relayouts the whole document; offset the view instead so both are O(1).
- §7 Targets: measurability. - "Compiled to nothing in a release build" contradicts "Release build" measurement. The counters need their own compile flag, not
DEBUG. - Targets were set before the post-phase-2 baseline exists. Peer → visible ≤ 60 ms at p20 (524 ms pre-phase-2, pageless) includes engine time that §12 puts out of scope. Record the baseline as S1 step 1, then confirm the table, splitting engine time from main-thread time. - The audit calls its numbers ±15% on a loaded machine; p95 of 40 keys is two samples. Make the deterministic counters (whole renders, block renders, body evaluations,attributedTextassignments) the hard gates, and give timings a tolerance and re-run rule. - The UI probe uses an in-memory store and skips the sealed outbox; iPhone numbers are simulator-only. Say so beside the targets.
- §6 is incomplete against today's states. -
refreshAccessmaps 401/403/404 tocan_write = false. A fully revoked grant or a deleted document would read "View only" over stale text. Add a "no longer available" state, which also covers a document deleted on another device (saves then hold forever). - The offline banner is driven by connectivity, not byoffline(n): offline with nothing pending is.saved, so "Saved" plus the banner is a real row. State it. -needsSignIn(0)(session ended, nothing pending) needs wording. - Define the Saving… debounce precisely (status continuously not.savedfor 1 s), and drive it from.task, never body. - Missing rows: draft being created; opened from the replica cache while offline. - Subtitle team: detail JSON has no visibility or owner, so "<Team> · Saved" shows the account's team even on a private document or one shared in from elsewhere. Either accept that as account context (Paul's call) or addvisibilityto the detail answer.
- Delete… server change (§1, S2) is under-specified. - Version skew: lagged and self-hosted servers will 303 to HTML after the delete has committed. Define the client rule (for example: non-JSON answer, re-GET, 404 means gone) and the deploy-before-release order. - A retry after a lost response gets 404; treat as done. - Tests beyond owner-only: a writer grantee, a reader, a guest, a team non-owner, already-deleted, the JSON failure shape, and the HTML redirect unchanged. - Client: also refresh the home list, File ▸ Recent and thumbnails, and pop to the library on iPhone. Say what Delete… does for a draft.
- §3 iPhone feasibility. -
ToolbarItemGroup(placement: .keyboard)is unreliable for aUIViewRepresentableUITextView; name theinputAccessoryViewfallback, and say what happens with a hardware keyboard. - "Opening it dismisses the keyboard and keeps the selection": resigning first responder hides the selection highlight, which defeats ruling 3's point. Keep first responder with an emptyinputView, or specify an equivalent. Say what happens to typing marks set at a collapsed caret. - How the large title scrolls with theUITextView(inset plus header subview, or an outer scroll) is unstated, and it must not touch the text host. - The iPhone has no zoom control at all, so §9's "zoom is the page's control" is untrue there. Add Zoom to ••• or pinch.
- RTL and long languages are not specified or tested (ar is shipped). Only the subtitle join is covered. State mirroring for the inspector edge and centring, the undo/redo and indent glyphs, the keyboard bar and the shelf. Add ar and one long language (ru or ga) snapshots per new screen; the 248pt inspector and the pills are the risk.
- Menus vs the web. Keyboard shortcuts… is under Help on the web (
menu.go:355), Tools on the Mac in the spec and Help on iPhone — pick Help. The web's View is a Paged / Continuous pair and has no Zoom, so D2's "as on the web" is wrong for Zoom (keeping it native-only is fine). "Format: today's menu, unchanged" keeps "Normal", "Bullet list" and "Block quote" beside an inspector saying "Body text", "Bulleted list" and "Quote"; move the menu to the web keys. Say what Open a document… ⌘K does on the Mac, and that Show/Hide Format is disabled for a reader and in the home window.
- Slice safety. iPad gets the iPhone layout at every width from S3 until S5. That is a visible regression if S3 or S4 ships to TestFlight; get Paul's explicit yes, or hold iOS releases until S5. S2 is very large (header, inspector, popover, reader, menus, Delete, server, 12-language strings); consider splitting Share popover plus Delete into S2b.
Low
- Web Format toggle is a disclosure (
aria-expanded); the spec uses.isSelectedplus a value. Fine, but pick one. - Once-only URL in a transient popover: a stray click outside loses it. Consider non-transient while it shows.
- New English strings (
native.share.offline,native.delete.unsent, Show/Hide Format) need the copy-review step. - iPad regular keeps iOS geometric pagination (lines split across pages), not the Mac's block plan; note it in PARITY. iPad multi-window and state restoration are unstated.
- Property test for block rendering should include insert and remove at index 0, split and merge across blocks, multi-block paste and undo of each.
- Add a VoiceOver check that a peer edit no longer resets the cursor on iPhone (a real gain from dropping
attributedText =). - One physical-iPhone sanity pass belongs in S3's REVIEW.md, since every iOS number is simulator.
Confirmed correct
- Inspector geometry (248 / 12 / 12 / 14, glass, rim) matches
show.html. Default open matches the cookie rule. Readers get no inspector, as on the web. can_shareis owner-and-member, the same rule as the web's Delete… and Share.thumbnail.Excerptis already in the list JSON;?q=search exists natively; the shelf of five and the four groups match./share/team,/share/linkand grants already answer native JSON.- The hard-rule tests cited all exist. S1-first ordering is right.
Open questions 1–3 in §13 are properly Paul's; my defaults would be: Import later, web gains the row later, Share disabled offline.