Documentation
¶
Overview ¶
Package providerstate projects safe provider runtime state from its concept owners. It does not own adapter activation, credential resolution, or offering circuit transitions.
Index ¶
- Variables
- type AdapterObservation
- type AdapterState
- type AdapterStatus
- type CredentialGeneration
- type CredentialObservation
- type CredentialPublisher
- type CredentialState
- type CredentialStatus
- type OfferingStatus
- type ProviderStatus
- type ReasonCode
- type Snapshot
- type Store
- func (s *Store) OperatorMaterialReady(providerID string, materialVersion string) bool
- func (s *Store) PublishAvailability(snapshot availability.Snapshot) error
- func (s *Store) PublishCatalog(generationID string, catalog *catalogs.Catalog, ...) error
- func (s *Store) PublishCredentials(generation CredentialGeneration)
- func (s *Store) PublishOutcome(outcome execution.AttemptOutcome)
- func (s *Store) Snapshot() Snapshot
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCatalogRequired reports an incomplete catalog-state projection. ErrCatalogRequired = errors.New("provider-state catalog is required") // ErrAdapterProjectionIncomplete reports missing or duplicate adapter state. ErrAdapterProjectionIncomplete = errors.New("provider adapter projection is incomplete") )
Functions ¶
This section is empty.
Types ¶
type AdapterObservation ¶
type AdapterObservation struct {
ProviderID catalogs.ProviderID
State AdapterState
Reason ReasonCode
}
AdapterObservation is the activation owner's safe projection.
type AdapterState ¶
type AdapterState string
AdapterState identifies compiled support for one catalog provider.
const ( AdapterReady AdapterState = "ready" AdapterUnsupportedTransport AdapterState = "unsupported_transport" AdapterUnsupportedAuthentication AdapterState = "unsupported_authentication" AdapterNoOfferings AdapterState = "no_offerings" )
Adapter support states are a closed projection of compiled primitives and catalog offerings.
type AdapterStatus ¶
type AdapterStatus struct {
State AdapterState `json:"state"`
Reason ReasonCode `json:"reason,omitempty"`
}
AdapterStatus is safe compiled support state.
type CredentialGeneration ¶
type CredentialGeneration struct {
CatalogGenerationID string
Observations []CredentialObservation
}
CredentialGeneration replaces the complete operator credential projection for one exact catalog generation.
type CredentialObservation ¶
type CredentialObservation struct {
ProviderID catalogs.ProviderID
State CredentialState
Reason ReasonCode
Usable bool
MaterialVersion string
}
CredentialObservation is the reconciler's safe lifecycle projection. MaterialVersion is opaque internal evidence and never enters Snapshot.
type CredentialPublisher ¶
type CredentialPublisher interface {
PublishCredentials(CredentialGeneration)
}
CredentialPublisher accepts complete reconciler projections.
type CredentialState ¶
type CredentialState string
CredentialState identifies operator inference credential state.
const ( CredentialReady CredentialState = "ready" CredentialNotConfigured CredentialState = "not_configured" CredentialDenied CredentialState = "denied" CredentialInvalid CredentialState = "invalid" CredentialRefreshing CredentialState = "refreshing" )
Operator credential states are a closed lifecycle projection.
type CredentialStatus ¶
type CredentialStatus struct {
State CredentialState `json:"state"`
Reason ReasonCode `json:"reason,omitempty"`
Usable bool `json:"usable"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
CredentialStatus is safe operator credential state.
type OfferingStatus ¶
type OfferingStatus struct {
ProviderModelID catalogs.ProviderModelID `json:"provider_model_id"`
State availability.State `json:"state"`
Reason ReasonCode `json:"reason,omitempty"`
}
OfferingStatus is the projected state of one exact opaque provider model ID.
type ProviderStatus ¶
type ProviderStatus struct {
ProviderID catalogs.ProviderID `json:"provider_id"`
Adapter AdapterStatus `json:"adapter"`
OperatorCredential CredentialStatus `json:"operator_credential"`
Offerings []OfferingStatus `json:"offerings"`
}
ProviderStatus separates adapter, operator credential, and offering state.
type ReasonCode ¶
type ReasonCode string
ReasonCode is a stable, secret-free operator reason.
const ( ReasonNone ReasonCode = "" ReasonTransportUnsupported ReasonCode = "transport_unsupported" ReasonAuthenticationUnsupported ReasonCode = "authentication_unsupported" ReasonNoOfferings ReasonCode = "no_offerings" ReasonOperatorNotRequired ReasonCode = "credential_not_required" ReasonOperatorNotConfigured ReasonCode = "credential_not_configured" ReasonOperatorSourceDenied ReasonCode = "credential_source_denied" ReasonOperatorSourceInvalid ReasonCode = "credential_source_invalid" ReasonOperatorRefreshRetained ReasonCode = "credential_refresh_failed_retained" ReasonOperatorRefreshing ReasonCode = "credential_refreshing" ReasonAuthenticationFailed ReasonCode = "authentication_failed" ReasonPermissionDenied ReasonCode = "permission_denied" ReasonQuotaExceeded ReasonCode = "quota_exceeded" ReasonCatalogRetired ReasonCode = "catalog_retired" ReasonOfferingNotFound ReasonCode = "offering_not_found" ReasonRateLimited ReasonCode = "rate_limited" ReasonProviderTimeout ReasonCode = "provider_timeout" )
Provider-state reason codes are stable and contain no provider diagnostics or credential material.
type Snapshot ¶
type Snapshot struct {
Revision uint64 `json:"revision"`
CatalogGenerationID string `json:"catalog_generation_id"`
Providers []ProviderStatus `json:"providers"`
}
Snapshot is one caller-owned immutable provider-state generation.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store retains safe projections and exact opaque versions needed to reject stale inference outcomes.
func (*Store) OperatorMaterialReady ¶
OperatorMaterialReady reports whether an exact resolved material version is eligible for a new inference attempt. A version not yet observed by the projection is admitted so an atomic runtime publication cannot be blocked by a lagging status projection.
func (*Store) PublishAvailability ¶
func (s *Store) PublishAvailability(snapshot availability.Snapshot) error
PublishAvailability projects the availability owner's complete snapshot.
func (*Store) PublishCatalog ¶
func (s *Store) PublishCatalog( generationID string, catalog *catalogs.Catalog, observations []AdapterObservation, ) error
PublishCatalog replaces the complete catalog and adapter projection.
func (*Store) PublishCredentials ¶
func (s *Store) PublishCredentials(generation CredentialGeneration)
PublishCredentials replaces the reconciler projection. A successful read of the same material version does not erase an inference-proved failure.
func (*Store) PublishOutcome ¶
func (s *Store) PublishOutcome(outcome execution.AttemptOutcome)
PublishOutcome applies only explicitly scoped operator credential evidence.