Skip to content

Conversation

@hubcio
Copy link
Contributor

@hubcio hubcio commented Feb 10, 2026

mod.rs mixed traits, unsafe left-right infra, and code-gen macros in a single 400-line file, making each concern hard to review independently. StateHandler also returned void, preventing commands from producing results through the left-right layer.

Split into focused modules (traits.rs, left_right.rs, macros.rs) and introduce CommandEnvelope to smuggle typed return values out of Absorb's void interface. StateHandler and Command now carry an Output associated type. WriteCell gains a debug-mode reentrancy guard and LeftRight exposes with_state() for lock-free reads.

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

❌ Patch coverage is 77.61194% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.45%. Comparing base (4b18446) to head (2b7fe86).

Files with missing lines Patch % Lines
core/metadata/src/stm/macros.rs 71.64% 18 Missing and 1 partial ⚠️
core/metadata/src/stm/stream.rs 14.28% 12 Missing ⚠️
core/metadata/src/stm/user.rs 18.18% 9 Missing ⚠️
core/metadata/src/stm/left_right.rs 94.00% 3 Missing ⚠️
core/metadata/src/stm/consumer_group.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2714      +/-   ##
============================================
+ Coverage     68.30%   68.45%   +0.14%     
  Complexity      585      585              
============================================
  Files           734      735       +1     
  Lines         59764    59863      +99     
  Branches      56177    56276      +99     
============================================
+ Hits          40822    40979     +157     
+ Misses        16955    16893      -62     
- Partials       1987     1991       +4     
Flag Coverage Δ
rust 69.99% <77.61%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
core/metadata/src/stm/mux.rs 98.63% <100.00%> (+3.89%) ⬆️
core/metadata/src/stm/consumer_group.rs 0.00% <0.00%> (ø)
core/metadata/src/stm/left_right.rs 94.00% <94.00%> (ø)
core/metadata/src/stm/user.rs 14.16% <18.18%> (+14.16%) ⬆️
core/metadata/src/stm/stream.rs 6.66% <14.28%> (+6.66%) ⬆️
core/metadata/src/stm/macros.rs 71.64% <71.64%> (ø)

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hubcio hubcio marked this pull request as ready for review February 11, 2026 09:22
StateHandler returned void, preventing commands from producing results
through the left-right layer. Introduce CommandEnvelope to smuggle
typed return values out of Absorb's void interface.

- StateHandler and Command now carry an Output associated type
- WriteCell gains a debug-mode reentrancy guard
- LeftRight exposes with_state() for lock-free reads
- Timestamps captured once before entering left-right for
  deterministic replay across both copies
- Mux base case panics on unhandled commands instead of silent drop
- Add integration tests for stream/user creation and mux fallthrough
mod.rs mixed traits, unsafe left-right infra, and code-gen macros
in a single 400-line file, making each concern hard to review
independently.

Split into focused modules:
- traits.rs: StateHandler, Command, State, StateMachine
- left_right.rs: CommandEnvelope, WriteCell, LeftRight
- macros.rs: define_state!, collect_handlers!
- mod.rs: module declarations and re-exports

Add bytemuck and bytes as dev-dependencies for test message
construction.
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