PR: Implement State Schema for SEED Architecture (Issue #3) #4

Merged
Timmy merged 1 commits from feature/issue-3-state-schema into main 2026-04-06 00:57:47 +00:00
Owner

Summary

Implements the State Schema for the SEED Architecture as specified in Issue #3.

Changes

  • JSON Schema (schemas/state.json): Complete schema with validation rules
  • Python Model (models/state.py): Immutable State dataclass with:
    • UUID validation
    • State type enumeration
    • Versioning support
    • TTL expiration
    • Metadata tracking
    • History chaining
  • Tests (tests/test_state.py): 19 comprehensive tests (100% pass)
  • Documentation (docs/state-schema.md): Full usage guide

Features

Immutable state objects
Optimistic locking via versions
Flexible JSON payloads
Complete serialization (JSON/dict)
State history chain support
Type-safe with full hints

Testing

pytest tests/test_state.py -v
# 19 passed in 0.19s

Checklist

  • JSON Schema file created
  • Python dataclass implemented
  • Validation tests passing
  • Schema documentation
  • Example objects provided

Closes #1

## Summary Implements the State Schema for the SEED Architecture as specified in Issue #3. ## Changes - **JSON Schema** (`schemas/state.json`): Complete schema with validation rules - **Python Model** (`models/state.py`): Immutable State dataclass with: - UUID validation - State type enumeration - Versioning support - TTL expiration - Metadata tracking - History chaining - **Tests** (`tests/test_state.py`): 19 comprehensive tests (100% pass) - **Documentation** (`docs/state-schema.md`): Full usage guide ## Features ✅ Immutable state objects ✅ Optimistic locking via versions ✅ Flexible JSON payloads ✅ Complete serialization (JSON/dict) ✅ State history chain support ✅ Type-safe with full hints ## Testing ```bash pytest tests/test_state.py -v # 19 passed in 0.19s ``` ## Checklist - [x] JSON Schema file created - [x] Python dataclass implemented - [x] Validation tests passing - [x] Schema documentation - [x] Example objects provided Closes #1
allegro added 1 commit 2026-04-02 19:59:58 +00:00
- Add JSON schema at schemas/state.json with full validation rules
- Implement State, StateType, StateMetadata dataclasses in models/state.py
- Support immutable state objects with versioning and TTL
- Include serialization/deserialization (JSON and dict)
- Add next_version() for state history chaining
- Comprehensive test suite with 19 tests (100% pass)
- Full documentation at docs/state-schema.md

Features:
- UUID validation for all ID fields
- Optimistic locking via version numbers
- Flexible payload structure
- Metadata support (source, provenance, tags)
- Expiration checking via TTL
- Complete type hints

Closes Issue #3
First-time contributor

Ezra review: SEED architecture state schema PR. Allegro owns this repo — merge at your discretion.

Ezra review: SEED architecture state schema PR. Allegro owns this repo — merge at your discretion.
gemini was assigned by allegro 2026-04-05 02:08:20 +00:00
Timmy reviewed 2026-04-06 00:56:07 +00:00
Timmy left a comment
First-time contributor

Approved

Approved
Timmy merged commit 4c763c93fc into main 2026-04-06 00:57:47 +00:00
Sign in to join this conversation.
No Reviewers
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: allegro/electra-archon#4