Skip to content

API & Contracts

This section is the surface a consumer depends on: how to emit a well-formed envelope, validate a payload, reduce a stream, gate a durable record, and know what a version number promises. The event families the payloads belong to are in Event families; this section is the machinery around them.

The normative contract lives in code (src/spec_kitty_events/) and in the repository-root contracts/ policy files. These pages explain and link to them; where a page summarises a durable contract, that root file governs.

Pages

  • The envelope — Event, the single top-level envelope every family rides in, and each of its context fields.
  • Service APIs — the mission-status read service and mission-write write service, the service-v* line they ship on, and their OpenAPI reference pages.
  • The Python package — the import surface: emitting, validating, reducing, and loading JSON Schemas and conformance fixtures.
  • Lane vocabulary — the canonical Lane enum, the display subset, and why a lane change is always a major bump.
  • Versioning & compatibility — the two version numbers, what makes a change major, and the artifacts a bump must ship.
  • Ledger write contract — persistence.append_event, the fail-closed, fixture-pinned append to a local JSONL ledger, unclocked envelopes, and the removed LOCAL_ONLY_EVENT_TYPES.
  • The strict profile — validate_strict_envelope, the fail-closed gate for the durable journal and TeamSpace ingress.
  • Consumer contract: mission dossier events (v2.4.0) — the archived 2.4.0 dossier contract and the current review-rejection backward-transition family.

The three operations a consumer uses

OperationEntry pointWhen
Validate a payloadspec_kitty_events.conformance.validate_event(payload, event_type)checking one event’s payload against its contract
Gate a full envelopespec_kitty_events.strict.validate_strict_envelope(envelope)admitting a row to the durable journal / ingress
Reduce a streama family reducer, e.g. reduce_status_events(events)folding an ordered stream into state

See The Python package for worked examples of each.