Tochemey/ego
76.7
Strong · 21 September 2026
12.9k
lines of production code
Go
primary language
4
measurements over time
What this system is
This system is a Go-based actor framework that supports event-sourced and durable-state entities with cluster-safe saga orchestration. It provides a pluggable persistence layer for storing events, snapshots, and state, alongside configurable projection subsystems for consuming and processing those events. The framework includes built-in capabilities for event encryption, schema migration, and publishing events to various messaging backends like Kafka and NATS.
How it got here
2023 — v4.5.0 cluster-safe saga and storage refactoring
11 changes.
This period focused on releasing eGo v4.5.0, which introduced cluster-safe sagas, durable entity deletion, and a new projection subsystem with configurable failure recovery. Significant architectural changes included removing the legacy Go event-sourced aggregate implementation and internal storage backends, while adding PostgreSQL schema definitions and a bounded eventstream package to support the new distributed requirements.
2024 — v4 persistence and concurrency foundations
7 changes.
This period focused on establishing the core infrastructure for eGo v4, introducing new interfaces for durable state, event sourcing, and offset management. It also enhanced internal concurrency primitives with lock-free queues and generic maps, while providing comprehensive testing tools and examples to support these new persistence capabilities.
2025–2026 — v4 protocol and saga support
10 changes.
This period focused on upgrading the core protocol to version 4, introducing native support for saga orchestration, encryption, and durable state management. It expanded the ecosystem with new messaging publishers, comprehensive migration tools for legacy data, and production-ready examples demonstrating cluster deployment and distributed transactions.
Features
Add durable state and event-sourced account examples
New example programs demonstrating eGo's persistence capabilities have been added. The durable state example shows how to configure a Go-Akt actor system with a durable state store to manage entity state directly, while the event-sourced example illustrates building an entity behavior that emits events and reconstructs state from them. Both examples use the v4 API, the testkit for in-memory stores, and Protobuf-based account commands to provide a complete, runnable reference for implementing persistent actors.
example/durablestate · high confidence
Added PostgreSQL schema definitions for durable state, events, offsets, and snapshots
New SQL migration scripts have been added to the resources directory to define the database schema for PostgreSQL-based persistence. These files create the necessary tables and indexes for storing durable state (states\_store), event logs (events\_store), projection offsets (offsets\_store), and snapshots (snapshots\_store), enabling users to deploy the system with a PostgreSQL backend.
resources · high confidence
Added fund transfer saga example
The example/saga directory now includes a demonstration of a distributed transaction pattern using the eGo saga process manager. This example implements a fund transfer saga that coordinates debiting a source account and crediting a destination account, with automatic compensation (refund) if the credit step fails or a 30-second timeout is exceeded. It serves as a reference for integrating eGo's saga capabilities with event-sourced entities.
example/saga · high confidence
Added internal time ticker with back-pressure support
A new internal ticker component has been introduced to deliver time-based ticks at configurable intervals. The implementation includes a back-pressure mechanism that prevents blocking when receivers are slow, ensuring that ticks are only delivered if the channel buffer can accept them. This component is now available for internal use within the application.
internal/ticker · high confidence
Added sample saga example with account and transfer protocol buffers
This change introduces a new example demonstrating saga patterns by adding the \sample.proto\ definition and its generated Go code (\sample.pb.go\). The protocol buffer definitions include messages for account management (CreateAccount, CreditAccount, DebitAccount) and events (AccountCreated, AccountCredited, AccountDebited), as well as specific messages for a fund transfer saga (StartTransfer, TransferState, SourceDebited, DestinationCredited, TransferFailed). This provides the data structures required for the saga example implementation.
example/examplepb, protos/sample · high confidence
Introduce eventstream package with bounded subscriber support
The eventstream package now provides a pub/sub broker that supports both unbounded and bounded subscribers. Users can create bounded subscribers via AddBoundedSubscriber(capacity) to prevent memory growth from slow consumers, with dropped message counts exposed via the Dropped() method. The system uses a Ready channel for efficient, non-busy-waiting consumption and fan-out publishing to active subscribers.
eventstream · high confidence
Introduction of OffsetStore interface for projection offset management
A new OffsetStore interface has been added to define the contract for persisting and managing offsets for projections. This interface includes methods to connect and disconnect from the storage backend, verify connectivity, and perform CRUD operations on offsets (write, read, reset, and delete) for specific projection IDs. It relies on protobuf definitions from the ego/v4 library for offset and projection ID structures.
offsetstore · high confidence
New Kafka, NATS, Pulsar, and WebSocket publishers added
The publisher module now includes four new connector implementations for delivering ego events and durable state changes: Apache Kafka (using IBM Sarama with TLS and SASL support), NATS (using JetStream with connection retry logic), Apache Pulsar (with configurable connection timeouts and keep-alive), and WebSocket (using Gorilla Websocket). Each publisher implements the ego EventPublisher and StatePublisher interfaces, allowing users to route their actor events and state snapshots to these specific messaging backends.
publisher · high confidence
New encryption, event adaptation, and legacy migration capabilities
This release introduces three new capabilities to support v4. First, the encryption package now provides an AES-256-GCM encryptor backed by a KeyStore, enabling per-entity encryption and crypto-shredding (deleting a key makes all associated events irrecoverable). Second, the eventadapter package adds an EventAdapter interface and a Chain utility, allowing transparent transformation of persisted events during replay to handle schema changes across revisions. Third, the migration package provides a Migrator that reads legacy events containing inline resulting\_state and seeds the new SnapshotStore with the latest state for each entity, facilitating a one-time, idempotent migration from the old format.
encryption, eventadapter, migration · high confidence
New in-memory testkit stores and scenario runners for entity testing
The testkit package now includes in-memory implementations of persistence backends—DurableStore, EventStore, SnapshotStore, OffsetStore, and KeyStore—along with fluent scenario runners (EventSourcedScenario and DurableStateScenario) that allow testing entity behaviors without starting an engine. These components provide the necessary infrastructure for unit testing event-sourced and durable-state behaviors by simulating state storage, event replay, and offset management.
testkit · high confidence
New internal runner chain and pause utilities
The internal/runner package now includes a new Chain type that allows users to compose multiple error-returning functions into a single execution flow, supporting both fail-fast (stop on first error) and return-all (collect all errors) modes via WithFailFast and WithRunAll options. Additionally, a new pause utility has been added to allow controlled process pauses for a specified duration.
internal/runner · high confidence
New lock-free queue and generic concurrent map added to internal packages
The internal/queue package now provides a new lock-free queue implementation using atomic operations and a sync.Pool for node reuse, which improves performance and prevents memory leaks in concurrent scenarios. Additionally, the internal/syncmap package introduces a new generic, concurrency-safe map backed by a read-write mutex, offering thread-safe Set, Get, Delete, Len, Range, Values, and Reset operations for storing key-value pairs.
internal/queue · high confidence
New persistence store interfaces for events, snapshots, and durable state
The persistence layer now exposes three new interfaces—EventsStore, SnapshotStore, and StateStore—that define the contract for writing and reading event logs, entity snapshots, and durable actor state respectively. These interfaces provide methods for connecting, disconnecting, and pinging the underlying storage, as well as specific operations like batch event writing, snapshot management, and state persistence with versioned deletion. This change establishes the foundational API for the new durable state actor and v4 persistence features, allowing implementations to support efficient event replay, state recovery via snapshots, and durable state management.
persistence · high confidence
New v4 cluster example with Kubernetes deployment and observability
Added a new production-ready example in example/cluster that demonstrates a 3-node eGo cluster running on Kubernetes via Kind. The example includes a Dockerfile for building the application, a Makefile for orchestrating the full lifecycle (cluster creation, deployment, integration tests, and teardown), and Kubernetes manifests for the application, PostgreSQL, and an observability stack (OpenTelemetry, Jaeger, Prometheus, Grafana). It showcases Kubernetes-native peer discovery, CQRS with a projection read side, and a fund-transfer saga, with HTTP requests load-balanced across pods via NGINX Ingress.
example/cluster · high confidence
Projection subsystem introduces configurable event processing and failure recovery
The projection package now provides the core abstractions for consuming and processing events from an event store. Users can define custom event handlers via the new \Handler\ interface and configure projection behavior using \Options\, including buffer size, polling intervals, and start/reset offsets. A new \Recovery\ system allows configuring how the projection handles processing failures with policies such as Fail, RetryAndFail, Skip, and RetryAndSkip, along with customizable retry counts and delays. Additionally, a \DeadLetterHandler\ interface enables routing events that exhaust their recovery policy to a custom handler (with a default \DiscardDeadLetterHandler\ available), ensuring failed events can be logged, persisted, or published as needed.
projection · high confidence
eGo v4.5.0: Cluster-safe sagas, durable entity deletion, and bounded publishers
This release makes sagas cluster-safe and durable by reading from the journal instead of the local event stream, journaling their own status and progress, and ensuring reliable settlement after restarts. It introduces breaking changes requiring an offset store for sagas and idempotent saga handlers due to at-least-once delivery. New features include the ability to delete durable-state entities (with optional crypto-shredding via a key store), bounded publishers with configurable timeouts and drop metrics, and the removal of settled saga offsets. Several bugs are fixed, including sagas now seeing events from all cluster nodes, compensation completing fully, and projections handling offset units and store errors correctly. The testkit is improved to accept real behaviors and arrange scenarios from state or history, and the cluster example now demonstrates a fund-transfer saga.
(repo-wide) · high confidence
Removals
Postgres datastore implementation removed
The internal Postgres database implementation, including its configuration, interface, core logic, and test infrastructure, has been deleted. This change removes the ability to connect to and query a Postgres database from this location, as the codebase is being moved to a separate repository.
internal/postgres · high confidence
Removal of in-memory and PostgreSQL event store implementations
The \plugins/store/memory\ and \plugins/store/postgres\ packages, along with the central \store/events\_store.go\ interface, have been deleted. This removes the built-in support for persisting event journal data in both an in-memory database (suitable for testing) and a PostgreSQL database. Users relying on these specific storage backends for event sourcing will no longer have access to these implementations within this plugin location.
plugins/store, store · high confidence
Removal of internal telemetry span helper
The internal telemetry package no longer provides the \SpanContext\ helper function, which previously created OpenTelemetry spans for a given method name. This change removes the convenience wrapper that initialized a tracer and started a span, meaning any code relying on this specific internal utility for tracing must be updated to use the OpenTelemetry SDK directly.
internal/telemetry · high confidence
Removal of the Go event-sourced aggregate implementation
The \aggregate\ package, which provided the core event-sourced actor implementation for managing state and command handling in Go, has been removed. This deletion eliminates the \Aggregate\ struct, the \Behavior\ interface, and the associated test suite that validated command processing and state persistence for this actor model.
aggregate · high confidence
Behavioural changes
Ego v4 protocol schema with saga, encryption, and durable state support
The protobuf definitions for the Ego library have been updated to version 4, moving the file from protos/ego/v1/ to protos/ego/ and changing the Go package path to github.com/tochemey/ego/v4/egopb. This schema introduces support for saga orchestration with new messages for status tracking (SagaStatusChanged, SagaCompensationConfirmed) and querying (GetSagaStatus, SagaStatusReply). It also adds encryption capabilities to both Event and Snapshot messages via encryption\_key\_id and is\_encrypted fields, and introduces a separate DurableState message for entity state management. Additionally, the Event message now includes a shard field, and the CommandReply message has removed the NoReply option.
protos/ego · high confidence
Node-wide caching for event store shard offsets
The internal extensions layer now wraps the event store with a local cache for shard offsets. This change reduces polling load on the underlying store by sharing a single round-trip answer among all runners on the node for 250 milliseconds, merging concurrent requests via singleflight. Local writes or explicit invalidations drop the cached answer so the next poll reads the current journal state, ensuring events persisted on the node are noticed promptly while peer events are noticed once the cache expires.
internal/extensions · high confidence
Updated protobuf schema with encryption support and shard ID
The generated protobuf code for the \egopb\ package has been regenerated using \protoc-gen-go v1.36.12\ (upgraded from v1.28.1) and updated to reflect changes in the underlying \ego/ego.proto\ source. The \Event\ message now includes new fields for \Shard\ (uint64), \EncryptionKeyId\ (string), and \IsEncrypted\ (bool), enabling support for event sharding and payload encryption. Additionally, the \ResultingState\ field has been removed from the \Event\ message. The code generation also migrated to the \protogen\ open.v1 system, simplifying internal state management and removing the \protoimpl.UnsafeEnabled\ checks in favor of direct nil checks.
egopb · high confidence
Test coverage
Added autogenerated mocks for core Ego v4 interfaces; Added benchmark suite for actor performance; Updated test protocol buffer definitions; Updated test protocol buffer definitions and configuration.
Dependencies
New dependency manifests for benchmark, cluster example, and Kafka publisher
Added go.mod and go.sum files for the benchmark, example/cluster, and publisher/kafka sub-modules. These manifests pin the local ego/v4 library (v4.5.0) and goakt/v4 (v4.5.6), along with specific versions for dependencies like IBM Sarama (v1.60.2), Jackc pgx (v5.11.0), and OpenTelemetry (v1.46.0). They also include an exclude block for broken HashiCorp go-metrics versions to resolve transitive dependency conflicts.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 70 → 77 (+6.5)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 93 → 94 (+1.0)
- Architecture 100 → 98 (-2.0)
- Maturity 64 → 68 (+3.9)
- Readiness 75 → 90 (+14.9)
- Security 66 → 76 (+9.8)
Resolved (45)
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- Duplicated block (10 lines × 2) (engine.go)
- Duplicated block (10 lines × 2) (saga_actor.go)
- Duplicated block (12 lines × 2) (example/durablestate/main.go)
- Duplicated block (12 lines × 2) (example/eventssourced/main.go)
- Duplicated block (14 lines × 2) (example/durablestate/main.go)
- Duplicated block (14 lines × 2) (internal/runner/runner.go)
- Duplicated block (19 lines × 2) (engine.go)
- Duplicated block (5 lines × 2) (projection_runner.go)
- Duplicated block (9 lines × 2) (durable_state_actor.go)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 25 more
New (75)
- ClassTooLong: Engine (engine.go)
- ClassTooLong: EventSourcedActor (event_sourced_actor.go)
- Documentation: no contributor guidance (README.md)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (10 lines × 2) (testkit/eventstore.go)
- Duplicated block (10 lines × 3) (events_janitor_actor.go)
- Duplicated block (10 lines × 3) (example/durablestate/main.go)
- Duplicated block (11 lines × 3) (testkit/eventstore.go)
- Duplicated block (16 lines × 2) (internal/runner/runner.go)
- Duplicated block (16–18 lines × 2) (example/eventssourced/main.go)
- Duplicated block (17–18 lines × 2) (example/durablestate/main.go)
- Duplicated block (20 lines × 2) (durable_state_actor.go)
- Duplicated block (30 lines × 2) (example/durablestate/main.go)
- Duplicated block (6–7 lines × 2) (projection_runner.go)
- Duplicated block (8 lines × 2) (example/saga/main.go)
- Duplicated block (9 lines × 2) (durable_state_actor.go)
- Duplicated block (9 lines × 2) (engine.go)
- Duplicated block (9 lines × 2) (saga_actor.go)
- Duplicated block (9–11 lines × 3) (example/durablestate/main.go)
- …and 55 more
Changes since last survey
- 32 commits — 21 feature/other, 11 fixes
By area
- (root) — 15 commits
- .github/workflows — 6 commits
- example/cluster — 4 commits
- benchmark/go.mod — 3 commits
- publisher/kafka — 3 commits
- publisher/nats — 1 commit
Notable commits
- fix: fix(deps): update module github.com/ibm/sarama to v1.60.2 (#339)
- fix: fix(deps): update module github.com/nats-io/nats.go to v1.54.0 (#355)
- fix: fix(deps): update module github.com/tochemey/ego/v4 to v4.4.2 (#330)
- fix: fix(deps): update module github.com/tochemey/ego/v4 to v4.4.3 (#340)
- fix: fix(deps): update module github.com/tochemey/ego/v4 to v4.5.0 (#352)
- fix: fix(deps): update module github.com/tochemey/goakt/v4 to v4.5.2 (#335)
- fix: fix(deps): update module github.com/tochemey/goakt/v4 to v4.5.5 (#350)
- fix: fix(deps): update module github.com/tochemey/goakt/v4 to v4.5.6 (#353)
- fix: fix(deps): update module go.uber.org/atomic to v1.12.0 (#354)
- fix: fix(deps): update opentelemetry-go monorepo to v1.46.0 (#343)
- fix: fix: harden the implementation (#344)
- change: chore(deps): update actions/setup-go action to v7 (#331)
- change: chore(deps): update actions/stale action to v11 (#332)
- change: chore(deps): update dependency go to v1.26.6 (#327)
- change: chore(deps): update dependency go to v1.27.0 (#341)
- change: chore(deps): update dependency golangci/golangci-lint to v2.13.1 (#337)
- change: chore(deps): update dependency golangci/golangci-lint to v2.13.2 (#347)
- change: chore(deps): update docker/dockerfile docker tag to v1.26 (#329)
- change: chore(deps): update docker/dockerfile docker tag to v1.27 (#351)
- change: chore(deps): update golang docker tag (#338)
- …and 12 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
Tochemey/ego was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 37299661ca69b5b4a9aea87d8c58b37ce812f468 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-fa71c66cabd8.