# Multi-Source Execution and Canonical Timeline Epoch

This document summarizes the current AI-facing multi-source model.

## One canonical stream

Logline programs do not execute one cursor per source. Source-specific import and temporal normalization occur upstream. The Engine consumes one deterministic canonical sequential stream.

## Canonical Timeline Epoch (CTE)

CTE is the run-level canonical time coordinate used to compare and order canonical record timestamps across admitted sources.

Each source's canonical top-level record timestamp is interpreted in its declared temporal domain and mapped exactly onto CTE before composition.

## Named non-canonical clocks

A source may also declare named temporal references for clocks embedded in payload data. These references are distinct from the source's canonical top-level record clock and can have their own domains/anchors.

A missing named reference does not alias the canonical source clock.

## Named anchors

Named anchors resolve to exact CTE timestamps. Programs use `time.anchor(source = ..., id = ...)` when they need the resolved anchor in an expression.

## Deterministic source composition

After each source record has a CTE timestamp, composition uses this total-order policy:

1. exact CTE timestamp;
2. resolved source order;
3. source-local cursor/record order.

The source order is resolved before worker execution. An explicitly configured source order is preserved; otherwise the source declaration order is used under the current source-order policy.

## Record identity

The composite stream assigns the final canonical `record.index`. Source-local position/provenance remains separate.

Therefore:

```text
record.index != source-local file index
```

in general.

## Exact and bounded composition

Composition is lazy/bounded rather than full-materialization by design: one current head per source is sufficient for deterministic merging. Each source must be monotonic in its normalized CTE order.

## Portable processing configuration and Workbench projection

Workbench retains imported sources independently. Raw is source-local; Execution Records is the one canonical merged CTE stream. Its **Log processing configuration** editor binds ordered logical log slots to retained source identities, declares participation independently of viewer filtering, and edits the exact temporal rules. Applying validated draft changes is transactional; Cancel leaves the active setup unchanged. Portable configuration rules do not silently bind by filename or reuse recording-specific anchor values as proof for a different recording.

A source may present numeric timestamps without a verified origin. The editor can explicitly declare `numeric-relative` or `numeric-unix-epoch` with the appropriate native unit (`ns`, `us`, `ms`, or `s`); neither unit nor epoch is guessed from magnitude. Relative canonical source clocks remain blocked until an allowed single-source reference convention or verified source-to-run/source-to-source relationship resolves them. Relative log zero points are not assumed aligned merely because multiple logs start near zero. Absolute clock representation is not proof of clock accuracy.

A single unambiguous source can be prepared automatically through the same canonical preflight. For one relative source, mapping its **first accepted** record to run-relative zero is an explicit convention, not an assertion that capture began there. Multi-source runs still require established comparability. The Workbench reuses shared preflight/binding and provides an explanatory synchronized-timeline preview. Execution Records and Run/Debug use independent readers over the same resolved participating-source chronology.

The editor does not infer offsets or silently align recordings by coincident events. It preserves other temporal declaration facts it does not own, including named non-canonical references and named anchors.

## Payload time is not automatically synchronized

A record can carry payload values representing device clocks, offsets, encoded times, or other temporal coordinates. Those fields are not automatically rewritten when the canonical record timestamp is normalized.

Use `time.toCte(...)` with explicit interpretation and, when needed, a named `time.reference(...)` or `time.anchor(...)` resolved from the same trusted preflight model.

## Language boundary

Logline source does not define per-source cursors, synchronization policy, anchor graphs, or run CTE selection. Programs consume the already-composed stream and may inspect `source`, `channel`, record fields, Groups, Parallel branches, collectors, and temporal operators.

## Equal timestamps

Multiple records may legitimately have the same CTE timestamp. The deterministic source/local-order tie-break produces stable stream order, but equal timestamp does not imply a physical causal order. If multiple equal-time observations must participate together in a decision, model that explicitly with constructs such as Parallel or Group rather than relying on an incidental source order for semantic meaning.
