engine

package
v0.25.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPolicy

func DefaultPolicy() models.Policy

DefaultPolicy returns the baseline placement policy.

func RankScores

func RankScores(estimates []models.Estimate, weights models.ScoringWeights) []models.ResolverScore

RankScores derives deterministic resolver scores from estimates and weights.

func Score

func Score(estimate models.Estimate, weights models.ScoringWeights) float64

Score returns weighted utility (maximize accuracy, minimize cost/latency).

Types

type Orchestrator

type Orchestrator struct {
	// contains filtered or unexported fields
}

Orchestrator is the default placement orchestrator implementation.

func NewOrchestrator

func NewOrchestrator(registry *resolvers.Registry, policies PlacementPolicy) *Orchestrator

NewOrchestrator constructs a policy-aware placement orchestrator.

func (*Orchestrator) Run

func (o *Orchestrator) Run(ctx context.Context, input RunInput) (models.Run, error)

type PlacementOrchestrator

type PlacementOrchestrator interface {
	Run(ctx context.Context, input RunInput) (models.Run, error)
}

PlacementOrchestrator executes placement resolvers under policy constraints.

type PlacementPolicy

type PlacementPolicy interface {
	Resolve(ctx context.Context, input PolicyResolveInput) (models.Policy, error)
}

PlacementPolicy resolves effective run policy with precedence-aware overrides.

type PolicyResolveInput

type PolicyResolveInput struct {
	OrgID           string
	UserID          string
	PerRunOverride  *models.Policy
	RegisteredOrder []string
}

PolicyResolveInput captures precedence context for policy resolution.

type RunInput

type RunInput struct {
	RunID              string
	AgreementID        string
	CreatedByUserID    string
	OrgID              string
	UserID             string
	PolicyOverride     *models.Policy
	DocumentBytes      []byte
	DocumentPageCount  int
	FieldDefinitions   []models.FieldDefinition
	ExistingPlacements []models.ExistingPlacement
	NativeFormFields   []models.NativeFormField
}

RunInput captures a placement execution request.

type StaticPolicyResolver

type StaticPolicyResolver struct {
	System models.Policy
	Org    map[string]models.Policy
	User   map[string]models.Policy
}

StaticPolicyResolver provides in-memory system/org/user policy overlays.

func NewStaticPolicyResolver

func NewStaticPolicyResolver(system models.Policy) *StaticPolicyResolver

NewStaticPolicyResolver creates a policy resolver with baseline defaults.

func (*StaticPolicyResolver) Resolve

func (*StaticPolicyResolver) SetOrgPolicy

func (r *StaticPolicyResolver) SetOrgPolicy(orgID string, policy models.Policy)

func (*StaticPolicyResolver) SetUserPolicy

func (r *StaticPolicyResolver) SetUserPolicy(userID string, policy models.Policy)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL