config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 28 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config compiles the separate graph topology, resolution lock, values, channel, deployment, and secret-catalog artifacts into one immutable launch plan. Construction is pure: it resolves metadata and validates every contract before a runtime factory can acquire resources.

Index

Constants

View Source
const ChannelsAPIVersion = "openrealtime.ai/channels/v1alpha1"
View Source
const PlanFormatVersion uint64 = 1

Variables

This section is empty.

Functions

func SecretCatalogFingerprint

func SecretCatalogFingerprint(catalog *graphsecret.Document) (string, error)

SecretCatalogFingerprint returns the exact private artifact identity used by Plan creation. It covers canonical provider/locator bindings but never resolves or hashes credential bytes. Runtime preparation uses this function to prove that the Store it snapshots was built from the same reviewed catalog as the immutable Plan.

Types

type Artifact

type Artifact struct {
	Path     string
	Encoding Encoding
	Data     []byte
}

Artifact is one caller-owned input. Create snapshots Data before returning; no Plan accessor aliases it.

type Artifacts

type Artifacts struct {
	Topology   Artifact
	Values     Artifact
	Lock       Artifact
	Channels   Artifact
	Deployment Artifact
}

Artifacts are the separate inputs to one immutable plan. Channels is optional and defaults to descriptor queue depths; every other artifact is required for a normal locked deployment.

type Channel

type Channel struct {
	Depth int `json:"depth" yaml:"depth"`
}

type ChannelDocument

type ChannelDocument struct {
	APIVersion string             `json:"apiVersion" yaml:"apiVersion"`
	Graph      string             `json:"graph" yaml:"graph"`
	Edges      map[string]Channel `json:"edges,omitempty" yaml:"edges,omitempty"`
}

ChannelDocument is the exceptional, edge-keyed queue-depth overlay. Loss remains topology (`=>`) and ordinary depths remain descriptor defaults.

type DependencyResolution

type DependencyResolution struct {
	Name     string                   `json:"name"`
	Artifact inspect.ArtifactIdentity `json:"artifact"`
	Scope    DependencyScope          `json:"scope"`
}

type DependencyScope

type DependencyScope string

DependencyScope fixes the lifetime at which a dependency service is selected. Process-scoped services are sealed during resource-free preparation; mount-scoped services are supplied independently to each prepared-plan mount. Scope is part of the immutable resolution identity.

const (
	DependencyScopeProcess DependencyScope = "process"
	DependencyScopeMount   DependencyScope = "mount"
)

func (DependencyScope) Validate

func (scope DependencyScope) Validate() error

type Discovery

type Discovery interface {
	ResolveImplementation(context.Context, ImplementationRequest) (ImplementationResolution, error)
	ResolveDependency(context.Context, string) (DependencyResolution, error)
}

Discovery is a metadata-only preflight boundary. Implementations must not dial providers, open devices, construct factories, or resolve secret values. Runtime startup performs a second live handshake against the identities frozen here.

type DiscoverySnapshot

type DiscoverySnapshot struct {
	Implementations []ImplementationResolution `json:"implementations"`
	Dependencies    []DependencyResolution     `json:"dependencies"`
}

DiscoverySnapshot is a deterministic, independent catalog view suitable for management-plane discovery. It contains no factory handles or secret data.

type Encoding

type Encoding string

Encoding identifies an artifact frontend. It is provenance, not graph semantics: equivalent frontends may compile to the same Graph IR while retaining different exact source identities.

const (
	ORTG Encoding = "ortg"
	JSON Encoding = "json"
	YAML Encoding = "yaml"
)

type Identity

type Identity struct {
	FormatVersion          uint64 `json:"format_version"`
	GraphID                string `json:"graph_id"`
	GraphRevision          uint64 `json:"graph_revision"`
	SourceDigest           string `json:"source_digest"`
	LockDigest             string `json:"lock_digest"`
	ValuesDigest           string `json:"values_digest"`
	ChannelsDigest         string `json:"channels_digest"`
	ValuesSchemaDigest     string `json:"values_schema_digest"`
	PublicDeploymentDigest string `json:"public_deployment_digest"`
	ResolutionDigest       string `json:"resolution_digest"`
	GraphFingerprint       string `json:"graph_fingerprint"`
	PlanFingerprint        string `json:"plan_fingerprint"`
}

Identity is the public, deterministic source-to-plan chain. Deployment secret references and secret-catalog locators are deliberately excluded; PublicDeploymentDigest is derived from the redacted per-node deployment digests frozen into Graph IR.

func (Identity) Validate

func (identity Identity) Validate() error

type ImplementationRequest

type ImplementationRequest struct {
	NodeID         string
	Reference      string
	Contract       element.Identity
	Placement      string
	Transport      string
	ResourceKeys   []string
	SecretSlotKeys []string
}

type ImplementationResolution

type ImplementationResolution struct {
	Reference    string                       `json:"reference"`
	Contract     element.Identity             `json:"contract"`
	Artifact     inspect.ArtifactIdentity     `json:"artifact"`
	Evidence     inspect.ResolutionEvidence   `json:"evidence"`
	Placements   []string                     `json:"placements,omitempty"`
	Transports   []string                     `json:"transports,omitempty"`
	ResourceKeys []string                     `json:"resource_keys,omitempty"`
	SecretSlots  []string                     `json:"secret_slots,omitempty"`
	Capabilities []inspect.CapabilityIdentity `json:"capabilities,omitempty"`
}

ImplementationResolution proves the registered artifact and exact element contract behind one deployment reference. Capabilities are declared or registration evidence, never mislabeled as live negotiation. Nil means the factory will select and attest its complete capability set during the live readiness handshake; a non-nil slice is an exact registered set.

type Limits

type Limits struct {
	MaxTopologyBytes   int
	MaxValuesBytes     int
	MaxLockBytes       int
	MaxChannelsBytes   int
	MaxDeploymentBytes int
	MaxTotalBytes      int
	MaxJSONDepth       int
	MaxJSONTokens      int
	MaxGraphNodes      int
	MaxGraphEdges      int
	MaxLockEntries     int
	MaxStringBytes     int
}

Limits bounds attacker-controlled artifacts and the frozen result. Zero fields select production defaults; negative fields are invalid.

func DefaultLimits

func DefaultLimits() Limits

DefaultLimits returns an independent set of production limits.

type NodeResolution

type NodeResolution struct {
	NodeID         string                   `json:"node_id"`
	Implementation ImplementationResolution `json:"implementation"`
}

type Options

type Options struct {
	Catalog        *resolve.Catalog
	Loader         graph.SourceLoader
	SchemaResolver schema.Resolver
	Discovery      Discovery
	SecretCatalog  *graphsecret.Document

	// OptionalDependencies explicitly selects descriptor-declared optional
	// services for this immutable plan. Selection and exact service artifacts
	// are frozen into ResolutionDigest; an unselected optional service cannot
	// appear later as ambient mount state.
	OptionalDependencies []string

	Revision uint64
	Limits   Limits
}

type Plan

type Plan struct {
	// contains filtered or unexported fields
}

Plan is immutable after Create. Every accessor returns an independent snapshot. Values and deployment bindings remain available to a future runtime adapter, while secret catalogs and resolved secret bytes are never retained.

func Create

func Create(ctx context.Context, artifacts Artifacts, options Options) (*Plan, error)

Create parses, resolves, validates, binds, and fingerprints every artifact without acquiring runtime resources. The returned Plan is suitable for a later runtime adapter only after its identity is rechecked at mount/startup.

func (*Plan) Channels

func (plan *Plan) Channels() ChannelDocument

func (*Plan) Deployment

func (plan *Plan) Deployment() map[string]deployment.Node

func (*Plan) DeploymentFingerprint

func (plan *Plan) DeploymentFingerprint() string

DeploymentFingerprint is private deployment identity. It changes when a secret reference changes and therefore must not be placed in public catalog metadata or default telemetry.

func (*Plan) Graph

func (plan *Plan) Graph() ir.Graph

func (*Plan) Identity

func (plan *Plan) Identity() Identity

func (*Plan) Lock

func (plan *Plan) Lock() resolve.Lock

func (*Plan) Resolution

func (plan *Plan) Resolution() Resolution

func (*Plan) SecretCatalogFingerprint

func (plan *Plan) SecretCatalogFingerprint() string

SecretCatalogFingerprint is private identity for the selected non-secret provider/locator bindings. Like DeploymentFingerprint, it must not appear in public catalogs or default telemetry.

func (*Plan) Source

func (plan *Plan) Source() Artifact

func (*Plan) Validate

func (plan *Plan) Validate() error

Validate rechecks the complete public identity chain and retained launch inputs without consulting mutable external catalogs.

func (*Plan) Values

func (plan *Plan) Values() map[string]json.RawMessage

func (*Plan) ValuesSchema

func (plan *Plan) ValuesSchema() schema.Bundle

type Resolution

type Resolution struct {
	Nodes        []NodeResolution       `json:"nodes"`
	Dependencies []DependencyResolution `json:"dependencies,omitempty"`
}

func (Resolution) Fingerprint

func (resolution Resolution) Fingerprint() (string, error)

Fingerprint returns the deterministic identity of a complete preflight resolution snapshot. It validates and canonicalizes the snapshot before hashing so catalogs can prove that the implementation metadata they publish is exactly the metadata selected by Plan creation.

type StaticDiscovery

type StaticDiscovery struct {
	// contains filtered or unexported fields
}

StaticDiscovery is a concurrency-safe immutable-revision catalog. Exact idempotent registration is allowed; changing metadata behind a reference is rejected.

func NewStaticDiscovery

func NewStaticDiscovery() *StaticDiscovery

func (*StaticDiscovery) RegisterDependency

func (catalog *StaticDiscovery) RegisterDependency(resolution DependencyResolution) error

func (*StaticDiscovery) RegisterImplementation

func (catalog *StaticDiscovery) RegisterImplementation(resolution ImplementationResolution) error

func (*StaticDiscovery) ResolveDependency

func (catalog *StaticDiscovery) ResolveDependency(ctx context.Context, name string) (DependencyResolution, error)

func (*StaticDiscovery) ResolveImplementation

func (catalog *StaticDiscovery) ResolveImplementation(
	ctx context.Context, request ImplementationRequest,
) (ImplementationResolution, error)

func (*StaticDiscovery) Snapshot

func (catalog *StaticDiscovery) Snapshot() DiscoverySnapshot

type UpdatedLock

type UpdatedLock struct {
	// contains filtered or unexported fields
}

UpdatedLock is the result of the only API that deliberately selects latest descriptor revisions. It is not a launch plan; callers must review/store its lock and call Create in locked mode.

func UpdateLock

func UpdateLock(
	ctx context.Context, topology Artifact, channelsArtifact Artifact, options Options,
) (UpdatedLock, error)

UpdateLock explicitly resolves the latest registered descriptor revisions. It performs no values, deployment, implementation, secret, or launch work.

func (UpdatedLock) ChannelsDigest

func (updated UpdatedLock) ChannelsDigest() string

func (UpdatedLock) Graph

func (updated UpdatedLock) Graph() ir.Graph

func (UpdatedLock) Lock

func (updated UpdatedLock) Lock() resolve.Lock

func (UpdatedLock) SourceDigest

func (updated UpdatedLock) SourceDigest() string

Jump to

Keyboard shortcuts

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