Skip to content

Two-channel fidelity: harmonised semantic construct vocabulary plus a quarantined residue channel #22

Description

@Mearman

Each codec's README documents what its format carries that the content model drops. This issue replaces those implicit, per-repo caveats with one explicit, two-channel model -- and defines "full fidelity" as three testable tiers.

Channel 1 -- semantic constructs as first-class nodes, in one harmonised vocabulary (no format-specific node kinds ever):

  • contentControl -- docx SDTs, PDF form widgets: a typed container of content.
  • field -- docx fldChar/instrText ranges, ODF field masters: instruction plus cached result, extent as containment rather than marker pairs.
  • anchor -- docx bookmarks, ODF text:bookmark, markdown footnotes: a named extent wrapping its content.
  • link -- hyperlinks and PDF link annotations: target plus wrapped runs.
  • provenance -- tracked changes (w:ins/w:del, text:tracked-changes): author/date wrappers around content.

A construct with no cross-format analogue (docx SDT with no ODF counterpart, ODF xforms with no OOXML one) does not get a bespoke node: it degrades to the nearest generic node with the specifics in the residue channel, decided once and documented. The tree is organised by what documents mean; the residue channel is how a format serialises.

Channel 2 -- quarantined residue: a per-node and package-level source: { format, xml } field, schema-validated as opaque text, never semantically interpreted, carrying what has no cross-format meaning (mc:AlternateContent internals, custom XML stores, proofing marks, raw HTML blocks in markdown). This generalises existing practice: starMath beside canonical MathML on ContentFormula, styleId's opaque source names, sourcePath traceability.

The three tiers, made precise:

  • Semantic fidelity: every translatable construct survives as a first-class node, so cross-format conversion loses no meaning.
  • Restorable fidelity: same-format re-emission rebuilds from semantic nodes plus residue, verified by round-trip tests over the corpus.
  • Byte fidelity: the edit model's job (live views over raw XML), for any format, forever. No semantic pivot achieves byte identity; the model does not pretend otherwise.

The construct verdicts (semantic / residue / derivable -- derivable meaning recomputable and dropped without loss, e.g. pivot caches, statistics parts) are recorded per format in the four inventory issues: ooxml.js, odf.js, markdown-codec, pdf-codec. Those lists feed this vocabulary; this issue blocks on them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions