Skip to main content

internal/infra/pg/formationrecovery.go

internal/infra/pg · 119 lines · 5 declarations · source

Declarations

type ParkedMetadata

type ParkedMetadata struct {
ObservationID string `json:"observation_id"`
LogOffset int64 `json:"log_offset"`
Attempts int `json:"attempts"`
ParkedAt time.Time `json:"parked_at"`
}

ParkedMetadata intentionally cannot carry provider errors, subjects or conversation text.

source

type ParkedPage

type ParkedPage struct {
Items []ParkedMetadata `json:"items"`
NextAfter *int64 `json:"next_after,omitempty"`
}

source

method ObservationStore.ParkedPage

func (s *ObservationStore) ParkedPage(ctx context.Context, schema Schema, scope string, after int64, limit int) (ParkedPage, error)

ParkedPage reads at most 201 metadata rows using the project/offset partial index. It is a live view: work parked behind a cursor appears on a fresh scan, not a later page.

source

var ErrFormationTurnNotFound

var ErrFormationTurnNotFound = errors.New("turn not found in the requested project")

source

method ObservationStore.UnparkAudited

func (s *ObservationStore) UnparkAudited(ctx context.Context, schema Schema, scope, observationID, principal string) (bool, error)

UnparkAudited is the operator recovery boundary. The opaque principal identifies the CLI invocation, not an authenticated human. The database operator is the authority for this command. A failed audit insert rolls back recovery, unlike best-effort audit on the request read path.

source