Help us shape the future of Go! Take the 2026 Go Developer Survey

postgres

package
v0.0.0-...-fef0d6a Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CurrentMigrationVersion = mustCurrentMigrationVersion()

Functions

func BaseSchemaSQL

func BaseSchemaSQL() (string, error)

func BootstrapDatabase

func BootstrapDatabase(ctx context.Context, db bootstrapDB) error

func MigrateDatabase

func MigrateDatabase(ctx context.Context, dsn string, policy string) error

func MigrationAssets

func MigrationAssets() ([]string, error)

func MigrationFS

func MigrationFS() fs.FS

func OpenPool

func OpenPool(ctx context.Context, dsn string) (*pgxpool.Pool, error)

Types

type ChunkAdjacentOptions

type ChunkAdjacentOptions = memory.ChunkAdjacentOptions

ChunkAdjacentOptions bounds evidence expansion. SessionID and UserID, when supplied, are assertions rather than filters: a mismatch fails closed. ChunkAdjacentOptions is retained as an alias for callers that historically imported the storage package; the neutral contract lives in memory.

type ContextCalibrationSummaryStore

type ContextCalibrationSummaryStore interface {
	ReadContextCalibrationSummary(context.Context, memory.ReadContextCalibrationSummaryInput) (memory.ContextCalibrationSummary, error)
	UpsertContextCalibrationSummary(context.Context, memory.ContextCalibrationSummary) (memory.ContextCalibrationSummary, error)
}

type EvaluationFixtureSeeder

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

EvaluationFixtureSeeder persists controlled fixture data through the same raw event, candidate, canonical-version, provenance, and lifecycle operations used by the service. It only accepts the reserved evaluation tenant and project.

func NewEvaluationFixtureSeeder

func NewEvaluationFixtureSeeder(repository *Repository) *EvaluationFixtureSeeder

func (*EvaluationFixtureSeeder) Cleanup

Cleanup removes only records named by an earlier seed result. It never performs a broad tenant/project delete and is therefore safe to defer in an owned harness.

func (*EvaluationFixtureSeeder) Seed

func (*EvaluationFixtureSeeder) SeedBatch

SeedBatch imports a fixture through one transaction with deterministic IDs. It is intended for large benchmark corpora where opening a transaction per raw event/candidate/promotion would dominate runtime. Repeated imports are idempotent because every row uses ON CONFLICT DO NOTHING.

type MemoryChunkWatermark

type MemoryChunkWatermark struct {
	DerivationID        string
	Source              memory.ChunkSourceReference
	PolicyVersion       string
	RendererVersion     string
	CounterVersion      string
	SourceWatermarkHash string
	CreatedAt           time.Time
}

MemoryChunkWatermark is the durable, non-content identity used by an operator or a rebuild process to decide whether a source has already been materialized under a particular policy and renderer.

type MigrationAsset

type MigrationAsset struct {
	Version        int64
	Name           string
	ChecksumSHA256 string
}

MigrationAsset is the immutable identity of one embedded forward migration. The checksum deliberately covers the exact embedded bytes, so changing a released asset is detectable without depending on database formatting.

func MigrationManifest

func MigrationManifest() ([]MigrationAsset, error)

MigrationManifest returns the ordered immutable forward migration assets compiled into this binary. It returns a new slice on each call so callers cannot mutate shared process state.

type MigrationIntegrityStatus

type MigrationIntegrityStatus string
const (
	MigrationIntegrityVerified MigrationIntegrityStatus = "verified"
	MigrationIntegrityLegacy   MigrationIntegrityStatus = "legacy"
	MigrationIntegrityUnknown  MigrationIntegrityStatus = "unknown"
)

type MigrationRunner

type MigrationRunner struct {
	OpenDB func(dsn string) (*sql.DB, error)
}

func NewMigrationRunner

func NewMigrationRunner() MigrationRunner

func (MigrationRunner) Apply

func (r MigrationRunner) Apply(ctx context.Context, dsn string) error

func (MigrationRunner) Status

func (r MigrationRunner) Status(ctx context.Context, dsn string) (MigrationState, error)

type MigrationState

type MigrationState struct {
	CurrentVersion  int64                    `json:"current_version"`
	LatestVersion   int64                    `json:"latest_version"`
	Dirty           bool                     `json:"dirty"`
	Pending         bool                     `json:"pending"`
	Status          MigrationStatus          `json:"status"`
	IntegrityStatus MigrationIntegrityStatus `json:"integrity_status"`
	IntegrityRows   int                      `json:"integrity_rows"`
}

func InspectMigrationState

func InspectMigrationState(ctx context.Context, db migrationDB) (MigrationState, error)

InspectMigrationState reads the version ledger without mutating the database. A missing ledger is reported as uninitialized so callers can choose whether to bootstrap or require an explicit migration command.

type MigrationStatus

type MigrationStatus string
const (
	MigrationStatusCurrent       MigrationStatus = "current"
	MigrationStatusPending       MigrationStatus = "pending"
	MigrationStatusDirty         MigrationStatus = "dirty"
	MigrationStatusDivergent     MigrationStatus = "divergent"
	MigrationStatusUninitialized MigrationStatus = "uninitialized"
	MigrationStatusIncompatible  MigrationStatus = "incompatible"
)

type ProviderSyncSource

type ProviderSyncSource struct {
	Repository *Repository
}

ProviderSyncSource exposes existing PostgreSQL raw-event and canonical-memory projections through the transport-neutral provider synchronization contract. It never writes canonical state and applies the exact runtime scope to every query.

func (ProviderSyncSource) Events

func (s ProviderSyncSource) Events(ctx context.Context, binding provider.RuntimeBinding, after int64, max int) ([]provider.SyncEvent, error)

func (ProviderSyncSource) RetentionFloor

func (s ProviderSyncSource) RetentionFloor(ctx context.Context, binding provider.RuntimeBinding) (int64, error)

RetentionFloor reports the oldest replay sequence still present in the source projection. raw_events is currently retained as a complete durable projection, so the floor is one while rows exist and zero for an empty scope. If retention pruning is introduced, this method is the single place that exposes the persisted floor to the transport-neutral synchronizer.

func (ProviderSyncSource) Snapshot

func (s ProviderSyncSource) Snapshot(ctx context.Context, binding provider.RuntimeBinding, maxBytes int) (provider.SyncSnapshot, error)

type Repository

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

func NewRepository

func NewRepository(db interface {
	queryRower
	transactionStarter
}) *Repository

func NewRepositoryWithEmbeddingRouter

func NewRepositoryWithEmbeddingRouter(db interface {
	queryRower
	transactionStarter
}, router embedding.Router) *Repository

func (*Repository) AcceptMemoryRepositoryImport

AcceptMemoryRepositoryImport persists the reviewed plan before returning an accepted import. It never creates canonical memory: the worker later turns each durable entry into a governed remember intent.

func (*Repository) AcquireMaintenanceLease

func (r *Repository) AcquireMaintenanceLease(ctx context.Context, input jobs.MaintenanceLeaseInput) (bool, error)

func (*Repository) ActivateRankingRolloutPolicy

func (r *Repository) ActivateRankingRolloutPolicy(ctx context.Context, input memory.ActivateRankingRolloutPolicyInput) (memory.RankingRolloutPolicy, error)

func (*Repository) AppendMemoryIntent

func (r *Repository) AppendMemoryIntent(ctx context.Context, record memory.MemoryIntentRecord) (memory.MemoryIntentRecord, error)

AppendMemoryIntent persists one governed intent. Idempotency and operation keys are scoped to tenant/project/namespace; retries return the first row.

func (*Repository) AppendMemoryIntentTransition

func (r *Repository) AppendMemoryIntentTransition(ctx context.Context, transition memory.MemoryIntentTransition) error

func (*Repository) AppendReflectionReview

func (r *Repository) AppendReflectionReview(ctx context.Context, record memory.ReflectionReviewRecord) (memory.ReflectionReviewRecord, error)

func (*Repository) AppendTemporalCorrection

func (r *Repository) AppendTemporalCorrection(ctx context.Context, correction memory.TemporalCorrection) error

AppendTemporalCorrection records one append-only validity correction and advances the canonical row's temporal head pointer. It never rewrites a prior version payload: memory_versions rows are insert-only and this path issues no statement against them at all.

The append is idempotent on its durable identity (scope + memory + successor version). A replay that agrees with the stored record converges silently; a replay that disagrees is refused with ErrTemporalCorrectionConflict rather than allowed to overwrite the ledger.

func (*Repository) AppendVectorRevision

func (r *Repository) AppendVectorRevision(ctx context.Context, revision memory.VectorRevision) error

func (*Repository) ApplyEmbeddingCutoverPlanAction

func (r *Repository) ApplyEmbeddingCutoverPlanAction(ctx context.Context, input memory.ApplyEmbeddingCutoverPlanActionInput) (memory.EmbeddingCutoverPlan, error)

func (*Repository) ApplyEmbeddingRecovery

func (*Repository) ApplyLifecycleAction

func (r *Repository) ApplyLifecycleAction(ctx context.Context, action governance.LifecycleAction) (memory.CanonicalMemory, error)

func (*Repository) ApplyReleaseEvidenceReconciliation

func (r *Repository) ApplyReleaseEvidenceReconciliation(ctx context.Context, scope memory.Scope, replayKey string, result retrieval.ReleaseEvidenceReconciliationResult) error

func (*Repository) ApproveRepairPlan

func (r *Repository) ApproveRepairPlan(ctx context.Context, input memory.ApproveRepairPlanInput) (memory.RepairPlan, error)

func (*Repository) AuthorizeContextTurn

func (r *Repository) AuthorizeContextTurn(ctx context.Context, b provider.RuntimeBinding, turnID string) error

func (*Repository) BeginJobExecution

func (r *Repository) BeginJobExecution(ctx context.Context, execution jobs.JobExecution) (bool, error)

func (*Repository) CancelDerivedWork

func (r *Repository) CancelDerivedWork(ctx context.Context, input workqueue.CancelInput) error

func (*Repository) CancelSchedulerRun

func (r *Repository) CancelSchedulerRun(ctx context.Context, scope memory.Scope, runKey string, now time.Time) error

func (*Repository) CheckpointDerivedWork

func (r *Repository) CheckpointDerivedWork(ctx context.Context, input workqueue.CheckpointInput) error

func (*Repository) CheckpointReleaseEvidenceReconciliation

func (r *Repository) CheckpointReleaseEvidenceReconciliation(ctx context.Context, scope memory.Scope, replayKey, checkpoint string, processed int) error

func (*Repository) ClaimDerivedWork

func (r *Repository) ClaimDerivedWork(ctx context.Context, input workqueue.ClaimInput) ([]workqueue.DerivedWorkItem, error)

func (*Repository) ClaimEmbeddingRebuilds

func (r *Repository) ClaimEmbeddingRebuilds(ctx context.Context, scope memory.Scope, limit int, attemptedAt time.Time) ([]memory.EmbeddingRebuildRecord, error)

func (*Repository) ClaimForgetApply

func (r *Repository) ClaimForgetApply(ctx context.Context, claim mcp.ForgetApplyClaim) (mcp.ForgetApplyClaimResult, error)

func (*Repository) ClaimLifecycle

func (*Repository) ClaimPendingRawEvents

func (*Repository) ClaimRepairActions

func (r *Repository) ClaimRepairActions(ctx context.Context, input memory.ClaimRepairActionsInput) ([]memory.RepairAction, error)

func (*Repository) ClaimScopeProofSteps

func (r *Repository) ClaimScopeProofSteps(ctx context.Context, input memory.ClaimScopeProofStepsInput) ([]memory.ScopeProofStep, error)

func (*Repository) CleanupContextReceipts

func (r *Repository) CleanupContextReceipts(ctx context.Context, limit int) (int, error)

func (*Repository) CleanupProgressiveExperimentReports

func (r *Repository) CleanupProgressiveExperimentReports(ctx context.Context, scope memory.Scope, now time.Time, limit int) (int64, error)

func (*Repository) CleanupRetrievalIntegrityEvidence

func (r *Repository) CleanupRetrievalIntegrityEvidence(ctx context.Context, now time.Time, limit int) (int64, error)

func (*Repository) CollectIngestionFreshness

func (r *Repository) CollectIngestionFreshness(ctx context.Context, scope memory.Scope, fixtureReference string, observedAt time.Time) (assurance.IngestionFreshnessInput, error)

CollectIngestionFreshness resolves a raw-event fixture only inside the supplied exact scope. The public-read stage comes exclusively from a prior successful Provider retrieval observation, never from canonical state.

func (*Repository) CompleteDerivedWork

func (r *Repository) CompleteDerivedWork(ctx context.Context, input workqueue.TerminalInput) error

func (*Repository) CompleteForgetApply

func (r *Repository) CompleteForgetApply(ctx context.Context, claim mcp.ForgetApplyClaim, response mcp.ForgetApplyResponse) error

func (*Repository) CompleteJobExecution

func (r *Repository) CompleteJobExecution(ctx context.Context, completion jobs.JobExecutionCompletion) error

func (*Repository) CompleteLifecycle

func (r *Repository) CompleteLifecycle(ctx context.Context, c provider.LifecycleClaim, out provider.OperationOutcome) error

func (*Repository) CompleteMaintenanceExecution

func (r *Repository) CompleteMaintenanceExecution(ctx context.Context, input jobs.MaintenanceCompletion) error

func (*Repository) CompleteMemoryRepositoryImport

func (r *Repository) CompleteMemoryRepositoryImport(ctx context.Context, scope memory.Scope, repositoryID, importID string, completedAt time.Time) error

CompleteMemoryRepositoryImport marks dispatch complete only when every entry has a terminal outcome. Completion is distinct from later candidate activation and retains no source payload in its public record.

func (*Repository) CompleteMemorySessionVerification

func (r *Repository) CompleteMemorySessionVerification(ctx context.Context, input memory.CompleteMemorySessionVerificationInput) error

func (*Repository) CompleteRepairAction

func (r *Repository) CompleteRepairAction(ctx context.Context, input memory.CompleteRepairActionInput) error

func (*Repository) CompleteScopeProofStep

func (r *Repository) CompleteScopeProofStep(ctx context.Context, input memory.CompleteScopeProofStepInput) error

func (*Repository) Create

func (r *Repository) Create(ctx context.Context, binding provider.RuntimeBinding) error

Create persists a provider runtime binding in PostgreSQL, the service's existing system of record. Bindings are opaque references and contain only bounded identity/scope metadata required for revalidation.

func (*Repository) CreateActivationDecision

func (r *Repository) CreateActivationDecision(ctx context.Context, record insights.ActivationDecisionRecord, evidence []insights.ActivationDecisionEvidence) error

func (*Repository) CreateAlertCandidate

func (r *Repository) CreateAlertCandidate(ctx context.Context, candidate assurance.AlertCandidate) (assurance.AlertCandidate, error)

func (*Repository) CreateAlertDeliveryAttempt

func (r *Repository) CreateAlertDeliveryAttempt(ctx context.Context, attempt assurance.AlertDeliveryAttempt) (assurance.AlertDeliveryAttempt, error)

func (*Repository) CreateCandidate

func (r *Repository) CreateCandidate(ctx context.Context, candidate governance.CandidateMemory, provenance memory.ProvenanceRecord) (governance.CandidateMemory, error)

func (*Repository) CreateConformanceProfile

func (r *Repository) CreateConformanceProfile(ctx context.Context, profile assurance.ConformanceProfile) (assurance.ConformanceProfile, error)

func (*Repository) CreateConformanceRun

func (r *Repository) CreateConformanceRun(ctx context.Context, run assurance.ConformanceRun) (assurance.ConformanceRun, error)

func (*Repository) CreateContextProjection

func (r *Repository) CreateContextProjection(ctx context.Context, projection memory.ContextProjection) (memory.ContextProjection, error)

func (*Repository) CreateDerivedInsightFeedback

func (*Repository) CreateDerivedInsightReplayRun

func (r *Repository) CreateDerivedInsightReplayRun(ctx context.Context, run memory.DerivedInsightReplayRun) (memory.DerivedInsightReplayRun, error)

func (*Repository) CreateEmbeddingCutoverPlan

func (*Repository) CreateHealthEvaluation

func (r *Repository) CreateHealthEvaluation(ctx context.Context, evaluation assurance.HealthEvaluation) (assurance.HealthEvaluation, error)

func (*Repository) CreateIncident

func (r *Repository) CreateIncident(ctx context.Context, incident assurance.Incident) (assurance.Incident, error)

func (*Repository) CreateMemory

func (*Repository) CreateMemoryChunk

func (r *Repository) CreateMemoryChunk(ctx context.Context, chunk memory.MemoryChunk, counterVersion string) (memory.MemoryChunk, error)

CreateMemoryChunk records a single chunk through the same append-only, idempotent derivation boundary as batch materialization. counterVersion is part of that identity because a changed counter may change bounded output.

func (*Repository) CreateMemoryChunks

func (r *Repository) CreateMemoryChunks(ctx context.Context, chunks []memory.MemoryChunk, counterVersion string) ([]memory.MemoryChunk, error)

CreateMemoryChunks persists chunks as immutable items. Replaying an identical source/policy/renderer/ordinal converges; it never updates an earlier derivation or item.

func (r *Repository) CreateMemoryLoopEvidenceLink(ctx context.Context, link memory.MemoryLoopEvidenceLink) (memory.MemoryLoopEvidenceLink, error)

func (*Repository) CreateMemorySessionRun

func (r *Repository) CreateMemorySessionRun(ctx context.Context, session memory.MemorySessionRun) (memory.MemorySessionRun, error)

func (*Repository) CreateMemorySessionTurn

func (r *Repository) CreateMemorySessionTurn(ctx context.Context, turn memory.MemorySessionTurn) (memory.MemorySessionTurn, error)

func (*Repository) CreateMemorySessionVerification

func (r *Repository) CreateMemorySessionVerification(ctx context.Context, verification memory.MemorySessionVerification) (memory.MemorySessionVerification, error)

func (*Repository) CreateMissingEvidenceDiagnostic

func (r *Repository) CreateMissingEvidenceDiagnostic(ctx context.Context, diagnostic assurance.MissingEvidenceDiagnostic) (assurance.MissingEvidenceDiagnostic, error)

func (*Repository) CreateOperationalProof

func (r *Repository) CreateOperationalProof(ctx context.Context, proof assurance.OperationalProof) (assurance.OperationalProof, error)

func (*Repository) CreatePrincipal

func (r *Repository) CreatePrincipal(ctx context.Context, principal auth.Principal, credential auth.Credential, grants []auth.ScopeGrant, audit auth.AuditRecord) error

func (*Repository) CreateProgressiveExperimentReport

func (r *Repository) CreateProgressiveExperimentReport(ctx context.Context, scope memory.Scope, report retrieval.ProgressiveExperimentReport, expiresAt *time.Time) error

func (*Repository) CreateQualityEvaluationFinding

func (r *Repository) CreateQualityEvaluationFinding(ctx context.Context, finding memory.QualityEvaluationFinding) (memory.QualityEvaluationFinding, error)

func (*Repository) CreateQualityEvaluationRun

func (r *Repository) CreateQualityEvaluationRun(ctx context.Context, run memory.QualityEvaluationRun) (memory.QualityEvaluationRun, error)

func (*Repository) CreateRankingRolloutPolicy

func (r *Repository) CreateRankingRolloutPolicy(ctx context.Context, policy memory.RankingRolloutPolicy) (memory.RankingRolloutPolicy, error)

func (*Repository) CreateReadinessReport

func (r *Repository) CreateReadinessReport(ctx context.Context, report assurance.ReadinessReport) (assurance.ReadinessReport, error)

func (*Repository) CreateRecoveryVerification

func (r *Repository) CreateRecoveryVerification(ctx context.Context, verification assurance.RecoveryVerification) (assurance.RecoveryVerification, error)

func (*Repository) CreateRepairAction

func (r *Repository) CreateRepairAction(ctx context.Context, action memory.RepairAction) (memory.RepairAction, error)

func (*Repository) CreateRepairPlan

func (r *Repository) CreateRepairPlan(ctx context.Context, plan memory.RepairPlan) (memory.RepairPlan, error)

func (*Repository) CreateRetentionRun

func (r *Repository) CreateRetentionRun(ctx context.Context, run assurance.RetentionRun) (assurance.RetentionRun, error)

func (*Repository) CreateRetrievalIntegrityReport

func (r *Repository) CreateRetrievalIntegrityReport(ctx context.Context, report evaluation.IntegrityReport, expiresAt *time.Time) error

CreateRetrievalIntegrityReport persists only bounded derived evidence. The scope columns are used for authorization predicates and never returned by the redacted report readers.

func (*Repository) CreateRetrievalIntegrityRetentionOutcome

func (r *Repository) CreateRetrievalIntegrityRetentionOutcome(ctx context.Context, scope memory.Scope, outcome evaluation.RetentionOutcome) error

CreateRetrievalIntegrityRetentionOutcome appends a bounded audit outcome for derived-evidence cleanup. Canonical source records are never represented.

func (*Repository) CreateRetrievalIntegrityTrajectory

func (r *Repository) CreateRetrievalIntegrityTrajectory(ctx context.Context, scope memory.Scope, trajectory evaluation.TrajectoryAggregate, reportID string, expiresAt *time.Time) error

func (*Repository) CreateScopeGrant

func (r *Repository) CreateScopeGrant(ctx context.Context, scope memory.Scope, grant auth.ScopeGrant, audit auth.AuditRecord) error

func (*Repository) CreateScopeProofRun

func (r *Repository) CreateScopeProofRun(ctx context.Context, run memory.ScopeProofRun) (memory.ScopeProofRun, error)

func (*Repository) CreateScopeProofStep

func (r *Repository) CreateScopeProofStep(ctx context.Context, step memory.ScopeProofStep) (memory.ScopeProofStep, error)

func (*Repository) CreateTaskEvaluation

func (r *Repository) CreateTaskEvaluation(ctx context.Context, evaluation memory.TaskEvaluation) (memory.TaskEvaluation, error)

func (*Repository) CreateUsefulnessFeedback

func (r *Repository) CreateUsefulnessFeedback(ctx context.Context, feedback memory.UsefulnessFeedback) (memory.UsefulnessFeedback, error)

func (*Repository) CreateWithSession

func (r *Repository) CreateWithSession(ctx context.Context, binding provider.RuntimeBinding, session memory.MemorySessionRun) error

CreateWithSession commits the runtime binding and its server-owned session together. A pre-existing session ID is reusable only when its exact scope matches; a foreign session can never be claimed by a new binding.

func (*Repository) CreateWorkflowRetentionRun

func (r *Repository) CreateWorkflowRetentionRun(ctx context.Context, run workflow.WorkflowRetentionRun) (workflow.WorkflowRetentionRun, error)

func (*Repository) CreateWorkflowTemplate

func (r *Repository) CreateWorkflowTemplate(ctx context.Context, template workflow.WorkflowTemplate) (workflow.WorkflowTemplate, error)

func (*Repository) DeleteConformanceEvidenceBefore

func (r *Repository) DeleteConformanceEvidenceBefore(ctx context.Context, scope memory.Scope, cutoff time.Time, limit int) (int, error)

DeleteConformanceEvidenceBefore removes bounded conformance evidence for an exact scope while preserving profiles, incidents, and canonical memory.

func (*Repository) DeleteContextProjectionEvidenceBefore

func (r *Repository) DeleteContextProjectionEvidenceBefore(ctx context.Context, scope memory.Scope, cutoff time.Time, limit int) (int, error)

DeleteContextProjectionEvidenceBefore removes only superseded derived projection records within an exact scope. Canonical source tables are never targeted.

func (*Repository) DeleteJobExecutionsBefore

func (r *Repository) DeleteJobExecutionsBefore(ctx context.Context, cutoff time.Time) (int, error)

func (*Repository) DeleteJobExecutionsBeforeScope

func (r *Repository) DeleteJobExecutionsBeforeScope(ctx context.Context, scope memory.Scope, cutoff time.Time, limit int) (int, error)

func (*Repository) DeleteWorkflowHistoryBefore

func (r *Repository) DeleteWorkflowHistoryBefore(ctx context.Context, scope memory.Scope, cutoff time.Time) (int, error)

func (*Repository) DisablePrincipal

func (r *Repository) DisablePrincipal(ctx context.Context, scope memory.Scope, principalID string, disabledAt time.Time, audit auth.AuditRecord) error

func (*Repository) DisableRankingRolloutPolicy

func (r *Repository) DisableRankingRolloutPolicy(ctx context.Context, input memory.DisableRankingRolloutPolicyInput) (memory.RankingRolloutPolicy, error)

func (*Repository) DisableWorkflowTemplate

func (r *Repository) DisableWorkflowTemplate(ctx context.Context, input workflow.DisableTemplateInput) (workflow.WorkflowTemplate, error)

func (*Repository) DispatchEmbeddingCutoverWave

func (r *Repository) DispatchEmbeddingCutoverWave(ctx context.Context, scope memory.Scope, requestedAt time.Time, limit int) (int, error)

func (*Repository) EnqueueDerivedWork

func (r *Repository) EnqueueDerivedWork(ctx context.Context, input workqueue.EnqueueInput) (workqueue.DerivedWorkItem, error)

func (*Repository) EnqueueMemoryIntent

func (r *Repository) EnqueueMemoryIntent(ctx context.Context, record memory.MemoryIntentRecord) error

EnqueueMemoryIntent hands the immutable intent to the existing durable work queue. The queue carries only the intent reference and stable identity.

func (*Repository) ExpandGraph

ExpandGraph performs bounded request-time expansion over relation projections. Paths are returned as transient proofs; no graph path is persisted.

func (*Repository) ExpandGraphResult

func (*Repository) ExpirePrincipal

func (r *Repository) ExpirePrincipal(ctx context.Context, scope memory.Scope, principalID string, expiresAt time.Time, audit auth.AuditRecord) error

func (*Repository) FailJobExecution

func (r *Repository) FailJobExecution(ctx context.Context, failure jobs.JobExecutionFailure) error

func (*Repository) FailMaintenanceExecution

func (r *Repository) FailMaintenanceExecution(ctx context.Context, input jobs.MaintenanceFailure) error

func (*Repository) FindActivationDecision

func (r *Repository) FindActivationDecision(ctx context.Context, scope memory.Scope, candidateFingerprint string) (insights.ActivationDecisionRecord, error)

func (*Repository) FindWorkflowRetentionEligibleHistory

func (r *Repository) FindWorkflowRetentionEligibleHistory(ctx context.Context, input workflow.FindRetentionEligibleHistoryInput) ([]workflow.WorkflowRun, error)

func (*Repository) GetLatestCanonicalByScopeAndClass

func (r *Repository) GetLatestCanonicalByScopeAndClass(ctx context.Context, scope memory.Scope, class memory.MemoryClass) (memory.CanonicalMemory, bool, error)

func (*Repository) GetLatestCanonicalByScopePathAndClass

func (r *Repository) GetLatestCanonicalByScopePathAndClass(ctx context.Context, scope memory.Scope, path string, class memory.MemoryClass) (memory.CanonicalMemory, bool, error)

GetLatestCanonicalByScopePathAndClass keeps consolidation within the exact path asserted by its candidate, including when a sibling path is newer.

func (*Repository) HasActiveAdminPrincipal

func (r *Repository) HasActiveAdminPrincipal(ctx context.Context) (bool, error)

func (*Repository) HasActiveScopeGrant

func (r *Repository) HasActiveScopeGrant(ctx context.Context, principalID string, scope memory.Scope) (bool, error)

func (*Repository) IngestEvent

func (r *Repository) IngestEvent(ctx context.Context, input memory.IngestEventInput, provenance memory.ProvenanceRecord) (memory.RawEvent, error)

func (*Repository) IssueContextReceiptForTurn

IssueContextReceiptForTurn keeps the immutable turn association on the receipt itself and writes the bounded attribution in the same transaction.

func (*Repository) ListAccessAudit

func (r *Repository) ListAccessAudit(ctx context.Context, scope memory.Scope, principalID string, limit int) ([]auth.AuditRecord, error)

func (*Repository) ListActivationDecisions

func (r *Repository) ListActivationDecisions(ctx context.Context, scope memory.Scope, limit int) ([]insights.ActivationDecisionRecord, error)

func (*Repository) ListAdjacentMemoryChunks

func (r *Repository) ListAdjacentMemoryChunks(ctx context.Context, scope memory.Scope, chunkID string, options ChunkAdjacentOptions) ([]memory.MemoryChunk, error)

ListAdjacentMemoryChunks returns a bounded local window from the same derivation only. It validates session/user assertions before any content is returned and applies budgets while preserving ordinal order.

func (*Repository) ListAlertCandidates

func (r *Repository) ListAlertCandidates(ctx context.Context, scope memory.Scope) ([]assurance.AlertCandidate, error)

func (*Repository) ListAlertDeliveryAttempts

func (*Repository) ListCandidatesByRawEvent

func (r *Repository) ListCandidatesByRawEvent(ctx context.Context, rawEventID string) ([]governance.CandidateMemory, error)

func (*Repository) ListCandidatesForCompaction

func (r *Repository) ListCandidatesForCompaction(ctx context.Context, scope memory.Scope, cutoff time.Time, limit int) ([]governance.CandidateMemory, error)

func (*Repository) ListCanonicalMemories

func (r *Repository) ListCanonicalMemories(ctx context.Context, scope memory.Scope, includeHidden bool) ([]memory.CanonicalMemory, error)

func (*Repository) ListCitations

func (r *Repository) ListCitations(ctx context.Context, scope memory.Scope, memoryIDs []string) (map[string][]retrieval.Citation, error)

func (*Repository) ListConformanceProfiles

func (*Repository) ListConformanceRuns

func (*Repository) ListContextProjectionCandidates

func (r *Repository) ListContextProjectionCandidates(ctx context.Context, scope memory.Scope, kind memory.ContextProjectionKind, limit int) ([]memory.ContextProjectionCandidate, error)

func (*Repository) ListDerivedInsightEvidence

func (r *Repository) ListDerivedInsightEvidence(ctx context.Context, scope memory.Scope, insightID string) ([]memory.DerivedInsightEvidenceRef, error)

func (*Repository) ListDerivedInsightFeedback

func (r *Repository) ListDerivedInsightFeedback(ctx context.Context, input memory.ListDerivedInsightFeedbackInput) ([]memory.DerivedInsightFeedback, error)

func (*Repository) ListDerivedInsightLifecycle

func (r *Repository) ListDerivedInsightLifecycle(ctx context.Context, scope memory.Scope, insightID string) ([]memory.DerivedInsightLifecycleRecord, error)

func (*Repository) ListDerivedInsightReplayRuns

func (r *Repository) ListDerivedInsightReplayRuns(ctx context.Context, input memory.ListDerivedInsightReplayRunsInput) ([]memory.DerivedInsightReplayRun, error)

func (*Repository) ListDerivedInsights

func (r *Repository) ListDerivedInsights(ctx context.Context, input memory.ListDerivedInsightsInput) ([]memory.DerivedInsight, error)

func (*Repository) ListDerivedWork

func (r *Repository) ListDerivedWork(ctx context.Context, input workqueue.ListInput) (workqueue.WorkPage, error)

func (*Repository) ListEligibleEmbeddingRebuilds

func (r *Repository) ListEligibleEmbeddingRebuilds(ctx context.Context, limit int) ([]memory.EmbeddingRebuildRecord, error)

func (*Repository) ListEmbeddingCutoverPlans

func (r *Repository) ListEmbeddingCutoverPlans(ctx context.Context, input memory.ListEmbeddingCutoverPlansInput) ([]memory.EmbeddingCutoverPlan, error)

func (*Repository) ListEmbeddingLifecycleCandidates

func (r *Repository) ListEmbeddingLifecycleCandidates(ctx context.Context, scope memory.Scope, limit int) ([]memory.EmbeddingLifecycleCandidate, error)

func (*Repository) ListEmbeddingRebuilds

func (r *Repository) ListEmbeddingRebuilds(ctx context.Context, input memory.ListEmbeddingRebuildsInput) ([]memory.EmbeddingRebuildView, error)

func (*Repository) ListEmbeddingRecoveryHistory

func (r *Repository) ListEmbeddingRecoveryHistory(ctx context.Context, input memory.ListEmbeddingRecoveryHistoryInput) ([]memory.EmbeddingRecoveryRecord, error)

func (*Repository) ListFailureEvidence

func (r *Repository) ListFailureEvidence(ctx context.Context, scope memory.Scope, limit int) ([]insights.FailureEvidence, error)

func (*Repository) ListGoalReviews

func (r *Repository) ListGoalReviews(ctx context.Context, scope memory.Scope, limit int) ([]insights.RedactedGoalReview, error)

ListGoalReviews returns a redacted exact-scope projection. Goal titles, summaries, prompts, provider payloads, and identifiers are intentionally not selected, even for an administrator.

func (*Repository) ListHealthEvaluations

func (r *Repository) ListHealthEvaluations(ctx context.Context, scope memory.Scope) ([]assurance.HealthEvaluation, error)

func (*Repository) ListIncidents

func (r *Repository) ListIncidents(ctx context.Context, input assurance.ListIncidentsInput) ([]assurance.Incident, error)

func (*Repository) ListMaintenanceExecutionHistory

func (r *Repository) ListMaintenanceExecutionHistory(ctx context.Context, scope memory.Scope, limit int, cursor *jobs.MaintenanceHistoryCursor) (jobs.MaintenanceHistoryPage, error)

func (*Repository) ListMaintenanceScopes

func (r *Repository) ListMaintenanceScopes(ctx context.Context, limit int) ([]memory.Scope, error)

func (*Repository) ListMemoryChunkWatermarks

func (r *Repository) ListMemoryChunkWatermarks(ctx context.Context, scope memory.Scope, source memory.ChunkSourceReference) ([]MemoryChunkWatermark, error)

func (*Repository) ListMemoryChunksBySource

func (r *Repository) ListMemoryChunksBySource(ctx context.Context, scope memory.Scope, source memory.ChunkSourceReference) ([]memory.MemoryChunk, error)

ListMemoryChunksBySource returns ordinary visible chunks in exact scope.

func (*Repository) ListMemoryIntents

func (r *Repository) ListMemoryIntents(ctx context.Context, input memory.MemoryIntentListInput) ([]memory.MemoryIntentRecord, error)

func (*Repository) ListMemorySessionRuns

func (r *Repository) ListMemorySessionRuns(ctx context.Context, input memory.ListMemorySessionRunsInput) ([]memory.MemorySessionRun, error)

func (*Repository) ListOperationalProofs

func (r *Repository) ListOperationalProofs(ctx context.Context, scope memory.Scope) ([]assurance.OperationalProof, error)

func (*Repository) ListPrincipals

func (r *Repository) ListPrincipals(ctx context.Context, scope memory.Scope, limit int) ([]auth.Principal, error)

func (*Repository) ListProgressiveExperimentReports

func (r *Repository) ListProgressiveExperimentReports(ctx context.Context, scope memory.Scope, limit int) ([]retrieval.ProgressiveExperimentReport, error)

func (*Repository) ListProjectionFeedbackScopes

func (r *Repository) ListProjectionFeedbackScopes(ctx context.Context, limit int) ([]memory.Scope, error)

ListProjectionFeedbackScopes discovers ledger scopes, including those with only pending evidence. The latest logical checkpoint is the scope's last service time: even a scope with an unchecked backlog must yield to others.

func (*Repository) ListQualityEvaluationFindings

func (r *Repository) ListQualityEvaluationFindings(ctx context.Context, input memory.ListQualityEvaluationFindingsInput) ([]memory.QualityEvaluationFinding, error)

func (*Repository) ListRankingRolloutPolicies

func (r *Repository) ListRankingRolloutPolicies(ctx context.Context, input memory.ListRankingRolloutPoliciesInput) ([]memory.RankingRolloutPolicy, error)

func (*Repository) ListReadinessReports

func (r *Repository) ListReadinessReports(ctx context.Context, scope memory.Scope) ([]assurance.ReadinessReport, error)

func (*Repository) ListRecentJobExecutions

func (r *Repository) ListRecentJobExecutions(ctx context.Context, scope memory.Scope, limit int) ([]jobs.JobExecutionRecord, error)

func (*Repository) ListRecoveryVerifications

func (r *Repository) ListRecoveryVerifications(ctx context.Context, scope memory.Scope) ([]assurance.RecoveryVerification, error)

func (*Repository) ListReleaseEvidenceReconciliation

func (r *Repository) ListReleaseEvidenceReconciliation(ctx context.Context, scope memory.Scope, limit int) ([]retrieval.ReconciliationInspection, error)

func (*Repository) ListReleaseEvidenceReconciliationInputs

func (r *Repository) ListReleaseEvidenceReconciliationInputs(ctx context.Context, scope memory.Scope, limit int) ([]retrieval.ReleaseEvidenceReconciliationInput, error)

func (*Repository) ListRetentionRuns

func (r *Repository) ListRetentionRuns(ctx context.Context, input assurance.ListRetentionRunsInput) ([]assurance.RetentionRun, error)

func (*Repository) ListRetentionTargets

func (r *Repository) ListRetentionTargets(ctx context.Context, scope memory.Scope, limit int) ([]governance.RetentionTarget, error)

func (*Repository) ListRetrievalIntegrityReports

func (r *Repository) ListRetrievalIntegrityReports(ctx context.Context, scope memory.Scope, limit int) ([]evaluation.RedactedIntegrityReport, error)

func (*Repository) ListSchedulerRunHistory

func (r *Repository) ListSchedulerRunHistory(ctx context.Context, input jobs.SchedulerRunHistoryQuery) (jobs.SchedulerRunHistoryPage, error)

func (*Repository) ListScopeGrants

func (r *Repository) ListScopeGrants(ctx context.Context, scope memory.Scope, principalID string) ([]auth.ScopeGrant, error)

func (*Repository) ListScopeProofRuns

func (r *Repository) ListScopeProofRuns(ctx context.Context, input memory.ListScopeProofRunsInput) ([]memory.ScopeProofRun, error)

func (*Repository) ListTaskEvaluations

func (r *Repository) ListTaskEvaluations(ctx context.Context, input memory.ListTaskEvaluationsInput) ([]memory.TaskEvaluation, error)

func (*Repository) ListUsefulnessFeedback

func (r *Repository) ListUsefulnessFeedback(ctx context.Context, input memory.ListUsefulnessFeedbackInput) ([]memory.UsefulnessFeedback, error)
func (r *Repository) ListWorkflowEvidenceLinks(ctx context.Context, input workflow.ListEvidenceLinksInput) ([]workflow.EvidenceLink, error)

func (*Repository) ListWorkflowGapDiagnostics

func (r *Repository) ListWorkflowGapDiagnostics(ctx context.Context, input workflow.ListDiagnosticsInput) ([]workflow.GapDiagnostic, error)

func (*Repository) ListWorkflowNextActions

func (r *Repository) ListWorkflowNextActions(ctx context.Context, input workflow.ListNextActionsInput) ([]workflow.NextAction, error)

func (*Repository) ListWorkflowRuns

func (r *Repository) ListWorkflowRuns(ctx context.Context, input workflow.ListRunsInput) ([]workflow.WorkflowRun, error)

func (*Repository) ListWorkflowStepRecords

func (r *Repository) ListWorkflowStepRecords(ctx context.Context, input workflow.ListStepRecordsInput) ([]workflow.WorkflowStepRecord, error)

func (*Repository) ListWorkflowTemplates

func (r *Repository) ListWorkflowTemplates(ctx context.Context, input workflow.ListTemplatesInput) ([]workflow.WorkflowTemplate, error)

func (*Repository) LoadForgetPreview

func (r *Repository) LoadForgetPreview(ctx context.Context, previewID string) (mcp.ForgetPreviewRecord, error)

func (*Repository) LoadSyncCursor

func (r *Repository) LoadSyncCursor(ctx context.Context, binding provider.RuntimeBinding) (provider.SyncCursor, error)

func (*Repository) Lookup

func (r *Repository) Lookup(ctx context.Context, bindingID string) (provider.RuntimeBinding, error)

func (*Repository) LookupContextReceipt

func (r *Repository) LookupContextReceipt(ctx context.Context, b provider.RuntimeBinding, reference string) (provider.ContextReceipt, error)

func (*Repository) MarkMemoryRepositoryImportRunning

func (r *Repository) MarkMemoryRepositoryImportRunning(ctx context.Context, scope memory.Scope, repositoryID, importID string) error

func (*Repository) MarkRawEventProcessed

func (r *Repository) MarkRawEventProcessed(ctx context.Context, input governance.CompleteClaimedRawEventInput) error

func (*Repository) MergeMemory

func (*Repository) PersistReasoningInsightCandidate

func (r *Repository) PersistReasoningInsightCandidate(ctx context.Context, candidate reasoning.InsightCandidate, disposition reasoning.InsightDisposition, reason string) error

PersistReasoningInsightCandidate stores only the normalized, non-authoritative envelope. Active insight admission remains owned by the reserved activation service and never happens as a side effect of this write.

func (*Repository) PromoteReviewedCandidate

func (r *Repository) PromoteReviewedCandidate(ctx context.Context, input memory.ReviewedCandidatePromotionInput) error

func (*Repository) PromoteVectorRevision

func (r *Repository) PromoteVectorRevision(ctx context.Context, revision memory.VectorRevision) error

func (*Repository) PruneExpiredMemoryRepositoryPreviews

func (r *Repository) PruneExpiredMemoryRepositoryPreviews(ctx context.Context, before time.Time, limit int) (int, error)

PruneExpiredMemoryRepositoryPreviews removes only unaccepted preview evidence in bounded batches. Accepted imports retain their immutable plan payload and deduplication history for recovery.

func (*Repository) PruneSchedulerRunAttemptDetails

func (r *Repository) PruneSchedulerRunAttemptDetails(ctx context.Context, before time.Time, limit int) (int, error)

func (*Repository) ReadActivationPolicy

func (r *Repository) ReadActivationPolicy(ctx context.Context, scope memory.Scope, version string) (insights.ReservedInsightActivationPolicy, error)

func (*Repository) ReadActiveRankingRolloutPolicy

func (r *Repository) ReadActiveRankingRolloutPolicy(ctx context.Context, input memory.ReadActiveRankingRolloutPolicyInput) (memory.RankingRolloutPolicy, error)

func (*Repository) ReadAdmissionPressureSnapshot

func (r *Repository) ReadAdmissionPressureSnapshot(ctx context.Context, scope memory.Scope, operation memory.AdmissionPressureOperation, observedAt time.Time) (memory.AdmissionPressureSnapshot, error)

func (*Repository) ReadAlertCandidate

func (*Repository) ReadCanonicalMemory

func (r *Repository) ReadCanonicalMemory(ctx context.Context, scope memory.Scope, memoryID string, includeHidden bool) (memory.CanonicalMemory, error)

func (*Repository) ReadConformanceProfile

func (*Repository) ReadConformanceRun

func (*Repository) ReadContextProjection

func (r *Repository) ReadContextProjection(ctx context.Context, scope memory.Scope, projectionID string) (memory.ContextProjection, error)

func (*Repository) ReadDerivedInsight

func (*Repository) ReadDerivedInsightFeedback

func (*Repository) ReadDerivedWorkStatus

func (r *Repository) ReadDerivedWorkStatus(ctx context.Context, scope memory.Scope, observedAt time.Time) (workqueue.Status, error)

func (*Repository) ReadEffectiveQueryAnalysisRolloutPolicy

func (r *Repository) ReadEffectiveQueryAnalysisRolloutPolicy(ctx context.Context, input memory.ReadEffectiveQueryAnalysisRolloutPolicyInput) (memory.RankingRolloutPolicy, error)

ReadEffectiveQueryAnalysisRolloutPolicy selects only a query-analysis payload whose complete exact scope (including nullable session/user selectors) matches the request. It intentionally has no broader fallback.

func (*Repository) ReadEmbeddingCutoverPlan

func (*Repository) ReadGoalContext

func (r *Repository) ReadGoalContext(ctx context.Context, scope memory.Scope, limit int) ([]retrieval.GoalContextItem, string, error)

ReadGoalContext is the PostgreSQL-backed experimental projection. It is deliberately a separate query from ordinary derived insight retrieval and returns nothing unless an exact-scope, enabled visibility policy exists.

func (*Repository) ReadGovernanceStatus

func (r *Repository) ReadGovernanceStatus(ctx context.Context, now time.Time) (jobs.GovernanceStatus, error)

func (*Repository) ReadHealthEvaluation

func (*Repository) ReadIncident

func (*Repository) ReadLatestContextProjection

func (r *Repository) ReadLatestContextProjection(ctx context.Context, scope memory.Scope, kind memory.ContextProjectionKind) (memory.ContextProjection, error)

func (*Repository) ReadLatestContextProjectionForMaintenance

func (r *Repository) ReadLatestContextProjectionForMaintenance(ctx context.Context, scope memory.Scope, kind memory.ContextProjectionKind) (memory.ContextProjection, error)

func (*Repository) ReadMemoryChunk

func (r *Repository) ReadMemoryChunk(ctx context.Context, scope memory.Scope, chunkID string) (memory.MemoryChunk, error)

ReadMemoryChunk reads only a chunk whose parent source remains visible in precisely the requested scope. In particular, stale chunk lifecycle snapshots never bypass a later canonical lifecycle transition.

func (*Repository) ReadMemoryChunkParent

func (r *Repository) ReadMemoryChunkParent(ctx context.Context, scope memory.Scope, chunkID string) (memory.ChunkSourceReference, error)

ReadMemoryChunkParent proves that the linked source is still visible before exposing the source identity to callers.

func (*Repository) ReadMemoryEmbedding

func (r *Repository) ReadMemoryEmbedding(ctx context.Context, scope memory.Scope, memoryID string) (memory.EmbeddingMemoryInspection, error)

func (*Repository) ReadMemoryHistory

func (r *Repository) ReadMemoryHistory(ctx context.Context, scope memory.Scope, memoryID string, includeHidden bool) (memory.MemoryHistory, error)

func (*Repository) ReadMemoryIntent

func (r *Repository) ReadMemoryIntent(ctx context.Context, scope memory.Scope, intentID string) (memory.MemoryIntentRecord, error)

func (*Repository) ReadMemoryIntentHistory

func (r *Repository) ReadMemoryIntentHistory(ctx context.Context, scope memory.Scope, intentID string) (memory.MemoryIntentHistory, error)

func (*Repository) ReadMemoryProvenance

func (r *Repository) ReadMemoryProvenance(ctx context.Context, scope memory.Scope, memoryID string) ([]memory.ProvenanceRecord, error)

func (*Repository) ReadMemoryRepository

func (r *Repository) ReadMemoryRepository(ctx context.Context, scope memory.Scope, repositoryID string) (memory.MemoryRepositoryRecord, error)

ReadMemoryRepository never performs an unscoped repository lookup: callers must already hold an exact scope and a foreign id is indistinguishable from an absent resource to the storage boundary.

func (*Repository) ReadMemoryRepositoryImport

func (r *Repository) ReadMemoryRepositoryImport(ctx context.Context, scope memory.Scope, repositoryID, importID string) (memory.MemoryRepositoryImportRecord, error)

ReadMemoryRepositoryImport exposes only durable dispatch bookkeeping. The content-bearing preview and per-entry plan payloads remain retained evidence, not a status-response channel.

func (*Repository) ReadMemoryRepositoryImportPlan

func (r *Repository) ReadMemoryRepositoryImportPlan(ctx context.Context, scope memory.Scope, repositoryID, importID string) (memory.MemoryRepositoryImportRecord, memory.MemoryRepositoryPreview, error)

ReadMemoryRepositoryImportPlan is a worker-only exact-scope read of the immutable accepted plan. Ordinary inspection deliberately never uses this method, because the plan contains retained source evidence.

func (*Repository) ReadMemoryRepositoryManifest

func (r *Repository) ReadMemoryRepositoryManifest(ctx context.Context, scope memory.Scope, repositoryID string) (memory.MemoryRepositoryManifest, error)

ReadMemoryRepositoryManifest returns a latest-import watermark. Canonical identity mapping is intentionally omitted until the import worker records provenance that can be joined with current lifecycle/disclosure policy; an empty set is safer than exposing retained source text or stale targets.

func (*Repository) ReadMemoryRepositoryPreview

func (r *Repository) ReadMemoryRepositoryPreview(ctx context.Context, scope memory.Scope, repositoryID, previewID string) (memory.MemoryRepositoryPreview, error)

ReadMemoryRepositoryPreview is deliberately exact-scope. It cannot become a cross-scope payload-disclosure oracle even though previews contain source evidence that is more sensitive than ordinary registration labels.

func (*Repository) ReadMemorySessionRun

func (r *Repository) ReadMemorySessionRun(ctx context.Context, input memory.ReadMemorySessionRunInput) (memory.MemorySessionRun, error)

func (*Repository) ReadOperationalProof

func (*Repository) ReadOwnedMaintenanceExecution

func (r *Repository) ReadOwnedMaintenanceExecution(ctx context.Context, identity jobs.MaintenanceIdentity, workerID string) (jobs.MaintenanceExecutionState, error)

func (*Repository) ReadPrincipal

func (r *Repository) ReadPrincipal(ctx context.Context, scope memory.Scope, principalID string) (auth.Principal, error)

func (*Repository) ReadPrincipalCredential

func (r *Repository) ReadPrincipalCredential(ctx context.Context, credentialID string) (auth.Principal, auth.Credential, error)

func (*Repository) ReadQualityDiagnostics

func (*Repository) ReadQualityEvaluationRun

func (*Repository) ReadRankingRolloutPolicy

func (*Repository) ReadReadinessReport

func (*Repository) ReadReleaseEvidenceReconciliationEligibility

func (r *Repository) ReadReleaseEvidenceReconciliationEligibility(ctx context.Context, scope memory.Scope, policyID string) (bool, error)

func (*Repository) ReadRepairPlan

func (r *Repository) ReadRepairPlan(ctx context.Context, input memory.ReadRepairPlanInput) (memory.RepairPlan, error)

func (*Repository) ReadRetentionRun

func (*Repository) ReadSchedulerRunHistory

func (r *Repository) ReadSchedulerRunHistory(ctx context.Context, scope memory.Scope, runKey string) (jobs.SchedulerRunSummary, []jobs.SchedulerRunAttempt, error)

func (*Repository) ReadScopeProofRun

func (r *Repository) ReadScopeProofRun(ctx context.Context, input memory.ReadScopeProofRunInput) (memory.ScopeProofRun, error)

func (*Repository) ReadTaskEvaluation

func (r *Repository) ReadTaskEvaluation(ctx context.Context, input memory.ReadTaskEvaluationInput) (memory.TaskEvaluation, error)

func (*Repository) ReadTemporalLineage

func (r *Repository) ReadTemporalLineage(ctx context.Context, scope memory.Scope, memoryID string) (memory.TemporalLineage, error)

ReadTemporalLineage returns a fact's correction history in append order. An uncorrected fact reads as an empty lineage rather than an error. A stored lineage that skips a version fails the domain contract, so corruption is surfaced instead of being silently reordered.

func (*Repository) ReadUsefulnessFeedback

func (*Repository) ReadWorkflowHealth

func (r *Repository) ReadWorkflowHealth(ctx context.Context, scope memory.Scope, observedAt time.Time) (assurance.WorkflowHealthSnapshot, error)

func (*Repository) ReadWorkflowRun

func (r *Repository) ReadWorkflowRun(ctx context.Context, input workflow.ReadRunInput) (workflow.WorkflowRun, error)

func (*Repository) ReadWorkflowTemplate

func (r *Repository) ReadWorkflowTemplate(ctx context.Context, input workflow.ReadTemplateInput) (workflow.WorkflowTemplate, error)

func (*Repository) ReclaimMaintenanceLease

func (r *Repository) ReclaimMaintenanceLease(ctx context.Context, input jobs.MaintenanceLeaseInput) (bool, error)

func (*Repository) ReclassifyMemory

func (*Repository) ReconcileProjectionFeedback

func (r *Repository) ReconcileProjectionFeedback(ctx context.Context, scope memory.Scope, limit int) (int, error)

ReconcileProjectionFeedback serializes with admission on the logical identity. A revision can map at most once; superseded evidence is never reactivated.

func (*Repository) RecordClaimedRawEventFailure

func (r *Repository) RecordClaimedRawEventFailure(ctx context.Context, input governance.RecordClaimedRawEventFailureInput) error

func (*Repository) RecordContextTurnAttribution

func (r *Repository) RecordContextTurnAttribution(ctx context.Context, b provider.RuntimeBinding, a provider.ContextTurnAttribution) error

func (*Repository) RecordEmbeddingRebuildFailure

func (r *Repository) RecordEmbeddingRebuildFailure(ctx context.Context, record memory.EmbeddingRebuildRecord, failureCause string, failedAt time.Time) error

func (*Repository) RecordEmbeddingRebuildRequired

func (r *Repository) RecordEmbeddingRebuildRequired(ctx context.Context, record memory.EmbeddingRebuildRecord) error

func (*Repository) RecordFailedVectorRevision

func (r *Repository) RecordFailedVectorRevision(ctx context.Context, record memory.EmbeddingRebuildRecord, revision memory.VectorRevision) error

func (*Repository) RecordMemoryRepositoryImportEntryAttempt

func (r *Repository) RecordMemoryRepositoryImportEntryAttempt(ctx context.Context, scope memory.Scope, repositoryID, importID string, entry memory.MemoryRepositoryImportEntry) error

RecordMemoryRepositoryImportEntryAttempt appends a bounded worker outcome before updating its current status. Both statements bind the repository and exact scope so an import id cannot cross an isolation boundary.

func (*Repository) RecordMemorySessionVerificationFailure

func (r *Repository) RecordMemorySessionVerificationFailure(ctx context.Context, input memory.RecordMemorySessionVerificationFailureInput) error

func (*Repository) RecordProviderMemoryRead

func (r *Repository) RecordProviderMemoryRead(ctx context.Context, scope memory.Scope, memoryIDs []string, observedAt time.Time) error

func (*Repository) RecordRankingRolloutDryRun

func (*Repository) RecordRepairActionFailure

func (r *Repository) RecordRepairActionFailure(ctx context.Context, input memory.RecordRepairActionFailureInput) error

func (*Repository) RecordSchedulerRunAttempt

func (r *Repository) RecordSchedulerRunAttempt(ctx context.Context, attempt jobs.SchedulerRunAttempt) error

func (*Repository) RecordSchedulerRunSummary

func (r *Repository) RecordSchedulerRunSummary(ctx context.Context, summary jobs.SchedulerRunSummary) error

func (*Repository) RecordScopeProofStepFailure

func (r *Repository) RecordScopeProofStepFailure(ctx context.Context, input memory.RecordScopeProofStepFailureInput) error

func (*Repository) RecordWorkflowGapDiagnostic

func (r *Repository) RecordWorkflowGapDiagnostic(ctx context.Context, diagnostic workflow.GapDiagnostic) (workflow.GapDiagnostic, error)

func (*Repository) RecordWorkflowNextAction

func (r *Repository) RecordWorkflowNextAction(ctx context.Context, action workflow.NextAction) (workflow.NextAction, error)

func (*Repository) RecordWorkflowStep

func (r *Repository) RecordWorkflowStep(ctx context.Context, record workflow.WorkflowStepRecord) (workflow.WorkflowStepRecord, error)

func (*Repository) RecoverDerivedWork

func (r *Repository) RecoverDerivedWork(ctx context.Context, input workqueue.RecoverInput) error

func (*Repository) RecoverSchedulerRun

func (r *Repository) RecoverSchedulerRun(ctx context.Context, scope memory.Scope, runKey string, now time.Time) error

func (*Repository) ReferenceLookup

func (r *Repository) ReferenceLookup(ctx context.Context, scope memory.Scope, principalID, referenceID, path, profile, mode string) (provider.ReferenceResponse, error)

func (*Repository) ReferenceStatus

func (r *Repository) ReferenceStatus(ctx context.Context, scope memory.Scope, principalID, eventID, profile, mode string) (provider.ReferenceResponse, error)

func (*Repository) RegisterMemoryRepository

func (r *Repository) RegisterMemoryRepository(ctx context.Context, record memory.MemoryRepositoryRecord) (memory.MemoryRepositoryRecord, error)

RegisterMemoryRepository persists only a scoped source identity and opaque display labels. It never receives a filesystem path, archive, or transport.

func (*Repository) ReleaseForgetApply

func (r *Repository) ReleaseForgetApply(ctx context.Context, claim mcp.ForgetApplyClaim) error

func (*Repository) ReleaseLifecycle

func (r *Repository) ReleaseLifecycle(ctx context.Context, c provider.LifecycleClaim) error

func (*Repository) RenewClaimedRawEventLease

func (r *Repository) RenewClaimedRawEventLease(ctx context.Context, input governance.RenewClaimedRawEventLeaseInput) error

func (*Repository) RenewDerivedWorkLease

func (r *Repository) RenewDerivedWorkLease(ctx context.Context, input workqueue.RenewLeaseInput) error

func (*Repository) RenewMaintenanceLease

func (r *Repository) RenewMaintenanceLease(ctx context.Context, input jobs.MaintenanceLeaseInput) error

func (*Repository) ResolveWorkflowNextActions

func (r *Repository) ResolveWorkflowNextActions(ctx context.Context, scope memory.Scope, runID string, resolvedAt time.Time) error

func (*Repository) RetainDerivedWorkDetails

func (r *Repository) RetainDerivedWorkDetails(ctx context.Context, input workqueue.RetentionInput) (int64, error)

func (*Repository) RetryDerivedWork

func (r *Repository) RetryDerivedWork(ctx context.Context, input workqueue.RetryInput) error

func (*Repository) RevokeScopeGrant

func (r *Repository) RevokeScopeGrant(ctx context.Context, scope memory.Scope, grantID string, revokedAt time.Time, audit auth.AuditRecord) error

func (*Repository) RollbackRankingRolloutPolicy

func (r *Repository) RollbackRankingRolloutPolicy(ctx context.Context, input memory.RollbackRankingRolloutPolicyInput) (memory.RankingRolloutPolicy, error)

func (*Repository) RotateCredential

func (r *Repository) RotateCredential(ctx context.Context, scope memory.Scope, principalID string, credential auth.Credential, audit auth.AuditRecord) error

func (*Repository) SaveForgetPreview

func (r *Repository) SaveForgetPreview(ctx context.Context, preview mcp.ForgetPreviewRecord) error

func (*Repository) SaveMemoryRepositoryPreview

func (r *Repository) SaveMemoryRepositoryPreview(ctx context.Context, preview memory.MemoryRepositoryPreview) (memory.MemoryRepositoryPreview, error)

SaveMemoryRepositoryPreview persists an immutable reviewed plan. The JSON payload is evidence only; callers must still recheck expiry and scope before accepting an import.

func (*Repository) SaveSyncCursor

func (r *Repository) SaveSyncCursor(ctx context.Context, binding provider.RuntimeBinding, cursor provider.SyncCursor) error

func (*Repository) ScopeGrantAccess

func (r *Repository) ScopeGrantAccess(ctx context.Context, principalID string, scope memory.Scope) (auth.ScopeGrantAccessMode, error)

func (*Repository) ScopeGrantDisclosure

func (r *Repository) ScopeGrantDisclosure(ctx context.Context, principalID string, scope memory.Scope) (auth.DisclosureEntitlements, error)

func (*Repository) SearchLexical

func (r *Repository) SearchLexical(ctx context.Context, input retrieval.SearchInput) ([]retrieval.ScoredMemory, error)

func (*Repository) SearchRelations

func (r *Repository) SearchRelations(ctx context.Context, input retrieval.SearchInput) ([]retrieval.ScoredMemory, error)

func (*Repository) SearchSemantic

func (r *Repository) SearchSemantic(ctx context.Context, input retrieval.SearchInput) ([]retrieval.ScoredMemory, error)

func (*Repository) SetTemporalPolicyDisabled

func (r *Repository) SetTemporalPolicyDisabled(disabled bool)

SetTemporalPolicyDisabled turns temporal-aware filtering off for repository reads that have no per-request constraint. It is the operational rollback for derived-evidence reads and deliberately does not delete or rewrite any stored validity data.

func (*Repository) StartWorkflowRun

func (r *Repository) StartWorkflowRun(ctx context.Context, run workflow.WorkflowRun) (workflow.WorkflowRun, error)

func (*Repository) StoreDerivedInsightReplayReport

func (r *Repository) StoreDerivedInsightReplayReport(ctx context.Context, report memory.DerivedInsightReplayReport) error

func (*Repository) StoreIngestionFreshnessEvidence

func (r *Repository) StoreIngestionFreshnessEvidence(ctx context.Context, evidence assurance.IngestionFreshnessEvidence) (assurance.IngestionFreshnessEvidence, error)

func (*Repository) SummarizeTaskEvaluations

func (*Repository) SupersedeDerivedInsightFeedback

func (r *Repository) SupersedeDerivedInsightFeedback(ctx context.Context, input memory.SupersedeDerivedInsightFeedbackInput) error

func (*Repository) SupersedeTaskEvaluation

func (r *Repository) SupersedeTaskEvaluation(ctx context.Context, input memory.SupersedeTaskEvaluationInput) error

func (*Repository) SupersedeUsefulnessFeedback

func (r *Repository) SupersedeUsefulnessFeedback(ctx context.Context, input memory.SupersedeUsefulnessFeedbackInput) error
func (r *Repository) SupersedeWorkflowEvidenceLink(ctx context.Context, input workflow.SupersedeEvidenceLinkInput) error

func (*Repository) TransitionCandidateStatus

func (r *Repository) TransitionCandidateStatus(ctx context.Context, transition governance.CandidateStatusTransition, provenance memory.ProvenanceRecord) (governance.CandidateMemory, error)

func (*Repository) TransitionDerivedInsightLifecycle

func (r *Repository) TransitionDerivedInsightLifecycle(ctx context.Context, transition memory.DerivedInsightLifecycleTransition) error

func (*Repository) TransitionIncident

func (r *Repository) TransitionIncident(ctx context.Context, transition assurance.IncidentTransition) (assurance.Incident, error)

func (*Repository) TransitionWorkflowRun

func (r *Repository) TransitionWorkflowRun(ctx context.Context, input workflow.TransitionRunInput) (workflow.WorkflowRun, error)

func (*Repository) TriggerReleaseEvidenceReconciliation

func (r *Repository) TriggerReleaseEvidenceReconciliation(ctx context.Context, scope memory.Scope, trigger retrieval.ReconciliationTrigger) (string, error)

func (*Repository) UpdateConformanceProfile

func (*Repository) UpdateDerivedInsightReplayRunStatus

func (r *Repository) UpdateDerivedInsightReplayRunStatus(ctx context.Context, input memory.UpdateDerivedInsightReplayRunStatusInput) error

func (*Repository) UpdateMemory

func (*Repository) UpdateMemorySessionRunStatus

func (r *Repository) UpdateMemorySessionRunStatus(ctx context.Context, input memory.UpdateMemorySessionRunStatusInput) (memory.MemorySessionRun, error)

func (*Repository) UpdateMemorySessionTurnOutcome

func (r *Repository) UpdateMemorySessionTurnOutcome(ctx context.Context, input memory.UpdateMemorySessionTurnOutcomeInput) (memory.MemorySessionTurn, error)

func (*Repository) UpdateRepairPlanVerification

func (r *Repository) UpdateRepairPlanVerification(ctx context.Context, input memory.UpdateRepairPlanVerificationInput) (memory.RepairPlan, error)

func (*Repository) UpdateScopeGrantDisclosure

func (r *Repository) UpdateScopeGrantDisclosure(ctx context.Context, scope memory.Scope, principalID, grantID string, e auth.DisclosureEntitlements, audit auth.AuditRecord) error

func (*Repository) UpdateScopeProofRunStatus

func (r *Repository) UpdateScopeProofRunStatus(ctx context.Context, input memory.UpdateScopeProofRunStatusInput) (memory.ScopeProofRun, error)

func (*Repository) UpdateWorkflowTemplate

func (r *Repository) UpdateWorkflowTemplate(ctx context.Context, input workflow.UpdateTemplateInput) (workflow.WorkflowTemplate, error)

func (*Repository) UpsertActivationPolicy

func (r *Repository) UpsertActivationPolicy(ctx context.Context, policy insights.ReservedInsightActivationPolicy, reason string, updatedAt time.Time) error

func (*Repository) UpsertContextCalibrationSummary

func (r *Repository) UpsertContextCalibrationSummary(ctx context.Context, summary memory.ContextCalibrationSummary) (memory.ContextCalibrationSummary, error)

func (*Repository) UpsertDerivedInsight

func (r *Repository) UpsertDerivedInsight(ctx context.Context, insight memory.DerivedInsight) (memory.DerivedInsight, error)

func (*Repository) ValidateMemoryIntentTarget

func (r *Repository) ValidateMemoryIntentTarget(ctx context.Context, input memory.MemoryIntentInput) error

func (*Repository) VerifyWorkflowEvidence

VerifyWorkflowEvidence is the single production boundary for workflow links. It reads only durable evidence metadata and never copies source payloads into a workflow.

func (*Repository) WriteProvenance

func (r *Repository) WriteProvenance(ctx context.Context, record memory.ProvenanceRecord) error

func (*Repository) WriteRawEvent

func (r *Repository) WriteRawEvent(ctx context.Context, input memory.IngestEventInput) (memory.RawEvent, error)

Jump to

Keyboard shortcuts

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