postgres

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Store)

func WithMemoryIndex

func WithMemoryIndex(index memoryindex.Index) Option

WithMemoryIndex enables an optional semantic candidate projection. The Store always rehydrates returned refs from PostgreSQL before activation.

type Store

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

Store is the PostgreSQL authority for deterministic causal intake.

func New

func New(ctx context.Context, databaseURL string, options ...Option) (*Store, error)

New opens and verifies a PostgreSQL-backed Store.

func (*Store) AcknowledgeMemoryIndexOperation

func (store *Store) AcknowledgeMemoryIndexOperation(ctx context.Context, operation memoryindex.Operation) error

func (*Store) Close

func (store *Store) Close()

Close releases the Store connection pool.

func (*Store) CompleteConsolidationJob

func (store *Store) CompleteConsolidationJob(ctx context.Context, jobRef, leaseToken string) error

CompleteConsolidationJob acknowledges only the caller's live lease.

func (*Store) ConsolidateWindow

func (store *Store) ConsolidateWindow(ctx context.Context, window consolidation.Window, worker consolidation.Worker) (consolidation.Receipt, error)

ConsolidateWindow is the only AI-assisted Seed evolution entry. The Worker returns text; Core derives ownership, validates causal eligibility, allocates refs, and commits effects automatically.

func (*Store) EnumerateMemoryIndexDocuments

func (store *Store) EnumerateMemoryIndexDocuments(ctx context.Context, cursor string, limit int) ([]memoryindex.Document, string, error)

func (*Store) LeaseConsolidationJob

func (store *Store) LeaseConsolidationJob(ctx context.Context, request scheduler.LeaseRequest) (scheduler.Job, bool, error)

LeaseConsolidationJob freezes and leases one ready window. Frozen retries keep the same refs and hash. One complete Episode becomes eligible after quiet time; source-only intake never enters the collecting queue.

func (*Store) LeaseMemoryIndexOperation

func (store *Store) LeaseMemoryIndexOperation(ctx context.Context, leaseUntil time.Time) (memoryindex.Operation, bool, error)

func (*Store) MemoryIndexDocument

func (store *Store) MemoryIndexDocument(ctx context.Context, operation memoryindex.Operation) (memoryindex.Document, bool, error)

func (*Store) Migrate

func (store *Store) Migrate(ctx context.Context) error

Migrate creates the canonical Memory Core schemas. Every statement is idempotent so startup may safely call this more than once.

func (*Store) Observe

func (store *Store) Observe(ctx context.Context, idempotencyKey string, event ledger.SourceEvent, binding ledger.EpisodeBinding) (ledger.ObserveReceipt, error)

Observe atomically freezes transport idempotency, immutable source input, one optional typed link, and a deterministically materialized Episode.

func (*Store) Ping

func (store *Store) Ping(ctx context.Context) error

Ping verifies that PostgreSQL can serve a request.

func (*Store) RecordMemoryDelivery

func (store *Store) RecordMemoryDelivery(ctx context.Context, delivery ledger.MemoryDelivery) (ledger.MemoryDeliveryReceipt, error)

RecordMemoryDelivery freezes only the stable memories a Harness can prove were exposed. It does not claim model use or behavioral causation.

func (*Store) ReportOutcome

func (store *Store) ReportOutcome(ctx context.Context, report ledger.OutcomeReport) (ledger.OutcomeReceipt, error)

ReportOutcome admits an immutable result SourceEvent, attaches its outcome relation, and freezes optional delivery attribution in one transaction.

func (*Store) RetryConsolidationJob

func (store *Store) RetryConsolidationJob(ctx context.Context, jobRef, leaseToken string, notBefore time.Time) error

RetryConsolidationJob releases the same frozen window after a failed call.

func (*Store) RetryMemoryIndexOperation

func (store *Store) RetryMemoryIndexOperation(ctx context.Context, operation memoryindex.Operation, notBefore time.Time, reason string) error

func (*Store) SelectMemory

func (store *Store) SelectMemory(ctx context.Context, request selection.SelectRequest) (selection.MemoryContext, error)

SelectMemory freezes one deterministic selection result for an exact run. Association scores are transient and never cross this boundary.

Jump to

Keyboard shortcuts

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