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
- func SecretCatalogFingerprint(catalog *graphsecret.Document) (string, error)
- type Artifact
- type Artifacts
- type Channel
- type ChannelDocument
- type DependencyResolution
- type DependencyScope
- type Discovery
- type DiscoverySnapshot
- type Encoding
- type Identity
- type ImplementationRequest
- type ImplementationResolution
- type Limits
- type NodeResolution
- type Options
- type Plan
- func (plan *Plan) Channels() ChannelDocument
- func (plan *Plan) Deployment() map[string]deployment.Node
- func (plan *Plan) DeploymentFingerprint() string
- func (plan *Plan) Graph() ir.Graph
- func (plan *Plan) Identity() Identity
- func (plan *Plan) Lock() resolve.Lock
- func (plan *Plan) Resolution() Resolution
- func (plan *Plan) SecretCatalogFingerprint() string
- func (plan *Plan) Source() Artifact
- func (plan *Plan) Validate() error
- func (plan *Plan) Values() map[string]json.RawMessage
- func (plan *Plan) ValuesSchema() schema.Bundle
- type Resolution
- type StaticDiscovery
- func (catalog *StaticDiscovery) RegisterDependency(resolution DependencyResolution) error
- func (catalog *StaticDiscovery) RegisterImplementation(resolution ImplementationResolution) error
- func (catalog *StaticDiscovery) ResolveDependency(ctx context.Context, name string) (DependencyResolution, error)
- func (catalog *StaticDiscovery) ResolveImplementation(ctx context.Context, request ImplementationRequest) (ImplementationResolution, error)
- func (catalog *StaticDiscovery) Snapshot() DiscoverySnapshot
- type UpdatedLock
Constants ¶
const ChannelsAPIVersion = "openrealtime.ai/channels/v1alpha1"
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 ¶
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 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.
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.
type ImplementationRequest ¶
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 ¶
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 ¶
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) Resolution ¶
func (plan *Plan) Resolution() Resolution
func (*Plan) SecretCatalogFingerprint ¶
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) Validate ¶
Validate rechecks the complete public identity chain and retained launch inputs without consulting mutable external catalogs.
func (*Plan) ValuesSchema ¶
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