Skip to content

fix(T-0896): Rust-cdylib accumulator kinds — real type in FFI metadata + macros usable in packaged crates#194

Open
dylanbstorey wants to merge 2 commits into
mainfrom
fix/packaged-accumulator-followons
Open

fix(T-0896): Rust-cdylib accumulator kinds — real type in FFI metadata + macros usable in packaged crates#194
dylanbstorey wants to merge 2 commits into
mainfrom
fix/packaged-accumulator-followons

Conversation

@dylanbstorey

Copy link
Copy Markdown
Contributor

Closes the Rust-cdylib side of T-0896: packaged Rust reactors reported every
accumulator as passthrough (hardcoded in the plugin metadata), and the
accumulator attribute macros couldn't even be used in a lean packaged crate
(their generated impl cloacina::… structs need the cloacina umbrella). No
example/fixture ever decorated an accumulator — the path was dead.

  • New AccumulatorEntry inventory (name/type/config). get_graph_metadata and
    get_reactor_metadata build a name->spec map from it and report each
    accumulator's real kind + config, falling back to passthrough only for a name
    with no entry.
  • Each accumulator macro (passthrough/state/batch/polling/stream) emits a
    cfg-gated AccumulatorEntry submission and gates its cloacina::-bound
    struct/impls behind cfg(not(packaged)) — so packaged mode emits only the
    function + inventory record (the host provides the runtime), making
    #[state_accumulator] etc. compile in lean packaged crates.
  • reactor-only-rust now declares alpha as #[state_accumulator(capacity=5)];
    primitive_only_packaging asserts the metadata reports alpha=state(capacity
    5) and undecorated beta=passthrough. Verified: compiles packaged + passes.

The reconciler's accumulator_factory_for (from the merged Python-side T-0896
work) consumes this real type, so a packaged Rust reactor now gets a real
state/batch/polling accumulator instead of a silent passthrough.

Dylan Bobby Storey added 2 commits July 14, 2026 22:04
…a + macros usable in packaged crates

The plugin shell hardcoded accumulator_type = "passthrough" in get_graph/reactor
metadata, so every Rust packaged accumulator silently degraded — the Rust analog
of the Python-path T-0896 fix. And the accumulator attribute macros could not
even be used in a lean packaged crate: their generated `impl cloacina::…`
structs reference the `cloacina` umbrella, which packaged crates don't depend on
(no example/fixture ever decorated an accumulator — the path was dead).

- cloacina-workflow-plugin: new `AccumulatorEntry` inventory (name/type/config).
  get_graph_metadata + get_reactor_metadata build a name->spec map from it and
  report each accumulator's REAL kind + config, falling back to passthrough only
  when a name has no entry.
- cloacina-macros: each accumulator macro (passthrough/state/batch/polling/stream)
  now emits a cfg-gated `AccumulatorEntry` submission carrying its kind + config,
  and gates its `cloacina::`-bound struct/impls behind cfg(not(packaged)) — so in
  packaged mode the macro emits only the function + the inventory record (the host
  provides the runtime), making `#[state_accumulator]` etc. compile in lean
  packaged crates.
- reactor-only-rust fixture: `alpha` is now a real #[state_accumulator(capacity=5)];
  primitive_only_packaging asserts get_reactor_metadata reports alpha as `state`
  (capacity 5) and `beta` (undecorated) as passthrough. Verified: compiles packaged
  + test passes.

Completes the Rust-cdylib side of T-0896 (Python side landed earlier).
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