Skip to content

compiler: accept \paragraph/\subparagraph instead of erroring on them (rebase of #407, + inventory sync and duplicate-attribute fixes) - #474

Merged
GoKubar merged 4 commits into
mainfrom
integration/407-paragraph-rebased
Sep 14, 2026
Merged

GoKubar merged 4 commits into
mainfrom
integration/407-paragraph-rebased

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Rebase of #407 onto current main, with two fixes it needed. Replaces #407.

Why a replacement

1. #407 would have turned a green gate red. It regenerated crates/compiler/supported/{supported-latex.json,coverage.md} and docs/user/compiler.md but not the Mac app's bundled copy, so its bundled inventory matches the compiler check was failing on CI. All four artefacts are regenerated here with crates/compiler/scripts/render_supported_latex.sh, which since #408 also runs apps/mac/scripts/sync-supported-latex.sh. That check now passes.

2. A duplicated #[test] attribute. The new test carried #[test] twice. rustc accepts this with a duplicate_macro_attributes warning and then runs the test twice — cosmetic, but removed while here. (Checked, rather than assumed: a throwaway crate with a doubled #[test] compiles and reports the test twice.)

Re-checked: does #407 still need a vendor re-pin?

Yes. crates/render-pipeline/vendor/compiler/PIN is faa7d484, the pin #451 moved it to, and faa7d484 is main's #437 commit — which predates this change. So the render pipeline keeps erroring on \paragraph until a separate re-pin PR.

The pipeline half is already on main: adapter.rs::run_in_heading_at and apply_run_in_heading read the command back from the source and give the head its weight, indent and \hskip 1em. This is the compiler-side prerequisite for that, and it is worth landing on its own because crates/compiler also feeds the flashtex-compiler binary and crates/bridge directly.

Measured effect (compiler route, main vs this branch)

\paragraph{Solution.} Body text.
  main: recovered, 'Solution.Bodytext.',
        error/unsupported_feature: \paragraph is not supported by this compiler version
  this: ok,        'Solution.Bodytext.', no diagnostics

\paragraph*{Solution.} Body text.
  main: recovered, '*Solution.Bodytext.'        <- the star was typeset
  this: ok,        'Solution.Bodytext.'

\paragraph[Short]{Solution.} Body text.
  main: recovered, '[Short]Solution.Bodytext.'  <- the short title was typeset
  this: ok,        'Solution.Bodytext.'

\section{Head}Body.                             <- unaffected

Worth being precise about: the title already fell through as body text before this change. What changes is that the spurious error is retired and the star and optional short title are consumed as the command parameters they are, instead of being set on the page.

Verification (Linux, this checkout)

Font environment set — FLASHTEX_FONT_DIRS + FLASHTEX_TFM_DIRS — without which roughly 110 tests silently skip and report as passes.

gate result baseline
cargo test --release --no-fail-fast crates/compiler 644 passed, 0 failed, 5 ignored 643 / 0 / 5
cargo test --release --no-fail-fast crates/bridge 170 passed, 0 failed, 2 ignored unchanged
apps/mac/scripts/sync-supported-latex.sh --check clean clean

The resulting tree diff against main is #407's own merge-base diff plus the regenerated Mac bundled copy (+6 lines) minus the duplicated attribute (−1 line).

Scope note

The only apps/mac/ path touched is the generated Resources/supported-latex.json, produced by the sync script. No Swift, so this does not collide with the Mac UI lane that currently has the machine.

Original author: the nixos-gfxsec lane (#407). Rebased by the linux-primary integration lane.

…them

`\paragraph` and `\subparagraph` raised `\paragraph is not supported by
this compiler version`. That diagnostic is stale: they are `\@startsection`
with a *negative* after-skip (article.cls 406-414), and `\@xsect`'s
negative branch never sets the head as a block of its own — it arms
`\everypar`, throws away the following paragraph's `\parindent` box and
sets the head into that paragraph's first line instead. The render pipeline
lays them out correctly from the source, so the error was reporting a gap
that no longer exists.

The right thing for this layer is therefore to take the star and the
optional short title and then get out of the way: the braced title falls
through to the main token loop as ordinary body text, which is exactly the
material LaTeX runs into the following paragraph, in the right place and
with the right spans. `flush_paragraph` is deliberately not called, for the
same reason — a run-in head does not start a new paragraph.

**No geometry changes.** Measured on the 22-document real-world corpus with
the vendored compiler patched to this change (local only; never committed):
dx 85.17%, dy 65.74%, both 59.46%, 14002 aligned words, page counts 20/22 —
identical to the same build without it, to the last word. What changes is
that `fixtures/real-world/ps-calculus` no longer reports four
`unsupported_feature` errors, and a probe of all three forms reports none.

`\paragraph*[short]{...}` is left alone: `\@startsection`'s starred form
takes no optional argument, and pdflatex itself typesets the brackets there
(`[Short]Solution.`), so there is no oracle behaviour to match.

Inventory: both commands move out of `KNOWN_UNIMPLEMENTED_COMMANDS` into
`BUILT_INS` and the supported-LaTeX inventory; the generated artefacts
(`docs/user/compiler.md`, `supported/supported-latex.json`,
`supported/coverage.md`) are regenerated with
`crates/compiler/scripts/render_supported_latex.sh`.

**A vendor re-pin is required** for the rendered corpus to see this:
`crates/render-pipeline/vendor/compiler` is a frozen snapshot (`e44d5917`)
and is deliberately not touched here. The pipeline side of this feature is
a separate PR and needs no re-pin — it reads the command back from the
source, so it works against the existing pin either way.

`cargo test --release --no-fail-fast` on crates/compiler: 583 passed, 0
failed, 4 ignored (was 577; the new `run_in_headings_are_accepted_...`
test plus the two doc/inventory gates).

Implementation-Agent: Claude Opus 5 (lane nixos-graphics-sectioning, linux-primary)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
Rebase of #407 onto current main, with two fixes it needed.

1. #407 regenerated `crates/compiler/supported/{supported-latex.json,
   coverage.md}` and `docs/user/compiler.md` but not the Mac app's bundled
   copy, so its "bundled inventory matches the compiler" CI check failed and
   merging it as-is would have turned that gate red on main. All four
   artefacts are regenerated here with
   `crates/compiler/scripts/render_supported_latex.sh`, which since #408 also
   runs `apps/mac/scripts/sync-supported-latex.sh`.

2. The new test carried a duplicated `#[test]` attribute, which rustc accepts
   with a `duplicate_macro_attributes` warning and then runs the test twice.
   Removed.

Measured effect on the direct compiler route (`flashtex-compiler`, and
`crates/bridge`, both of which build against `crates/compiler` rather than
the vendor), main vs this branch:

  \paragraph{Solution.} Body text.
    main: recovered, 'Solution.Bodytext.',
          error/unsupported_feature: \paragraph is not supported by this
          compiler version
    this: ok,        'Solution.Bodytext.', no diagnostics

  \paragraph*{Solution.} Body text.
    main: recovered, '*Solution.Bodytext.'   <- the star was typeset
    this: ok,        'Solution.Bodytext.'

  \paragraph[Short]{Solution.} Body text.
    main: recovered, '[Short]Solution.Bodytext.'  <- the short title was typeset
    this: ok,        'Solution.Bodytext.'

So the title already fell through as body text before this change; what
changes is that the spurious error is retired and the star and the optional
short title are consumed as the command parameters they are instead of being
set on the page. `\section` is unaffected.

The vendor re-pin note in #407's title is still accurate:
`crates/render-pipeline/vendor/compiler/PIN` is `faa7d484`, which predates
this change, so the render pipeline keeps erroring on `\paragraph` until a
separate re-pin PR. The pipeline side is already in place on main —
`adapter.rs::run_in_heading_at` and `apply_run_in_heading` read the command
back from the source and give the head its weight, indent and `\hskip 1em`.
This change is the compiler-side prerequisite for that.

Verified on this Linux worktree with the font environment set
(FLASHTEX_FONT_DIRS + FLASHTEX_TFM_DIRS, without which ~110 tests silently
skip and report as passes):

  crates/compiler   644 passed, 0 failed, 5 ignored  (main: 643/0/5)
  crates/bridge     170 passed, 0 failed, 2 ignored  (unchanged)

Implementation-Agent: nixos-gfxsec lane (original PR #407)
Rebased-By: linux-primary integration lane (Claude Code agent af761de6)
Commit-Executor: Claude Code agent af761de6 on linux-primary (direct Git,
  Cursor usage limit fallback per AGENTS.md)
Co-authored-by: GoKubar <[email protected]>
GoKubar and others added 2 commits September 14, 2026 18:27
…s (rebase of #432 onto current main) (#473)

* compiler: preamble \setlength, \addtolength and TeX length assignments

The compiler half of lane #258, split from agent/daniel-parent/preamble-lengths
@ 695dfaa (20 reviewed WIP commits). The render-pipeline half is its own PR.

- \setlength and \addtolength are accepted in the preamble, along with direct
  TeX assignments (\parindent=10pt) to the page and paragraph lengths; plus/minus
  glue is parsed.
- Units use TeX's scan_dimen factors: bp is 1.00375pt (it was treated as pt),
  plus dd, cc and sp; ex uses the cmr x-height.
- An unresolved length reference, including a page length such as
  \setlength{\textwidth}{\paperwidth}, warns instead of being silently dropped.
- The inventory is regenerated; both supported-latex.json copies are byte-identical.

What was run (CARGO_TARGET_DIR=target-prelen): cargo test --manifest-path crates/compiler/Cargo.toml
test result: ok. 327 passed; 0 failed; 0 ignored  (lib)
test result: ok. 10 passed; 0 failed; 0 ignored   (preamble_lengths)
All other test binaries ok, 0 failed.

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast (lane commits ae37132..695dfaa)
Commit-Executor: daniel-parent (split into compiler and pipeline PRs)
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz

* wip(#432): keep user-defined skip registers out of parser addtolength

HOST_PRELUDE no longer undefines \setlength/\addtolength. When the target
is already defined (\newlength skip), the kernel assignment/\advance runs
so \the can read it back. Undefined preamble lengths still pass through
as host commands mapped back to \setlength/\addtolength with the full
csname. \parindent TeX assignment and \addtolength are silent in the
preamble; \setlength{\parindent}{nonzero} still warns.

Ran: cargo test --manifest-path crates/compiler/Cargo.toml --test
kernel_untested_a addtolength
  before: FAILED 0 passed; 1 failed (Missing number; \addtolength{\\})
  after:  ok. 1 passed; 0 failed; 0 ignored; 0 measured; 20 filtered out
  cargo test --test preamble_lengths
  test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Next: full compiler crate tests and render-pipeline --lib.

Open questions: none.

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast
Commit-Executor: cursor-agent (direct git commit)
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>

* wip(#432): full compiler crate and render-pipeline lib green

ASCII-only wording in the HOST_PRELUDE comment. No behaviour change.

Ran: CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-prelen
  cargo test --manifest-path crates/compiler/Cargo.toml
    every test result: ok (lib: 331 passed; 0 failed;
    kernel_untested_a: 20 passed; 0 failed; 1 ignored)
  cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib
    test result: ok. 121 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out

Next: push this lane branch. No remaining acceptance gaps.

Open questions: none.

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast
Commit-Executor: cursor-agent (direct git commit)
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>

---------

Co-authored-by: d-q222 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Rebase of #407 onto current main, with two fixes it needed.

1. #407 regenerated `crates/compiler/supported/{supported-latex.json,
   coverage.md}` and `docs/user/compiler.md` but not the Mac app's bundled
   copy, so its "bundled inventory matches the compiler" CI check failed and
   merging it as-is would have turned that gate red on main. All four
   artefacts are regenerated here with
   `crates/compiler/scripts/render_supported_latex.sh`, which since #408 also
   runs `apps/mac/scripts/sync-supported-latex.sh`.

2. The new test carried a duplicated `#[test]` attribute, which rustc accepts
   with a `duplicate_macro_attributes` warning and then runs the test twice.
   Removed.

Measured effect on the direct compiler route (`flashtex-compiler`, and
`crates/bridge`, both of which build against `crates/compiler` rather than
the vendor), main vs this branch:

  \paragraph{Solution.} Body text.
    main: recovered, 'Solution.Bodytext.',
          error/unsupported_feature: \paragraph is not supported by this
          compiler version
    this: ok,        'Solution.Bodytext.', no diagnostics

  \paragraph*{Solution.} Body text.
    main: recovered, '*Solution.Bodytext.'   <- the star was typeset
    this: ok,        'Solution.Bodytext.'

  \paragraph[Short]{Solution.} Body text.
    main: recovered, '[Short]Solution.Bodytext.'  <- the short title was typeset
    this: ok,        'Solution.Bodytext.'

So the title already fell through as body text before this change; what
changes is that the spurious error is retired and the star and the optional
short title are consumed as the command parameters they are instead of being
set on the page. `\section` is unaffected.

The vendor re-pin note in #407's title is still accurate:
`crates/render-pipeline/vendor/compiler/PIN` is `faa7d484`, which predates
this change, so the render pipeline keeps erroring on `\paragraph` until a
separate re-pin PR. The pipeline side is already in place on main —
`adapter.rs::run_in_heading_at` and `apply_run_in_heading` read the command
back from the source and give the head its weight, indent and `\hskip 1em`.
This change is the compiler-side prerequisite for that.

Verified on this Linux worktree with the font environment set
(FLASHTEX_FONT_DIRS + FLASHTEX_TFM_DIRS, without which ~110 tests silently
skip and report as passes):

  crates/compiler   644 passed, 0 failed, 5 ignored  (main: 643/0/5)
  crates/bridge     170 passed, 0 failed, 2 ignored  (unchanged)

Implementation-Agent: nixos-gfxsec lane (original PR #407)
Rebased-By: linux-primary integration lane (Claude Code agent af761de6)
Commit-Executor: Claude Code agent af761de6 on linux-primary (direct Git,
  Cursor usage limit fallback per AGENTS.md)
Co-authored-by: GoKubar <[email protected]>
@GoKubar
GoKubar merged commit b891e7d into main Sep 14, 2026
20 of 21 checks passed
GoKubar added a commit that referenced this pull request Sep 14, 2026
GoKubar added a commit that referenced this pull request Sep 14, 2026
…tion, settings, states (#476)

* design: install the UI kit, the frontend-design skill and a snapshot render loop

* design: fill in the real architecture, and record the owner's rulings on behaviour and scope

* design: the style guide's numbers are a starting point, not law — the target per surface is what binds

* design tests: windowed render loop — hosted windows, fixture ShellModel, shell surface snapshots

Surfaces render inside real off-screen HostedWindows windows now: List rows
only populate in a window, NavigationSplitView and .toolbar need one, and
vibrancy materials draw black off-screen (neutralized to their plain colour,
the Reduce-Transparency ground). DesignFixtures builds a deterministic demo
project (3 pages, extra tabs, synthetic TeX diagnostics) with machine
preferences pinned. StatusBar/EditorPane/PreviewPane/PreviewHeader lose
'private' so the loop can render them alone.

Implementation-Agent: Claude Fable (lane mac-ui-design, linux-primary)
Commit-Executor: Claude Fable (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

* design tests: capture surfaces through the window server, not cacheDisplay

macOS 26 glass materials (NSContainerConcentricGlassEffectView and friends,
wrapping every NavigationSplitView sidebar) never reach cacheDisplay or
CALayer.render — the sidebar snapshotted blank white. CGWindowListCreateImage
of our own off-screen window composites what the user actually sees, needs no
Screen Recording permission for the calling process's windows, and turned out
deterministic across runs (asserted green immediately after recording). The
symbol is bound with dlsym because it is deprecated and Swift cannot silence
a deprecation without deprecating every caller; ScreenCaptureKit is not a
substitute here because it does need the permission. Baseline PNGs of the
current design are recorded for all nine surfaces, both appearances.

Implementation-Agent: Claude Fable (lane mac-ui-design, linux-primary)
Commit-Executor: Claude Fable (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

* design: DesignSystem.swift, and the main-window chrome reads its tokens

The token file from context/style-guide.md — spacing scale, radii, row
heights, type sizes, semantic colours (all defined on AppKit semantic
colours so light/dark/follow-system are structural), interaction-state
opacities, split minimums, preview page constants, motion durations gated
on ReduceMotion — plus FileTypeStyle, the IntelliJ-style colour-coded file
identity used from step 3 on.

Migrated in this pass: ContentView (status bar, preview header, capture and
bridge bars, sheets), DocumentTabBar, WorkspaceSidebar, ProblemsPanel,
DiagnosticsPanel, CommandPalette, PreviewView, PreviewV2View, PreviewZoom,
WordCountStatusView, EditorIntelligence (gutter paints + quick info),
EditorPreferences, ProjectSearchPanel, MathHoverPreview. Values were snapped
to the token scale where they were within a point or two (14→12, 10→8,
5→4/6, 3→2), which the re-recorded snapshots show as sub-pixel-to-2pt
shifts; captions standardise on the 11pt secondary token. Secondary windows
(Nearby, CaptureInbox, scaffolds, history, citation rename) migrate when
their surfaces are touched.

Implementation-Agent: Claude Fable (lane mac-ui-design, linux-primary)
Commit-Executor: Claude Fable (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

* mac: the window shell is the flat tool-window layout — rail, stacked tool column, three-chip toolbar, 900pt minimum

IntelliJ's structure with Xcode's restraint (design-principles §1/§4):
a left icon rail toggles the tool windows; the tool column stacks the
Project tree above the Outline (which ships collapsed); Problems left the
column — its homes are the bottom panel and the status-bar badge; regions
separate by hairlines and one tonal shift, and the status bar spans the
window. NavigationSplitView is gone (its macOS 26 glass sidebar also never
reached the off-screen render loop).

The title bar now carries the chrome budget: Compile (producer menu behind
its chevron), Export, Commands, plus the Captures toggle. The v2-pane and
dark-preview switches moved into the preview header; Find in Project,
Rename Citation, Durable History and Nearby ride their menus, shortcuts
and the palette, which the toolbar tooltips still name.

Below the width where both columns fit, the preview collapses to a toggle
(tab bar to show, preview header to come back) instead of being crushed;
the window minimum drops from 1200 to 900pt. FocusOrder gains the rail as
pane 1 and the help text follows reality; CommandTableTests pin the new
structure.

Implementation-Agent: Claude Fable (lane mac-ui-design, linux-primary)
Commit-Executor: Claude Fable (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

* mac: LaTeX-semantic breadcrumb leads the status bar

'main.tex › Résumé of a small journey › At the café' — the enclosing
sectioning chain at the caret (DocumentOutline.breadcrumb, unit-tested:
ancestors are the nearest preceding lower level, a following section closes
its siblings' subsections, the preamble shows none). Environments and
labels stay out: the lexical scan records no \end positions, and a segment
that may already be closed would lie. Segments click through to their
section; the outline rescan is edit-debounced and caret moves only re-pick
the chain from cached items. Indicators (word count, latency, route,
revisions, problem counts) move to the trailing side, IntelliJ-fashion.

Implementation-Agent: Claude Fable (lane mac-ui-design, linux-primary)
Commit-Executor: Claude Fable (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

* mac: colour-coded file identity in tree and tabs; Islands active tab; 24pt tree rows

FileTypeStyle is now the one vocabulary for what a file is — .tex blue
(entry filled), .bib purple, .cls/.sty teal, .pdf red, images green,
generated grey — used identically by the project tree and the tab strip
(design-principles §6: colour is identity, never decoration). Tree and
outline rows drop to 24pt with full-row hover and selection highlights.

Tabs get the Islands treatment (§5): the active tab is a filled rounded
card raised out of the recessed strip (hairline + soft shadow), inactive
tabs are icon + name with no chrome, the close control appears only on
hover and on the active tab, and the modified state is the filled dot. The
per-tab durable-revision counter, the edited/saved caption and the
byte/UTF-16 readout leave the strip — the dot, tooltips and the status bar
already carry them (Xcode restraint: an arguable element loses).

Implementation-Agent: Claude Fable (lane mac-ui-design, linux-primary)
Commit-Executor: Claude Fable (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

* mac: preview header in two tiers — page and zoom at rest, controls on pointer-over; Fit Page (⌘⇧9)

Design-principles §8: at rest the header shows only the page indicator and
zoom percentage, dimmed, plus quiet state — the fixed-slot compile spinner,
a FIXTURE/HISTORICAL badge only when the pages are not the worker's current
result, staleness text and capability warnings. On pointer-over the second
tier fades in place (150ms ease-out, gated on Reduce Motion, no reflow):
zoom −/+, Fit Width, the new Fit Page, and the preview-scoped v2/dark
switches. Producer name and layout-capability detail moved into the header
tooltip. No error cards in this column, before or after.

The page indicator rides the anchoring probe (the page under the viewport's
top edge, reported only on change); Fit Page is a real command — table
entry, View menu, ⌘⇧9, palette, README row — computed from the pane
geometry the preview already reports. Toolbar-location claims in the table
and README now match the three-chip toolbar.

Implementation-Agent: Claude Fable (lane mac-ui-design, linux-primary)
Commit-Executor: Claude Fable (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

* mac: IntelliJ problems rows with in-row disclosure; gutter ring marks Tab-applicable fixes

The panel row is now F1's anatomy: severity glyph, the human-readable
message, and the dimmed location at the trailing edge — one line per
problem. The detail (notes, help, recovery, catalogue explanation,
withheld-underline state) collapses under the *selected* row: selecting is
the disclosure, exactly §9's 'a disclosure inside the selected problem,
not a separate destination'. The redundant per-row Go-to-source button is
gone (Return, double-click and the context menu all jump); Fix… and the
'N places' menu stay as the row's actions.

Lines whose diagnostic carries a mechanical edit now get an accent ring
around the gutter's severity dot (a second shape, never colour alone) —
without it the 'Tab applies the fix at the caret' affordance was invisible
(§9). Mark gains hasFix at construction; the fixture demonstrates the whole
path (ringed gutter dot, squiggle, panel Fix…, disclosure) and busts the
editor-marks memo the way a real reply would, with a fresh result id.

Implementation-Agent: Claude Fable (lane mac-ui-design, linux-primary)
Commit-Executor: Claude Fable (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

* mac: outline in document order with typed icons and a header filter; palette grows Search-Everywhere scopes; completion popup on tokens

Outline (D1's Structure panel, simpler on purpose): one flat list in
document order — never regrouped by type, because for prose the order is
the meaning (§7) — indented by nesting, typed icons whose colour is the
item's type identity (floats green/blue, math purple, labels orange,
structure neutral), line numbers dimmed at the trailing edge, and the
filter as an in-header menu. The kind-grouped disclosure sections are gone.

The palette (§10) gains scope tabs — All / Files / Sections / Labels /
Citations / Commands — over state the shell already holds: the project
listing and discoverable includes, the outline scan, the helper's
project-index citations, and the full command table. Tab cycles scopes,
rows carry the shared typed-icon vocabulary with dimmed context, commands
keep their key caps and richer ranking. Table/README texts updated to match.

The completion popup already had the K1 anatomy (typed icon → monospace
candidate → right-aligned dimmed origin, fixed documentation pane, footer
hints); it now reads its chrome from DS tokens, with completion rows pinned
at 24 (not the guide's 22 — candidate rows carry 16pt kind icons and 22
crowds them; the reference, not the number). New snapshot proves both
appearances — the exact surface that once shipped unreadable in light mode.

Implementation-Agent: Claude Fable (lane mac-ui-design, linux-primary)
Commit-Executor: Claude Fable (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

* mac: Settings becomes the toolbar-tabbed macOS window (Editor | Conversion), applying live

The Settings scene now shows the standard macOS tabbed IA — two panes are
all this app has, so IntelliJ's search-plus-tree settings IA would be
chrome without content (deliberate simplification of design-principles
§13's reference; the binding parts hold: ⌘,, a window not a sheet, live
apply, no OK/Cancel/Apply anywhere). EditorPreferencesView itself is
untouched, so the panel focus-order table and its accessibility walk stay
exactly as pinned; the Conversion section moves to its own tab as its own
grouped form. Snapshot added, both appearances.

Find/replace stays the native NSTextFinder bar rather than L1's IntelliJ
bar — a deliberate reading of loyalty #1 ('macOS conventions win on
mechanics') over the reference: the bar's replace path is the documented
guarantee that replacements share the editor's undo/attribute machinery,
and rebuilding it custom would trade that for looks. Recorded as a
judgement call for the report.

Implementation-Agent: Claude Fable (lane mac-ui-design, linux-primary)
Commit-Executor: Claude Fable (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

* mac: pressed and unfocused-selection states, honest empty preview, contrast on informational dimmed text

Every custom interactive row now has a visible pressed state
(PressableStyle: a pressed wash over whatever the label draws) — sidebar
rows, tabs, rail buttons; the document tab becomes a real Button (keyboard
activation and pressed feedback) instead of a tap gesture. Selection reads
correctly unfocused (§14): tree rows fall back to the unemphasized
selection colour, the active tab drops its shadow while the window is not
key.

The no-result preview column top-aligns and fills its ground (with both
split children flexible, HSplitView collapsed and centred everything —
found by the new empty-state snapshot), guidance text names the Compile
chip's menu instead of removed toolbar buttons, and the page/zoom readouts
appear only once a result exists. Information-carrying dimmed text
(problem locations, outline line numbers) moves from tertiary to secondary
for AA contrast; decorative separators stay tertiary.

Implementation-Agent: Claude Fable (lane mac-ui-design, linux-primary)
Commit-Executor: Claude Fable (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

* mac: the secondary windows read the token file too — zero raw style literals left in view files

Captures inspector, Nearby pairing window, project scaffolds (New
Project/File, Rename, Delete), Durable History, Rename Citation, the
navigation sheets, proposal preview and review history all migrate onto
DS tokens: spacing snapped to the scale, radii, severity/status colours,
window minimums as named tokens, status dots, thumbnails and image tiles.
Two deliberate one-offs became named tokens rather than exceptions: the QR
ground stays literal white in both appearances (scanners need it) and the
pairing code keeps its across-the-room 34pt monospaced face.

Implementation-Agent: Claude Fable (lane mac-ui-design, linux-primary)
Commit-Executor: Claude Fable (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

* mac: discard createMissingInclude results explicitly — the create-file rows report through project.status

Implementation-Agent: Claude Fable (lane mac-ui-design, linux-primary)
Commit-Executor: Claude Fable (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

* mac: the capture bar earns its place — shown once the capture flow is in play, absent at rest

Same rule the bridge line already followed (daniel-fable-ui-qa #5): a
permanent 'no insertion point pinned' strip under the editor is chrome
with no content. It appears with a pinned anchor, queued proposals, or the
open Captures inspector; ⌘⌥P and the Edit menu still pin from anywhere.
The reading-order table says when the pane is present. Snapshots
re-recorded; the empty and rest states drop the strip.

Implementation-Agent: Claude Fable (lane mac-ui-design, linux-primary)
Commit-Executor: Claude Fable (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

* mac: \paragraph leaves beyondCompiler and \subparagraph joins the completion goldens (#474)

---------

Co-authored-by: Claude Opus 5 <[email protected]>
GoKubar added a commit that referenced this pull request Sep 15, 2026
… CleverReference, default math-class-override (#477)

The pin was 13 `crates/compiler` commits behind `main`, which left merged work
inert in the pipeline. The one this was asked for is #474: `\paragraph` and
`\subparagraph` are real compiler commands there, so `ps-calculus`'s four
`\paragraph is not supported by this compiler version` errors are gone through
the `render` producer. Nothing in the pipeline had to change for it -- the
run-in head was already laid out by `adapter::run_in_heading_at`, which reads
the command back from the source; the old pin's parser simply had no
`"paragraph"` arm. Also now visible: #472 (mathtools colon relations), #473
(preamble `\setlength`/`\addtolength`), #455, #454, #456, #457, #460, #416,
#424, #428, #444, #408.

One new compiler API surfaced: `parser::Inline::CleverReference` (#460,
cleveref). Three exhaustive matches in `adapter.rs` stopped building --
`inline_span`, the incremental paragraph-cache hash, and `items_from_inlines`.
It is implemented, not dropped behind a wildcard:

- `adapter::clever_reference_text` resolves `\cref`/`\Cref`/`\crefrange`/
  `\cpageref`/`\labelcref` to text in `lower_inline`, exactly where `Reference`
  already was, so `items_from_inlines` keeps its `unreachable!` instead of
  gaining a swallow-everything arm.
- `Labels` gains `kinds` (from `Inline::Label::kind`) and `cleveref` (from
  `Parsed::cleveref`) to feed it, and `Labels::needs_pages` now also answers
  true for a `\cpageref`, which otherwise had no page numbers to print.
- The grouping, consecutive-number ranges, `and`/`, and` joining and
  parenthesised equation numbers mirror the compiler's private
  `layout::clever_reference_text`. The naming is *not* duplicated:
  `xref::cleveref_name`/`cleveref_kind` are public and are called, so
  `\crefname` and the `capitalise`/`noabbrev` options stay compiler-owned.
- The one thing it cannot do is link. The compiler has no link backend, so
  `CleverReference::linked` is carried in the cache key and otherwise unused.

`tests/cleveref.rs` was written against this and marked
`#[ignore = "needs vendor re-pin past GH-CLEVEREF"]`. It is un-ignored and
passes unchanged: `Section 2` and `eqs. (1) and (2)`.

`math-class-override` becomes a default feature, as `amsmath-inline` and
`par-leading` did once their preconditions were met: the re-pinned `math.rs`
declares `pub class_override: Option<AtomClass>` and `pub enum AtomClass`.
Without it #472 is merged but inert here, because `typeset::class_override_of`
re-derives `\colon`'s class from source text that is identical with and without
amsmath loaded. `class_override_of` stays as the no-default-features fallback.

No other vendor directory had to move. `compiler`'s four path dependencies
(`font-engine`, `tex-text-encoding`, `tex-boxes`, `tex-expansion`) are
unchanged from the pin, and the three `tex-*` crates have had no commits at all
since `87a513de`. `math-layout` *is* 8 commits behind `main` (#186, #229), but
`compiler` does not depend on it, so that is a separate re-pin. The stale
opening paragraph of VENDORING.md (which still named `ea4ee5c8` as the
`compiler` pin and "~150 commits") is corrected.

Verified with `FLASHTEX_FONT_DIRS`/`FLASHTEX_TFM_DIRS` set to the bundled
`apps/mac/Fonts`:

- `cargo test --release --no-fail-fast -p flashtex-render-pipeline`:
  365 passed / 0 failed (364 baseline + the un-ignored cleveref test).
- amsmath oracle corpus: `TOTAL 59/59 within 0.5 bp`.
- `tabular_oracle: 106/106 fixtures match pdflatex`.
- Real-world corpus, all 22 fixtures: page counts checked by counting
  `/Type /Page` leaf objects in each `reference.pdf` and in each produced
  `render.pdf`, not by reading the harness summary -- 22/22 agree. Zero
  font-FAILURE diagnostics on either producer. HW1 and HW2: 3 pages, 0 errors.
- The `packages::supersede_message` regression the last re-pin hit did not
  return: every `... are recognised but not implemented` line in the report is
  `render 0 / compiler N`, so none leak through the pipeline.

Implementation-Agent: claude-opus-5 render-pipeline lane (agent-a98bd88c4a9d49a22)
Commit-Executor: claude-opus-5 render-pipeline lane, direct git (observed Cursor usage limit)
GoKubar added a commit that referenced this pull request Sep 15, 2026
…ng skips, page-1 \@Texttop (#482)

* render-pipeline: re-pin vendor/compiler faa7d48 -> 6a47ed4, implement CleverReference, default math-class-override

The pin was 13 `crates/compiler` commits behind `main`, which left merged work
inert in the pipeline. The one this was asked for is #474: `\paragraph` and
`\subparagraph` are real compiler commands there, so `ps-calculus`'s four
`\paragraph is not supported by this compiler version` errors are gone through
the `render` producer. Nothing in the pipeline had to change for it -- the
run-in head was already laid out by `adapter::run_in_heading_at`, which reads
the command back from the source; the old pin's parser simply had no
`"paragraph"` arm. Also now visible: #472 (mathtools colon relations), #473
(preamble `\setlength`/`\addtolength`), #455, #454, #456, #457, #460, #416,
#424, #428, #444, #408.

One new compiler API surfaced: `parser::Inline::CleverReference` (#460,
cleveref). Three exhaustive matches in `adapter.rs` stopped building --
`inline_span`, the incremental paragraph-cache hash, and `items_from_inlines`.
It is implemented, not dropped behind a wildcard:

- `adapter::clever_reference_text` resolves `\cref`/`\Cref`/`\crefrange`/
  `\cpageref`/`\labelcref` to text in `lower_inline`, exactly where `Reference`
  already was, so `items_from_inlines` keeps its `unreachable!` instead of
  gaining a swallow-everything arm.
- `Labels` gains `kinds` (from `Inline::Label::kind`) and `cleveref` (from
  `Parsed::cleveref`) to feed it, and `Labels::needs_pages` now also answers
  true for a `\cpageref`, which otherwise had no page numbers to print.
- The grouping, consecutive-number ranges, `and`/`, and` joining and
  parenthesised equation numbers mirror the compiler's private
  `layout::clever_reference_text`. The naming is *not* duplicated:
  `xref::cleveref_name`/`cleveref_kind` are public and are called, so
  `\crefname` and the `capitalise`/`noabbrev` options stay compiler-owned.
- The one thing it cannot do is link. The compiler has no link backend, so
  `CleverReference::linked` is carried in the cache key and otherwise unused.

`tests/cleveref.rs` was written against this and marked
`#[ignore = "needs vendor re-pin past GH-CLEVEREF"]`. It is un-ignored and
passes unchanged: `Section 2` and `eqs. (1) and (2)`.

`math-class-override` becomes a default feature, as `amsmath-inline` and
`par-leading` did once their preconditions were met: the re-pinned `math.rs`
declares `pub class_override: Option<AtomClass>` and `pub enum AtomClass`.
Without it #472 is merged but inert here, because `typeset::class_override_of`
re-derives `\colon`'s class from source text that is identical with and without
amsmath loaded. `class_override_of` stays as the no-default-features fallback.

No other vendor directory had to move. `compiler`'s four path dependencies
(`font-engine`, `tex-text-encoding`, `tex-boxes`, `tex-expansion`) are
unchanged from the pin, and the three `tex-*` crates have had no commits at all
since `87a513de`. `math-layout` *is* 8 commits behind `main` (#186, #229), but
`compiler` does not depend on it, so that is a separate re-pin. The stale
opening paragraph of VENDORING.md (which still named `ea4ee5c8` as the
`compiler` pin and "~150 commits") is corrected.

Verified with `FLASHTEX_FONT_DIRS`/`FLASHTEX_TFM_DIRS` set to the bundled
`apps/mac/Fonts`:

- `cargo test --release --no-fail-fast -p flashtex-render-pipeline`:
  365 passed / 0 failed (364 baseline + the un-ignored cleveref test).
- amsmath oracle corpus: `TOTAL 59/59 within 0.5 bp`.
- `tabular_oracle: 106/106 fixtures match pdflatex`.
- Real-world corpus, all 22 fixtures: page counts checked by counting
  `/Type /Page` leaf objects in each `reference.pdf` and in each produced
  `render.pdf`, not by reading the harness summary -- 22/22 agree. Zero
  font-FAILURE diagnostics on either producer. HW1 and HW2: 3 pages, 0 errors.
- The `packages::supersede_message` regression the last re-pin hit did not
  return: every `... are recognised but not implemented` line in the report is
  `render 0 / compiler N`, so none leak through the pipeline.

Implementation-Agent: claude-opus-5 render-pipeline lane (agent-a98bd88c4a9d49a22)
Commit-Executor: claude-opus-5 render-pipeline lane, direct git (observed Cursor usage limit)
Co-authored-by: GoKubar <[email protected]>

* render-pipeline: re-pin vendor/compiler onto #316 so the pipeline can see CBlock::LetterBlock

Stacked on #477 (the re-pin to `main`). **Blocked on #316 merging**, and
deliberately so: this is a temporary pin to an unmerged branch, the second such
row in `vendor/VENDORING.md` after `vector-graphics`.

Why a pin to a branch at all: PR #316 adds `parser::Block::LetterBlock`, and
`adapter::inlines_of` matches `CBlock` exhaustively with no catch-all, so the
render-pipeline side of the `letter` class is a hard compile error against any
vendored compiler that lacks the variant. It cannot be written first and pinned
later. `engine/letter-class-compiler` is `main` + one commit (`15264d7b`,
rebased and green: 664 passed / 0 failed on `crates/compiler`), and
`vendor/compiler` here is a plain `git archive` of its `crates/compiler`.

**When #316 merges, re-pin this row to `main`** — `git archive <main>:crates/compiler`
and nothing else. The compiler row of `VENDORING.md` says so in the first
sentence.

Two exhaustive matches in `adapter.rs` needed the new variant: `inlines_of` and
the unit-building block walk. Neither gained a wildcard. `LetterBlock` carries
`Vec<Vec<Inline>>` rather than one flat slice, so it is lowered in
`lower_blocks` alongside `Verbatim`/`TitleBlock`/`VFill`: each line becomes an
ordinary paragraph in the nearest alignment the pipeline has today
(`flushright` for `\opening`'s return address, `flushleft` for the recipient
and the closing), with **one typed `unsupported_block` limitation per block**
naming exactly what is not applied — the `\longindentation` offset, the class's
own vertical skips, and the `\raggedleft` box whose lines share a left edge
where `flushright` aligns their right ones. No line of an `\opening` or a
`\closing` is dropped, and nothing about the class is silently approximated.

The typesetting PR stacked on this one replaces that arm and spends the skips
the compiler already resolved.

Verified with `FLASHTEX_FONT_DIRS`/`FLASHTEX_TFM_DIRS` set to the bundled
`apps/mac/Fonts`:

- `cargo test --release --no-fail-fast -p flashtex-render-pipeline`:
  365 passed / 0 failed.
- Real-world corpus, all 22 fixtures: page counts checked by counting
  `/Type /Page` leaf objects in each `reference.pdf` and in each produced
  `render.pdf` — 22/22 agree. Zero font-FAILURE diagnostics.
- `letter` compiles through the `render` producer with **0 errors**, where the
  #477 pin still reported seven `unknown_command`s (`\signature`, `\address`,
  `\opening`, `\closing`, `\encl`, `\cc`, `\ps`).

Implementation-Agent: claude-opus-5 render-pipeline/letter lane (agent-a98bd88c4a9d49a22)
Commit-Executor: claude-opus-5 direct git (observed Cursor usage limit)
Co-authored-by: GoKubar <[email protected]>

* render-pipeline: typeset letter.cls — class \parskip, \opening/\closing skips, page-1 \@Texttop

Stacked on the re-pin that gives the pipeline `CBlock::LetterBlock`, which in
turn is stacked on #477 and blocked on #316. This is the third and last link of
the `letter` chain: #297 gave the class its page frame, #316 gave the compiler
the class's commands, and this makes the pipeline put the result where pdfLaTeX
puts it.

`fixtures/real-world/letter` was **218 words at 0% vertical accuracy**, the
worst whole-fixture failure in the corpus. Landing the compiler alone did not
move it: the class's commands parsed, and the page was still 93 bp out with
**0 of 227 aligned words within 0.5 bp on the vertical axis**. Four separate
things were wrong, and they had to be fixed in this order because each one hid
the next.

## 1. `\parskip` is a class length, and the pipeline never read it

`Stylesheet::from_resolved` copied `\parindent`, `\topskip` and `\maxdepth` out
of `flashtex-class-geometry` but not `\parskip`, so every document kept
`Stylesheet::article`'s `0pt plus 1pt`. For article/report/book that is
identical to what the class says, which is why nobody noticed. letter.cls line
91 sets `0.7em` — 7.66498pt rigid at 11pt — so **every paragraph gap in every
letter was 7.6 bp short**, and the error accumulated down the page.

This is a no-op for every other class: `class-geometry`'s article `\parskip` is
`Glue::new("0pt", "1pt", "0pt")` and `document-style`'s `PARSKIP` is
`Skip::new(0.0, 1.0, 0.0)`. A document's own `\setlength\parskip` (#473) is
applied later in `adapt_cached` and still wins.

Effect alone: vertical agreement after removing a rigid page shift, 26.4% →
85.0%; max |dy| 186.5 → 67.6 bp.

## 2. `\opening`'s blocks are one paragraph each, not one paragraph per line

The compiler hands over `lines: Vec<Vec<Inline>>` with the class's own skips
already resolved into `gap_before_pt`, `gap_after_pt` and `extra_gap_after_pt`
— all multiples of that `\parskip`. `lower_blocks` now spends them instead of
dropping them, and joins each run of lines with `Inline::LineBreak` into **one**
paragraph. That distinction is the whole structure: a `\\` inside a paragraph
costs `\baselineskip`, a new paragraph costs `\baselineskip` *plus* `\parskip`,
and letter.cls sets the address and the recipient as single `\\`-separated
groups (a `tabular{l@{}}` and a `{\raggedright ...\par}`). The one mid-block
gap, `\\*[2\parskip]` between `\fromaddress` and `\@date`, does split the
paragraph, so the `\vspace` carrying it has the next paragraph's own `\parskip`
taken out of it.

Effect: max |dy| 67.6 → 41.9 bp — by then a *rigid* offset, the whole page
uniformly too high.

## 3. `{\raggedleft ...}` is a declaration, not a `flushright` environment

The recipient and the closing are now plain paragraphs rather than `Styled`
ones. `letter.cls` writes them as `\raggedright` *declarations*, which carry
none of `\trivlist`'s `\topsep`/`\partopsep` (9pt + 3pt at 11pt); a `Styled`
block does, and it put both blocks 12pt too low. They are short, unwrapped
lines, where `\raggedright` and justification set identical text, so this is
the right vertical answer and the same horizontal one.

The return address must stay right-aligned, so it stays `Styled(FlushRight)`,
and the `env_close` pass — which gives any non-`Plain` paragraph
`\@endparenv`'s `\@topsepadd` on the assumption that it came from an
environment — now skips the paragraphs `lower_blocks` made from a letter block.
They are keyed by their first inline's span, not the block's, because
`\address`'s text comes from the **preamble** and lies outside `\opening`'s own
span entirely.

## 4. letter.cls's page-1 `\@texttop`

Line 405:

    \def\@Texttop{\ifnum\c@page=1\vskip \z@ plus.00006fil\relax\fi}

On page 1 only, a fil glue sits at the top of the text block. Line 404's
`\raggedbottom` — unguarded, unlike article's `\if@twoside\else\raggedbottom\fi`,
so a `[twoside]` letter gets it too, which `Stylesheet::from_resolved` now also
models — puts `\@textbottom`'s `\vskip \z@ \@plus.0001fil` at the bottom. The
page's leftover space is shared in the ratio of their stretch, so the top takes
3/8 of it and the first baseline moves down by that much.

`crates/class-geometry`'s `letter_oracle` documents this exactly and is why it
checks its frame model on page 2 and only bounds page 1: the shift is page
building, not a frame length, so it belongs here. Without it every letter's
page 1 rode 41.95 bp too high on this fixture — a rigid offset that held *0%*
of the page's words outside 0.5 bp however exactly the spacing between them was
set.

Effect: max |dy| 41.9 → 4.3 bp.

## Where `letter` now is

| | dx ≤ 0.5 bp | dy ≤ 0.5 bp | dy ≤ 0.5 after a rigid shift | max \|dy\| |
|---|---|---|---|---|
| before #316 | — | — | — | the page had no letter structure at all |
| #316 + re-pin only | 93.39% | **0.00%** | 26.43% | 186.46 bp |
| this PR | 93.39% | 3.96% | **89.43%** | **4.29 bp** |

Measured with `tools/visual-oracle/rank.py` against the pinned
`fixtures/real-world/letter/reference.pdf`. Line by line the address block is
within 0.39 bp, the whole body (17 of the 26 lines) within 1.37 bp, and nothing
is worse than 4.29 bp.

## What is still wrong, measured rather than hidden

Three residuals, each diagnosed and none of them silent:

* **2.92 bp** at the boundary into `\closing`. Its argument goes in a
  `\parbox` whose first line is a `\strut` and whose height drives the
  interline glue TeX chooses; the pipeline has no `\parbox` box model to hang
  that on.
* **0.98 bp** at the boundary out of `\opening`'s return address, which
  pdfLaTeX sets in a `tabular` whose last row carries `\@arstrut`'s
  `0.3\baselineskip` depth where a text line carries its glyphs'.
* Those two make our content 2.91 bp taller than the reference's between the
  first and last baseline, which feeds back through the `\@texttop` share above
  and leaves the whole page a uniform ~1.4 bp low. That is why `dy ≤ 0.5` is
  3.96% and not ~100%: the structure is right and the total height is not. Fix
  either box model and the axis should snap.

Horizontally, the one remaining item is `\longindentation`: the closing and
signature sit at the left margin instead of 180pt in (max |dx| 179.328 bp is
exactly that length). `Block::Paragraph` has no per-paragraph left offset or
measure, so it cannot be expressed yet; it keeps its typed `unsupported_block`
limitation naming the exact offset, as does the `\raggedleft` box whose lines
share a *left* edge where `flushright` aligns their right ones.

One more difference this PR does not fix and the new test records: this page
carries a folio and the reference does not, because `\opening` runs
`\thispagestyle{empty}` whenever `\fromaddress` is non-empty (letter.cls
170-176). That is a page-style event the compiler does not emit yet.

`crates/render-pipeline/tests/letter_class_geometry.rs` pins all four fixes
against the reference's own baselines, with a per-boundary tolerance that is
the measured residual rather than a margin chosen to pass — tightening those
numbers is the next lane's gate.

Verified with `FLASHTEX_FONT_DIRS`/`FLASHTEX_TFM_DIRS` set to the bundled
`apps/mac/Fonts`:

- `cargo test --release --no-fail-fast -p flashtex-render-pipeline`:
  **370 passed / 0 failed** (365 + the 5 new letter tests).
- amsmath oracle corpus `TOTAL 59/59 within 0.5 bp`;
  `tabular_oracle: 106/106 fixtures match pdflatex`.
- Real-world corpus, all 22 fixtures: page counts checked by counting
  `/Type /Page` leaf objects in each `reference.pdf` and in each produced
  `render.pdf` — **22/22** agree. Zero font-FAILURE diagnostics on either
  producer. HW1 and HW2: 3 pages, 0 errors.
- Full `tools/visual-oracle/rank.py` sweep of the corpus in
  `docs/evidence/visual-oracle-letter-after/`: no fixture regressed, and the
  21 non-letter fixtures are untouched by construction — the `\parskip` read is
  a no-op for their classes and the other two changes are gated on
  `ClassKind::Letter`.

Implementation-Agent: claude-opus-5 render-pipeline/letter lane (agent-a98bd88c4a9d49a22)
Commit-Executor: claude-opus-5 direct git (observed Cursor usage limit)
Co-authored-by: GoKubar <[email protected]>

* vendor: re-pin compiler to main c95977d (now that #316's letter class has landed)
@GoKubar
GoKubar deleted the integration/407-paragraph-rebased branch September 16, 2026 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant