GaloyMoney/es-entity
55.0
Adequate · 8 November 2026
39.2k
lines of production code
Rust
primary language
7
measurements over time
What this system is
Features
Batch isolation and commit hooks for atomic operations
The \src/operation\ module now provides \BatchIsolation\ methods (\run\_isolated\ and \run\_bisected\) that allow processing a batch of items within a single transaction while isolating each item's failure using savepoints. It also introduces a commit hook system (\CommitHook\) that lets users register pre-commit, post-commit, and rollback callbacks to execute side effects like event publishing or cache updates, with support for hook ordering, merging, and re-entrant registration.
src/operation · high confidence
Initial CI pipeline configuration for es-entity
This change introduces the foundational CI infrastructure for the es-entity project, establishing a Concourse pipeline that automates code checking, testing, and release processes. The pipeline leverages Nix for reproducible builds and integrates with Galoy's shared CI assets via vendir to standardize task definitions. Key capabilities include automated checks using \nix flake check\, test execution via \cargo nextest\, and a complete release workflow that publishes to crates.io and creates GitHub releases, with built-in retry logic for stability. Additionally, a self-bootstrapping fuzzing job is configured to run nightly, persisting its corpus to Google Cloud Storage and triggering Zenduty alerts on crashes, ensuring continuous security testing without manual seed management.
ci · high confidence
Initial CI/CD pipeline tasks for release automation
This change introduces the initial set of CI/CD tasks required to build, version, and release the Calaserver project. The new scripts automate the end-to-end release process: prep-docker-build-env.sh prepares the build environment with version and commit metadata; build-release.sh compiles the Rust binary for Linux and macOS targets; publish-to-crates.sh publishes the es-entity and es-entity-macros crates to crates.io; bump-image-digest.sh and open-charts-pr.sh handle updating Helm chart values and creating pull requests for container image updates; and set-dev-version.sh and update-repo.sh manage version bumps for development and release cycles respectively.
ci/tasks · high confidence
Initial release of the es-entity event-sourcing library
This entry introduces the core \src\ module of the \es-entity\ crate, providing a Rust library for persisting event-sourced entities to PostgreSQL. It establishes the foundational types and modules for the system, including centralized database type aliases (\db.rs\), error handling with constraint violation parsing (\error.rs\), and the event management infrastructure (\events.rs\) for tracking persisted and new events. The release adds support for GDPR-compliant data deletion via the \Forgettable\<T\>\ wrapper (\forgettable.rs\), idempotency guards to prevent duplicate event processing (\idempotent.rs\), and utilities for nested entity operations (\nested.rs\). It also includes a \OneTimeExecutor\ for trace-context annotation of SQL statements (\one\_time\_executor.rs\), cursor-based pagination structures (\pagination.rs\), and the \es\_query!\ macro infrastructure for type-safe entity hydration (\query.rs\ and \macros.rs\).
src · high confidence
Initial release of the es-entity-macros crate
This entry introduces the \es-entity-macros\ crate, providing the foundational procedural macros for the event-sourcing library. The \\#\[derive(EsEntity)\]\ macro implements the \EsEntity\ trait, automatically managing event storage and supporting nested child entities. The \\#\[derive(EsEvent)\]\ macro generates event type definitions with support for forgettable payloads (for GDPR compliance) and context injection. The \\#\[derive(EsRepo)\]\ macro generates repository implementations, including a migration-aware \IndexCatalog\ that optimizes query plans based on physical database indexes. Additionally, the \\#\[es\_event\_context\]\ attribute macro allows automatic capture of function arguments into the event context for audit trails, and the \es\_query!\ macro enables type-safe, parameterized SQL queries with snapshot and forgettable payload support.
es-entity-macros · high confidence
Introduce \`\#\[derive(Classify)\]\` and \`\#\[instrument\]\` macros for error classification and tracing
The \errlanes-derive\ crate now provides two new proc-macro capabilities: \\#\[derive(Classify)\]\ and \\#\[instrument\]\. The \Classify\ derive macro enables 'laned' error classification (fatal, transient, denied) and supports a 'pure mode' that forwards to the existing \Rejection\ derive for backward compatibility. The \instrument\ attribute macro automatically injects specific tracing fields (such as \error.lane\, \error.code\, and \otel.status\_code\) into function spans and handles error recording, offering a structured way to emit telemetry for classified errors.
errlanes-derive/src · high confidence
Introduce structured error-lane classification with compile-time lane profiles
The \errlanes\ crate now provides a structured error-handling system that classifies errors into four distinct lanes—Rejected, Denied, Transient, and Fatal—using compile-time lane profiles. This change replaces the previous \Failure\ type with new \Fault\ and \Fail\ carriers, enabling composable lane subsets via \WithDenied\, \WithTransient\, and \WithFatal\ type aliases. Errors are classified using the \Classify\ trait and \\#\[derive(Classify)\]\, with a complete rejection-code catalogue (\RejectionCode::CODES\) and operator-safe logging via \tracing\ integration (recording \error.lane\, \error.code\, and \otel.status\_code\). The library also includes built-in classifiers for \reqwest\, \sqlx\, and \serde\_json\ errors, and provides \ResultExt\ methods like \narrow\_rejected\ and \lift\ to move errors between lanes and signatures safely.
errlanes/src · high confidence
Introduce thread-local event context with lazy async propagation
A new context module provides a thread-local system for attaching metadata (such as request IDs, user IDs, or audit info) to events as they are persisted. The \EventContext\ struct manages a stack of contexts within a single thread, while \ContextData\ offers an immutable, thread-safe snapshot for transferring context across async boundaries or threads. To optimize performance, context seeding in async tasks is now lazy: the \with\_event\_context\ wrapper defers the creation of context stack entries until the context is actually observed during a poll, avoiding unnecessary allocations for polls that do not access the context. Additionally, the module integrates with OpenTelemetry via the \tracing-context\ feature, automatically injecting trace IDs and span information into event context when available.
src/context · high confidence
Introduce unified clock abstraction with manual time control and global access
The \src/clock\ module now provides a unified time abstraction that supports both real-time and manual (test) clocks via \ClockHandle\. Users can create manual clocks for deterministic testing, where time only advances via explicit \ClockController\ calls like \advance()\ and \advance\_to\_next\_wake()\. A new \sleep\_coalesce()\ method allows housekeeping tasks to coalesce wake-ups during large time jumps, preventing excessive processing. Additionally, a global \Clock\ singleton is available for easy access to time operations, with support for installing a manual clock globally for testing purposes.
src/clock · high confidence
New batch isolation helpers for transactional operations
Added \run\_isolated\ and \run\_bisected\ methods to the \BatchIsolation\ trait, allowing users to execute batches of database operations within a single transaction while isolating individual failures. \run\_isolated\ processes items one-by-one with separate savepoints, ensuring a failure in one item does not abort the processing of healthy peers. \run\_bisected\ uses a binary search strategy to efficiently isolate failing items in large batches, minimizing the number of database probes required to identify the root cause of errors. These helpers automatically handle transient errors like deadlocks and serialization failures, retrying affected ranges before giving up.
src/operation/batch · high confidence
Repository initialization with Nix-based development environment and documentation
The repository is initialized with a comprehensive Nix flake configuration that replaces Docker Compose with \nix process-compose\ for managing development dependencies like PostgreSQL, enabling reproducible local setups without Docker. The project includes a new Event Sourcing Entity Framework for Rust (\es-entity\), featuring derive macros for automatic repository generation, optimistic concurrency control, and idempotent operations. Development tooling is established with \bacon.toml\ for hot-reloading, \deny.toml\ for license and dependency auditing, and \CLAUDE.md\ for AI-assisted development guidance. Documentation is added via a new mdBook structure, a detailed README with usage examples, and a SECURITY.md policy. The build system includes a \build.rs\ script to ensure proc-macro code regenerates when database migrations change, and the project enforces safe Rust with \\#!\[forbid(unsafe\_code)\]\.
(repo-wide) · high confidence
Behavioural changes
Vendored CI tasks updated from shared repository
The CI vendor tasks in ci/vendor/tasks have been replaced with new versions synced from the galoy-concourse-shared repository. This update introduces a new fuzzing task (fuzz.sh) that supports cargo-fuzz with corpus management and seed merging, updates the release preparation script (prep-release-src.sh) to use git-cliff for changelog generation and bump2version for semver bumping, and refreshes the test and code-check tasks (test-integration.sh, test-bats.sh, check-code.sh) to run within a Nix environment using Podman for dependencies. The helpers.sh script now sets specific CARGO\_HOME and CARGO\_TARGET\_DIR paths, and the with-nix-cache.sh wrapper has been updated to improve Nix binary cache management and fetch retry logic.
ci/vendor/tasks · high confidence
Test coverage
2 commits adding/updating tests in tests/ui; Added coherence tests for cross-crate error type conversions; Added compile-time and runtime tests for the errlanes-derive macro; Added comprehensive test coverage for the errlanes error-handling library; Added database migration fixtures for testing repository features; Added fuzz targets for event hydration and constraint parsing; Added micro-benchmarks for event-context performance; Added test entity definitions for event-sourced domain models; Added tests for composable rejections and typed lane subsets; Comprehensive integration test coverage for core framework capabilities.
Dependencies
Initial release of es-entity 0.13.1-dev with Rust 2024 edition and updated dependencies
This change introduces the initial codebase for the es-entity Event Sourcing Entity Framework, setting the project version to 0.13.1-dev and adopting the Rust 2024 edition. It establishes the core library and proc-macro crate with a dependency stack that includes async-graphql 8.0.0-rc.5, sqlx 0.8, tokio 1.52, and uuid 1.23 (with v7 support), alongside optional features for tracing, GraphQL, and event context. A dedicated fuzzing workspace is also added to support automated fuzz targets for constraint parsing and event hydration.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 55 → 55 (-0.4)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 90 → 90 (-0.2)
- Architecture 100 → 100 (+0.2)
- Maturity 62 → 61 (-1.1)
- Readiness 67 → 72 (+4.3)
- Security 35 → 33 (-1.6)
- Domain Modelling 100 → 100 (+0.0)
- Event Sourcing 100 → 100 (+0.0)
- Performance 91 → 91 (+0.0)
Resolved (20)
- Change coupling: find_by_fn.rs ↔ list_for_fn.rs (es-entity-macros/src/repo/find_by_fn.rs)
- Confusing duplication of 'narrow' operations. ResultExt has narrow_rejected and narrow_rejected_with. Additionally, there are separate types NarrowRejectedLane and NarrowRejectedBy with their own narrow methods. This suggests that ResultExt methods might be wrappers or aliases for these types, or that the API exposes both builder-pattern types and extension methods redundantly.
- Inconsistent API for installing manual clocks. Clock uses install_manual and returns a ClockController. ClockHandle uses manual and returns a tuple (Self, ClockController). The naming (install_manual vs manual) and return types differ for functionally similar operations (switching to manual mode).
- Inconsistent conversion methods. Fail has into_fault() directly. ResultExt has both into_fault() and into_fail(). This creates ambiguity: should a user call result.into_fault() or result.into_fail().into_fault()? The existence of into_fail on ResultExt suggests a two-step process that isn't mirrored in the Fail type itself (which doesn't have an into_result or similar obvious reverse, but the asymmetry is notable).
- Inconsistent naming and return types for classification logic. Fault.classify returns a Fault, while Classify.classify returns a Fail. ResultExt.classify returns a Result. The verb 'classify' is used for operations that produce different result types (Fault vs Fail), creating confusion about which error carrier is being produced.
- Leaked secret: hardcoded-credential (Cargo.toml)
- Medium CVE: RUSTSEC-2026-0381 (Cargo.lock)
- Medium advisory (unmaintained): RUSTSEC-2026-0247 (Cargo.lock)
- Medium advisory (unmaintained): RUSTSEC-2026-0248 (Cargo.lock)
- Medium advisory (unmaintained): RUSTSEC-2026-0251 (Cargo.lock)
- Medium advisory (unsound): RUSTSEC-2023-0126 (Cargo.lock)
- Medium advisory (unsound): RUSTSEC-2026-0097 (Cargo.lock)
- Medium advisory (unsound): RUSTSEC-2026-0255 (Cargo.lock)
- Members sharing a duplicated core (5 members, 50+ identical tokens) (es-entity-macros/src/repo/find_all_fn.rs)
- Off-boarding risk: anonymized user #1
- Outdated: opentelemetry
- Outdated: opentelemetry_sdk
- Outdated: schemars
- Outdated: serde_json
- Outdated: syn
New (10)
- Duplicated block (5 lines × 2) (es-entity-macros/src/entity.rs)
- Duplicated block (8 lines × 2) (es-entity-macros/src/repo/find_all_for_fn.rs)
- FindAllForFn::to_tokens (cognitive 36) (es-entity-macros/src/repo/find_all_for_fn.rs)
- FindAllForFn::to_tokens (cyclomatic 16) (es-entity-macros/src/repo/find_all_for_fn.rs)
- Medium advisory (unsound): RUSTSEC-2026-0097 (Cargo.lock)
- Members sharing a duplicated core (6 members, 50+ identical tokens) (es-entity-macros/src/repo/find_all_fn.rs)
- MethodTooLong: FindAllForFn.to_tokens (es-entity-macros/src/repo/find_all_for_fn.rs)
- Off-boarding risk: anonymized user #1
- Outdated: bon
- Outdated: uuid
Changes since last survey
- 20 commits — 18 feature/other, 2 fixes
By area
- errlanes/tests — 12 commits
- (root) — 2 commits
- errlanes-derive/tests — 2 commits
- es-entity-macros/src — 2 commits
- src/lib.rs — 1 commit
- tests/entities — 1 commit
Notable commits
- fix: fix(errlanes-derive): with = .. structs bind fields and emit source() (#298)
- fix: fix(repo): make find_all_for opt-in and read its key from the entity (#295)
- change: chore(deps): bump the all-dependencies group across 1 directory with 8 updates (#293)
- change: chore(deps): replace im with imbl (#301)
- change: chore(nix): update flake inputs (#302)
- change: ci(dev): set version to 0.20.1-dev
- change: ci(dev): set version to 0.20.2-dev
- change: ci(dev): set version to 0.20.3-dev
- change: ci(dev): set version to 0.20.4-dev
- change: ci(dev): set version to 0.20.5-dev
- change: ci(dev): set version to 0.20.6-dev
- change: ci(release): release version 0.20.0
- change: ci(release): release version 0.20.1
- change: ci(release): release version 0.20.2
- change: ci(release): release version 0.20.3
- change: ci(release): release version 0.20.4
- change: ci(release): release version 0.20.5
- change: feat(entity)!: EsEntity generates {Entity}Hydrator; bon replaces derive_builder (#292)
- change: feat(graphql): publish UUID scalar specification metadata (#299)
- change: feat(repo): find_all_for_{col}s — batch lookup keyed by a list_for column (#294)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
GaloyMoney/es-entity 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 8 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 05bfed36f01e1356eec3d07c496dcd1233729eab — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-45ab2cab63de.