Window name and key
The state family and logical entity, such as DeviceOffline for device-17.
Concepts
A latest-state table tells you what is true now. A state window tells you when a predicate was true, for which key, from which source, and with what context. Everything else in Spanfold builds on that record.
Problem
If a device is healthy now, a latest-state table cannot show that it was offline earlier, which provider saw it, how long it lasted, or whether another provider missed it. That missing duration is usually the evidence needed for debugging, audit, and quality checks.
Solution
A window opens when the active predicate becomes true for a key and
closes when it becomes false. Think of it as [start, end):
active at the start point and no longer active at the end point. That
convention lets touching windows line up without overlapping by one
unit.
var pipeline = Spanfold.Spanfold
.For<DeviceSignal>()
.RecordWindows()
.Window("DeviceOffline", window => window
.Key(signal => signal.DeviceId)
.ActiveWhen(signal => !signal.IsOnline))
.Build();
What is stored
The state family and logical entity, such as DeviceOffline for device-17.
The lane that reported the state and the runtime partition that owns its state machine.
Processing positions or timestamps for the start and end of active state.
Boundary context and descriptive metadata preserved for later filtering, comparison, and export.