controller

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CandidateHash

func CandidateHash(candidate memcontract.Candidate) string

CandidateHash returns the stable hash used for decision audit rows.

func FrontmatterHash

func FrontmatterHash(header memcontract.Header) string

FrontmatterHash returns a stable hash for a decision's frontmatter material.

func IdempotencyKey

func IdempotencyKey(decision memcontract.Decision) string

IdempotencyKey returns the write-ahead-log uniqueness key for a decision.

Types

type Controller

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

Controller decides Memory v2 write outcomes with deterministic Slice 1 rules.

func New

func New(index TargetIndex, opts ...Option) *Controller

New constructs a rule-first controller over the provided target index.

func (*Controller) Decide

Decide returns a deterministic Decision. Mutation and WAL persistence are owned by Store.ApplyDecision.

type Option

type Option func(*Controller)

Option customizes a Controller.

func WithClock

func WithClock(now func() time.Time) Option

WithClock injects a deterministic clock for tests.

func WithPromptVersion

func WithPromptVersion(version string) Option

WithPromptVersion pins the decision prompt version recorded in WAL rows.

type Target

type Target struct {
	ID             string
	WorkspaceID    string
	Scope          memcontract.Scope
	AgentName      string
	AgentTier      memcontract.AgentTier
	TargetFilename string
	Frontmatter    memcontract.Header
	Entity         string
	Attribute      string
	Content        string
	RawContent     string
	ContentHash    string
	LastUpdatedAt  time.Time
}

Target is one existing curated memory entry visible to the controller.

type TargetIndex

type TargetIndex interface {
	ListTargets(ctx context.Context, candidate memcontract.Candidate) ([]Target, error)
}

TargetIndex supplies current curated memory candidates for rule decisions.

Jump to

Keyboard shortcuts

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