Files
wordcraft/ROADMAP.md
T
02e2a51bb4 LaTeX (.tex) import and export (#7) (#11)
* LaTeX (.tex) import and export (#7)

Open and save LaTeX source as a document format, next to Markdown and
HTML. Export writes a standalone article (fontenc, ulem, xcolor,
multirow, amsmath, hyperref, loaded only when used): unnumbered sections,
itemize/enumerate, quote, center/flushright, verbatim, tabular with the
document's column widths and merged cells, equations as $..$ / \[..\],
character formatting, colours and links; metadata goes to \hypersetup.
Import reads the everyday subset: preamble \title/\author, sectioning
(\part/\chapter shift levels), paragraphs, lists with labels, quote,
alignment environments, verbatim-like environments, tabular with
\multicolumn/\multirow/\cellcolor and p{} widths, inline and display
math, formatting commands and declarations, colours, links, refs,
citations, footnotes, accents, TeX ligatures and special characters.
Unknown commands keep their arguments' text; layout and definition
commands are dropped with their arguments. Nesting is depth-limited and
input is capped, so hostile files can't overflow the stack.

The flow model gains an Equation inline so equations survive LaTeX round
trips; the other text formats write their linear text as before.

Wired into open/save dispatch, the file dialog filter, Backstage Export,
the web app, CLI/MCP help, docs and the Linux desktop entry.

Fixes #7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019FczntrDNYd6DupyBdpbL5

* #7: bound LaTeX column specs and equation export (review)

- spec_widths: `*{n}{…}` repeats recurse with a depth argument and stop at
  MAX_NEST, so a deeply nested column spec no longer overflows the stack or
  exhausts memory. Column counts saturate and widths stop at MAX_COLS.
- Column specs read from the source are capped at MAX_SPEC (4096) chars.
- balanced() looks groups up in a table of closers built in one stack pass,
  so linear_to_latex no longer rescans to the end of the string for every
  unmatched `(` (quadratic: 50k took seconds). spec_widths uses it too.
- env_name restores the position when `\begin{` / `\end{` has no `}`
  within 64 chars, so the `{` is no longer lost.
- Regression tests: the 100k-deep `*{1}{` spec and a 200k-`(` equation in
  deep_nesting_is_bounded; unclosed_begin_keeps_its_brace and
  spec_widths_repeats_are_bounded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LyVbT6Vv4BwWZ4hY8973qD

* #7: linear-time labels, brackets and \begin{; no commands from the document in exports

Applies @HaringIbon's review suggestions:

1. Parser::anchor keeps at most MAX_ANCHOR_RUN (64) bookmarks in a row with
   no text between them; text() looked back past every one, so a file of
   labels imported in quadratic time. Labels separated by text are all kept.
2. linear_to_latex_at checks for the `/` of a fraction before copying the
   group out, so deeply nested matched brackets export in linear time.
3. env_name searches only the next 65 bytes for `}`, so a run of unclosed
   `\begin{` imports in linear time.
4. An equation's `\name` is written as a command only when it is a known
   symbol, function or font/spacing command (MATH_COMMANDS); anything else
   becomes `\backslash name`. Two carets are never written side by side in
   equations or anchor names, since TeX reads `^^5c` as a backslash. Compiling
   an export can no longer `\input` files or `\write18` named by the document.

Regression tests: three cases added to deep_nesting_is_bounded, plus
latex_export_carries_no_commands_from_the_document and
latex_labels_in_a_row_are_read_in_linear_time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LyVbT6Vv4BwWZ4hY8973qD

* Merge follow-ups: FTable.borderless (from #102) in the LaTeX importer; rustfmt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-10 06:57:01 -04:00

7.4 KiB
Raw Blame History

WordCraft roadmap

WordCraft aims for complete feature parity with Microsoft Word, then goes further on speed, openness and agent control. This file tracks where we are honestly. Generated numbers come from cargo xtask parity (docs/parity.md).

Where we are (2026-10-09)

Measure Value
Commands (every action, scriptable by CLI/MCP/control channel) 390
Feature catalog coverage (Word ribbon/menu features with a command) 355 / 405 (88%)
Estimated real feature parity (depth and fidelity, not just a command) ~62%
Distance to alpha ~85% of the way; ≈20–25 h of Claude wall-clock work
Distance to 100% parity ≈120–150 h of Claude Opus 5.5 wall-clock work (with parallel agents)
Tests ~225 test functions (unit, round-trip, fuzz/proptest, MCP acceptance)
Layout speed (188-page document) 61 ms cold, 1.4 ms relayout after an edit
Code ~44k lines of Rust in 12 crates and 3 apps

Catalog coverage overstates parity: many commands are first versions. The real-parity estimate weighs each area by how much of Word's behaviour it reproduces, and by how often people use it.

Alpha

What we mean by alpha: someone can write, format and review real documents every day, open the .docx files they receive and send back files Word opens cleanly, on every desktop platform from a signed download, without losing work.

Alpha requirement State
Editing, formatting, styles, lists, tables, headers/footers, references, review done (first versions, tested)
Pagination fidelity: wrap, row splitting, hyphenation, drop caps, line numbers, borders done this arc
Comments in margin balloons, track changes done
Never-crash standard (no panics, hostile-param fuzzing, panic guard) done
Autosave and crash recovery done; needs a soak test
DOCX fidelity against a corpus of real-world files (open, render, round-trip, fix) not started — the main alpha blocker (≈10 h)
Footnotes that continue onto the next page; column balancing missing (≈4 h)
Native printing (today printing goes through PDF) missing (≈4 h)
Signed builds for macOS, Windows, Linux, FreeBSD and web pipeline written; needs the GitHub remote and release secrets from the owner
Real app icon / mascot art placeholder; needs owner art

So: alpha is roughly 85% of the way, with about 20–25 hours of agent work left, plus two owner actions (push to github.com/storytold/wordcraft and enable the release secrets, and supply the icon art).

Parity by area

Area Status Parity
Typing, selection, clipboard, undo, find/replace Solid; IME, autocorrect, smart quotes, list autoformat 85%
Character & paragraph formatting Nearly all properties; Font/Paragraph dialogs 85%
Styles (gallery, pane, create/modify, style sets, themes) Good 75%
Lists (bullets, numbering, multilevel, restart, set value) Good 75%
Tables (insert, merge/split, styles, borders, header rows, sort, formula) Good; rows split across pages; no drawn tables, no nested-table polish 72%
Page layout (margins, size, orientation, columns, breaks, sections) Good; page borders, line numbers, vertical alignment, drop caps, hyphenation; columns don't balance 72%
Headers/footers, page numbers, fields Good; first/even/odd, link to previous 70%
Footnotes/endnotes Placed and editable; long notes don't continue onto the next page 60%
References (TOC, citations APA/MLA/Chicago/IEEE, bibliography, index, figures, cross-refs, TOA) Working first versions 60%
Review (spelling, grammar, thesaurus, comments, track changes, compare, protect) Good; comment balloons in the margin; no track-changes balloons 75%
Mailings (mail merge, rules, preview, envelopes, labels) Working 70%
Pictures & shapes (insert, size, crop, recolour, effects, styles, float position) Text wraps around floats (rectangular); text boxes render their text; no tight/contour wrap, no rotation handles 55%
Draw tab (ink), SmartArt, charts, 3D models, equations editor Not started / linear equations only 5%
File formats: DOCX read/write Good (Word opens our files); charts/SmartArt/OLE dropped; untested on a real-world corpus 75%
File formats: PDF, ODT, RTF, HTML, Markdown, LaTeX, TXT Working 70%
View modes (print, web, draft, read, focus, zoom, navigation pane) Working 70%
Backstage (new from templates, open, info, export, options) Working; printing goes through PDF 55%
Agent control (CLI, MCP, control channel, macros) Beyond Word 100%+

Estimate to 100%

About 120–150 hours of Claude Opus 5.5 wall-clock work (with parallel agents), in this order:

  1. Alpha blockers (≈20–25 h): DOCX fidelity corpus, footnote continuation, column balancing, native printing, autosave soak test, first signed release.
  2. Objects (≈15 h): tight/through (contour) wrap, rotation and resize handles on the canvas, grouping, z-order polish, track-changes balloons and formatting revisions.
  3. Draw tab / ink (≈15 h).
  4. Charts (own renderer) and SmartArt-style diagrams (≈20 h).
  5. Equation editor (OMML read/write, 2D layout) (≈15 h).
  6. Dialog depth: every Word dialog with all its options (Font, Paragraph, Tabs, Borders and Shading, Page Setup, Styles, Columns, Index/TOC options, Mail Merge wizard, Options panes) (≈20 h).
  7. Accessibility (screen readers), localisation, RTL and complex scripts (≈15 h).
  8. Long tail: kerning/ligature options, drawn tables, nested-table polish, more templates, Word's less-used commands still missing from the catalog (≈10 h).

Milestones

# Milestone State
M0 Skeleton + vertical slice (model, layout, render, engine, Word-style UI, CLI, MCP, web) done
M1 DOCX I/O done (first version; corpus testing next)
M2 Home tab complete done
M3 Insert tab mostly done (charts/SmartArt/icons/3D missing)
M4 Layout + Design tabs done except column balancing
M5 Tables done (row splitting landed)
M6 References first version done; footnote continuation missing
M7 Review done (margin balloons landed)
M8 View mostly done
M9 Mailings done (first version)
M10 File/Backstage mostly done; native printing missing
M11 Draw + objects text wrap and text boxes done; ink, rotation, grouping missing
M12 Formats breadth (PDF, ODT, RTF, HTML, MD, TXT) done (first versions)
M13 Performance budgets on track (1.4 ms relayout)
M14 1.0 polish, packaging, signing pipeline written; waiting on remote and secrets

Recently landed

  • Brazilian Portuguese interface catalog: all existing 771 labels, pt-BR locale detection and a persisted language choice (#127).
  • Text wraps around floating pictures and shapes; text boxes lay out their own text.
  • Table rows split across pages between lines (Can't Split honoured, header rows repeat).
  • Drop caps; automatic hyphenation with Word's 0.25" hyphenation zone; soft hyphens.
  • Page borders measured from the page edge, line numbers, vertical alignment, column separators.
  • Comment balloons in a markup area beside each page, with leader lines to their anchors.

Next

The DOCX fidelity corpus, then footnote continuation, column balancing and native printing.