Add a tick-bar aggregator, factoring the windowed-rollover fold into the engine layer #289
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Phase 4 of the Stratification milestone (#288) placed
Resamplein the newaura-marketcrate. Its mechanics, though, are domain-free: a windowed-rolloverfold over N
f64channels — keyed by a time bucket, one reduction per channel(
first/max/min/last), emitting a completed window only on bucketrollover (C2). Only three things make
Resamplemarket-specific: theo/h/l/cport/field naming, the OHLC reduction quartet
[first, max, min, last], and thenominal-minute bucketing (
snap_to_nearest_minute, #280).Extracting that generic fold into the engine layer (
aura-std) was deliberatelynot done in #288: with
Resamplethe only consumer, it would have been aone-implementor abstraction — the pattern aura defers by its demand-driven rule
(the same reasoning behind the twice-ratified #136 / #147 deferral). A second
consumer removes that objection.
The work
A tick → bar aggregator (market, new). Aggregate a raw tick stream into
bars. This is the second consumer that justifies the shared fold.
Extract the generic fold into
aura-std(engine). A domain-freewindowed-rollover reducer over N channels with a closed reduction vocabulary,
emit-on-complete (C2),
aura-core-only. Proposed shape (a design sketch,not yet implemented — validate against the
aura-coreNodemodel duringspec production):
Re-express
Resample(market) over the shared fold — behaviour-preserving.BucketFold<4>with reducers[First, Max, Min, Last]+ minute bucketing + theo/h/l/cschema. The existingResampletests (crates/aura-market/src/resample.rs) must stay green unchanged — this is a pure factoring; theobservable OHLC behaviour is identical.
Design forks (to settle in the spec)
Resample'skeying), fixed tick count, or accumulated volume — likely more than one, as a
closed policy vocabulary rather than a single choice.
vocabulary gains a
Sumreducer. Worth deciding up front soBucketFold'sReducerset is right the first time rather than widened later.Scope
Resamplelives inaura-market, moved verbatim); this is a follow-up that cleans up the one nodeC28 flagged as mechanically-generic-but-market-placed.
Resample; net-new for the tick aggregator. Thefactoring lands the generic fold in the engine layer, keeping the C28 import
direction (market → engine) intact.