Documentation
¶
Overview ¶
Package spec loads and validates jevkit SDLC workflow definitions: authored YAML at .jevkit/sdlc/*.yaml, declarative only (no shell, no templates, no code), following the compaction.yaml precedent (internal/compact/policy.go).
Index ¶
Constants ¶
const ( KindWork = "work" KindGate = "gate" KindSelect = "select" KindCheck = "check" KindDecide = "decide" KindHuman = "human" KindJoin = "join" KindTerminal = "terminal" )
Node kinds.
const ( DefaultMaxNodeAttempts = 3 DefaultMaxReroutes = 2 DefaultMaxRunActiveSeconds = 21600 DefaultMissingUsage = "warn" )
Default budgets, applied when a workflow omits them.
const DefaultMaxStageSteps = 20
Variables ¶
This section is empty.
Functions ¶
func BuiltinNames ¶
func BuiltinNames() []string
BuiltinNames returns every embedded built-in workflow's name, sorted.
func BuiltinSource ¶
BuiltinSource returns the raw YAML for the built-in workflow named name, for `sdlc init` to write out as an editable starting point.
Types ¶
type Artifact ¶
type Artifact struct {
Path string `yaml:"path"`
Required bool `yaml:"required"`
Seedable bool `yaml:"seedable"`
Schema string `yaml:"schema"`
}
Artifact is one node input/output declaration.
type Budgets ¶
type Budgets struct {
MaxNodeAttempts int `yaml:"maxNodeAttempts"`
MaxReroutes int `yaml:"maxReroutes"`
MaxRunActiveSeconds int `yaml:"maxRunActiveSeconds"`
MaxEstimatedCostUsd float64 `yaml:"maxEstimatedCostUsd"`
MissingUsage string `yaml:"missingUsage"`
}
Budgets bound a run. Zero values are filled with the defaults above.
type Node ¶
type Node struct {
ID string `yaml:"id"`
Kind string `yaml:"kind"`
Agent string `yaml:"agent"`
Produces []Artifact `yaml:"produces"`
Consumes []Artifact `yaml:"consumes"`
Objective string `yaml:"objective"`
Next string `yaml:"next"`
QuestionSet string `yaml:"questionSet"`
State *StateSpec `yaml:"state"`
Routes map[string]string `yaml:"routes"`
Default string `yaml:"default"`
// TrueRoute names which of a gate node's two Routes keys is taken when
// its noul question answers true (e.g. "yes" or "ready"); the other key
// is taken when it answers false. A noul answer carries no chosen label
// of its own — only a truth value — so a generic engine has no other way
// to know which authored label means which outcome. Gate-only.
TrueRoute string `yaml:"trueRoute"`
Candidates []string `yaml:"candidates"`
AssignTo string `yaml:"assignTo"`
Command string `yaml:"command"`
Prompt string `yaml:"prompt"`
Outcome string `yaml:"outcome"`
}
Node is one workflow node. Not every field applies to every kind; Validate enforces which fields a given kind requires.
type Stage ¶
type Stage struct {
ID string `yaml:"id" json:"id"`
Question *StageQuestion `yaml:"question,omitempty" json:"question,omitempty"`
Work *StageWork `yaml:"work,omitempty" json:"work,omitempty"`
Spawn *StageSpawn `yaml:"spawn,omitempty" json:"spawn,omitempty"`
Finish string `yaml:"finish,omitempty" json:"finish,omitempty"`
}
Stage workflows are authored as questions, standard SDLC work, and endings. They share the project workflow file location with older node graphs.
type StageQuestion ¶
type StageQuestion struct {
Prompt string `yaml:"prompt" json:"prompt"`
Options map[string]string `yaml:"options" json:"options"`
Routes map[string]string `yaml:"routes" json:"routes"`
Fallback string `yaml:"fallback" json:"fallback"`
MinConfidence float64 `yaml:"minConfidence,omitempty" json:"minConfidence,omitempty"`
}
type StageSpawn ¶
type StageSpawn struct {
Workflow string `yaml:"workflow" json:"workflow"`
Objective string `yaml:"objective,omitempty" json:"objective,omitempty"`
Routes map[string]string `yaml:"routes" json:"routes"`
}
StageSpawn starts another SDLC run with the parent's task and policy.
type Workflow ¶
type Workflow struct {
Version int `yaml:"version" json:"version"`
Name string `yaml:"name" json:"name"`
Description string `yaml:"description" json:"description"`
Budgets Budgets `yaml:"budgets" json:"budgets,omitempty"`
Nodes []Node `yaml:"nodes" json:"nodes,omitempty"`
Entry string `yaml:"entry,omitempty" json:"entry,omitempty"`
MaxSteps int `yaml:"maxSteps,omitempty" json:"maxSteps,omitempty"`
Stages []Stage `yaml:"stages,omitempty" json:"stages,omitempty"`
}
Workflow is one authored spec file.
func Builtin ¶
Builtin loads and validates the built-in workflow named name. ok is false when name is not a built-in; err is non-nil only if an embedded workflow somehow fails to validate, which would be a bug in jevkit itself, not a user-fixable error.
func Load ¶
Load parses and validates raw YAML into a Workflow, applying budget defaults. Unknown fields are rejected so a typo never silently no-ops.
func (*Workflow) IsStageFlow ¶
func (*Workflow) SeedableArtifacts ¶
SeedableArtifacts lists every seedable artifact path declared anywhere in the workflow, in node order, for `--file` entry-point resolution.
func (*Workflow) Validate ¶
Validate checks structural and cross-referential correctness: the schema JSON Schema cannot express (target existence, kind-specific requirements, id uniqueness) is enforced here.
func (*Workflow) ValidateStages ¶
ValidateStages checks the stage-oriented SDLC format. Questions route by named answers; work stages route by structured SDLC worker outcomes.