models

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InboxMessageStateQueued    InboxMessageState = "queued"
	InboxMessageStateDelivered InboxMessageState = "delivered"
	InboxMessageStateDeferred  InboxMessageState = "deferred"
	InboxMessageStateForwarded InboxMessageState = "forwarded"

	ExecutionKindRoot  ExecutionKind = "root"
	ExecutionKindChild ExecutionKind = "child"

	ExecutionStateQueued      ExecutionState = "queued"
	ExecutionStateRunning     ExecutionState = "running"
	ExecutionStatePaused      ExecutionState = "paused"
	ExecutionStateReconciling ExecutionState = "reconciling"
	ExecutionStateCompleted   ExecutionState = "completed"
	ExecutionStateFailed      ExecutionState = "failed"
	ExecutionStateCancelled   ExecutionState = "cancelled"

	ActivityKindModel       ActivityKind = "model"
	ActivityKindTool        ActivityKind = "tool"
	ActivityKindCompaction  ActivityKind = "compaction"
	ActivityKindPreparation ActivityKind = "preparation"

	ActivityStateScheduled ActivityState = "scheduled"
	ActivityStateRunning   ActivityState = "running"
	ActivityStateCompleted ActivityState = "completed"
	ActivityStateFailed    ActivityState = "failed"
	ActivityStatePaused    ActivityState = "paused"
	ActivityStateUncertain ActivityState = "uncertain"
	ActivityStateCancelled ActivityState = "cancelled"

	ActivityReplayPolicyRetry     ActivityReplayPolicy = "retry"
	ActivityReplayPolicyReconcile ActivityReplayPolicy = "reconcile"

	TurnStateRunning     TurnState = "running"
	TurnStateCompleted   TurnState = "completed"
	TurnStateFailed      TurnState = "failed"
	TurnStateCancelled   TurnState = "cancelled"
	TurnStateInterrupted TurnState = "interrupted"

	// MessageRoleSystem is a notice Peen itself adds to the conversation, such
	// as how the previous turn ended. The model receives it as a system
	// message.
	MessageRoleSystem    MessageRole = "system"
	MessageRoleUser      MessageRole = "user"
	MessageRoleAssistant MessageRole = "assistant"
	MessageRoleTool      MessageRole = "tool"

	InjectedKindNone  InjectedKind = ""
	InjectedKindSkill InjectedKind = "skill"

	AgentRunStateRunning     AgentRunState = "running"
	AgentRunStateCompleted   AgentRunState = "completed"
	AgentRunStateFailed      AgentRunState = "failed"
	AgentRunStateCancelled   AgentRunState = "cancelled"
	AgentRunStateInterrupted AgentRunState = "interrupted"

	AgentRunDefinitionStored AgentRunDefinition = "stored"
	AgentRunDefinitionAdHoc  AgentRunDefinition = "ad-hoc"

	NoticeDeliveryQueue NoticeDelivery = "queue"
	NoticeDeliveryWake  NoticeDelivery = "wake"

	NoticeStatePending   NoticeState = "pending"
	NoticeStateDelivered NoticeState = "delivered"

	JobStateRunning     JobState = "running"
	JobStateExited      JobState = "exited"
	JobStateSignalled   JobState = "signalled"
	JobStateFailed      JobState = "failed"
	JobStateInterrupted JobState = "interrupted"

	JobOutputStreamStdout JobOutputStream = "stdout"
	JobOutputStreamStderr JobOutputStream = "stderr"

	JobSignalStop JobSignal = "stop"
	JobSignalKill JobSignal = "kill"

	ModelRunStageTurn       ModelRunStage = "turn"
	ModelRunStageChild      ModelRunStage = "child"
	ModelRunStageCompaction ModelRunStage = "compaction"

	ModelRunStateRunning     ModelRunState = "running"
	ModelRunStateCompleted   ModelRunState = "completed"
	ModelRunStateFailed      ModelRunState = "failed"
	ModelRunStateCancelled   ModelRunState = "cancelled"
	ModelRunStateInterrupted ModelRunState = "interrupted"

	ModelCallStateRunning     ModelCallState = "running"
	ModelCallStateCompleted   ModelCallState = "completed"
	ModelCallStateFailed      ModelCallState = "failed"
	ModelCallStateCancelled   ModelCallState = "cancelled"
	ModelCallStateInterrupted ModelCallState = "interrupted"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityKind added in v0.25.0

type ActivityKind string

type ActivityReplayPolicy added in v0.25.0

type ActivityReplayPolicy string

type ActivityState added in v0.25.0

type ActivityState string

type AgentRun added in v0.4.0

type AgentRun struct {
	ID                    uuid.UUID
	SessionID             uuid.UUID
	ParentTurnID          uuid.UUID
	WorkerGenerationID    string
	ParentAgentRunID      *uuid.UUID
	ParentToolCallID      string
	RequestID             uuid.UUID
	Name                  string
	Definition            AgentRunDefinition
	Depth                 int64
	Workspace             string
	ModelReference        string
	ModelID               string
	Task                  string
	Instructions          string
	AllowedToolsJSON      string
	SystemPrompt          string
	EventCount            int64
	CancelRequested       bool
	State                 AgentRunState
	ResponseText          string
	ResponseThinking      string
	ResponseMessagesJSON  string
	FinishReason          string
	PromptTokenCount      int64
	CompletionTokenCount  int64
	FailureClassification string
	FailureDetail         string
	StartedAt             time.Time
	EndedAt               *time.Time
}

AgentRun is one durable child-agent execution launched from a session turn.

func (AgentRun) TableName added in v0.4.0

func (AgentRun) TableName() string

TableName pins the schema-owned agent_runs table name.

type AgentRunCompaction added in v0.11.0

type AgentRunCompaction struct {
	ID                     uuid.UUID
	SessionID              uuid.UUID
	AgentRunID             uuid.UUID
	FromMessageID          uuid.UUID
	ToMessageID            uuid.UUID
	FromSequence           int64
	ToSequence             int64
	DirectFromSequence     int64
	DirectToSequence       int64
	Summary                string
	SourceMessageCount     int64
	InputTokenCount        int64
	SummaryTokenCount      int64
	ModelID                string
	PromptHash             string
	CreatedAt              time.Time
	SupersedesCompactionID *uuid.UUID
}

AgentRunCompaction is one immutable summary covering a completed prefix of one child agent's transcript.

DirectFromSequence and DirectToSequence record only the messages this row covered itself. FromSequence and ToSequence span the whole superseded lineage, so a later compaction extends the chain without rewriting the direct membership an earlier row already recorded.

func (AgentRunCompaction) TableName added in v0.11.0

func (AgentRunCompaction) TableName() string

TableName pins the schema-owned agent_run_compactions table name.

type AgentRunDefinition added in v0.4.0

type AgentRunDefinition string

AgentRunDefinition records whether a child is stored or inline.

type AgentRunEvent added in v0.4.0

type AgentRunEvent struct {
	ID           uuid.UUID
	SessionID    uuid.UUID
	AgentRunID   uuid.UUID
	Sequence     int64
	FeedSequence int64
	EventType    string
	PayloadJSON  string
	CreatedAt    time.Time
}

AgentRunEvent is one ordered, replayable child-agent event.

func (AgentRunEvent) TableName added in v0.4.0

func (AgentRunEvent) TableName() string

TableName pins the schema-owned agent_run_events table name.

type AgentRunMessage added in v0.11.0

type AgentRunMessage struct {
	ID            uuid.UUID
	SessionID     uuid.UUID
	AgentRunID    uuid.UUID
	Sequence      int64
	Role          MessageRole
	Content       string
	ModelID       string
	Thinking      string
	ToolCallsJSON string
	ToolCallID    string
	CompactionID  *uuid.UUID
	IsError       bool
	Incomplete    bool
	CreatedAt     time.Time
}

AgentRunMessage is one durable prompt-visible record in a child agent's own transcript.

A child agent runs a separate model context, so its conversation is stored apart from the session transcript. A parent-session compaction can then never absorb child messages, and a child compaction can never rewrite the parent's.

func (AgentRunMessage) TableName added in v0.11.0

func (AgentRunMessage) TableName() string

TableName pins the schema-owned agent_run_messages table name.

type AgentRunState added in v0.4.0

type AgentRunState string

AgentRunState is the durable lifecycle state of one child-agent run.

type Compaction

type Compaction struct {
	ID                     uuid.UUID
	SessionID              uuid.UUID
	FromMessageID          uuid.UUID
	ToMessageID            uuid.UUID
	FromSequence           int64
	ToSequence             int64
	Summary                string
	SourceMessageCount     int64
	InputTokenCount        int64
	SummaryTokenCount      int64
	ModelID                string
	PromptHash             string
	CreatedAt              time.Time
	SupersedesCompactionID *uuid.UUID
}

Compaction is one immutable summary covering a completed message prefix.

func (Compaction) TableName

func (Compaction) TableName() string

TableName pins the schema-owned compactions table name.

type ContentBlob added in v0.26.3

type ContentBlob struct {
	Hash string `gorm:"primaryKey"`
	Data []byte
}

ContentBlob stores one long JSON string literal of durable execution state, once, under the SHA-256 of its bytes. Compacted documents refer to it by hash. See package contentblob.

The table is shared by every session. A workflow converter encodes payloads without knowing their session, and a blob reveals nothing to a reader who does not already hold its exact bytes, because the hash is the only key.

func (ContentBlob) TableName added in v0.26.3

func (ContentBlob) TableName() string

TableName pins the schema-owned content_blobs table name.

type ContextSnapshot

type ContextSnapshot struct {
	Hash            string `gorm:"primaryKey"`
	ManifestJSON    string
	ResolvedContent string
	CreatedAt       time.Time
}

ContextSnapshot stores one immutable resolved harness context.

func (ContextSnapshot) TableName

func (ContextSnapshot) TableName() string

TableName pins the schema-owned context_snapshots table name.

type Event

type Event struct {
	ID                 uuid.UUID
	SessionID          uuid.UUID
	TurnID             uuid.UUID
	WorkerGenerationID string
	Sequence           int64
	FeedSequence       int64
	RequestID          uuid.UUID
	EventType          string
	PayloadJSON        string
	ParentToolCallID   string
	CreatedAt          time.Time
}

Event is one ordered internal or protocol event in a session transcript.

func (Event) TableName

func (Event) TableName() string

TableName pins the schema-owned events table name.

type Execution added in v0.25.0

type Execution struct {
	ID                  uuid.UUID      `json:"id"`
	SessionID           uuid.UUID      `json:"sessionId"`
	RootTurnID          uuid.UUID      `json:"rootTurnId"`
	RootExecutionID     uuid.UUID      `json:"rootExecutionId"`
	ParentExecutionID   *uuid.UUID     `json:"parentExecutionId"`
	AgentRunID          *uuid.UUID     `json:"agentRunId"`
	Kind                ExecutionKind  `json:"kind"`
	State               ExecutionState `json:"state"`
	WorkflowVersion     string         `json:"workflowVersion"`
	WorkflowExecutionID string         `json:"workflowExecutionId"`
	Task                string         `json:"task"`
	WorkingDirectory    string         `json:"workingDirectory"`
	ContextJSON         string         `json:"contextJson"`
	EventCount          int64          `json:"eventCount"`
	ControlRevision     int64          `json:"controlRevision"`
	PauseReason         string         `json:"pauseReason"`
	FailureDetail       string         `json:"failureDetail"`
	CreatedAt           time.Time      `json:"createdAt"`
	UpdatedAt           time.Time      `json:"updatedAt"`
	PausedAt            *time.Time     `json:"pausedAt"`
	CompletedAt         *time.Time     `json:"completedAt"`
}

Execution keeps an agent's workflow identity, context, and control state.

func (Execution) TableName added in v0.25.0

func (Execution) TableName() string

type ExecutionActivity added in v0.25.0

type ExecutionActivity struct {
	ID                uuid.UUID            `json:"id"`
	SessionID         uuid.UUID            `json:"sessionId"`
	ExecutionID       uuid.UUID            `json:"executionId"`
	StepID            string               `json:"stepId"`
	Kind              ActivityKind         `json:"kind"`
	State             ActivityState        `json:"state"`
	ReplayPolicy      ActivityReplayPolicy `json:"replayPolicy"`
	Name              string               `json:"name"`
	InputJSON         string               `json:"inputJson"`
	OutputJSON        *string              `json:"outputJson"`
	ContextJSON       string               `json:"contextJson"`
	Attempt           int64                `json:"attempt"`
	OwnerGenerationID string               `json:"ownerGenerationId"`
	FailureDetail     string               `json:"failureDetail"`
	ResolutionJSON    string               `json:"resolutionJson"`
	CreatedAt         time.Time            `json:"createdAt"`
	StartedAt         *time.Time           `json:"startedAt"`
	CompletedAt       *time.Time           `json:"completedAt"`
}

ExecutionActivity records a stable step before and after its external work.

func (ExecutionActivity) TableName added in v0.25.0

func (ExecutionActivity) TableName() string

type ExecutionEvent added in v0.25.0

type ExecutionEvent struct {
	ID          uuid.UUID `json:"id"`
	SessionID   uuid.UUID `json:"sessionId"`
	ExecutionID uuid.UUID `json:"executionId"`
	Sequence    int64     `json:"sequence"`
	EventType   string    `json:"eventType"`
	PayloadJSON string    `json:"payloadJson"`
	CreatedAt   time.Time `json:"createdAt"`
}

ExecutionEvent records ordered control and activity decisions for an agent.

func (ExecutionEvent) TableName added in v0.25.0

func (ExecutionEvent) TableName() string

type ExecutionInboxMessage added in v0.25.0

type ExecutionInboxMessage struct {
	ID                   uuid.UUID         `json:"id"`
	SessionID            uuid.UUID         `json:"sessionId"`
	ExecutionID          uuid.UUID         `json:"executionId"`
	TurnID               uuid.UUID         `json:"turnId"`
	RequestID            uuid.UUID         `json:"requestId"`
	SourceEventID        *uuid.UUID        `json:"sourceEventId"`
	StopRevision         int64             `json:"stopRevision"`
	Sequence             int64             `json:"sequence"`
	WorkingDirectory     string            `json:"workingDirectory"`
	Message              string            `json:"message"`
	PartsJSON            string            `json:"partsJson"`
	State                InboxMessageState `json:"state"`
	DeliveredActivityID  *uuid.UUID        `json:"deliveredActivityId"`
	CreatedAt            time.Time         `json:"createdAt"`
	DeliveredAt          *time.Time        `json:"deliveredAt"`
	ForwardedExecutionID *uuid.UUID        `json:"forwardedExecutionId"`
}

func (ExecutionInboxMessage) TableName added in v0.25.0

func (ExecutionInboxMessage) TableName() string

type ExecutionKind added in v0.25.0

type ExecutionKind string

type ExecutionState added in v0.25.0

type ExecutionState string

type ExecutionTurnLease added in v0.25.0

type ExecutionTurnLease struct {
	ExecutionID        uuid.UUID  `gorm:"primaryKey"         json:"executionId"`
	SessionID          uuid.UUID  `json:"sessionId"`
	TurnID             uuid.UUID  `json:"turnId"`
	LeaseID            uuid.UUID  `json:"leaseId"`
	OwnerGenerationID  uuid.UUID  `json:"ownerGenerationId"`
	ControlRevision    int64      `json:"controlRevision"`
	WorkerGenerationID *uuid.UUID `json:"workerGenerationId"`
	CreatedAt          time.Time  `json:"createdAt"`
	UpdatedAt          time.Time  `json:"updatedAt"`
}

ExecutionTurnLease retains one root turn's current workflow holder.

func (ExecutionTurnLease) TableName added in v0.25.0

func (ExecutionTurnLease) TableName() string

type InboxMessageState added in v0.25.0

type InboxMessageState string

type InjectedKind added in v0.18.0

type InjectedKind string

InjectedKind says what an injected message is, so a client can show it as more than an unlabelled update. It is empty for a message that is injected without a more specific kind.

type Job added in v0.4.0

type Job struct {
	ID                 uuid.UUID
	SessionID          uuid.UUID
	TurnID             uuid.UUID
	AgentRunID         *uuid.UUID
	WorkerGenerationID string
	ToolCallID         string
	PID                int64 `gorm:"column:pid"`
	Purpose            string
	Command            string
	Directory          string
	State              JobState
	ExitCode           int64
	FailureDetail      string
	StartedAt          time.Time
	EndedAt            *time.Time
}

Job is one durable supervised process launched from a session turn.

func (Job) TableName added in v0.4.0

func (Job) TableName() string

TableName pins the schema-owned jobs table name.

type JobOutputLine added in v0.4.0

type JobOutputLine struct {
	ID        uuid.UUID
	SessionID uuid.UUID
	JobID     uuid.UUID
	Sequence  int64
	Stream    JobOutputStream
	Content   string
	CreatedAt time.Time
}

JobOutputLine is one ordered immutable stdout or stderr line.

func (JobOutputLine) TableName added in v0.4.0

func (JobOutputLine) TableName() string

TableName pins the schema-owned job_output_lines table name.

type JobOutputStream added in v0.4.0

type JobOutputStream string

JobOutputStream identifies one process output stream.

type JobSignal added in v0.4.0

type JobSignal string

JobSignal identifies a requested process signal.

type JobSignalRequest added in v0.4.0

type JobSignalRequest struct {
	ID             uuid.UUID
	SessionID      uuid.UUID
	JobID          uuid.UUID
	Signal         JobSignal
	Accepted       bool
	StateAtRequest JobState
	RequestedAt    time.Time
}

JobSignalRequest records every accepted or no-op request to signal a job.

func (JobSignalRequest) TableName added in v0.4.0

func (JobSignalRequest) TableName() string

TableName pins the schema-owned job_signal_requests table name.

type JobState added in v0.4.0

type JobState string

JobState is the durable lifecycle state of one supervised process.

type Message

type Message struct {
	ID        uuid.UUID
	SessionID uuid.UUID
	TurnID    uuid.UUID
	Sequence  int64
	Workspace string
	Role      MessageRole
	Content   string
	ModelID   string
	Thinking  string
	// ProviderReasoningJSON is the provider's reasoning envelope for an
	// assistant message, replayed to the same model in later turns. Empty
	// when the provider returned none.
	ProviderReasoningJSON string
	ToolCallsJSON         string
	ToolCallID            string
	CompactionID          *uuid.UUID
	IsError               bool
	Incomplete            bool
	// Injected marks a message the harness added to the conversation, such as
	// delivered session events, rather than one a person typed.
	Injected bool
	// InjectedKind labels an injected message, such as a skill a user
	// invoked. It is empty for any other message.
	InjectedKind InjectedKind
	CreatedAt    time.Time
}

Message is one durable user, assistant, or tool transcript record.

func (Message) TableName

func (Message) TableName() string

TableName pins the schema-owned messages table name.

type MessageRole

type MessageRole string

MessageRole identifies a transcript message source.

type ModelCall added in v0.4.0

type ModelCall struct {
	ID                      uuid.UUID
	SessionID               uuid.UUID
	ModelRunID              uuid.UUID
	Round                   int64
	RequestMessagesJSON     string
	RequestToolsJSON        string
	State                   ModelCallState
	ResponseMessageJSON     string
	ResponseUsageJSON       string
	RetryAttemptsJSON       string
	RetryAttemptCount       int64
	PromptTokens            int64
	CompletionTokens        int64
	TotalTokens             int64
	ReasoningTokens         int64
	CacheReadTokens         int64
	CacheWriteTokens        int64
	CacheWriteLongTTLTokens int64
	WastedPromptTokens      int64
	WastedCompletionTokens  int64
	WastedTotalTokens       int64
	TotalAttempts           int64
	ResponseModelID         string
	FinishReason            string
	ResponseCostAmount      string
	RetryCostAmount         string
	BilledCostAmount        string
	CostKnown               bool
	FailureClassification   string
	FailureDetail           string
	StartedAt               time.Time
	CompletedAt             *time.Time
}

ModelCall records one outbound provider round within a logical ModelRun.

func (ModelCall) TableName added in v0.4.0

func (ModelCall) TableName() string

TableName pins the schema-owned model_calls table name.

type ModelCallState added in v0.4.0

type ModelCallState string

ModelCallState is the durable lifecycle state of one provider round.

type ModelRun added in v0.4.0

type ModelRun struct {
	ID                     uuid.UUID
	SessionID              uuid.UUID
	TurnID                 uuid.UUID
	AgentRunID             *uuid.UUID
	Stage                  ModelRunStage
	ModelReference         string
	ConnectionName         string
	RequestedModelID       string
	ResponseModelID        string
	RequestSettingsJSON    string
	State                  ModelRunState
	ResponseText           string
	ResponseThinking       string
	ResponseMessagesJSON   string
	ResponseInjectionsJSON string
	ResponseUsageJSON      string
	ResponseCostAmount     string
	RetryCostAmount        string
	BilledCostAmount       string
	CostKnown              bool
	FinishReason           string
	FailureClassification  string
	FailureDetail          string
	StartedAt              time.Time
	CompletedAt            *time.Time
}

ModelRun records one logical Elelem Run invocation. It keeps the complete non-secret input and output audit record while ModelCall splits its provider rounds into separately replayable rows.

func (ModelRun) TableName added in v0.4.0

func (ModelRun) TableName() string

TableName pins the schema-owned model_runs table name.

type ModelRunStage added in v0.4.0

type ModelRunStage string

ModelRunStage identifies the Peen operation that issued model work.

type ModelRunState added in v0.4.0

type ModelRunState string

ModelRunState is the durable lifecycle state of one logical model run.

type NoticeDelivery added in v0.4.0

type NoticeDelivery string

NoticeDelivery identifies whether an outside notice can wake a session.

type NoticeState added in v0.4.0

type NoticeState string

NoticeState records whether a notice has reached the model context.

type PromptSnapshot

type PromptSnapshot struct {
	Hash            string `gorm:"primaryKey"`
	EffectivePrompt string
	CreatedAt       time.Time
}

PromptSnapshot stores one immutable effective prompt.

func (PromptSnapshot) TableName

func (PromptSnapshot) TableName() string

TableName pins the schema-owned prompt_snapshots table name.

type Session

type Session struct {
	ID                    uuid.UUID
	CreatedAt             time.Time
	UpdatedAt             time.Time
	LastMessageAt         *time.Time
	MessageCount          int64
	CompletedTurnCount    int64
	LastCompletedSequence int64
	ActiveContextHash     string
	RootAgent             string
	ModelID               string
	Workspace             string
	StopRevision          int64
	FeedSequence          int64

	// AgentSpace is the agent space this session's tools run in: `control` or
	// `docker:<profile>`. It is empty for a session recorded before agent
	// spaces existed, which the supervisor reads as the deployment default.
	AgentSpace string
}

Session is the durable metadata for one Peen conversation.

func (Session) TableName

func (Session) TableName() string

TableName pins the schema-owned sessions table name.

type SessionAgentSpaceDecision added in v0.19.0

type SessionAgentSpaceDecision struct {
	ID             uuid.UUID
	SessionID      uuid.UUID
	FromAgentSpace string
	ToAgentSpace   string
	Reason         string
	DecidedAt      time.Time
}

SessionAgentSpaceDecision records one deliberate change of a session's agent space, with the reason the operator gave.

An agent space change replaces the session's execution environment, so it is kept as history rather than overwritten: a later reader can tell which agent space ran which turns and why it moved.

func (SessionAgentSpaceDecision) TableName added in v0.19.0

func (SessionAgentSpaceDecision) TableName() string

TableName pins the schema-owned session_agent_space_decisions table name.

type SessionNotice added in v0.4.0

type SessionNotice struct {
	ID           uuid.UUID
	SessionID    uuid.UUID
	Sequence     int64
	FeedSequence int64
	Type         string
	Source       string
	Summary      string
	DataJSON     string
	Delivery     NoticeDelivery
	State        NoticeState
	CreatedAt    time.Time
	DeliveredAt  *time.Time
}

SessionNotice is a durable report waiting for or already delivered to a session.

func (SessionNotice) TableName added in v0.4.0

func (SessionNotice) TableName() string

TableName pins the schema-owned session_notices table name.

type Turn

type Turn struct {
	ID                    uuid.UUID
	SessionID             uuid.UUID
	RequestID             uuid.UUID
	Workspace             string
	State                 TurnState
	CancelRequested       bool
	StartedAt             time.Time
	CompletedAt           *time.Time
	FailureClassification string
	ContextSnapshotHash   *string
	PromptSnapshotHash    *string

	// WorkerGenerationID names the worker process that ran this turn. It is
	// empty for a turn recorded before worker generations existed.
	WorkerGenerationID string
	StopRevision       int64
}

Turn is one request execution within a session.

func (Turn) TableName

func (Turn) TableName() string

TableName pins the schema-owned turns table name.

type TurnOpeningNotice added in v0.25.0

type TurnOpeningNotice struct {
	SessionID      uuid.UUID
	TurnID         uuid.UUID
	NoticeID       uuid.UUID
	SourceSequence int64
}

TurnOpeningNotice retains the ordered notice snapshot accepted with a turn.

func (TurnOpeningNotice) TableName added in v0.25.0

func (TurnOpeningNotice) TableName() string

type TurnState

type TurnState string

TurnState is the durable lifecycle state of one session turn.

type WorkerGeneration added in v0.8.0

type WorkerGeneration struct {
	ID                 uuid.UUID
	SessionID          uuid.UUID
	Kind               string
	AgentSpace         string
	AgentSpaceRevision int64
	State              string
	Workspace          string

	// CredentialHash verifies the worker's one-time launch credential. The raw
	// credential is never stored, so a controller that reads its own database
	// cannot recover one, and a restarted controller can still accept the
	// worker it recorded.
	CredentialHash string

	// SocketPath is the private session-bound socket this generation talks to
	// its controller over.
	SocketPath string

	// ProcessID identifies a control worker. It is zero for a Docker worker.
	ProcessID int

	// ContainerID and ImageDigest identify a Docker worker.
	ContainerID string
	ImageDigest string

	// FailureDetail explains a failed generation. It never holds a credential.
	FailureDetail string

	// ExitCode is the process or container exit status once the worker ended.
	ExitCode int

	CreatedAt time.Time
	StartedAt *time.Time
	EndedAt   *time.Time
}

WorkerGeneration is one live worker process for one session and one agent space.

It is recorded before the worker launches, so a controller that dies mid-launch still leaves a row an operator can reconcile. Replacing a dead worker starts a new generation rather than reusing the old one, so every turn can name the exact process that ran it.

func (WorkerGeneration) TableName added in v0.8.0

func (WorkerGeneration) TableName() string

TableName pins the schema-owned worker_generations table name.

Jump to

Keyboard shortcuts

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