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 ¶
func (c *Controller) Decide(ctx context.Context, candidate memcontract.Candidate) (memcontract.Decision, error)
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 WithPromptVersion ¶
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.