The event contracts of Spec Kitty: the canonical vocabulary the Spec Kitty CLI and
runtime emit as a Mission moves through its lifecycle. This repository is the
event-contract surface of the Build Kitty
product line — the free CLI and its extension surface.
spec-kitty-events owns the CloudEvents-shaped envelope, the payload schemas for
every event family, the pure reducers that fold an event stream into state, the packaged
conformance fixtures, and the compatibility policy. It is a small, dependency-light
Python package with no runtime dependency on the CLI, so any system — a dashboard, an
analytics job, the Team Kitty dossier, a SaaS ingress — can validate, order and reduce
Spec Kitty events orthogonally, without coupling to the CLI's internals.
One envelope.Event is the single top-level envelope every family rides in: a
stable set of context fields (identity, ordering clock, project, schema version) carrying
an opaque, per-family payload.
Event families. Typed Pydantic payload models and event-type constants for mission
lifecycle, work-package status, review and audit, runtime observation, collaboration, and
semantics and analytics. See Event families.
Deterministic reducers. Pure functions that fold an ordered event stream into a frozen
state snapshot (mission state, work-package lanes, audit verdict, collaboration roster, …).
A fail-closed strict profile.validate_strict_envelope — an opt-in, deterministic
gate (STRICT_PROFILE_ID = "journal/v1") for the durable journal and TeamSpace ingress.
Conformance fixtures. Valid/invalid payloads, replay streams and golden reducer
outputs, shipped in the package so every consumer validates against one corpus.
The durable, governing contracts live in contracts/;
COMPATIBILITY.md is the public compatibility policy and the
authoritative version-and-compatibility reference.
Installation
Pin a released version (a v<version> tag), not a mainline commit — a package version
is frozen only when it is tagged, so main may still move an unreleased version
(versioning policy).
From PyPI (pin an explicit version — see COMPATIBILITY.md for the
current release and what a major bump means):
pip install "spec-kitty-events==11.3.0"
# with conformance-validation support:
pip install "spec-kitty-events[conformance]==11.3.0"
With uv, install the exact versions pinned by the committed
uv.lock — what CI and make test-fast / make test-full resolve against:
from spec_kitty_events.conformance import validate_event
result = validate_event(event.payload, "WPStatusChanged")
assert result.valid
Gate a full envelope fail-closed (durable journal / ingress)
from spec_kitty_events.strict import validate_strict_envelope
errors = validate_strict_envelope(event.to_dict())
assert not errors
More, including reducing a stream into state, is in
API & Contracts.
Versioning in one line
Two version numbers move independently: the package version (contract behaviour) and the
on-wire envelope schema_version (3.0.0, held stable across package majors). A change
is major if it flips the accept/reject boundary for any producer or consumer. The rules and
the required artifacts on a bump are in
contracts/versioning-and-compatibility.md.
Development
make test-fast # implementer blast-radius baseline
make test-full # whole suite with coverage (CI agent)
uv run pytest --pyargs spec_kitty_events.conformance # packaged conformance gate — every PR
ruff check . && ruff format --check . # lint