Concepts

Use the right time axis for the question.

Temporal bugs often happen because event time, processing order, availability time, and live horizons are treated as one thing. Spanfold keeps those ideas explicit.

Problem

Different clocks answer different questions.

Event time answers when the source says something happened. Processing position answers when your pipeline saw it. Known-at answers what was available to a decision. A live horizon answers how to evaluate still-open windows now.

Processing position

Default monotonic sequence. Use it for deterministic tests, replay, and pipeline-stage comparison.

Timestamp

Use event timestamps when the source clock is the analytical truth and durations need real time.

Known-at

Filter out records that were not available at the decision point. This prevents future leakage.

Live horizon

Clip open windows to an explicit point and mark dependent rows as provisional.

How

Make time explicit in the plan.

var audit = pipeline.History
    .Compare("Decision audit")
    .Target("decision", s => s.Source("decision-service"))
    .Against("risk", s => s.Source("risk-provider"))
    .Within(scope => scope.Window("HighRisk"))
    .Normalize(n => n.KnownAtPosition(42))
    .Using(c => c.AsOf(
        AsOfDirection.Previous,
        TemporalAxis.ProcessingPosition,
        toleranceMagnitude: 10))
    .Run();