0001: Convergence over byte-losslessness

Status

Accepted (2026-09-10)

Context

morg converts between Markdown and Org-mode in both directions. Strict byte-losslessness (convert(convert(x)) === x for arbitrary input) is impossible: the formats disagree on syntax choices (bullet markers, emphasis markers, link styles) and each has constructs the other lacks. A correctness criterion weaker than byte identity but strong enough to trust for a canonical second-brain store was needed.

Decision

The guarantee is convergence after one round trip, both directions:

Semantic losslessness is layered on top: md→org stores md-isms as org properties; org→md serializes org-isms as key:: value conventions. Canonical form is defined by the default stringifier settings of the underlying libraries; exposing formatting knobs as flags is possible later without weakening the guarantee, since canonical form is then parameterized by those settings.

Consequences