Spec Authoring
Pipeline specs in ByteOr are structured documents that describe what a pipeline does, how it is connected, and what execution constraints apply. This page covers authoring practices for both SingleRing and LaneGraph targets.
The Spec Format
ByteOr uses a deterministic key-value (KV) format for pipeline specs. The format is:
- UTF-8 text with one
key=valuepair per line - Newline-delimited and whitespace-sensitive
- Deterministic — the same logical spec always produces the same byte-for-byte encoding
- Canonicalizable — specs can be round-tripped through encode/decode without drift
- Diff-friendly — line-based format works naturally with version control
KV Encoding Rules
- No quoting or escaping for simple values
- Nested structures use dotted key paths
- Arrays use indexed keys
- Boolean values are
trueorfalse - Integer values are decimal
Source Authoring Contract
The supported authoring surface is PipelinePlanV2. This is the source contract for both execution targets.
Builder-First Rule
The builder API in byteor-pipeline-spec is the baseline authoring contract. Macros are optional ergonomics built on top of the builder. A macro-only surface without an equivalent builder path is not the supported baseline.
Authoring a SingleRing Spec
- Set the pipeline name and execution target to
SingleRing - Define ingress and egress boundaries
- List stages in topological order with explicit dependencies
- Set execution constraints: shard count, ordering, producer, scheduling
- Validate and compile
Authoring a LaneGraph Spec
- Set the pipeline name and execution target to
LaneGraph - Define boundaries and stages
- Define graph connections with lane-kind intents
- Set boundary lane policies
- Set the
on_fullbackpressure policy - Validate and compile
Validation Rules
The compiler validates specs before lowering. Common rejection reasons:
- Self-dependencies in stage lists
- Dependencies on later stages (violates topological order)
- Duplicate stage references
- Invalid constraint combinations (e.g.,
Strictordering withshards > 1) - Unsupported lane kinds without the required feature flag
- Topology violations in LaneGraph connections
Version Creation
After validation and lowering, the compiler produces an immutable pipeline version. This version is:
- Content-addressed — identified by spec hash
- Immutable — once created, it cannot change
- Auditable — the full validation result and compilation diagnostics are recorded
In Cloud, version creation happens through the editor's compile path. The draft plan is lowered through the compiler-backed WASM pipeline and stored as a canonical version.
Compile Diagnostics
The compiler emits structured diagnostics during lowering:
- Inserted bridges, routers, and merges (LaneGraph)
- Constraint resolutions
- Feature-gated capabilities used
These diagnostics are part of the compile report and can be inspected after version creation.