Versions in this module Expand all Collapse all v0 v0.3.0 Jun 11, 2026 Changes in this version + var ErrSolutionFound = errors.New("solution found") + var TierMapping = map[string]core.Tier + var TierSourceFiles = map[core.Tier]string + func Flatten(rootID string, input any) ([]string, error) + func FromFacts[T any](rootID string, facts []string) (*T, error) + func LabelsToFacts(entityID string, labels []string) ([]string, error) + func ToFacts(id string, input any) ([]string, error) + type EvaluateResult struct + EntityID string + Matched bool + RuleHead string + type Evaluator struct + func NewEvaluator(rule string) (*Evaluator, error) + func (e *Evaluator) Evaluate(entityID string, entity any) (EvaluateResult, error) + type ExternalPredicate func(ctx context.Context, inputs []any) ([][]any, error) + type ExternalPredicateRegistry struct + func NewExternalPredicateRegistry() *ExternalPredicateRegistry + func (r *ExternalPredicateRegistry) Count() int + func (r *ExternalPredicateRegistry) Get(name string) (ExternalPredicate, bool) + func (r *ExternalPredicateRegistry) List() map[string]ExternalPredicate + func (r *ExternalPredicateRegistry) Register(name string, fn ExternalPredicate) error + type FactIndex map[string]map[string][]string + type GherkinCompiler struct + func NewGherkinCompiler() *GherkinCompiler + func NewGherkinCompilerWithRegistry(registry *StepRegistry) *GherkinCompiler + func (c *GherkinCompiler) Compile(feature *parse.Feature) (string, error) + func (c *GherkinCompiler) CompileFromString(content string) (string, error) + type MangleRuntime struct + func NewMangleRuntime() *MangleRuntime + func (r *MangleRuntime) AddEternalFact(factString string) error + func (r *MangleRuntime) AddPolicy(source string) error + func (r *MangleRuntime) AddTemporalFact(factString string, start, end time.Time) error + func (r *MangleRuntime) AddTemporalFactAt(factString string, at time.Time) error + func (r *MangleRuntime) AddTemporalFactInFuture(factString string, duration time.Duration) error + func (r *MangleRuntime) AddTemporalFactInPast(factString string, duration time.Duration) error + func (r *MangleRuntime) ContainsTemporalFact(factString string) (bool, error) + func (r *MangleRuntime) EnableTemporal() + func (r *MangleRuntime) ExecuteQuery(ctx context.Context, facts []ast.Atom, queryStr string) (bool, error) + func (r *MangleRuntime) ExternalPredicates() *ExternalPredicateRegistry + func (r *MangleRuntime) GetEvaluationTime() time.Time + func (r *MangleRuntime) GetTemporalStore() *factstore.TemporalStore + func (r *MangleRuntime) IsTemporalEnabled() bool + func (r *MangleRuntime) Load(path string) error + func (r *MangleRuntime) LoadFacts(facts []string) error + func (r *MangleRuntime) LoadFromSource(source string) error + func (r *MangleRuntime) LoadFromString(rule string) error + func (r *MangleRuntime) QueryTemporalFactsAt(factPattern string, at time.Time) ([]string, error) + func (r *MangleRuntime) QueryTemporalFactsDuring(factPattern string, start, end time.Time) ([]string, error) + func (r *MangleRuntime) QueryWithSolutions(ctx context.Context, facts []ast.Atom, queryStr string, ...) error + func (r *MangleRuntime) RegisterExternalPredicate(name string, fn ExternalPredicate) error + func (r *MangleRuntime) SetEvaluationTime(t time.Time) + type PolicyEngine struct + func New() (*PolicyEngine, error) + func NewWithObservability(tracer core.Tracer, logger core.Logger) (*PolicyEngine, error) + func NewWithTracer(tracer core.Tracer) *PolicyEngine + func (e *PolicyEngine) Assess(ctx context.Context, actionMeta core.ActionMetadata, input core.Envelope) error + func (e *PolicyEngine) AssessPlan(ctx context.Context, input core.Envelope) (core.Decision, error) + func (e *PolicyEngine) CheckRequirement(ctx context.Context, input core.Envelope, reqName string) (bool, error) + func (e *PolicyEngine) EvaluateSteering(ctx context.Context, input core.Envelope) (string, map[string]string, error) + func (e *PolicyEngine) ExecuteQuery(ctx context.Context, facts []ast.Atom, queryStr string) (bool, error) + func (e *PolicyEngine) ExternalPredicateRegistry() *ExternalPredicateRegistry + func (e *PolicyEngine) ExtractActionArguments(ctx context.Context, input core.Envelope, actionName string) (map[string]interface{}, error) + func (e *PolicyEngine) GetActionConfig(ctx context.Context, input core.Envelope) (map[string]string, error) + func (e *PolicyEngine) LoadFacts(facts []string) error + func (e *PolicyEngine) LoadFromSource(ctx context.Context, source string) error + func (e *PolicyEngine) LoadGherkinPolicy(ctx context.Context, featureContent string) error + func (e *PolicyEngine) LoadPolicy(ctx context.Context, policy string) error + func (e *PolicyEngine) Logger() core.Logger + func (e *PolicyEngine) Query(ctx context.Context, facts []string, queryStr string) ([]map[string]string, error) + func (e *PolicyEngine) QueryWithAudit(ctx context.Context, facts []string, queryStr string) (*QueryWithAuditResult, error) + func (e *PolicyEngine) RecordLineage(ctx context.Context, childID, parentID string) + func (e *PolicyEngine) Reflect(ctx context.Context, actionMeta core.ActionMetadata, output core.Envelope) (core.Envelope, error) + func (e *PolicyEngine) RegisterAction(meta core.ActionMetadata) error + func (e *PolicyEngine) RegisterExternalPredicate(name string, fn func(ctx context.Context, inputs []any) ([][]any, error)) error + func (e *PolicyEngine) Runtime() *MangleRuntime + func (e *PolicyEngine) WithQueryTimeout(timeout time.Duration) *PolicyEngine + type QueryWithAuditResult struct + AuditTrail *core.AuditTrail + Results []map[string]string + type StepDefinition struct + Pattern *regexp.Regexp + StepType parse.StepType + Template string + type StepRegistry struct + func NewStepRegistry() *StepRegistry + func (r *StepRegistry) GenerateDatalog(step parse.Step, expectedType parse.StepType) (string, error) + func (r *StepRegistry) Match(step parse.Step, expectedType parse.StepType) (*StepDefinition, map[string]string, error) + func (r *StepRegistry) Register(pattern, template string, stepType parse.StepType) error + func (r *StepRegistry) Substitute(template string, params map[string]string) string