feat: two-layer architecture — core primitives + engine runtime#32
feat: two-layer architecture — core primitives + engine runtime#32prakashUXtech wants to merge 1 commit intomainfrom
Conversation
Introduce a clean separation between protocol primitives (core/) and the opinionated runtime (engine/). The core layer depends only on pydantic and provides: Identity, MemoryEntry, MemoryStore protocol, DictMemoryStore, SoulContainer, .soul file pack/unpack, and Manifest. The engine layer re-exports existing modules (Soul, CognitiveEngine, MemoryManager, etc.) under a structured namespace. Packaging: `pip install soul-protocol` now only requires pydantic. Full runtime available via `pip install soul-protocol[engine]`. All existing imports preserved for backward compatibility. 41 new core tests. All 519 existing tests, 28 E2E tests, and 260 simulation checks pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Issues (must fix)
Heads up
Please update your PR to address these points. |
Self-Review: PR #32 — Two-Layer ArchitectureWhat's Good
Issues Found
VerdictApprove with minor suggestions. The separation is clean and well-tested. The core is exactly the right size (~480 lines) for a future Go port. |
Summary
Splits soul-protocol into two clean layers within the same repo:
core/— Protocol primitives (Identity, MemoryStore, MemoryEntry, SoulContainer, .soul file format, Manifest). Depends only on pydantic. This is the portable standard — like the MP3 spec.engine/— Opinionated runtime namespace re-exporting existing modules (Soul, CognitiveEngine, MemoryManager, OCEAN personality, psychology-informed memory). This is the player that brings souls alive.What changed
src/soul_protocol/core/— 6 files, ~480 lines of schema-free primitivessrc/soul_protocol/engine/— 4 files, thin re-export layer over existing modulespyproject.toml— Core deps trimmed topydantic>=2.0only. Runtime deps moved to[engine]extra. Added[all]composite extra.__init__.py— Added core primitive exports (CoreIdentity,CoreManifest,CoreMemoryEntry,DictMemoryStore,MemoryStore). All existing exports preserved.tests/test_core/covering all core primitivesInstall paths
Zero breakage
All existing imports (
from soul_protocol import Soul) work unchanged.Test plan