Versions in this module Expand all Collapse all v1 v1.1.1 Jul 30, 2026 v1.1.0 Jul 30, 2026 Changes in this version + const ArtifactErrorCodeABIUnsupported + const ArtifactErrorCodeCapabilityMismatch + const ArtifactErrorCodeCapabilityUnsupported + const ArtifactErrorCodeDigestMismatch + const ArtifactErrorCodeInvalid + const ArtifactErrorCodeInvalidIR + const ArtifactErrorCodeLanguageUnsupported + const ArtifactErrorCodeLimitExceeded + const ArtifactErrorCodeLimitInvalid + const ArtifactErrorCodeMalformed + const ArtifactErrorCodeNil + const ArtifactErrorCodeNonCanonical + const ArtifactErrorCodeSourceInvalid + const ArtifactErrorCodeTooLarge + const ArtifactErrorCodeVersionUnsupported + const ArtifactFormatV1 + const ArtifactFormatV1MaxNestingDepth + const DefaultArtifactMaxBytes + const EvaluatorABIV1 + const LanguageVersionV1 + const ReasonApprovalRequired + const ReasonGraphAllowed + const ReasonGraphDenied + const ReasonGuardAllowed + const ReasonGuardDenied + type Action struct + Expression GraphExpression + Name string + Position Position + type ActionDescriptor struct + Action string + Entity string + Guarded bool + type ActionRef struct + Action string + Entity string + type Artifact struct + func CompileArtifact(sourceName string, source []byte) (*Artifact, error) + func CompileArtifactWithLimits(sourceName string, source []byte, limits Limits) (*Artifact, error) + func DecodeArtifact(data []byte) (*Artifact, error) + func DecodeArtifactWithLimits(data []byte, limits ArtifactDecodeLimits) (*Artifact, error) + func (a *Artifact) CanonicalIR() []byte + func (a *Artifact) CanonicalSource() []byte + func (a *Artifact) Digest() [sha256.Size]byte + func (a *Artifact) Manifest() ArtifactManifest + func (a *Artifact) MarshalBinary() ([]byte, error) + func (a *Artifact) Program() *Program + type ArtifactCapability string + const CapabilityGraphV1 + const CapabilityGuardsV1 + type ArtifactDecodeLimits struct + MaxBytes int + Program Limits + func DefaultArtifactDecodeLimits() ArtifactDecodeLimits + type ArtifactDiagnostic struct + Code string + Column int + Line int + Source string + type ArtifactDiagnostics struct + func (d *ArtifactDiagnostics) All() []ArtifactDiagnostic + func (d *ArtifactDiagnostics) Error() string + type ArtifactError struct + Cause error + Code string + Message string + func (e *ArtifactError) Diagnostics() []ArtifactDiagnostic + func (e *ArtifactError) Error() string + func (e *ArtifactError) Unwrap() error + type ArtifactManifest struct + Capabilities []ArtifactCapability + EvaluatorABI string + FormatVersion uint32 + LanguageVersion string + MaxGraphDepth int + type BinaryExpression struct + At Position + Left GraphExpression + Operator BinaryOperator + Right GraphExpression + func (e BinaryExpression) Position() Position + func (e BinaryExpression) String() string + type BinaryOperator uint8 + const OperatorAnd + const OperatorOr + func (o BinaryOperator) String() string + type CheckError struct + Cause error + Code string + Message string + func (e *CheckError) Error() string + func (e *CheckError) Unwrap() error + type ComparisonExpression struct + At Position + Field []string + Operator ComparisonOperator + Values []Literal + func (e ComparisonExpression) Position() Position + func (e ComparisonExpression) String() string + type ComparisonOperator uint8 + const ComparisonEqual + const ComparisonGreater + const ComparisonGreaterOrEqual + const ComparisonIn + const ComparisonLess + const ComparisonLessOrEqual + const ComparisonNotEqual + func (o ComparisonOperator) String() string + type ConditionExpression interface + Position func() Position + type Decision uint8 + const DecisionAllow + const DecisionDeny + const DecisionRequireApproval + func (d Decision) String() string + type Diagnostic struct + Code string + Column int + Line int + Message string + Source string + func (d Diagnostic) Error() string + type Diagnostics []Diagnostic + func (d Diagnostics) Error() string + type Entity struct + Actions []Action + Name string + Permissions []Permission + Position Position + Relations []Relation + type EntityRef struct + ID string + Type string + type GraphExpression interface + Position func() Position + type Guard struct + Action string + Entity string + Position Position + Rules []GuardRule + type GuardEffect uint8 + const EffectAllow + const EffectDeny + const EffectRequireApproval + func (e GuardEffect) String() string + type GuardMatch struct + Approval string + Effect GuardEffect + type GuardRule struct + Approval string + Condition ConditionExpression + Effect GuardEffect + Otherwise bool + Position Position + type Limits struct + MaxConditionNodes int + MaxDeclarationsPerEntity int + MaxEntities int + MaxExpressionNodes int + MaxGraphDepth int + MaxGuardRules int + MaxGuards int + MaxRelationTargets int + MaxSourceBytes int + func DefaultLimits() Limits + type Literal struct + Boolean bool + Integer int64 + Kind LiteralKind + String string + type LiteralKind uint8 + const LiteralBoolean + const LiteralInteger + const LiteralNull + const LiteralString + type LogicalCondition struct + At Position + Left ConditionExpression + Operator BinaryOperator + Right ConditionExpression + func (e LogicalCondition) Position() Position + func (e LogicalCondition) String() string + type Permission struct + Expression GraphExpression + Name string + Position Position + type Position struct + Column int + Line int + Offset int + type Program struct + func Compile(sourceName string, source []byte) (*Program, error) + func CompileSchema(schema *Schema) (*Program, error) + func CompileSchemaWithLimits(schema *Schema, limits Limits) (*Program, error) + func CompileWithLimits(sourceName string, source []byte, limits Limits) (*Program, error) + func (p *Program) Actions() []ActionDescriptor + func (p *Program) Check(ctx context.Context, request Request, reader TupleReader) (Result, error) + type ReferenceExpression struct + At Position + Member string + Relation string + func (e ReferenceExpression) Position() Position + func (e ReferenceExpression) String() string + type Relation struct + Name string + Position Position + Targets []RelationTarget + type RelationTarget struct + Entity string + Position Position + Relation string + type Request struct + Action string + Arguments map[string]any + MaxDepth int + Resource EntityRef + ResourceAttributes map[string]any + Subject EntityRef + type Result struct + Decision Decision + MatchedAction ActionRef + MatchedGuards []GuardMatch + Reason string + RequiredApprovals []string + Trace []TraceStep + type Schema struct + Entities []Entity + Guards []Guard + Source string + func Parse(sourceName string, source []byte) (*Schema, error) + type SubjectRef struct + ID string + Relation string + Type string + type TraceStep struct + Declaration string + Kind string + Matched bool + Resource EntityRef + type Tuple struct + Relation string + Resource EntityRef + Subject SubjectRef + type TupleReader interface + ReadTuples func(ctx context.Context, resource EntityRef, relation string) ([]SubjectRef, error) + type TupleSet struct + func NewTupleSet(tuples []Tuple) (*TupleSet, error) + func (s *TupleSet) ReadTuples(ctx context.Context, resource EntityRef, relation string) ([]SubjectRef, error)