Documentation
¶
Overview ¶
Package memoryindex defines the provider-neutral port for Memory Core's optional, disposable semantic candidate projection. The selected relational CoreStore remains authoritative for every fact and eligibility decision.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action string
Action identifies the only disposable-index mutations carried by the queue.
type CanonicalSource ¶
type CanonicalSource interface {
MemoryIndexDocument(context.Context, Operation) (Document, bool, error)
EnumerateMemoryIndexDocuments(context.Context, string, int) ([]Document, string, error)
}
CanonicalSource rehydrates one queued operation and enumerates the complete disposable projection through an opaque stable cursor.
type Index ¶
type Index interface {
Search(context.Context, Query) ([]Candidate, error)
Upsert(context.Context, []Document) error
Delete(context.Context, Scope, []Candidate) error
Reset(context.Context) error
}
Index is implemented by any semantic provider. Search output is untrusted and must be rehydrated from the configured relational CoreStore before it can affect selection or consolidation.
type Kind ¶
type Kind string
Kind identifies the only canonical document kinds accepted by the index.
type Operation ¶
type Operation struct {
ID string
StreamRef string
Sequence int64
Action Action
Kind Kind
Ref string
Scope Scope
LeaseToken string
}
Operation is one frozen, ordered projection mutation. It intentionally has no document text: UPSERT text must be rehydrated from canonical Memory.
type OperationQueue ¶
type OperationQueue interface {
LeaseMemoryIndexOperation(context.Context, time.Time) (Operation, bool, error)
AcknowledgeMemoryIndexOperation(context.Context, Operation) error
RetryMemoryIndexOperation(context.Context, Operation, time.Time, string) error
}
OperationQueue owns durable leasing, retry, and acknowledgement.
type Projector ¶
type Projector struct {
// contains filtered or unexported fields
}
Projector independently reconciles canonical Memory into a disposable semantic index. ProcessOne and Rebuild serialize within this process.
func NewProjector ¶
func NewProjector(queue OperationQueue, source CanonicalSource, index Index, config ProjectorConfig) *Projector
func (*Projector) ProcessOne ¶
type ProjectorConfig ¶
type ProjectorConfig struct {
LeaseDuration time.Duration
RetryDelay time.Duration
PollInterval time.Duration
PageSize int
OnError func(error)
}
func DefaultProjectorConfig ¶
func DefaultProjectorConfig() ProjectorConfig