Report unsupported environments and leaked commands

This commit is contained in:
gloamxun committed 2026-10-26 00:31:43 +08:00
1 parent c9a074b1fe
commit a28e8926c7
4 files changed
+177 -10

No files matched your search

+4 -2
View File
@@ -48,8 +48,10 @@ floats (`\floatsep`, `\textfloatsep`, `\intextsep`, `\topfraction`,
`\bottomnumber`, `\totalnumber`), insertion classes (`\skip`, fraction and
absolute limits, splitting), marks, Rust output hook, multi-page PDF, and the
route-D service endpoints (`/api/route-d/preview|pdf|edit`, project preview and
PDF opt-in with `?engine=route-d`). 802 workspace tests are green and no oracle
fixture is ignored.
PDF opt-in with `?engine=route-d`). 804 workspace tests are green and no oracle
fixture is ignored. Preview JSON also carries a `warnings` array naming
environments route-D cannot lay out and control words that survived layout, so
unsupported source is reported instead of being silently typeset.
Status after G1 (P0-P2): the paragraph model reproduces TeX's passes,
demerits and paragraph registers, the paged builder implements the page
+4 -4
View File
@@ -367,7 +367,7 @@ Math coverage includes fractions/roots, scripts, `\left...\right` with body-scal
Paragraph units carry a `ParagraphFont`; `Unit::paragraph_with_face` and `Unit::paragraph_with_style_and_face` select Roman, bold, italic, mono, or sans. The corresponding Computer Modern TFM (`cmr10`, `cmbx10`, `cmti10`, `cmbxti10`, `cmtt10`, `cmss10`, `cmssbx10`, `cmssi10`, `cmcsc10`) supplies advances, kerns, ligatures, and italic correction for layout, the display list selects the matching face, and the PDF writes Computer Modern Type1 outlines for each built-in face (`cmr10`/`cmbx10`/`cmti10`/`cmbxti10`/`cmtt10`/`cmss10`/`cmssbx10`/`cmssi10`/`cmcsc10`, plus `cmmi10` for mathematical italic letters, `cmsy10` for math symbols and `cmex10` for big operators), falling back to Liberation subsets only for characters the Type1 encodings cannot address; those fallback glyphs keep their Unicode text under PDF extraction, so accented and Greek words round-trip; Type1 faces carry a ToUnicode CMap built from the requested characters, so glyphs whose names are ambiguous in the Adobe Glyph List (capital Omega, which would otherwise extract as U+2126) keep their intended code points. `Engine::edit` preserves the face when reflowing an edited paragraph.
The crate currently has 411 unit tests plus ten route-D integration tests and thirty-five oracle fixtures. Workspace verification: `cargo fmt --all -- --check`; `cargo test --workspace --offline` runs 802 tests (414 route-D unit, 207 engine binary unit, 10 route-D integration, 35 oracle, 71 v1 integration, 60 server, 4 engine unit, 1 core unit), with none ignored. v1 remains the live server path.
The crate currently has 414 unit tests plus ten route-D integration tests and thirty-five oracle fixtures. Workspace verification: `cargo fmt --all -- --check`; `cargo test --workspace --offline` runs 804 tests (414 route-D unit, 209 engine binary unit, 10 route-D integration, 35 oracle, 71 v1 integration, 60 server, 4 engine unit, 1 core unit), with none ignored. v1 remains the live server path.
### M0 incremental demo
@@ -414,8 +414,8 @@ Residual approximations, documented rather than special-cased:
### G2 audit (M3-M7)
The `M3`-`M7` stage of the roadmap is implemented to the extent recorded below.
The goal ran for 90 rounds and landed 123 commits (`8c42f2d..7350fb7`); the
workspace suite is at 802 tests.
The goal ran for 90 rounds and landed 123 commits (`8c42f2d..c9a074b`); the
workspace suite is at 804 tests.
| Milestone | Evidence |
| --- | --- |
@@ -423,7 +423,7 @@ workspace suite is at 802 tests.
| M4 math | Computer Modern math metrics (cmmi/cmsy/cmex/msbm/eufm) embedded as Type1 outlines, TeX's 3/4/5mu class table, `\mid`/`\colon`, `\mskip`-family dimension scans, `\frac` and infix fraction forms, `\left`/`\right`/`\middle` and `\big` CMEX sizing, `align`/`gather` row layout with per-row tags, equation numbering with `\eqref`/`\ref`/`\tag`/`\notag`, math alphabets (`\mathbf`/`\mathit`/`\mathsf`/`\mathtt`/`\mathcal`/`\mathbb`/`\mathfrak`) and wide-display line splitting. |
| M5 fonts | twelve Computer Modern text programs (roman/bold/italic/bold-italic/mono/sans/sans-bold/sans-italic/small-caps/slanted/bold-slanted/mono-italic) plus four math programs, all embedded as Type1 with TFM widths; NFSS declarations, legacy switches, paragraph/inline runs with relative composition, per-run base sizes, superscripts/subscripts, accent composition, case commands, per-glyph Liberation fallback and Type1 ToUnicode CMaps. |
| M6 class execution | article size options and `\linespread`, title/author/date and `\maketitle`, five-level sectioning with counters, TOC and float lists with page numbers and dot leaders, floats and in-text graphics with `\includegraphics` sizing/`\graphicspath`, footnote insertions, `thebibliography`/`\cite`, theorem environments and `\newtheorem`, nested lists with article skips and hanging indents, `quotation`/`quote`/`verse`, `minipage`, `\today`, page numbering, label/counter renaming, and preamble macro execution (`\newcommand`/`\def`/`\let`/`\newenvironment`/`\newif`/`\newlength`/`\newcounter`). Project `.cls`/`.sty` files are inlined with `\DeclareOption`/`\ProcessOptions`/`\ExecuteOptions`, `\LoadClass` inheritance, recursive `\RequirePackage`, local `\input`, `\AtBeginDocument` hooks and `\PassOptionsToClass`/`\PassOptionsToPackage`. |
| M7 service | route-D preview/PDF/edit endpoints and the `?engine=route-d` project switch, `TEXRRA_ENGINE` default, memoised project previews/PDFs (source and image bytes in the key), flat endpoint caches with FIFO eviction and concurrency coverage, JSON 422 errors, PDF `/Link` annotations from `\href`, and per-glyph Unicode extraction. |
| M7 service | route-D preview/PDF/edit endpoints and the `?engine=route-d` project switch, `TEXRRA_ENGINE` default, memoised project previews/PDFs (source and image bytes in the key), flat endpoint caches with FIFO eviction and concurrency coverage, JSON 422 errors, PDF `/Link` annotations from `\href`, per-glyph Unicode extraction, and a `warnings` array in preview JSON that reports unsupported environments and control words that survived layout instead of failing silently. |
Residuals are deliberate and documented rather than template special cases: