Versions in this module Expand all Collapse all v1 v1.4.0 Oct 20, 2026 Changes in this version + type AccountingReconciliation struct + ModelLedgerDrift int64 + ProviderReceiptGaps int64 + QuotaReservedDrift int64 + Repaired bool + TaskLedgerDrift int64 + WorkflowCounterDrift int64 + type Store struct + func New(pool *pgxpool.Pool) *Store + func NewWithClock(pool *pgxpool.Pool, clock func() time.Time) *Store + func (s *Store) AcknowledgeCancellation(ctx context.Context, in kernelstore.CancelAttemptInput) (kernelstore.CancelAttemptResult, error) + func (s *Store) AcknowledgeIPCMessages(ctx context.Context, in kernelstore.AcknowledgeIPCMessagesInput) (kernelstore.AcknowledgeIPCMessagesResult, error) + func (s *Store) AcquireAttempt(ctx context.Context, in kernelstore.AcquireAttemptInput) (kernelstore.AttemptLease, error) + func (s *Store) AcquireCircuit(ctx context.Context, in provider.CircuitAcquire) (provider.CircuitPermit, error) + func (s *Store) AggregateMetrics(ctx context.Context, tenantID string, since time.Time) (*observability.Metrics, error) + func (s *Store) AppendIPCMessage(ctx context.Context, in kernelstore.AppendIPCMessageInput) (kernelstore.AppendIPCMessageResult, error) + func (s *Store) ArtifactMetadata(ctx context.Context, tenantID, uri string) ([]byte, int64, string, error) + func (s *Store) ClaimOutbox(ctx context.Context, in kernelstore.ClaimOutboxInput) ([]kernelstore.OutboxEvent, error) + func (s *Store) ClaimTasks(ctx context.Context, in kernelstore.ClaimTasksInput) ([]kernelstore.TaskClaim, error) + func (s *Store) ClaimWorkflows(ctx context.Context, in kernelstore.ClaimWorkflowsInput) ([]kernelstore.Workflow, error) + func (s *Store) CommitCheckpoint(ctx context.Context, input kernelstore.CommitCheckpointInput) (kernelstore.Checkpoint, kernelstore.Attempt, error) + func (s *Store) CompleteAttempt(ctx context.Context, in kernelstore.CompleteAttemptInput) (kernelstore.CompleteAttemptResult, error) + func (s *Store) CompleteRun(ctx context.Context, in kernelstore.CompleteRunInput) (kernelstore.Run, kernelstore.Task, error) + func (s *Store) CreateAgentVersion(ctx context.Context, in kernelstore.CreateAgentVersionInput) (kernelstore.CreateAgentVersionResult, error) + func (s *Store) CreateInstance(ctx context.Context, inst *supervisor.Instance) error + func (s *Store) CreateModelCall(ctx context.Context, in kernelstore.CreateModelCallInput) (kernelstore.CreateModelCallResult, error) + func (s *Store) CreateNamespace(ctx context.Context, ns *namespace.Namespace) error + func (s *Store) CreateRun(ctx context.Context, in kernelstore.CreateRunInput) (kernelstore.Run, error) + func (s *Store) CreateService(ctx context.Context, svc *supervisor.Service) error + func (s *Store) CreateTask(ctx context.Context, in kernelstore.CreateTaskInput) (kernelstore.CreateTaskResult, error) + func (s *Store) CreateToolApproval(ctx context.Context, in kernelstore.CreateToolApprovalInput) (kernelstore.CreateToolApprovalResult, error) + func (s *Store) CreateToolCall(ctx context.Context, in kernelstore.CreateToolCallInput) (kernelstore.CreateToolCallResult, error) + func (s *Store) CreateWorkflow(ctx context.Context, in kernelstore.CreateWorkflowInput) (kernelstore.CreateWorkflowResult, error) + func (s *Store) DecideAdmission(ctx context.Context, in kernelstore.DecideAdmissionInput) (kernelstore.Task, error) + func (s *Store) DecideToolApproval(ctx context.Context, in kernelstore.DecideToolApprovalInput) (kernelstore.ToolApproval, error) + func (s *Store) DecideWorkflowStepApproval(ctx context.Context, in kernelstore.DecideWorkflowStepApprovalInput) (kernelstore.WorkflowStep, error) + func (s *Store) DeferTaskSchedule(ctx context.Context, in kernelstore.DeferTaskScheduleInput) (kernelstore.Task, error) + func (s *Store) DeleteInstance(ctx context.Context, tenantID, serviceID, instanceID string) error + func (s *Store) DeleteNamespace(ctx context.Context, tenantID, name string) error + func (s *Store) DeleteService(ctx context.Context, tenantID, serviceID string) error + func (s *Store) DeleteTenantQuota(ctx context.Context, tenantID string) error + func (s *Store) ExportAuditChain(ctx context.Context, tenantID string) ([]kernelstore.AuditEvent, error) + func (s *Store) FinishModelCall(ctx context.Context, in kernelstore.FinishModelCallInput) (kernelstore.ModelCall, error) + func (s *Store) GetAgentVersion(ctx context.Context, tenantID string, id uuid.UUID) (kernelstore.AgentVersion, error) + func (s *Store) GetAgentVersionByRef(ctx context.Context, tenantID, ref string) (kernelstore.AgentVersion, error) + func (s *Store) GetAuditEvent(ctx context.Context, tenantID string, id uuid.UUID) (kernelstore.AuditEvent, error) + func (s *Store) GetExecutionCorrelation(ctx context.Context, tenantID string, workflowID uuid.UUID) (observability.ExecutionCorrelation, error) + func (s *Store) GetHeartbeatStatus(ctx context.Context, tenantID string, attemptID uuid.UUID, fencingToken int64) (kernelstore.HeartbeatStatus, error) + func (s *Store) GetIPCMessage(ctx context.Context, tenantID string, id uuid.UUID) (kernelstore.IPCMessage, error) + func (s *Store) GetInstance(ctx context.Context, tenantID, serviceID, instanceID string) (*supervisor.Instance, error) + func (s *Store) GetMemory(ctx context.Context, tenantID string, id uuid.UUID) (kernelstore.MemoryRecord, error) + func (s *Store) GetModelCall(ctx context.Context, tenantID string, id uuid.UUID) (kernelstore.ModelCall, error) + func (s *Store) GetModelDescriptor(ctx context.Context, tenantID, provider, modelName string) (kernelstore.ModelDescriptor, error) + func (s *Store) GetNamespace(ctx context.Context, tenantID, name string) (*namespace.Namespace, error) + func (s *Store) GetRunMailboxScope(ctx context.Context, tenantID string, runID uuid.UUID) (kernelstore.RunMailboxScope, error) + func (s *Store) GetRuntimeAssignment(ctx context.Context, tenantID string, attemptID uuid.UUID, fencingToken int64) (kernelstore.RuntimeAssignment, error) + func (s *Store) GetRuntimeReceipt(ctx context.Context, tenantID string, attemptID uuid.UUID, ...) (kernelstore.RuntimeReceipt, error) + func (s *Store) GetService(ctx context.Context, tenantID, serviceID string) (*supervisor.Service, error) + func (s *Store) GetServiceByName(ctx context.Context, tenantID, namespace, name string) (*supervisor.Service, error) + func (s *Store) GetServiceTaskExecution(ctx context.Context, tenantID string, taskID uuid.UUID) (supervisor.TaskExecution, error) + func (s *Store) GetTask(ctx context.Context, tenantID string, id uuid.UUID) (kernelstore.Task, error) + func (s *Store) GetTaskBudget(ctx context.Context, tenantID string, taskID uuid.UUID) (kernelstore.TaskBudgetStatus, error) + func (s *Store) GetTenantQuota(ctx context.Context, tenantID string) (kernelstore.TenantQuota, error) + func (s *Store) GetTenantQuotaUsage(ctx context.Context, tenantID string, at time.Time) (kernelstore.TenantWindowUsage, error) + func (s *Store) GetToolApproval(ctx context.Context, tenantID string, id uuid.UUID) (kernelstore.ToolApproval, error) + func (s *Store) GetToolCall(ctx context.Context, tenantID string, id uuid.UUID) (kernelstore.ToolCall, error) + func (s *Store) GetToolDescriptor(ctx context.Context, tenantID, name, version string) (kernelstore.ToolDescriptor, error) + func (s *Store) GetUsage(ctx context.Context, tenantID, name string) (*namespace.ResourceUsage, error) + func (s *Store) GetWorkflow(ctx context.Context, tenantID string, id uuid.UUID) (kernelstore.Workflow, error) + func (s *Store) GetWorkflowStep(ctx context.Context, tenantID string, workflowID uuid.UUID, name string) (kernelstore.WorkflowStep, error) + func (s *Store) HeartbeatLease(ctx context.Context, in kernelstore.HeartbeatLeaseInput) (kernelstore.Lease, error) + func (s *Store) ListActiveWorkflows(ctx context.Context, batch int) ([]kernelstore.Workflow, error) + func (s *Store) ListAllInstances(ctx context.Context, tenantID string) ([]*supervisor.Instance, error) + func (s *Store) ListAllServices(ctx context.Context) ([]*supervisor.Service, error) + func (s *Store) ListAudit(ctx context.Context, in kernelstore.ListAuditInput) ([]kernelstore.AuditEvent, error) + func (s *Store) ListExpiredAttempts(ctx context.Context, now time.Time, limit int) ([]kernelstore.RecoveryCandidate, error) + func (s *Store) ListInstances(ctx context.Context, tenantID, serviceID string) ([]*supervisor.Instance, error) + func (s *Store) ListMailbox(ctx context.Context, in kernelstore.ListMailboxInput) ([]kernelstore.IPCMessage, error) + func (s *Store) ListNamespaces(ctx context.Context, tenantID string) ([]*namespace.Namespace, error) + func (s *Store) ListRuntimePools(ctx context.Context, tenantID string) ([]scheduler.RuntimePool, error) + func (s *Store) ListServices(ctx context.Context, tenantID, namespace string) ([]*supervisor.Service, error) + func (s *Store) ListToolDescriptors(ctx context.Context, tenantID string) ([]kernelstore.ToolDescriptor, error) + func (s *Store) ListWorkflowSteps(ctx context.Context, tenantID string, workflowID uuid.UUID) ([]kernelstore.WorkflowStep, error) + func (s *Store) MarkOutboxFailed(ctx context.Context, eventID uuid.UUID, dispatcherID string, lockToken int64, ...) error + func (s *Store) MarkOutboxPublished(ctx context.Context, eventID uuid.UUID, dispatcherID string, lockToken int64, ...) error + func (s *Store) MarkWorkflowBudgetExhausted(ctx context.Context, tenantID string, workflowID uuid.UUID, ...) (kernelstore.Workflow, error) + func (s *Store) MarkWorkflowDeadlineExceeded(ctx context.Context, tenantID string, workflowID uuid.UUID, ...) (kernelstore.Workflow, error) + func (s *Store) PollRuntimeAssignment(ctx context.Context, tenantID, runtimeInstanceID string) (kernelstore.RuntimeAssignment, error) + func (s *Store) PoolInstanceHealth(ctx context.Context, instanceIDs []string, now time.Time, ...) (map[string]bool, error) + func (s *Store) PutMemory(ctx context.Context, in kernelstore.PutMemoryInput) (kernelstore.MemoryRecord, bool, error) + func (s *Store) ReconcileAccounting(ctx context.Context, repair bool) (AccountingReconciliation, error) + func (s *Store) ReconcileWorkflowReservations(ctx context.Context, repair bool) (WorkflowReservationReconciliation, error) + func (s *Store) RecordCircuit(ctx context.Context, in provider.CircuitRecord) error + func (s *Store) RecordUsageDelta(ctx context.Context, tenantID, name string, delta namespace.ResourceUsageDelta) error + func (s *Store) RecoverExpiredAttempt(ctx context.Context, in kernelstore.RecoverExpiredAttemptInput) (kernelstore.RecoveryResult, error) + func (s *Store) RegisterModelDescriptor(ctx context.Context, in kernelstore.RegisterModelDescriptorInput) (kernelstore.ModelDescriptor, error) + func (s *Store) RegisterRuntimePools(ctx context.Context, pools []scheduler.RuntimePool) error + func (s *Store) RegisterToolDescriptor(ctx context.Context, in kernelstore.RegisterToolDescriptorInput) (kernelstore.ToolDescriptor, error) + func (s *Store) ReleaseTaskClaim(ctx context.Context, claim kernelstore.TaskClaim) error + func (s *Store) ReleaseTaskUsageReservation(ctx context.Context, tenantID string, taskID uuid.UUID, key string) error + func (s *Store) RenewWorkflowClaim(ctx context.Context, tenantID string, workflowID uuid.UUID, owner string, ...) error + func (s *Store) RequestTaskCancellation(ctx context.Context, tenantID string, taskID uuid.UUID, expectedVersion int64) (kernelstore.Task, error) + func (s *Store) RequestWorkflowCancellation(ctx context.Context, tenantID string, workflowID uuid.UUID, ...) (kernelstore.Workflow, error) + func (s *Store) ReserveTaskUsage(ctx context.Context, in kernelstore.ReserveTaskUsageInput) error + func (s *Store) ScheduleTask(ctx context.Context, in kernelstore.ScheduleTaskInput) (kernelstore.AttemptLease, error) + func (s *Store) SearchMemory(ctx context.Context, in kernelstore.SearchMemoryInput) ([]kernelstore.MemoryRecord, error) + func (s *Store) SetTenantQuota(ctx context.Context, in kernelstore.SetTenantQuotaInput) (kernelstore.TenantQuota, error) + func (s *Store) SettleTaskUsage(ctx context.Context, in kernelstore.SettleTaskUsageInput) (kernelstore.TaskBudgetStatus, error) + func (s *Store) SettleTaskUsageDelta(ctx context.Context, in kernelstore.SettleTaskUsageDeltaInput) (kernelstore.TaskBudgetStatus, error) + func (s *Store) SpawnWorkflowStep(ctx context.Context, in kernelstore.SpawnWorkflowStepInput) (kernelstore.SpawnWorkflowStepResult, error) + func (s *Store) TombstoneMemory(ctx context.Context, tenantID string, id uuid.UUID, expectedVersion int64) (kernelstore.MemoryRecord, error) + func (s *Store) TransitionAttempt(ctx context.Context, in kernelstore.TransitionAttemptInput) (kernelstore.Attempt, error) + func (s *Store) TransitionTask(ctx context.Context, tenantID string, id uuid.UUID, expectedVersion int64, ...) (kernelstore.Task, error) + func (s *Store) TransitionWorkflow(ctx context.Context, in kernelstore.TransitionWorkflowInput) (kernelstore.Workflow, error) + func (s *Store) TransitionWorkflowStep(ctx context.Context, in kernelstore.TransitionWorkflowStepInput) (kernelstore.WorkflowStep, error) + func (s *Store) UpdateInstance(ctx context.Context, inst *supervisor.Instance) error + func (s *Store) UpdateNamespace(ctx context.Context, ns *namespace.Namespace) error + func (s *Store) UpdateRuntimePoolStatus(ctx context.Context, in kernelstore.UpdateRuntimePoolStatusInput) (kernelstore.RuntimePoolState, error) + func (s *Store) UpdateService(ctx context.Context, svc *supervisor.Service) error + func (s *Store) UpdateToolCall(ctx context.Context, in kernelstore.UpdateToolCallInput) (kernelstore.ToolCall, error) + func (s *Store) VerifyAuditChain(ctx context.Context, tenantID string) (kernelstore.AuditVerification, error) + func (s *Store) WithServiceLock(ctx context.Context, tenantID, serviceID string, ...) error + func (s *Store) WorkflowLineage(ctx context.Context, tenantID string, taskID uuid.UUID) (uuid.UUID, string, int64, bool, error) + func (s *Store) WorkflowUsageSnapshot(ctx context.Context, tenantID string, workflowID uuid.UUID) (kernelstore.WorkflowUsage, error) + func (s *Store) WriteRuntimeReceipt(ctx context.Context, in kernelstore.WriteRuntimeReceiptInput) error + type WorkflowReservationReconciliation struct + Flagged int64 + Reconciled int64 + Repaired bool + StepsAdjusted int64