ADR 0046: State which CSL data survives, which is preserved verbatim and which is reported lost
- Status: Accepted
- Date: 2026-10-25
- Decision issue: #40
- Parent story: #19
- Parent epic: #15
- Builds on: ADR 0012, ADR 0042
- Contract: Citation format
Context#
CSL JSON is the exchange format for references and for citation items. Neither side can store everything the other holds, and silently dropping data would break trust in an import.
Decision#
Reference data keeps ADR 0012 and gains one lookup, csl_field_fate, so the policy has a
single readable source:
| Fate | Fields | Behaviour |
|---|---|---|
| stored, normalised | id | normalised to a source identifier as in ADR 0012 (Smith2003 becomes smith2003; an id with no ASCII slug becomes a csl- digest) and exported as that identifier |
| stored | title, language, issued, author, editor, translator, DOI, ISBN, ISSN, URL, PMID, PMCID, custom | mapped to library fields and exported again; round-trips |
| preserved | type (other than document) and variables with no library field (publisher, container-title, volume, ...) | kept verbatim under the record's csl field, text or number only |
| private-dropped | note, abstract, annote, keyword | never stored and reported, so they cannot reach a public artifact |
| unsupported | anything else | not stored; the import plan reports it with a reason |
Citation items map to CSL's label and locator:
- Kinds
page,folio,line,section,chapterandtimestamphave the same CSL label.canonicaland otherx-kinds have none;x-csl-kinds write back their kept label. - CSL has one locator per item. Export writes the first locator, reports each thing CSL cannot
carry (further locators, a kind with no label, the range structure, since CSL writes a range as
one text) as a loss, and writes the full ordered list in
openblog-locators, which CSL processors ignore. Import restores that list when its first locator still agrees withlabelandlocator; if someone edited those elsewhere, CSL wins and the disagreement is reported. - A CSL label with no matching kind is kept as an
x-csl-<label>extension kind, not dropped, and export writes it back as thatlabel. The current CSL schema spells the sub-verbo labelsub-verbo, which is kept asx-csl-sub-verboand round-trips exactly; export always writessub-verbo. The legacy spellingsub verbo(CSL 1.0.1) is accepted on import as an alias of the same kind, and the respelling is reported as a loss. A kind cannot hold a space, so any other label with spaces is kept with hyphens and the respelling is reported. An item without a label is apagelocator, as CSL specifies. prefix,suffix,suppress-author,author-only, embeddeditemDataand any other field are reported and not stored. The library stays the only source of reference data. An item'sidis normalised exactly as a reference import normalises it (derive_id), so a citation ofSmith2003names the source imported assmith2003; a changed id is reported as a loss.- Nothing contacts a service, and no style is rendered.
Consequences#
- An import never loses data without saying so, and an export-then-import of a citation is lossless for open.blog.
- Another tool can read the first locator and ignore the rest, at the cost of the listed losses.
- Supporting grouped citations, prefixes or suffixes later is additive.
Domain language#
Citation, Locator and Reference are defined in CONTEXT.md.