Documentation
¶
Index ¶
- Constants
- Variables
- func AppendUniqueString(values []string, value string) []string
- func CanonicalResources(resources []Resource) ([]byte, error)
- func ContractProjectionHash(manifest *Manifest) string
- func ContractRevision(resources []Resource, appName string) (string, error)
- func EnsureFieldProvenance(resource *Resource, path, stage string)
- func IsCanonicalSHA256Digest(value string) bool
- func KindForBlock(blockType string) string
- func MarkExpansionFieldProvenance(resource *Resource, generator Resource)
- func ModuleResourceAddress(instance string) string
- func ProvenanceChildPath(parent, name string) string
- func RebaseFieldProvenance(origin *Origin, from, to string)
- func ResourceAddress(module, blockType, name string) string
- func RevisionHash(prefix string, value any) string
- func SetFieldProvenance(origin *Origin, path string, value any, field FieldProvenance)
- func SetFieldProvenanceTree(origin *Origin, value any, path string, field FieldProvenance)
- func ValidateManifest(manifest *Manifest) error
- func WalkReferences(value any, path string, visit func(string, string))
- type ApplicationIdentity
- type ContextBundle
- func Context(manifest *Manifest, options ContextOptions) (ContextBundle, error)
- func ContextAt(manifest *Manifest, workspaceRevision string, diagnostics []Diagnostic, ...) (ContextBundle, error)
- func ContextSnapshot(manifest *Manifest, workspaceRevision string, options ContextOptions) (ContextBundle, error)
- func ContextSnapshotWithDiagnostics(manifest *Manifest, workspaceRevision string, diagnostics []Diagnostic, ...) (ContextBundle, error)
- type ContextOptions
- type ContextToken
- type Diagnostic
- type ExpansionStep
- type FieldProvenance
- type GraphEdge
- type GraphOptions
- type Manifest
- type Origin
- type PartialGraph
- type Related
- type Resource
- type ResourceGraph
- type SourceRecord
Constants ¶
View Source
const ( AgentMaxResources = 1000 AgentMaxBytes = 2_000_000 AgentMaxDepth = 16 )
View Source
const ContextTokenTTL = 5 * time.Minute
View Source
const ManifestKind = "scenery.manifest"
Variables ¶
View Source
var ( ManifestSchemaRevision = "sha256:d5b3c19523c452c5fafe25bceac20c42ab1d6de2d285a11615c7d24f21c2c3c7" DiagnosticCatalog = string(spec.SchemaRevision(spec.DiagnosticDefinitions())) )
Functions ¶
func AppendUniqueString ¶
func CanonicalResources ¶
func ContractProjectionHash ¶
ContractProjectionHash identifies the canonical contract projection without folding in the current specification revision. It is used only to prove a revision-scheme rebind; executable artifacts remain bound to ContractRevision.
func EnsureFieldProvenance ¶
func IsCanonicalSHA256Digest ¶
func KindForBlock ¶
func ModuleResourceAddress ¶
func ProvenanceChildPath ¶
func RebaseFieldProvenance ¶
func ResourceAddress ¶
func RevisionHash ¶
func SetFieldProvenance ¶
func SetFieldProvenance(origin *Origin, path string, value any, field FieldProvenance)
func SetFieldProvenanceTree ¶
func SetFieldProvenanceTree(origin *Origin, value any, path string, field FieldProvenance)
SetFieldProvenanceTree applies provenance to every non-scalar descendant.
func ValidateManifest ¶
Types ¶
type ApplicationIdentity ¶
type ApplicationIdentity struct {
Name string `json:"name"`
}
type ContextBundle ¶
type ContextBundle struct {
machine.ArtifactIdentity
WorkspaceRevision string `json:"workspace_revision"`
ContractRevision string `json:"contract_revision"`
View string `json:"view"`
Resources []Resource `json:"resources"`
Schemas map[string]map[string]any `json:"schemas,omitempty"`
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
Provenance map[string]Origin `json:"provenance,omitempty"`
Truncated bool `json:"truncated"`
ContinuationToken string `json:"continuation_token,omitempty"`
}
func Context ¶
func Context(manifest *Manifest, options ContextOptions) (ContextBundle, error)
func ContextAt ¶
func ContextAt(manifest *Manifest, workspaceRevision string, diagnostics []Diagnostic, options ContextOptions, now time.Time) (ContextBundle, error)
func ContextSnapshot ¶
func ContextSnapshot(manifest *Manifest, workspaceRevision string, options ContextOptions) (ContextBundle, error)
func ContextSnapshotWithDiagnostics ¶
func ContextSnapshotWithDiagnostics(manifest *Manifest, workspaceRevision string, diagnostics []Diagnostic, options ContextOptions) (ContextBundle, error)
type ContextOptions ¶
type ContextOptions struct {
Focus []string `json:"focus"`
Include []string `json:"include,omitempty"`
Depth int `json:"depth,omitempty"`
MaxResources int `json:"max_resources,omitempty"`
MaxBytes int `json:"max_bytes,omitempty"`
View string `json:"view,omitempty"`
ContinuationToken string `json:"continuation_token,omitempty"`
}
type ContextToken ¶
type ContextToken struct {
WorkspaceRevision string `json:"w"`
ContractRevision string `json:"c"`
QueryDigest string `json:"q"`
Offset int `json:"o"`
ExpiresUnix int64 `json:"e"`
}
func ParseContextToken ¶
func ParseContextToken(token string) (ContextToken, error)
type Diagnostic ¶
type Diagnostic struct {
Code string `json:"code"`
Severity string `json:"severity"`
Message string `json:"message"`
ReportToken string `json:"report_token,omitempty"`
Address string `json:"address,omitempty"`
Path string `json:"path,omitempty"`
Range *scn.Range `json:"range,omitempty"`
Related []Related `json:"related,omitempty"`
Suggestions []string `json:"suggestions,omitempty"`
Details map[string]any `json:"details,omitempty"`
}
type ExpansionStep ¶
type FieldProvenance ¶
type FieldProvenance struct {
Kind string `json:"kind"`
DeclaredAt *scn.Range `json:"declared_at,omitempty"`
Input string `json:"input,omitempty"`
ProvidedBy string `json:"provided_by,omitempty"`
SourceAddress string `json:"source_address,omitempty"`
Transformations []string `json:"transformations,omitempty"`
}
func NearestFieldProvenance ¶
func NearestFieldProvenance(origin Origin, path string) FieldProvenance
type GraphEdge ¶
func ResourceEdges ¶
type GraphOptions ¶
type Manifest ¶
type Manifest struct {
Kind string `json:"kind"`
SchemaRevision string `json:"schema_revision"`
SpecRevision string `json:"spec_revision"`
Producer machine.Producer `json:"producer"`
DiagnosticCatalog string `json:"diagnostic_catalog"`
Application ApplicationIdentity `json:"application"`
ContractRevision string `json:"contract_revision"`
Resources []Resource `json:"resources"`
SourceMap map[string]SourceRecord `json:"source_map"`
Diagnostics []Diagnostic `json:"diagnostics"`
}
func DecodeManifest ¶
type Origin ¶
type Origin struct {
Kind string `json:"kind"`
SourceID string `json:"source_id,omitempty"`
Patches []string `json:"patches,omitempty"`
DeclarationRange *scn.Range `json:"declaration_range,omitempty"`
AttributeRanges map[string]scn.Range `json:"attribute_ranges,omitempty"`
ModuleChain []string `json:"module_instantiation_chain,omitempty"`
ExpansionLineage []ExpansionStep `json:"expansion_lineage,omitempty"`
FieldProvenance map[string]FieldProvenance `json:"field_provenance,omitempty"`
}
type PartialGraph ¶
type PartialGraph struct {
Deployable bool `json:"deployable"`
Application ApplicationIdentity `json:"application"`
Resources []Resource `json:"resources"`
SourceMap map[string]SourceRecord `json:"source_map"`
}
type Resource ¶
type Resource struct {
Address string `json:"address"`
Kind string `json:"kind"`
Name string `json:"name"`
Module string `json:"module"`
Spec map[string]any `json:"spec"`
Origin Origin `json:"origin"`
}
type ResourceGraph ¶
type ResourceGraph struct {
machine.ArtifactIdentity
Focus string `json:"focus"`
Direction string `json:"direction"`
Resources []Resource `json:"resources"`
Edges []GraphEdge `json:"edges"`
Truncated bool `json:"truncated"`
}
func Graph ¶
func Graph(manifest *Manifest, focus string, options GraphOptions) (ResourceGraph, error)
type SourceRecord ¶
type SourceRecord struct {
URI string `json:"uri"`
}
Click to show internal directories.
Click to hide internal directories.