Settles the transform-placement question left open in #563: parse at the format edge, lower at the model level, so every input format that can carry LaTeX benefits from one lowering implementation rather than it living inside markdown-codec.
Pipeline, once the schemas land (blocked by ExaDev/document-schema.js#15):
- Pinned parser (temml as a dependency or a port — the one component genuinely not worth hand-writing; the pin itself is recorded so string storage has one defined meaning).
- Lowering rules from the presentation tree to
MathExpression: mechanical where notation is unambiguous (\frac to math:divide, radicals to math:sqrt, Σ with limits to a sum binder, subscripts to distinct symbol identities through the symbol table, superscripts to math:pow unless the table says the glyph pair is one symbol).
- Context-starved constructs (juxtaposition, overloaded glyphs, domain conventions) degrade to
unparsed plus a diagnostic — visible, curable later through the round-trip-safe semantic editing the schema defines, never a silent guess.
- Symbol-table construction from document prose ("where R is the resistance per unit length..."), which is where equations acquire computability at all.
- The coherence lint: re-parse the stored presentation string, re-run the lowering, compare with stored content. Divergence is a warning backed by provenance (someone edited a layer deliberately), never an automatic re-derivation.
Coverage over real-world notation is measurable against any source with printed ground truth.
Settles the transform-placement question left open in #563: parse at the format edge, lower at the model level, so every input format that can carry LaTeX benefits from one lowering implementation rather than it living inside markdown-codec.
Pipeline, once the schemas land (blocked by ExaDev/document-schema.js#15):
MathExpression: mechanical where notation is unambiguous (\fractomath:divide, radicals tomath:sqrt,Σwith limits to asumbinder, subscripts to distinct symbol identities through the symbol table, superscripts tomath:powunless the table says the glyph pair is one symbol).unparsedplus a diagnostic — visible, curable later through the round-trip-safe semantic editing the schema defines, never a silent guess.Coverage over real-world notation is measurable against any source with printed ground truth.