Skip to content

refactor!: API cleanup and renames (MERGE LAST — mechanical, conflicts expected) - #105

Merged
patrickleet merged 1 commit into
mainfrom
review/api-cleanup-renames
Jul 4, 2026
Merged

patrickleet merged 1 commit into
mainfrom
review/api-cleanup-renames

Conversation

@patrickleet

@patrickleet patrickleet commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

MERGE ORDER: LAST

This PR is part of a batch of 11 parallel PRs and intentionally conflicts with the other 10. Every change here is purely mechanical (deletes, renames, re-export moves — no behavior change). Merge all other PRs first, then resolve conflicts in this one by re-applying the mechanical rename/delete on top of the merged code (one commit per item makes each rename easy to re-apply or cherry-pick).

Changes (one commit per item)

  1. refactor!: Delete dead Committable trait — zero callers anywhere (src, tests, macros, CLI); a fossil of the pre-CommitBatch API.
  2. refactor!: Delete HandlerBuilder backwards-compat aliasRouteBuilder is the real name; pre-release, no compat promises.
  3. refactor!: Complete the emitter opt-in — verified the Event trait was a two-method string-accessor trait with a single impl and no trait-method callers; deleted it. LocalEvent (used only by the emitter feature) moved from src/entity/ to src/emitter/ behind the emitter feature (distributed::emitter::LocalEvent).
  4. refactor!: HashMapRepositoryInMemoryRepository, HashMapOutboxStoreInMemoryOutboxStore, module hashmap_repoin_memory_repo, tests/hashmap_repository_conformancetests/in_memory_repository_conformance. Pure textual rename across src, tests, docs, README, CLI templates — matches InMemoryBus, InMemoryLockManager, InMemoryReadModelStore, InMemorySnapshotStore.
  5. refactor: rabbit_bus.rsrabbitmq_bus.rs — file/mod rename only, aligning with rabbitmq.rs and the rabbitmq feature. Type names (RabbitBus, RabbitBusConnect, …) left unchanged: they appear across tests/docs/README, so renaming the type would ripple widely.
  6. refactor!: Prune adapter plumbing from the crate root, per the existing intent comments in lib.rs:
    • outbox_worker constants (SOURCED_METADATA_PREFIX, DEFAULT_OUTBOX_SOURCE_BATCH, DEFAULT_OUTBOX_SOURCE_LEASE) → distributed::outbox_worker::* only.
    • read_model schema/mutation/adapter plumbing (ColumnDef, ColumnType, RowMutation family, ReadModelSchema* family, capabilities, load plans, ReadModelWorkspace, ReadModelWritePlan, …) → distributed::read_model::* only.
    • Kept at root (README quick-start surface): ReadModel, RelationalReadModel, ReadModelError, InMemoryReadModelStore, ReadModelWorkspaceExt, ReadModelWritePlanBuilder, RowKey, RowValue, Versioned. Macro expansions now emit module paths for moved types.
  7. chore: Entity::set_replayingpub(crate) — all callers are in-crate (hydration + emitter ext). Skipped #![warn(missing_docs)]: enabling it surfaces 518 warnings — far beyond a mechanical pass.

Test output

Full suite with all features (in-memory, sqlite, postgres via review_api DB on the batch container, rabbitmq/nats/kafka env unchanged):

cargo clippy --workspace --all-features --all-targets   # clean (2 pre-existing warnings on main, untouched)
cargo test --workspace --all-features --all-targets
passed: 805  failed: 0  ignored: 3

Verified after every individual commit (fmt + clippy + full test suite).

🤖 Generated with Claude Code

https://claude.ai/code/session_01DzYSVLas93c7LbgHJWsW7n

Summary by CodeRabbit

  • New Features

    • Added support for an in-process local event type for post-commit emission.
    • Standardized the default in-memory repository naming across examples and generated service templates.
  • Bug Fixes

    • Updated repository and outbox wiring so integrations, sagas, snapshots, and transport flows consistently use the in-memory implementation.
  • Documentation

    • Refreshed README and guide examples to match the current in-memory repository names and setup patterns.
  • Tests

    • Expanded and updated conformance, replay, outbox, microsvc, and saga test coverage to use the in-memory backend.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1ae55a06-ebc3-4c7f-b26e-51ae76464257

📥 Commits

Reviewing files that changed from the base of the PR and between c283864 and 5a714e2.

📒 Files selected for processing (69)
  • README.md
  • distributed_cli/src/generate/service_crate.rs
  • docs/postgres-event-store.md
  • docs/repositories.md
  • src/bus/mod.rs
  • src/bus/rabbitmq_bus.rs
  • src/commit_builder/mod.rs
  • src/emitter/entity_ext.rs
  • src/emitter/local_event.rs
  • src/emitter/mod.rs
  • src/entity/committable.rs
  • src/entity/entity.rs
  • src/entity/event.rs
  • src/entity/local_event.rs
  • src/entity/mod.rs
  • src/hashmap_repo/mod.rs
  • src/in_memory_repo/mod.rs
  • src/in_memory_repo/repository.rs
  • src/lib.rs
  • src/microsvc/dependencies.rs
  • src/microsvc/grpc.rs
  • src/microsvc/http.rs
  • src/microsvc/mod.rs
  • src/microsvc/runtime.rs
  • src/microsvc/service.rs
  • src/outbox/commit.rs
  • src/outbox_worker/outbox_dispatch.rs
  • src/outbox_worker/outbox_source.rs
  • src/outbox_worker/store.rs
  • src/repository/traits.rs
  • tests/blob_game/main.rs
  • tests/bomberman/main.rs
  • tests/distributed_read_model/checkout_saga_service/mod.rs
  • tests/distributed_read_model/main.rs
  • tests/distributed_read_model/seat_inventory_service/mod.rs
  • tests/distributed_read_model_board/board_service/mod.rs
  • tests/distributed_read_model_board/main.rs
  • tests/durable_enqueue_sqlite/main.rs
  • tests/enqueue/main.rs
  • tests/event_store/main.rs
  • tests/hashmap_repository_conformance/main.rs
  • tests/in_memory_repository_conformance/main.rs
  • tests/microsvc/basic.rs
  • tests/microsvc/convention.rs
  • tests/microsvc/handlers/mod.rs
  • tests/microsvc/transport_grpc.rs
  • tests/microsvc/transport_http.rs
  • tests/microsvc/transport_listen.rs
  • tests/microsvc/transport_subscribe.rs
  • tests/queued_repo/main.rs
  • tests/read_model_commit_bridge/main.rs
  • tests/read_model_relationship_includes/main.rs
  • tests/replay_property/main.rs
  • tests/repository_api/main.rs
  • tests/sagas/handlers/inventory/mod.rs
  • tests/sagas/handlers/orders/mod.rs
  • tests/sagas/handlers/payments/mod.rs
  • tests/sagas/handlers/saga/mod.rs
  • tests/sagas/microsvc_saga.rs
  • tests/sagas/orchestration.rs
  • tests/snapshots/main.rs
  • tests/sourced/main.rs
  • tests/sourced_enqueue/main.rs
  • tests/sourced_snapshot/main.rs
  • tests/sourced_upcasting/main.rs
  • tests/sql_lock_manager/main.rs
  • tests/todos/main.rs
  • tests/transport_conformance/mod.rs
  • tests/upcasting/main.rs
💤 Files with no reviewable changes (6)
  • src/entity/mod.rs
  • tests/hashmap_repository_conformance/main.rs
  • src/entity/committable.rs
  • src/entity/event.rs
  • src/hashmap_repo/mod.rs
  • src/entity/local_event.rs

📝 Walkthrough

Walkthrough

This PR renames the in-memory repository implementation from HashMapRepository/HashMapOutboxStore to InMemoryRepository/InMemoryOutboxStore across the crate, CLI generator, documentation, and full test suite. Separately, it relocates LocalEvent into the emitter module, removes the Committable and Event traits, restricts Entity::set_replaying visibility, renames the rabbit_bus module to rabbitmq_bus, removes the HandlerBuilder alias, and trims several crate-root public re-export lists.

Changes

Repository Rename: HashMapRepository → InMemoryRepository

Layer / File(s) Summary
Core implementation and crate wiring
src/in_memory_repo/mod.rs, src/in_memory_repo/repository.rs, src/lib.rs
Introduces InMemoryRepository/InMemoryOutboxStore, its trait implementations and constructors, and rewires crate module declarations and root re-exports.
Src-level repository/outbox consumers
src/commit_builder/mod.rs, src/outbox/commit.rs, src/outbox_worker/{outbox_dispatch,outbox_source,store}.rs, src/microsvc/{dependencies,runtime,service}.rs, src/repository/traits.rs
Updates internal consumers and their tests to construct and reference the in-memory repository/outbox types.
CLI generator and documentation
distributed_cli/src/generate/service_crate.rs, README.md, docs/*.md, src/microsvc/{grpc,http,mod}.rs
Updates the generated service template and documentation code examples to use InMemoryRepository.
Conformance test harness
tests/in_memory_repository_conformance/main.rs
Adds a new conformance entrypoint targeting InMemoryRepository.
Integration/feature test migration
tests/* (games, sagas, microsvc transports, snapshots, event_store, upcasting, sourced*, queued_repo, transport_conformance, todos, etc.)
Switches repository/outbox construction across many integration tests to the in-memory implementation.

Entity/Emitter Trait Restructuring

Layer / File(s) Summary
LocalEvent relocation and trait removal
src/emitter/{local_event,entity_ext,mod}.rs, src/entity/{entity,mod}.rs, src/lib.rs
Moves LocalEvent to emitter, removes Committable/Event traits, narrows Entity::set_replaying visibility, and trims related crate-root exports.

RabbitMQ Bus Module Rename

Layer / File(s) Summary
Module and re-export rename
src/bus/mod.rs
Renames rabbit_bus module and its public re-exports to rabbitmq_bus.

Public Export Trimming and HandlerBuilder Removal

Layer / File(s) Summary
microsvc/read_model export cleanup
src/microsvc/{mod,service}.rs, src/lib.rs, tests/read_model_relationship_includes/main.rs
Removes the HandlerBuilder alias, trims outbox_worker/read_model re-exports, and adjusts test import paths.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Possibly related PRs

  • hops-ops/distributed#40: Prior outbox-worker store boundary refactor introducing the OutboxStore/OutboxClaimRef APIs that this PR rebinds to InMemoryOutboxStore.
  • hops-ops/distributed#48: Introduced the distributed read-model publish_pending_outbox flow that this PR updates to use InMemoryOutboxStore.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the mechanical API cleanup and renames in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch review/api-cleanup-renames

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Re-derived on current main (all other review PRs merged) rather than
rebasing the stale diff, since these mechanical renames touch symbols the
other PRs restructured. Squashed from the original 7 commits (see PR #105
history). Pre-release: no compat shims left behind.

- Delete dead `Committable` trait (zero callers; pre-CommitBatch fossil).
- Delete `HandlerBuilder` type alias (use `RouteBuilder`).
- Complete emitter opt-in: delete the `Event` trait; move `LocalEvent`
  into `src/emitter/` behind the feature (now `distributed::emitter::LocalEvent`).
- Rename `HashMapRepository`/`HashMapOutboxStore` -> `InMemoryRepository`/
  `InMemoryOutboxStore`, module `hashmap_repo` -> `in_memory_repo`, and
  `tests/hashmap_repository_conformance` -> `tests/in_memory_repository_conformance`,
  matching every other in-memory default. Includes the CLI scaffold template.
- Rename `src/bus/rabbit_bus.rs` -> `src/bus/rabbitmq_bus.rs` to match the
  `rabbitmq` feature and `rabbitmq.rs` sibling.
- Prune adapter plumbing from the crate root (quick-start API at root,
  plumbing under module path): outbox adapter constants
  (SOURCED_METADATA_PREFIX, DEFAULT_OUTBOX_SOURCE_*) now only under
  `distributed::outbox_worker::*`; read_model load-graph/query plumbing
  (ReadModelLoadGraph/Request, ReadModelQueryCapabilities, ReadModelWorkspace,
  ReadModelIncludeRows, ReadModelLoadBuilder) now only under
  `distributed::read_model::*`. Kept `RelationalReadModelIncludes` at root
  (the ReadModel derive expands to it). Left #109's `table::` root surface
  as-is (its deliberate decision, out of scope here).
- `Entity::set_replaying` -> pub(crate) (ReplayGuard covers internal use).

Skipped #![warn(missing_docs)]: surfaces 518 warnings (mechanical-pass
infeasible), as in the original PR.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DzYSVLas93c7LbgHJWsW7n
@patrickleet
patrickleet force-pushed the review/api-cleanup-renames branch from 263d040 to 5a714e2 Compare July 3, 2026 16:30
@patrickleet
patrickleet merged commit e750333 into main Jul 4, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant