Event log library with Lamport clocks and systematic error tracking
Project description
spec-kitty-events
Canonical event contracts for Spec Kitty mission state, mission runtime, conformance, and replay.
Version: 3.0.0 | Cutover Contract: 3.0.0 | Python: >=3.10
What Changed In 3.0.0
3.0.0 is a breaking mission-contract cutover release.
- Mission identity fields are canonicalized to
mission_slug,mission_number, andmission_type. - Event envelopes require
build_idand use the cutover signalschema_version="3.0.0". - Live ingestion is fail-closed. There are no runtime compatibility aliases for legacy mission-domain fields.
- Legacy mission-domain keys and names such as
feature_slug,feature_number,mission_key,FeatureCreated, andFeatureClosedare rejected on live paths.
See COMPATIBILITY.md for the exact fail-closed rollout policy.
Installation
From PyPI:
pip install "spec-kitty-events>=3.0.0,<4.0.0"
With conformance validation support:
pip install "spec-kitty-events[conformance]>=3.0.0,<4.0.0"
Development install:
git clone https://github.com/Priivacy-ai/spec-kitty-events.git
cd spec-kitty-events
pip install -e ".[dev,conformance]"
Contract Highlights
Eventis the canonical top-level envelope.build_ididentifies the build that emitted the envelope.node_ididentifies the emitting node within that build.schema_versionis the on-wire compatibility signal. Live envelopes must use3.0.0for this release.StatusTransitionPayloadusesmission_slugfor mission identity.- Mission catalog payloads use
mission_slug,mission_number, andmission_type. - Mission runtime payloads use
mission_type; they do not acceptmission_key.
Quick Start
Emit a Canonical Event Envelope
import uuid
from datetime import datetime
from spec_kitty_events import Event
event = Event(
event_id="01ARZ3NDEKTSV4RRFFQ69G5FAV",
event_type="WPStatusChanged",
aggregate_id="mission/WP01",
payload={
"mission_slug": "mission-001",
"wp_id": "WP01",
"from_lane": "planned",
"to_lane": "claimed",
"actor": "ci-bot",
"execution_mode": "worktree",
},
timestamp=datetime.now(),
build_id="build-2026-04-05",
node_id="runner-01",
lamport_clock=1,
project_uuid=uuid.uuid4(),
correlation_id="01ARZ3NDEKTSV4RRFFQ69G5FAV",
schema_version="3.0.0",
)
Validate a Payload Against the Canonical Contract
from spec_kitty_events.conformance import validate_event
payload = {
"mission_slug": "mission-001",
"wp_id": "WP01",
"from_lane": "planned",
"to_lane": "claimed",
"actor": "ci-bot",
"execution_mode": "worktree",
}
result = validate_event(payload, "WPStatusChanged")
assert result.valid
Validate a Full Envelope With Fail-Closed Cutover Checks
from spec_kitty_events.conformance import validate_event
envelope = {
"event_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"event_type": "WPStatusChanged",
"aggregate_id": "mission/WP01",
"timestamp": "2026-04-05T12:00:00Z",
"build_id": "build-2026-04-05",
"node_id": "runner-01",
"lamport_clock": 1,
"project_uuid": "12345678-1234-5678-1234-567812345678",
"correlation_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"schema_version": "3.0.0",
"payload": {
"mission_slug": "mission-001",
"wp_id": "WP01",
"from_lane": "planned",
"to_lane": "claimed",
"actor": "ci-bot",
"execution_mode": "worktree",
},
}
result = validate_event(envelope, "WPStatusChanged", strict=True)
assert result.valid
Schemas And Conformance
- Committed JSON Schemas are generated from the canonical Pydantic models.
- Replay streams and golden reducer outputs ship in the package.
- Conformance validation combines Pydantic validation, committed JSON Schemas, and cutover artifact checks.
Run the drift and conformance gates:
python -m spec_kitty_events.schemas.generate --check
pytest --pyargs spec_kitty_events.conformance -v
Public Guidance
- Use
mission_slug,mission_number, andmission_typein public mission-domain payloads. - Use
build_idto identify the emitting build andnode_idto identify the emitting node. - Do not rely on runtime translation of legacy mission-domain fields.
- Use offline rewrite or migration jobs if you need to transform historical pre-cutover data.
Versioning
This package now publishes the breaking cutover release as 3.0.0.
2.xdocumentation and mixed-field operation are no longer the public contract.3.xconsumers should treat the cutover artifact and committed fixtures as the authoritative compatibility surface.
License
All rights reserved. This repository is owned by Priivacy AI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spec_kitty_events-3.1.0.tar.gz.
File metadata
- Download URL: spec_kitty_events-3.1.0.tar.gz
- Upload date:
- Size: 157.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fcca7fc7f3f535f09d0fd8e05a9b5acdf98b17d5acdc488dfce11a15069b442
|
|
| MD5 |
deb68237fd839f9c4fe34fa29ab6d68f
|
|
| BLAKE2b-256 |
c0f4818241e5f17e7a969117b234a9f724c0d11e4a0dcb7c9418fe81471a10ce
|
Provenance
The following attestation bundles were made for spec_kitty_events-3.1.0.tar.gz:
Publisher:
publish-pypi.yml on Priivacy-ai/spec-kitty-events
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spec_kitty_events-3.1.0.tar.gz -
Subject digest:
1fcca7fc7f3f535f09d0fd8e05a9b5acdf98b17d5acdc488dfce11a15069b442 - Sigstore transparency entry: 1285474237
- Sigstore integration time:
-
Permalink:
Priivacy-ai/spec-kitty-events@fb77ce26a68fd0a0e7d4018b708dff37a49d4c81 -
Branch / Tag:
refs/tags/v3.1.0 - Owner: https://github.com/Priivacy-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@fb77ce26a68fd0a0e7d4018b708dff37a49d4c81 -
Trigger Event:
push
-
Statement type:
File details
Details for the file spec_kitty_events-3.1.0-py3-none-any.whl.
File metadata
- Download URL: spec_kitty_events-3.1.0-py3-none-any.whl
- Upload date:
- Size: 238.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
111039eaea43d0c1761848dbcccd33756d6257051fc88568857adcade62a7a75
|
|
| MD5 |
0d74e26ba31f3e10a2f8eb3b8e83782e
|
|
| BLAKE2b-256 |
32492e4b3ad016141150f876a1837e0828de98ddc047b8f195999f2d3eb1d72a
|
Provenance
The following attestation bundles were made for spec_kitty_events-3.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on Priivacy-ai/spec-kitty-events
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spec_kitty_events-3.1.0-py3-none-any.whl -
Subject digest:
111039eaea43d0c1761848dbcccd33756d6257051fc88568857adcade62a7a75 - Sigstore transparency entry: 1285474320
- Sigstore integration time:
-
Permalink:
Priivacy-ai/spec-kitty-events@fb77ce26a68fd0a0e7d4018b708dff37a49d4c81 -
Branch / Tag:
refs/tags/v3.1.0 - Owner: https://github.com/Priivacy-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@fb77ce26a68fd0a0e7d4018b708dff37a49d4c81 -
Trigger Event:
push
-
Statement type: