Skip to content

CrumblES ADR-003: The SDK Checks That Event Data Is a JSON Object

Accepted — 2026-11-03. Issue #21 requires the check in the SDK. Where the check sits inside the SDK is a choice of the implementation.

This record concerns the implementation, CrumblES. The specification stays unedited. It adds to CrumblES ADR-001, whose decision 1 stays in force.

The record schema of the specification (section 6.2) says that data is a JSON object, at requirement level MUST. CrumblES ADR-001 decision 1 says that the entities and the use cases hold data as opaque bytes, and that the store does not parse, validate or index them.

So the command-line program made the check while it parsed its input. Each other caller of CrumblES would have to copy that check. The CrumblES SDK, the library crumbles_sdk, is the one programming interface for every caller, so the check moves there.

  • data stays opaque bytes in the entities and the use cases. Decision 1 of CrumblES ADR-001 stays as it is.
  • Event::new in the SDK rejects data that is not one JSON object. It checks nothing else: the entities still check the event type and the tags, at the append.
  • The check keeps the bytes of the object as given. Whitespace inside it, duplicate keys and the spelling of numbers survive. Whitespace around the object does not reach the store, as the Git translation writes the JSON value alone.
  • A read does not check. Another writer can store data that is not a JSON object, so SequencedEvent holds the data as stored and does not contain an Event.
Specification CrumblES
Record schema (section 6.2): data is a JSON object, requirement level MUST The SDK enforces it for every event appended through the SDK. A writer that does not use the SDK can still store other data, and a read yields it.

Store::append checks, and the SDK also offers a check function. Rejected: each front end would have to remember to call the function to keep its error order, and the Store would interpret the data.

The entities check. Rejected: it contradicts CrumblES ADR-001 decision 1, and it ties the inner packages to one serialization.

The check also covers the event type and the tags. Rejected: the command-line program reports a bad tag after it opens the store, so the order of its errors would change.

  • Each caller of the SDK gets the check of section 6.2.
  • A value that fails the check cannot reach an append, so Store::append has no such error.
  • The command-line program calls Event::new while it parses its input, so the order of its errors stays.
  • A caller builds an event through a function that can fail, even for a caller whose data is always valid.
  • The data is parsed once more at the append, because the Git translation checks that it is one JSON value.

Git Event Store is an independent open specification for an event store that uses Git as its storage component. It is not affiliated with or endorsed by the Git Project or Software Freedom Conservancy. Git and the Git logo are either registered trademarks or trademarks of Software Freedom Conservancy, Inc., corporate home of the Git Project, in the United States and/or other countries.

Git Event Store is not affiliated with or endorsed by Kurrent, the maker of KurrentDB (formerly EventStoreDB). "Event store" is used here as the generic name of the event-sourcing storage pattern.