seed

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package seed resolves `sdlc start --file` arguments against a workflow's declared seedable artifacts: a pre-existing document takes the place of whatever node would otherwise have produced it, which is why only an artifact the workflow author explicitly marked seedable: true is ever a valid target — an artifact a node merely happens to produce is not automatically safe to substitute (that node's own execution may do more than write the file).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveTargets

func ResolveTargets(w *spec.Workflow, args []FileArg) (map[string]string, error)

ResolveTargets validates args against w and returns artifact path to source file path. Target resolution is deterministic and never uses Jev — a bare --file resolves only when w declares exactly one seedable artifact; more than one (or zero) requires the explicit path=artifact form. An artifact name that is declared but not seedable, or not declared at all, is an error, as is targeting the same artifact twice.

func ValidateSchema

func ValidateSchema(schemaPath string, content []byte) error

ValidateSchema validates content against the JSON Schema at schemaPath. An artifact's schema is a path (relative to the workflow file's own directory, or absolute) to a JSON Schema document; content failing to parse as JSON is itself a validation failure, not a distinct error, since either way the seeded file does not satisfy what a schema-bearing artifact promises downstream nodes.

Types

type FileArg

type FileArg struct {
	// Path is the local source file to seed.
	Path string
	// Artifact is the explicit "=artifact" target; empty for a bare --file,
	// which resolves only when the workflow declares exactly one seedable
	// artifact.
	Artifact string
}

FileArg is one parsed `--file` value.

func ParseFileArg

func ParseFileArg(raw string) (FileArg, error)

ParseFileArg parses "path" or "path=artifact". The split is on the last "=", so a path containing "=" before an explicit artifact name still parses correctly.

Jump to

Keyboard shortcuts

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