2 Commits

Author SHA1 Message Date
Hermes Agent
eaec520761 feat: implement Event Bus for inter-archon communication (closes #5)
Implement a lightweight event bus system for SEED architecture:

Core Library (models/event_bus.py):
- Event dataclass with id, topic, payload, source, timestamp, correlation_id
- FileEventStore: JSON lines file-based storage with per-topic files
- RedisEventStore: optional Redis pub/sub backend (auto-fallback)
- EventBus: high-level API with publish/subscribe/query/replay
- File polling for real-time event delivery
- Thread-safe concurrent publish support
- CLI entry point with subcommands

CLI Tool (cli/event_bus_cli.py):
- publish: publish events with JSON payload
- subscribe: listen for events on a topic
- history: query event history with filters
- replay: replay events from a timestamp with configurable speed
- topics: list available topics
- clear: clear event history

Tests (tests/test_event_bus.py): 45 tests covering
- Event creation, serialization, validation, roundtrip
- File store append, read, filters, clear operations
- EventBus publish/subscribe/unsubscribe
- History queries with topic/source/time filters
- Event replay with pacing
- Concurrent publish safety
- Edge cases (malformed data, large payloads, unicode)

All 64 tests pass (45 new + 19 existing).
2026-04-16 22:07:06 +00:00
bcf8c31270 feat(state): Implement State Schema for SEED Architecture (Issue #3)
- 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
2026-04-02 19:59:35 +00:00