Documentation
¶
Overview ¶
Package refs validates loop template and CEL references against one namespace.
Index ¶
- Constants
- func CostWarningThresholdReached(cost, limit uint64) bool
- func RenderCommandTemplateString(name string, raw string, data any) (string, error)
- func RenderTemplateString(name string, raw string, data any) (string, error)
- type Condition
- type ConditionCompiler
- type ConditionCompilerOption
- type ConditionEvaluation
- type Error
- type Namespace
- type NodeSchema
- type Reference
- type Schema
- type Template
Constants ¶
const ( // CodeUnknownReference identifies an unknown namespace root or symbol. CodeUnknownReference = "unknown_reference" // CodeUnresolvablePath identifies a known symbol with a missing child path. CodeUnresolvablePath = "unresolvable_path" // CodeItemOutsideFanout identifies item/index usage outside fan-out scope. CodeItemOutsideFanout = "item_outside_fanout" // CodeConditionNotBool identifies a CEL expression that does not return bool. CodeConditionNotBool = "condition_not_bool" // CodeUnsafeCommandInterpolation identifies command output outside the safe shell quoting contract. CodeUnsafeCommandInterpolation = "unsafe_command_interpolation" )
Variables ¶
This section is empty.
Functions ¶
func CostWarningThresholdReached ¶
CostWarningThresholdReached reports the inclusive 80-percent warning boundary.
func RenderCommandTemplateString ¶
RenderCommandTemplateString materializes one validated shell command template.
Types ¶
type ConditionCompiler ¶
type ConditionCompiler struct {
// contains filtered or unexported fields
}
ConditionCompiler compiles CEL expressions over the shared namespace.
func NewConditionCompiler ¶
func NewConditionCompiler( namespace Namespace, opts ...ConditionCompilerOption, ) (*ConditionCompiler, error)
NewConditionCompiler builds a CEL environment for the shared namespace.
type ConditionCompilerOption ¶
type ConditionCompilerOption func(*ConditionCompiler)
ConditionCompilerOption configures a condition compiler.
func WithCostLimit ¶
func WithCostLimit(limit uint64) ConditionCompilerOption
WithCostLimit overrides the CEL runtime cost limit.
type ConditionEvaluation ¶
ConditionEvaluation is one pure CEL result with its measured runtime cost.
type Error ¶
type Error struct {
Code string
Path []string
ReferencePath []string
DeepestValidPath []string
AvailableFields []string
AvailableNodes []string
Message string
}
Error reports a namespace validation failure.
type Namespace ¶
type Namespace struct {
Inputs map[string]Schema
Nodes map[string]NodeSchema
Gates map[string]struct{}
AllowFanout bool
AllowProgress bool
AllowTrigger bool
AllowEvent bool
FanoutItems map[string]struct{}
FanoutIndexes map[string]struct{}
}
Namespace is the single reference namespace consumed by templates and CEL.
func (Namespace) InputPathUnproven ¶
InputPathUnproven reports inferred input paths accepted only by field-map compatibility.
func (Namespace) ValidatePath ¶
ValidatePath checks a dotted path against the namespace.
type NodeSchema ¶
type NodeSchema struct {
Output Schema
FallbackOutput Schema
// OutputJSONSchema distinguishes normalized/descriptor schemas from field maps.
OutputJSONSchema bool
ResultViewOutput bool
HasOutput bool
HasProgress bool
AllowOpenOutput bool
}
NodeSchema exposes the referenceable output/status shape for one node.
func (NodeSchema) CheckOutputPath ¶
func (n NodeSchema) CheckOutputPath(path, original []string) (bool, *Error)
CheckOutputPath distinguishes proven paths, unproven acceptance, and rejected paths.
func (NodeSchema) OutputPathUnproven ¶
func (n NodeSchema) OutputPathUnproven(path []string) bool
OutputPathUnproven reports a path accepted without proof from its output contract.
type Template ¶
Template is a parsed value interpolation template plus validated references.
func CompileCommandTemplate ¶
CompileCommandTemplate validates a shell command template before runtime materialization. Every action that emits runtime data must end in shellQuote so data cannot become shell syntax.