Files
sam ce70d4f3ee feat(runs): workflow documents take today's step shape, references and when (#2039)
A step is id/type/settings with when and on_failure; the five kinds become
the types agent.run (inline mission), connector.action, approval.wait,
run.notify and workflow.sleep. Documents declare inputs, repository,
instructions, identity and profile; references are {{ task|inputs|steps }}
checked at save. Any number of approval steps, each asking only about what
was held since; actions still held at the end are put to people before the
run finishes. Triggers are refused for a workflow they can't start, and the
workflows API lists, reads and saves documents beside a step-type catalog.

Copied from internal/domain/workflow: definition.go, step_refs.go,
step_flow.go's checks, control_steps.go's when parser, vocabulary.go and
task/interface.go. stableid moves to internal/platform.
2026-11-17 18:43:45 +11:00

16 lines
608 B
Go

// Package stableid owns the stable-identifier shape shared by plugin
// manifests, workflow step types and playbook action ids: a lowercase,
// dotted or dashed identifier, so one name has exactly one spelling and
// cannot smuggle whitespace or case into a vocabulary two processes compare.
package stableid
import "regexp"
// Pattern is the stable-identifier grammar, for error messages that quote it.
const Pattern = `^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$`
var re = regexp.MustCompile(Pattern)
// Valid reports whether id is a stable identifier.
func Valid(id string) bool { return re.MatchString(id) }