Concepts

Inspect one history before comparing two.

Not every temporal question is cross-source. Sometimes you first need to know which windows exist, which are open, what was active at a point, or what context was attached to one lane.

Problem

A comparison result is too late if the source history is wrong.

Before asking why two providers disagree, inspect the raw recorded history. Direct history queries help validate predicates, key selectors, source labels, segment boundaries, and open windows.

var open = pipeline.History.OpenWindows
    .Where(window => window.WindowName == "DeviceOffline");

var closedForDevice = pipeline.History.ClosedWindows
    .Where(window => window.WindowName == "DeviceOffline")
    .Where(window => Equals(window.Key, "device-17"));

Solution

Treat the recorded history as the first diagnostic surface.

Query one history when you need to understand what Spanfold recorded before introducing another source. This is the place to verify that the active predicate opens and closes in the right places, the key is stable, the source lane is correct, and segments split exactly where the domain says they should.

Questions

Start with one lane before explaining disagreement.

What is open now?

Read open windows to see active state before running live comparison.

What closed earlier?

Read closed windows to validate start/end boundaries and source labels.

What was knowable?

Use known-at filtering when an audit must not include future records.

What should be exported?

Use JSON, Markdown, debug HTML, or LLM context once the recorded evidence is correct.

How

Narrow by window, key, source, segment, and tag.

A useful query usually starts broad, then narrows. First confirm the window family exists. Then filter by key or source. Finally add segment and tag filters to make sure the context model behaves the way a later comparison will expect.

var incidentWindows = pipeline.History
    .Query()
    .Window("DeviceOffline")
    .Segment("lifecycle", "Incident")
    .Tag("fleet", "critical")
    .Windows();

var byLifecycle = pipeline.History
    .Query()
    .Window("DeviceOffline")
    .Windows()
    .SummarizeBySegment("lifecycle");