Documentation
¶
Overview ¶
Package ir defines the immutable, language-neutral graph representation consumed by runtime and inspection tooling. Authoring frontends must lower through the shared graph compiler rather than constructing runtime objects.
Index ¶
Constants ¶
const BoundaryQueuePrefix = "boundary:"
BoundaryQueuePrefix reserves the runtime/inspection queue namespace used for exported graph boundaries. Internal edge IDs may never use it; without this reservation an edge could alias a boundary queue in live evidence.
const FormatVersion = 1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Boundary ¶
type Boundary struct {
Name string `json:"name" yaml:"name"`
Direction BoundaryDirection `json:"direction" yaml:"direction"`
Endpoint Endpoint `json:"endpoint" yaml:"endpoint"`
Type element.Type `json:"type" yaml:"type"`
Source *Source `json:"source,omitempty" yaml:"source,omitempty"`
}
Boundary exports an internal lane as part of the composite contract.
type BoundaryDirection ¶
type BoundaryDirection string
BoundaryDirection is relative to the composite graph.
const ( InputBoundary BoundaryDirection = "input" OutputBoundary BoundaryDirection = "output" )
type Edge ¶
type Edge struct {
ID string `json:"id" yaml:"id"`
From Endpoint `json:"from" yaml:"from"`
To Endpoint `json:"to" yaml:"to"`
Type element.Type `json:"type" yaml:"type"`
Delivery Delivery `json:"delivery" yaml:"delivery"`
Ordering string `json:"ordering" yaml:"ordering"`
Depth int `json:"depth" yaml:"depth"`
Source *Source `json:"source,omitempty" yaml:"source,omitempty"`
}
Edge is one bounded, typed channel.
type Endpoint ¶
type Endpoint struct {
Node string `json:"node" yaml:"node"`
Port string `json:"port" yaml:"port"`
Lane string `json:"lane,omitempty" yaml:"lane,omitempty"`
}
Endpoint identifies a concrete port lane. Lane is empty for a singular port.
type Graph ¶
type Graph struct {
FormatVersion uint64 `json:"format_version" yaml:"format_version"`
ID string `json:"id" yaml:"id"`
Revision uint64 `json:"revision" yaml:"revision"`
Fingerprint string `json:"fingerprint" yaml:"fingerprint"`
Lineage []string `json:"lineage,omitempty" yaml:"lineage,omitempty"`
Nodes []Node `json:"nodes" yaml:"nodes"`
Edges []Edge `json:"edges,omitempty" yaml:"edges,omitempty"`
Boundaries []Boundary `json:"boundaries,omitempty" yaml:"boundaries,omitempty"`
Scopes []Scope `json:"scopes,omitempty" yaml:"scopes,omitempty"`
}
Graph is a fully elaborated graph. Slices are canonicalized by Freeze; code mounting a graph should accept only values for which Validate succeeds.
func Freeze ¶
Freeze recursively clones, canonicalizes, validates, and fingerprints a graph. The input is never mutated.
type Node ¶
type Node struct {
ID string `json:"id" yaml:"id"`
Element element.Identity `json:"element" yaml:"element"`
Implementation string `json:"implementation,omitempty" yaml:"implementation,omitempty"`
ConfigReference string `json:"config_reference,omitempty" yaml:"config_reference,omitempty"`
ConfigDigest string `json:"config_digest,omitempty" yaml:"config_digest,omitempty"`
DeploymentReference string `json:"deployment_reference,omitempty" yaml:"deployment_reference,omitempty"`
DeploymentDigest string `json:"deployment_digest,omitempty" yaml:"deployment_digest,omitempty"`
Ports []Port `json:"ports" yaml:"ports"`
Reaction element.Reaction `json:"reaction,omitempty" yaml:"reaction,omitempty"`
StateSchema string `json:"state_schema,omitempty" yaml:"state_schema,omitempty"`
StateTransfer *element.StateTransferCapabilities `json:"state_transfer,omitempty" yaml:"state_transfer,omitempty"`
ConfigSchema string `json:"config_schema,omitempty" yaml:"config_schema,omitempty"`
Dependencies []element.Dependency `json:"dependencies,omitempty" yaml:"dependencies,omitempty"`
Effects []element.Effect `json:"effects,omitempty" yaml:"effects,omitempty"`
Source *Source `json:"source,omitempty" yaml:"source,omitempty"`
}
Node is one resolved element instance. Configuration and implementation references are non-secret identities; actual values live in separate artifacts and are schema-checked before mount.
type Port ¶
type Port struct {
Name string `json:"name" yaml:"name"`
Direction element.Direction `json:"direction" yaml:"direction"`
Type element.Type `json:"type" yaml:"type"`
Cardinality element.Cardinality `json:"cardinality" yaml:"cardinality"`
Required bool `json:"required,omitempty" yaml:"required,omitempty"`
MinConnections int `json:"min_connections,omitempty" yaml:"min_connections,omitempty"`
LossAllowed bool `json:"loss_allowed,omitempty" yaml:"loss_allowed,omitempty"`
DefaultDepth int `json:"default_depth,omitempty" yaml:"default_depth,omitempty"`
Lanes []string `json:"lanes,omitempty" yaml:"lanes,omitempty"`
}
Port is a resolved descriptor port group. A variadic port has one stable lane per edge or exported boundary; lane identities derive from semantic connection identities rather than author-facing numeric indexes.
type Scope ¶
type Scope struct {
ID string `json:"id" yaml:"id"`
Parent string `json:"parent,omitempty" yaml:"parent,omitempty"`
Composite element.Identity `json:"composite" yaml:"composite"`
Nodes []string `json:"nodes" yaml:"nodes"`
Boundaries []ScopeBoundary `json:"boundaries,omitempty" yaml:"boundaries,omitempty"`
}
Scope retains one expanded subgraph instance so inspection can collapse or expand hierarchy while runtime execution uses the same flattened channels.
type ScopeBoundary ¶
type ScopeBoundary struct {
Name string `json:"name" yaml:"name"`
Direction BoundaryDirection `json:"direction" yaml:"direction"`
Endpoint Endpoint `json:"endpoint" yaml:"endpoint"`
Type element.Type `json:"type" yaml:"type"`
}
type Source ¶
type Source struct {
Path string `json:"path,omitempty" yaml:"path,omitempty"`
StartOffset int `json:"start_offset,omitempty" yaml:"start_offset,omitempty"`
EndOffset int `json:"end_offset,omitempty" yaml:"end_offset,omitempty"`
Line int `json:"line,omitempty" yaml:"line,omitempty"`
Column int `json:"column,omitempty" yaml:"column,omitempty"`
}
Source identifies a frontend location for inspection and diagnostics. It is provenance rather than graph semantics and is excluded from fingerprints.