Documentation
¶
Index ¶
- Variables
- type ApprovalAudit
- type ApprovalCheckpoint
- type ApprovalLeaseRequest
- type CheckpointLeaseCompletion
- type CheckpointStatus
- type CheckpointStore
- type GoagentEventSink
- type GoagentRunRecordBuilder
- type MemoryCheckpointStore
- func (s *MemoryCheckpointStore) ApproveAndLease(ctx context.Context, request ApprovalLeaseRequest) (ApprovalCheckpoint, error)
- func (s *MemoryCheckpointStore) CompleteLease(ctx context.Context, completion CheckpointLeaseCompletion) error
- func (s *MemoryCheckpointStore) CreateCheckpoint(ctx context.Context, checkpoint ApprovalCheckpoint) error
- func (s *MemoryCheckpointStore) ExpireCheckpoints(ctx context.Context, now time.Time) (int, error)
- func (s *MemoryCheckpointStore) FailLease(ctx context.Context, completion CheckpointLeaseCompletion) error
- func (s *MemoryCheckpointStore) FailPendingCheckpoint(ctx context.Context, request PendingCheckpointFailure) error
- func (s *MemoryCheckpointStore) GetCheckpoint(ctx context.Context, checkpointID, tenantID string) (ApprovalCheckpoint, error)
- func (s *MemoryCheckpointStore) RejectCheckpoint(ctx context.Context, request ApprovalLeaseRequest) error
- type MemoryStore
- func (s *MemoryStore) AppendEvent(ctx context.Context, event RunEvent) error
- func (s *MemoryStore) Complete(ctx context.Context, runID string, summary TerminalSummary) error
- func (s *MemoryStore) Create(ctx context.Context, record RunRecord) error
- func (s *MemoryStore) Events(ctx context.Context, runID string) ([]RunEvent, error)
- func (s *MemoryStore) FindByWorkflowID(ctx context.Context, workflowID string) ([]RunRecord, error)
- func (s *MemoryStore) Get(ctx context.Context, runID string) (RunRecord, error)
- type PendingCheckpointFailure
- type PendingCheckpointFailureStore
- type RunEvent
- type RunRecord
- type Status
- type Store
- type TerminalSummary
Constants ¶
This section is empty.
Variables ¶
var ( ErrCheckpointNotFound = errors.New("approval checkpoint not found") ErrCheckpointNotClaimable = errors.New("approval checkpoint not claimable") ErrCheckpointLeaseOwner = errors.New("approval checkpoint lease owner mismatch") )
var ErrRunNotFound = errors.New("run not found")
Functions ¶
This section is empty.
Types ¶
type ApprovalAudit ¶
type ApprovalAudit struct {
ApproverID string
Approved bool
AuditRef string
ReasonCode string
DecidedAt time.Time
}
ApprovalAudit records the host identity that allowed or rejected a checkpoint.
type ApprovalCheckpoint ¶
type ApprovalCheckpoint struct {
ID string
RunID string
TenantID string
DefinitionHash string
Ciphertext []byte
Status CheckpointStatus
FailureCode string
LeaseOwner string
LeaseUntil time.Time
ExpiresAt time.Time
Approval *ApprovalAudit
CreatedAt time.Time
UpdatedAt time.Time
}
ApprovalCheckpoint stores opaque host-encrypted state. Runkit never decrypts Ciphertext, and stores drop it once the checkpoint reaches a terminal status (consumed, rejected, failed, or expired): it holds the paused run's tool arguments and is never decrypted again; the approval audit is kept.
type ApprovalLeaseRequest ¶
type CheckpointStatus ¶
type CheckpointStatus string
const ( CheckpointPending CheckpointStatus = "pending" CheckpointLeased CheckpointStatus = "leased" CheckpointConsumed CheckpointStatus = "consumed" CheckpointRejected CheckpointStatus = "rejected" CheckpointFailed CheckpointStatus = "failed" CheckpointExpired CheckpointStatus = "expired" )
type CheckpointStore ¶
type CheckpointStore interface {
CreateCheckpoint(ctx context.Context, checkpoint ApprovalCheckpoint) error
GetCheckpoint(ctx context.Context, checkpointID, tenantID string) (ApprovalCheckpoint, error)
ApproveAndLease(ctx context.Context, request ApprovalLeaseRequest) (ApprovalCheckpoint, error)
RejectCheckpoint(ctx context.Context, request ApprovalLeaseRequest) error
CompleteLease(ctx context.Context, completion CheckpointLeaseCompletion) error
FailLease(ctx context.Context, completion CheckpointLeaseCompletion) error
ExpireCheckpoints(ctx context.Context, now time.Time) (int, error)
}
CheckpointStore owns atomic state transitions for opaque approval checkpoints.
type GoagentEventSink ¶
type GoagentEventSink struct {
// contains filtered or unexported fields
}
func NewGoagentEventSink ¶
func NewGoagentEventSink(store Store, builder GoagentRunRecordBuilder) GoagentEventSink
type GoagentRunRecordBuilder ¶
type MemoryCheckpointStore ¶
type MemoryCheckpointStore struct {
// contains filtered or unexported fields
}
func NewMemoryCheckpointStore ¶
func NewMemoryCheckpointStore() *MemoryCheckpointStore
func (*MemoryCheckpointStore) ApproveAndLease ¶
func (s *MemoryCheckpointStore) ApproveAndLease(ctx context.Context, request ApprovalLeaseRequest) (ApprovalCheckpoint, error)
func (*MemoryCheckpointStore) CompleteLease ¶
func (s *MemoryCheckpointStore) CompleteLease(ctx context.Context, completion CheckpointLeaseCompletion) error
func (*MemoryCheckpointStore) CreateCheckpoint ¶
func (s *MemoryCheckpointStore) CreateCheckpoint(ctx context.Context, checkpoint ApprovalCheckpoint) error
func (*MemoryCheckpointStore) ExpireCheckpoints ¶
func (*MemoryCheckpointStore) FailLease ¶
func (s *MemoryCheckpointStore) FailLease(ctx context.Context, completion CheckpointLeaseCompletion) error
func (*MemoryCheckpointStore) FailPendingCheckpoint ¶
func (s *MemoryCheckpointStore) FailPendingCheckpoint(ctx context.Context, request PendingCheckpointFailure) error
func (*MemoryCheckpointStore) GetCheckpoint ¶
func (s *MemoryCheckpointStore) GetCheckpoint(ctx context.Context, checkpointID, tenantID string) (ApprovalCheckpoint, error)
func (*MemoryCheckpointStore) RejectCheckpoint ¶
func (s *MemoryCheckpointStore) RejectCheckpoint(ctx context.Context, request ApprovalLeaseRequest) error
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func (*MemoryStore) AppendEvent ¶
func (s *MemoryStore) AppendEvent(ctx context.Context, event RunEvent) error
func (*MemoryStore) Complete ¶
func (s *MemoryStore) Complete(ctx context.Context, runID string, summary TerminalSummary) error
func (*MemoryStore) Create ¶
func (s *MemoryStore) Create(ctx context.Context, record RunRecord) error
func (*MemoryStore) FindByWorkflowID ¶
type PendingCheckpointFailure ¶
type PendingCheckpointFailure struct {
CheckpointID string
RunID string
TenantID string
DefinitionHash string
FailureCode string
Now time.Time
}
PendingCheckpointFailure identifies one pending checkpoint without exposing or decrypting its opaque payload.
type PendingCheckpointFailureStore ¶
type PendingCheckpointFailureStore interface {
FailPendingCheckpoint(context.Context, PendingCheckpointFailure) error
}
PendingCheckpointFailureStore is an optional capability for atomically failing an exact pending checkpoint during controlled host shutdown.
type Store ¶
type Store interface {
Create(context.Context, RunRecord) error
Get(context.Context, string) (RunRecord, error)
AppendEvent(context.Context, RunEvent) error
Events(context.Context, string) ([]RunEvent, error)
Complete(context.Context, string, TerminalSummary) error
FindByWorkflowID(context.Context, string) ([]RunRecord, error)
}
Directories
¶
| Path | Synopsis |
|---|---|
|
Package approvalcrypto encrypts host-owned approval checkpoints without knowing their plaintext schema or persistence backend.
|
Package approvalcrypto encrypts host-owned approval checkpoints without knowing their plaintext schema or persistence backend. |
|
Package goagentapproval connects goagent approval interruptions to runkit's encrypted, single-lease checkpoint store.
|
Package goagentapproval connects goagent approval interruptions to runkit's encrypted, single-lease checkpoint store. |
|
Package pgstore persists opaque runkit approval checkpoints in PostgreSQL.
|
Package pgstore persists opaque runkit approval checkpoints in PostgreSQL. |
|
Package sqlitestore implements runkit.Store with SQLite persistence.
|
Package sqlitestore implements runkit.Store with SQLite persistence. |
|
Package storetest provides reusable conformance tests for runkit.Store.
|
Package storetest provides reusable conformance tests for runkit.Store. |