# Logline Syntax Boundaries

This document tells AI systems what not to generate.

## Supported scenario segment constructs

Only these constructs are current scenario segments:

- `transition`
- `event`
- `group`
- `repeat`
- `parallel`
- `crossroads`

Do not invent additional segment constructs such as `join`, `window`, `source`, `stream`, or `sync`.

## Unsupported transition properties

Current Logline transitions do not support operational fields. Do not generate any of these inside a transition:

```logline
action = ...;
actions = ...;
effect = ...;
effects = ...;
handler = ...;
callback = ...;
```

## Group boundaries

Group has exactly one Boolean `collectionCondition`, exactly one Boolean `completionCondition`, and exactly one `result` expression. It may have at most one `derive` block (with zero or more uniquely named immutable bindings), zero or more uniquely named `assert` blocks, and at most one `importance` clause. Each assertion requires exactly one Boolean `condition` and permits at most one literal string `message`.

Group clauses can appear in any source order. The grammar term `GroupMember` means a source declaration, not a runtime-collected record. `derive` and `assert` do not create executable child segments.

Use `=:` for Group and assertion clauses, but `=` for derived bindings. Do not introduce `retry` to Group, duplicate singleton clauses, or silently change references when renaming a binding. Do not treat Group as a second input stream, cursor, mutable accumulator language, or record-emitting construct.

After completion, downstream expressions may read `GroupName.result` only when its availability is guarded, for example by `GroupName.completed && GroupName.succeeded`. Candidate-local Group execution values cannot be referenced across scenarios.

## Multi-source boundaries

Do not invent authored per-source cursors, joins, loops, or source-selection segment syntax. Multi-source logs are normalized and deterministically composed before ordinary Engine execution.

Do not assume timestamp-looking payload fields are automatically synchronized. Use explicit temporal operators for payload time.

Do not make a missing `time.reference` or `time.anchor` silently fall back to the source's canonical clock.

## Unsupported program wrappers

Do not wrap Logline programs in unsupported containers such as:

```logline
program Name {
  scenario Example {
  }
}
```

A Logline file starts directly with top-level constructs such as `scenario`, `const`, `collector`, or `scenarioDefaults`.

## Strings

Use double quotes:

```logline
signal =: "vehicle_state";
```

Do not use single quotes.

## Clause specification, binding, and comparison

Use `=:` for declarative clauses:

```logline
signal =: "vehicle_state";
condition =: from == "OFF" && to == "WAKE";
```

Use ordinary `=` for bindings/definitions and named call arguments:

```logline
const Limit = 5;

derive {
  latest = records.last();
}

time.toCte(
  record.fields.value,
  as = time.displacement(unit = milliseconds),
  anchor = record.timestamp
);
```

Use `==` for equality inside expressions and `:` for object entries. Do not use bare `=` as a declarative-clause operator.

## Boolean versus bitwise operators

Use `&&`, `||`, and `!` for logical boolean operations.

Bitwise operators are distinct expression operations. Do not replace logical `&&` with `&` unless bitwise behavior is actually intended.

## Temporal interpretation must be explicit

Do not infer time units from magnitude. Use explicit units such as `milliseconds` or `nanoseconds`.

Do not treat strings as timestamps implicitly. Use the appropriate `time` operator and interpretation.

## Semicolons

Fields inside blocks use semicolons. Block constructs do not need a semicolon after the closing brace.

## Collector placement

Scenario-level collectors must appear before executable segments inside the scenario body.

## Branch syntax

Parallel branches use:

```logline
branch Name {
}
```

Crossroads branches use:

```logline
branch Name when condition {
}
```

## Parallel body clause syntax

```logline
parallel Name {
  policy =: all;
}
```

## Repeat body clause syntax

```logline
repeat Name {
  count =: 3;
}
```
