runtime

package
v0.1.0-alpha.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace            = "runtime."
	EnvNamespace         = Namespace + "env."
	SecretNamespace      = Namespace + "secrets."
	InputNamespace       = Namespace + "input."
	RunSlugParamName     = Namespace + "run.slug"
	RunDateParamName     = Namespace + "run.date"
	RunDateTimeParamName = Namespace + "run.datetime"
)

Variables

This section is empty.

Functions

func BoundOperationIdentity

func BoundOperationIdentity(value any, parameters map[string]any) (any, error)

BoundOperationIdentity materializes dynamic bindings only for checkpoint hashing. Dispatch keeps the original template so SQL and connector values remain bound data.

func EnvironmentKeys

func EnvironmentKeys(pipeline *pipelinespec.Pipeline) []string

EnvironmentKeys lists only references in fields ResolvePipeline substitutes.

func FreezeLiteralOperationFields

func FreezeLiteralOperationFields(pipeline *pipelinespec.Pipeline) map[slug.Slug]map[string]any

FreezeLiteralOperationFields turns supplied spans into ordinary connector bindings. Their request-local values are inserted by connectors once, after authored syntax validation.

func HasEnvironmentSecretReference

func HasEnvironmentSecretReference(input string) bool

func HasEnvironmentSecretReferenceInPipeline

func HasEnvironmentSecretReferenceInPipeline(pipeline *pipelinespec.Pipeline) bool

HasEnvironmentSecretReferenceInPipeline reports whether runtime secret resolution is needed.

func HasRuntimeVariableReference

func HasRuntimeVariableReference(input string) bool

func InputParameterKeys

func InputParameterKeys(input map[string]any) []string

InputParameterKeys returns the sorted safe parameter-key names for run source metadata.

func IsEnvironmentSecretReference

func IsEnvironmentSecretReference(input string) bool

func IsIncrementalExecution

func IsIncrementalExecution(ctx context.Context) bool

func IsRuntimeVariableReference

func IsRuntimeVariableReference(input string) bool

func IsSinkExecution

func IsSinkExecution(ctx context.Context) bool

func LiteralBindingsFrom

func LiteralBindingsFrom(ctx context.Context) map[string]any

func LiteralValue

func LiteralValue(value any) any

LiteralValue removes interpretation markers from values already bound as data.

func ResolveExecutionValue

func ResolveExecutionValue(value any, snapshot ExecutionContext) (any, error)

ResolveExecutionValue substitutes metadata before input and secret resolution so supplied values cannot introduce executable expressions. Whole-value references retain null/boolean types.

func ResolveIncrementalValue

func ResolveIncrementalValue(value any, parameters map[string]any) (any, error)

func ResolvePipeline

func ResolvePipeline(pipeline *pipelinespec.Pipeline, variables []model.RuntimeVariable) error

ResolvePipeline substitutes product-managed runtime variables in environment-aware runtime fields. Non-env placeholders are left for connector/query execution.

func ResolvePipelineExecution

func ResolvePipelineExecution(pipeline *pipelinespec.Pipeline, snapshot ExecutionContext) error

func ResolvePipelineInput

func ResolvePipelineInput(pipeline *pipelinespec.Pipeline, input map[string]any) error

ResolvePipelineInput substitutes non-secret per-run input values in runtime fields. Values are request-local: callers must persist only InputParameterKeys output, never values.

func ResolvePipelineSecrets

func ResolvePipelineSecrets(pipeline *pipelinespec.Pipeline, secrets []model.RuntimeSecretValue) error

ResolvePipelineSecrets substitutes write-only environment secret values inside the runtime boundary.

func ResolveSinkValue

func ResolveSinkValue(value any, metadata map[string]any) (any, error)

ResolveSinkValue checks metadata availability before a sink claims or dispatches an effect.

func RestoreLiteralLocations

func RestoreLiteralLocations(pipeline *pipelinespec.Pipeline, paths []LiteralLocation) bool

RestoreLiteralLocations restores literal trust markers lost by JSON.

func SecretReference

func SecretReference(key string) string

func ValidateExecutionAvailability

func ValidateExecutionAvailability(value any, snapshot ExecutionContext) error

ValidateExecutionAvailability checks context without substituting SQL-bound values.

func ValidateInput

func ValidateInput(input map[string]any) error

ValidateInput enforces the public non-secret runtime input key contract.

func ValidateInputKey

func ValidateInputKey(key string) error

ValidateInputKey checks whether a per-run input key can be referenced as runtime.input.key.

func ValidateOperationReferences

func ValidateOperationReferences(statement string, sink, incremental bool) error

ValidateOperationReferences validates the interpreted operation, including a JSON statement envelope.

func ValidatePipelineExecution

func ValidatePipelineExecution(pipeline *pipelinespec.Pipeline) error

ValidatePipelineExecution checks expression grammar without consulting a clock or history.

func ValidateRuntimeReferences

func ValidateRuntimeReferences(value any, expressions, sink, incremental bool) error

ValidateRuntimeReferences checks authored syntax, never resolved values. Dynamic keys and checkpoint fields are checked against their execution context later.

func VariableReference

func VariableReference(key string) string

func WithExecutionContext

func WithExecutionContext(ctx context.Context, snapshot ExecutionContext) context.Context

func WithIncrementalExecution

func WithIncrementalExecution(ctx context.Context) context.Context

func WithLiteralBindings

func WithLiteralBindings(ctx context.Context, values map[string]any) context.Context

func WithSinkExecution

func WithSinkExecution(ctx context.Context) context.Context

Types

type ExecutionContext

type ExecutionContext struct {
	RunSlug         string         `json:"run_slug,omitempty"`
	At              time.Time      `json:"at"`
	PreviousSuccess *SuccessfulRun `json:"previous_success,omitempty"`
}

ExecutionContext contains only safe, pinned execution metadata, never input or secret values.

func ExecutionContextFrom

func ExecutionContextFrom(ctx context.Context) (ExecutionContext, bool)

type IncrementalValue

type IncrementalValue struct{ Template any }

IncrementalValue defers an authored reference until the source checkpoint is known.

type LiteralLocation

type LiteralLocation struct {
	Path   []string `json:"path"`
	Ranges [][2]int `json:"ranges,omitempty"`
}

LiteralLocation records interpretation metadata without copying supplied values.

func LiteralLocations

func LiteralLocations(pipeline *pipelinespec.Pipeline) []LiteralLocation

LiteralLocations returns deterministic locations whose values must not be interpreted as runtime syntax after a JSON clone or deployment reload.

type LiteralString

type LiteralString string

LiteralString is a connector literal produced from a whole-value text runtime variable that would otherwise collide with a later runtime expression language. It is unwrapped back to string before connector execution.

type LiteralTemplate

type LiteralTemplate struct {
	Text   string
	Ranges [][2]int
}

LiteralTemplate preserves supplied spans while other authored references await resolution.

func (LiteralTemplate) MarshalJSON

func (v LiteralTemplate) MarshalJSON() ([]byte, error)

type SuccessfulRun

type SuccessfulRun struct {
	RunSlug    string    `json:"run_slug"`
	StartedAt  time.Time `json:"started_at"`
	FinishedAt time.Time `json:"finished_at"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL