Documentation
¶
Overview ¶
Package authoring provides immutable views over the canonical workflow graph IR for Go SDKs, UI tools, and agent-produced material. It compiles through workflow/compile and never owns execution or mutable in-flight state.
Index ¶
- Constants
- func SourceSchemaFor(format graph.SourceFormat) (id, version string, supported bool)
- func ValidatePlanLimits(plan *compile.ExecutionPlan, limits Limits) []diagnostic.Diagnostic
- type Builder
- func (b Builder) Authority(value string) Builder
- func (b Builder) Compile(ctx context.Context, options CompileOptions) Result
- func (b Builder) Edge(value graph.Edge) Builder
- func (b Builder) Envelope() Envelope
- func (b Builder) Graph() graph.Graph
- func (b Builder) Input(value graph.InputSpec) Builder
- func (b Builder) Namespace(value string) Builder
- func (b Builder) Node(value graph.Node) Builder
- func (b Builder) Output(value graph.OutputSpec) Builder
- type CompactDiagnostic
- type CompileOptions
- type Envelope
- type Limits
- type MaterialFormat
- type Result
Constants ¶
const ( // EnvelopeSchemaID is the closed authoring transport contract. EnvelopeSchemaID = "https://schemas.hollis-labs.dev/workflow/authoring/v1/envelope.schema.json" // EnvelopeSchemaVersion is the compact negotiation version for EnvelopeSchemaID. EnvelopeSchemaVersion = "1" // WorkflowSourceSchemaID identifies the graph-native YAML source contract. WorkflowSourceSchemaID = "https://schemas.hollis-labs.dev/workflow/source/v1/workflow-source" // WorkflowSourceSchemaVersion is the supported workflow-source negotiation version. WorkflowSourceSchemaVersion = "1" FormatGraphIR MaterialFormat = "graph_ir" FormatWorkflowSource MaterialFormat = "workflow_source" DefaultMaximumBytes = 2 << 20 DefaultMaximumDepth = 128 DefaultMaximumNodes = 512 DefaultMaximumEdges = 4096 CodeUnsupportedSchema diagnostic.Code = "HADR-SOURCE-038" CodeInvalidEnvelope diagnostic.Code = "HADR-SOURCE-039" CodeDiagnosticsTruncated diagnostic.Code = "HADR-SOURCE-040" )
Variables ¶
This section is empty.
Functions ¶
func SourceSchemaFor ¶
func SourceSchemaFor(format graph.SourceFormat) (id, version string, supported bool)
SourceSchemaFor returns the only accepted material schema for a persisted source discriminator. No caller should infer the format from source bytes.
func ValidatePlanLimits ¶
func ValidatePlanLimits(plan *compile.ExecutionPlan, limits Limits) []diagnostic.Diagnostic
ValidatePlanLimits applies authoring ingress structural ceilings to the final expanded plan, including bundled child definitions. It does not alter the full compiler diagnostics or execution plan.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is an immutable authoring view over graph.Graph. Every method returns an independently owned value; there is no execution or in-flight plan state.
func (Builder) Compile ¶
func (b Builder) Compile(ctx context.Context, options CompileOptions) Result
Compile delegates to the shared graph compile, dependency inference, and validation path.
type CompactDiagnostic ¶
type CompactDiagnostic struct {
Severity string `json:"severity"`
Code string `json:"code"`
Message string `json:"message"`
Path []string `json:"path,omitempty"`
Locator string `json:"locator,omitempty"`
Help string `json:"help,omitempty"`
}
CompactDiagnostic is the bounded generated-client projection. Full diagnostics remain available to Go callers.
func CompactDiagnostics ¶
func CompactDiagnostics(input []diagnostic.Diagnostic) []CompactDiagnostic
CompactDiagnostics returns a deterministic, bounded, presentation-safe projection. A final sentinel makes finding-count omissions explicit; an ellipsis marks truncated fields and path segments.
type CompileOptions ¶
type CompileOptions struct {
Compile compile.CompileOptions
Dependency compile.DependencyOptions
Validation compile.ValidationOptions
Definition graph.DefinitionRef
Limits Limits
}
CompileOptions supplies the exact ordinary compiler and validator catalogs.
type Envelope ¶
type Envelope struct {
SchemaID string `json:"schema_id"`
SchemaVersion string `json:"schema_version"`
MaterialSchemaID string `json:"material_schema_id"`
MaterialSchemaVersion string `json:"material_schema_version"`
Format MaterialFormat `json:"format"`
Graph *graph.Graph `json:"graph,omitempty"`
Source string `json:"source,omitempty"`
}
Envelope is the single strict ingress shape shared by generated clients and agent adapters. SchemaID and SchemaVersion identify this envelope; Material fields identify the selected graph/source schema without implicit fallback.
func DecodeEnvelope ¶
func DecodeEnvelope(data []byte, limits Limits) (Envelope, []diagnostic.Diagnostic)
DecodeEnvelope enforces bounds, JSON shape, schema negotiation, and graph JSON Schema before any compiler work begins.
type MaterialFormat ¶
type MaterialFormat string
MaterialFormat selects exactly one authoring payload.
func (MaterialFormat) Valid ¶
func (f MaterialFormat) Valid() bool
type Result ¶
type Result struct {
Plan *compile.ExecutionPlan
Visibility compile.ValueVisibilityPlan
Deferred []compile.DeferredDependency
Diagnostics []diagnostic.Diagnostic
}
Result carries either a fully inferred and validated plan or diagnostics.
func CompileEnvelope ¶
func CompileEnvelope(ctx context.Context, envelope Envelope, sourceFormat graph.SourceFormat, options CompileOptions) Result
CompileEnvelope applies the ordinary compiler, dependency inference, and validator to already decoded material.