Skip to content
LITHOEN

Evidence platform and governance

Document

ADR-0015: Visual assets, with rights as a publication precondition

Repository path
docs/decisions/ADR-0015-visual-asset-architecture.md
Size · SHA-256
2.5 KB · 3eff370c8193b9626ba3f491d13ad8cec739dc13cee09bd20fd110b672174e8e

Status: accepted (2026-09-06)

Context

Phase 2 is the first phase to publish images. An Earth-science platform without photographs, thin sections and diagrams is teaching with one hand tied; a platform that publishes images whose licences it has not read is a liability.

Decision

A first-class VisualAsset record with rights, file identity and scientific meaning all mandatory, and a publication gate that refuses anything incomplete.

Rights. rights.status has three values — VERIFIED, UNVERIFIED, REJECTED — and no value meaning "probably fine". VERIFIED means a human opened the recorded source page and read the licence there. Licences are an allow-list: a licence not on it is one Lithoen has not decided how to honour, and the gate refuses it. Attribution-bearing licences require a creator, an attribution line and a licence URL, all rendered from the record so that an obligation met on one page cannot be dropped on another.

Files. Assets are stored locally, never hotlinked. Every record carries a SHA-256, byte size, dimensions and MIME type, and the filesystem gate re-derives all four from the bytes. Downloaded files are treated as untrusted input: the bytes decide the type, not the extension, and an SVG carrying script, event handlers, foreignObject, external references or entity declarations is refused outright rather than sanitised.

Meaning. Every asset must name at least one entity it depicts and must carry alt text before it can publish. Original Lithoen diagrams must additionally cite the claims whose content they draw, so a diagram cannot assert something the corpus does not. Schematics are flagged and labelled as such to the reader; a derivative must record what was done to it and keeps a link to the original.

Consequences

  • Acquisition is a tool (scripts/acquire-visual.ts) that verifies before it downloads and refuses more often than it succeeds. During Phase 2 it refused a CC BY-SA 2.5 image because 2.5 is not on the allow-list — correct behaviour, not a bug to be worked around.
  • Publication renditions are requested from the source's own API and recorded as derivatives with the transformation stated, so a 7 MB original is neither shipped to readers nor silently substituted for.
  • Writing the safety tests found a real hole: the SVG patterns matched <foreignObject> but not <foreignObject/>. The gate was hardened rather than the test relaxed.