Skip to content

HMD-0031 — Authority and conformance

Which of the specification, the corpus, and the implementations decides what HyperMarkDown means, and what an implementation has to do to say it conforms.

The corpus names a canonical implementation

What the texts say. The specification's Status of this document says it does not describe any particular program, and that no program's behaviour overrides it. Its Conformance section says that where implementations disagree about behaviour the text leaves under-determined, the corpus decides. The corpus README says the Python package is canonical: where implementations disagree on a case, Python defines the correct answer. It also says every expected result was generated from that package and never written by hand.

Why it matters. Together these make Python's behaviour the language. A bug in the package is generated into an expected result, and the other two implementations are then required to copy it. The specification's claim to outrank every program holds only on paper.

Candidate resolutions.

  • The specification decides; no implementation is canonical. An expected result may be generated by a tool, but it is checked against the text before it is committed. A case that contradicts the prose is a defect in both, fixed in one change.
  • Python stays the tie-break, for under-determined behaviour only. Canonicity becomes a rule for settling what the text does not say, and the README says so. The arbitration logic of the drift ledger stays as it is.
  • Keep it as it is, and state in the specification that the canonical implementation decides wherever the corpus is silent.

The corpus compares an implementation's wording

What the repository does. The TypeScript runner compares each diagnostic's message, and every expected.json holds Python's English sentence. The specification requires a message but does not fix its words.

Why it matters. It is a small instance of the larger finding: the contract contains something the specification never promised, and it came from one implementation. A third implementation would have to reproduce another's prose to pass.

Candidate resolution. The corpus compares a public projection — rule, severity, path, line, column, and candidate list — and never the message. See corpus.hmd.

One kind of conformance, which the Rust crate cannot meet

What the text says. A conforming implementation MUST accept every well-formed document, MUST assign it its meaning, and MUST report every listed diagnostic with its identifier and severity. Rendering adds constraints on anything that renders.

Why it matters. The Rust crate is a resolver by design: it neither checks nor renders. Under the current text it cannot conform, although the corpus already runs it against resolutions alone. An editor's syntax highlighter, a parser library, and a site builder have different jobs too, and a single bar would force each to build the others' to claim conformance.

Candidate resolution. Classes, each claimed separately:

Class Does Tested by
Resolver Scans cards; resolves every reference and fragment resolutions, construct spans
Checker A resolver that also reports every listed diagnostic adds diagnostics
Publisher A checker that also expands embeds, applies visibility, and meets the rendering constraints adds expansions and the publication cases

A document conforms if it is well-formed by the grammar, which is a property of a card, not of a program.

Open questions

  • Does any implementation stay canonical, and if so, for what?
  • Are expected results generated and then reviewed, or written by hand?
  • Are the three classes the right split, and does a publisher have to be a checker, or only a resolver?
  • Is the class an implementation claims recorded in its tracker, in its README, or in the corpus runner?