optimization

package
v1.10.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package optimization connects governed Cortex lessons to Fabriq.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LessonSpec

func LessonSpec(name string) registry.EntitySpec

LessonSpec shares the physical lesson schema across governed producers.

func LessonWritePolicy

func LessonWritePolicy(name string) agent.WritePolicy

LessonWritePolicy permits guarded creation and revision of this entity.

Types

type Adapter

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

Adapter implements governed lesson delivery and recall.

func NewLessonStore

func NewLessonStore(toolkit Toolkit, fabric query.Fabric, mapper ScopeMapper, config Config) (*Adapter, error)

NewLessonStore constructs the adapter without starting background work.

func (*Adapter) CheckReady

func (a *Adapter) CheckReady(ctx context.Context) error

CheckReady verifies provisioned columns, the bound toolkit policy and semantic retrieval without writing a lesson. Destination write grants are exercised by actual delivery; this probe does not claim a test write occurred.

func (*Adapter) Deliver

func (a *Adapter) Deliver(ctx context.Context, request opt.Publication) (opt.PublicationReceipt, error)

Deliver reconciles a durable publication with authoritative destination state.

func (*Adapter) Publish

func (a *Adapter) Publish(ctx context.Context, lesson opt.Lesson) (opt.PublicationReceipt, error)

Publish delivers an already accepted local lesson. The outbox remains authoritative.

func (*Adapter) Recall

func (a *Adapter) Recall(ctx context.Context, request opt.RecallQuery) (opt.LessonPage, error)

Recall returns a bounded semantic result set. A nonempty cursor is refused: changing search rankings cannot supply a stable continuation. Missing required search channels or token-truncated results return ErrIncompleteEvidence.

func (*Adapter) Revoke

func (a *Adapter) Revoke(ctx context.Context, lessonID id.ID, revision int64) error

Revoke delivers an existing local revocation revision. Local withdrawal must commit first so a remote outage cannot leave the lesson eligible for recall.

type Config

type Config struct {
	Entity           string
	Repository       opt.Repository
	Authorizer       opt.Authorizer
	IdentityResolver opt.IdentityResolver
	Now              func() time.Time
}

Config supplies local evidence and current host authority.

type LessonToolkit

type LessonToolkit = lessontransport.Toolkit

LessonToolkit binds the shared typed schema and guarded recall policy.

func NewLessonToolkit

func NewLessonToolkit(fabric query.Fabric, reg *registry.Registry, embedder agent.Embedder, entity string) (*LessonToolkit, error)

NewLessonToolkit constructs strict recall with an explicit write policy.

type ScopeBinding

type ScopeBinding struct {
	Tenant string
	Scope  cortex.Scope
}

ScopeBinding maps one authenticated Cortex scope into a Fabriq tenant.

type ScopeMapper

type ScopeMapper interface {
	Map(context.Context, cortex.Scope) (ScopeBinding, error)
}

ScopeMapper resolves a tenant without changing the caller's exact Cortex scope.

type ScopeMapperFunc

type ScopeMapperFunc func(context.Context, cortex.Scope) (ScopeBinding, error)

ScopeMapperFunc adapts a host mapping function.

func (ScopeMapperFunc) Map

Map delegates to the host mapping function.

type Toolkit

Toolkit is the guarded Fabriq command and recall boundary.

Jump to

Keyboard shortcuts

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