Documentation
¶
Index ¶
- Constants
- Variables
- func ForkOperationPlanAuthorityThreadIDs(plan ForkOperationPlan) []string
- func ForkOperationPlanNodes(plan ForkOperationPlan) []sessiontree.ForkOptions
- func ForkOperationPlanSourceThreadIDs(plan ForkOperationPlan) []string
- func ValidateForkOperationCommitNodes(plan ForkOperationPlan, nodes []sessiontree.ForkOptions) error
- func ValidateForkOperationPlan(plan ForkOperationPlan, operationID, fingerprint string) error
- func ValidateForkOperationRecord(rec ForkOperationRecord) error
- func ValidatePreparedForkOperation(rec ForkOperationRecord) error
- type BackendKernel
- func (kernel *BackendKernel) ActiveToolset(ctx context.Context, scopeID, provider, model string) (result cache.ToolsetSnapshot, found bool, err error)
- func (kernel *BackendKernel) AppendProviderRequest(ctx context.Context, value cache.ProviderRequestRecord) error
- func (kernel *BackendKernel) AppendProviderResponse(ctx context.Context, value cache.ProviderResponseRecord) error
- func (kernel *BackendKernel) AppendSegment(ctx context.Context, value cache.Segment) error
- func (kernel *BackendKernel) AppendToolset(ctx context.Context, value cache.ToolsetSnapshot) error
- func (kernel *BackendKernel) Checkpoint(ctx context.Context) error
- func (kernel *BackendKernel) CommitForkOperation(ctx context.Context, request ForkOperationCommitRequest) (result ForkOperationRecord, replayed bool, err error)
- func (kernel *BackendKernel) DeletePromptScopes(ctx context.Context, scopeIDs ...string) error
- func (kernel *BackendKernel) DeleteRootTree(ctx context.Context, rootThreadID string) (result sessiontree.DeleteRootTreeResult, err error)
- func (kernel *BackendKernel) FailForkOperation(ctx context.Context, request ForkOperationFailureRequest) (result ForkOperationRecord, replayed bool, err error)
- func (kernel *BackendKernel) FinishTurn(ctx context.Context, request sessiontree.FinishTurnRequest) (result sessiontree.FinishTurnResult, err error)
- func (kernel *BackendKernel) ForkOperation(ctx context.Context, operationID string) (result ForkOperationRecord, err error)
- func (kernel *BackendKernel) LatestPressureAnchor(ctx context.Context, scopeID, provider, model string) (result cache.PressureAnchorState, found bool, err error)
- func (kernel *BackendKernel) PrepareForkOperation(ctx context.Context, record ForkOperationRecord) (result ForkOperationRecord, replayed bool, err error)
- func (kernel *BackendKernel) ProviderRequests(ctx context.Context, scopeID string) (result []cache.ProviderRequestRecord, err error)
- func (kernel *BackendKernel) ProviderResponses(ctx context.Context, scopeID string) (result []cache.ProviderResponseRecord, err error)
- func (kernel *BackendKernel) Segments(ctx context.Context, scopeID, provider, model string) (result []cache.Segment, err error)
- type ForkOperationCommitRequest
- type ForkOperationFailureRequest
- type ForkOperationPlan
- type ForkOperationPlanNode
- type ForkOperationRecord
- type ForkOperationState
- type ForkOperationStore
- type MemoryForkOperationStore
- func (s *MemoryForkOperationStore) CommitForkOperation(ctx context.Context, req ForkOperationCommitRequest) (ForkOperationRecord, bool, error)
- func (s *MemoryForkOperationStore) FailForkOperation(ctx context.Context, req ForkOperationFailureRequest) (ForkOperationRecord, bool, error)
- func (s *MemoryForkOperationStore) ForkOperation(_ context.Context, operationID string) (ForkOperationRecord, error)
- func (s *MemoryForkOperationStore) PrepareForkOperation(ctx context.Context, rec ForkOperationRecord) (ForkOperationRecord, bool, error)
- type MetadataRecord
- type MetadataStore
- type Store
- type StoreLeasePolicyMismatchError
- type StoreSchemaIdentity
- type StoreSchemaMigrationRequirement
- type StoreSchemaMigrationSource
- type UnsupportedStoreSchemaError
Constants ¶
View Source
const ForkOperationPlanVersion = 5
Variables ¶
View Source
var ( ErrForkOperationNotFound = errors.New("fork operation not found") ErrForkOperationConflict = errors.New("fork operation conflicts with existing record") )
View Source
var ErrMetadataNotFound = errors.New("storage metadata not found")
Functions ¶
func ForkOperationPlanAuthorityThreadIDs ¶
func ForkOperationPlanAuthorityThreadIDs(plan ForkOperationPlan) []string
func ForkOperationPlanNodes ¶
func ForkOperationPlanNodes(plan ForkOperationPlan) []sessiontree.ForkOptions
func ForkOperationPlanSourceThreadIDs ¶
func ForkOperationPlanSourceThreadIDs(plan ForkOperationPlan) []string
func ValidateForkOperationCommitNodes ¶
func ValidateForkOperationCommitNodes(plan ForkOperationPlan, nodes []sessiontree.ForkOptions) error
func ValidateForkOperationPlan ¶
func ValidateForkOperationPlan(plan ForkOperationPlan, operationID, fingerprint string) error
func ValidateForkOperationRecord ¶
func ValidateForkOperationRecord(rec ForkOperationRecord) error
func ValidatePreparedForkOperation ¶
func ValidatePreparedForkOperation(rec ForkOperationRecord) error
Types ¶
type BackendKernel ¶
type BackendKernel struct {
*sessiontree.BackendRepo
// contains filtered or unexported fields
}
BackendKernel is the single domain kernel shared by every public Backend.
func NewBackendKernel ¶
func NewBackendKernel(ctx context.Context, backend spi.Backend, policy sessiontree.LeasePolicy, now func() time.Time) (*BackendKernel, error)
NewBackendKernel opens all canonical Floret domain state.
func (*BackendKernel) ActiveToolset ¶
func (kernel *BackendKernel) ActiveToolset(ctx context.Context, scopeID, provider, model string) (result cache.ToolsetSnapshot, found bool, err error)
func (*BackendKernel) AppendProviderRequest ¶
func (kernel *BackendKernel) AppendProviderRequest(ctx context.Context, value cache.ProviderRequestRecord) error
func (*BackendKernel) AppendProviderResponse ¶
func (kernel *BackendKernel) AppendProviderResponse(ctx context.Context, value cache.ProviderResponseRecord) error
func (*BackendKernel) AppendSegment ¶
func (*BackendKernel) AppendToolset ¶
func (kernel *BackendKernel) AppendToolset(ctx context.Context, value cache.ToolsetSnapshot) error
func (*BackendKernel) Checkpoint ¶ added in v3.2.31
func (kernel *BackendKernel) Checkpoint(ctx context.Context) error
Checkpoint flushes both canonical domain state and memory-resident prompt observations during graceful shutdown or an explicit recovery barrier.
func (*BackendKernel) CommitForkOperation ¶
func (kernel *BackendKernel) CommitForkOperation(ctx context.Context, request ForkOperationCommitRequest) (result ForkOperationRecord, replayed bool, err error)
func (*BackendKernel) DeletePromptScopes ¶
func (kernel *BackendKernel) DeletePromptScopes(ctx context.Context, scopeIDs ...string) error
func (*BackendKernel) DeleteRootTree ¶
func (kernel *BackendKernel) DeleteRootTree(ctx context.Context, rootThreadID string) (result sessiontree.DeleteRootTreeResult, err error)
func (*BackendKernel) FailForkOperation ¶
func (kernel *BackendKernel) FailForkOperation(ctx context.Context, request ForkOperationFailureRequest) (result ForkOperationRecord, replayed bool, err error)
func (*BackendKernel) FinishTurn ¶ added in v3.2.31
func (kernel *BackendKernel) FinishTurn(ctx context.Context, request sessiontree.FinishTurnRequest) (result sessiontree.FinishTurnResult, err error)
FinishTurn commits the terminal semantic state and the accumulated prompt observations in one checkpoint. Prompt segments and provider diagnostics are memory-resident before this boundary so they never delay provider dispatch.
func (*BackendKernel) ForkOperation ¶
func (kernel *BackendKernel) ForkOperation(ctx context.Context, operationID string) (result ForkOperationRecord, err error)
func (*BackendKernel) LatestPressureAnchor ¶
func (kernel *BackendKernel) LatestPressureAnchor(ctx context.Context, scopeID, provider, model string) (result cache.PressureAnchorState, found bool, err error)
func (*BackendKernel) PrepareForkOperation ¶
func (kernel *BackendKernel) PrepareForkOperation(ctx context.Context, record ForkOperationRecord) (result ForkOperationRecord, replayed bool, err error)
func (*BackendKernel) ProviderRequests ¶
func (kernel *BackendKernel) ProviderRequests(ctx context.Context, scopeID string) (result []cache.ProviderRequestRecord, err error)
func (*BackendKernel) ProviderResponses ¶
func (kernel *BackendKernel) ProviderResponses(ctx context.Context, scopeID string) (result []cache.ProviderResponseRecord, err error)
type ForkOperationCommitRequest ¶
type ForkOperationCommitRequest struct {
OperationID string
RequestFingerprint string
Plan json.RawMessage
Nodes []sessiontree.ForkOptions
Result json.RawMessage
FinishedAt time.Time
}
type ForkOperationPlan ¶
type ForkOperationPlan struct {
Version int `json:"version"`
OperationID string `json:"operation_id"`
RequestFingerprint string `json:"request_fingerprint"`
PreparedAt time.Time `json:"prepared_at"`
Root ForkOperationPlanNode `json:"root"`
TerminalChildren []ForkOperationPlanNode `json:"terminal_children,omitempty"`
}
func DecodeForkOperationPlan ¶
func DecodeForkOperationPlan(data json.RawMessage) (ForkOperationPlan, error)
type ForkOperationPlanNode ¶
type ForkOperationPlanNode struct {
NodeID string `json:"node_id"`
SourceThreadID string `json:"source_thread_id"`
SourceEntryID string `json:"source_entry_id,omitempty"`
SourceLeafEntryID string `json:"source_leaf_entry_id,omitempty"`
DestinationThreadID string `json:"destination_thread_id"`
TurnIDMap map[string]string `json:"turn_id_map,omitempty"`
RunIDMap map[string]string `json:"run_id_map,omitempty"`
DestinationMeta *sessiontree.ForkDestinationMeta `json:"destination_meta,omitempty"`
ArtifactClosure artifact.Closure `json:"artifact_closure"`
}
type ForkOperationRecord ¶
type ForkOperationRecord struct {
OperationID string
RequestFingerprint string
SourceThreadIDs []string
AuthorityThreadIDs []string
State ForkOperationState
Plan json.RawMessage
Result json.RawMessage
ErrorCode string
ErrorMessage string
CreatedAt time.Time
UpdatedAt time.Time
FinishedAt time.Time
}
type ForkOperationState ¶
type ForkOperationState string
const ( ForkOperationPrepared ForkOperationState = "prepared" ForkOperationCompleted ForkOperationState = "completed" ForkOperationFailed ForkOperationState = "failed" )
func (ForkOperationState) Valid ¶
func (s ForkOperationState) Valid() bool
type ForkOperationStore ¶
type ForkOperationStore interface {
PrepareForkOperation(context.Context, ForkOperationRecord) (ForkOperationRecord, bool, error)
ForkOperation(context.Context, string) (ForkOperationRecord, error)
CommitForkOperation(context.Context, ForkOperationCommitRequest) (ForkOperationRecord, bool, error)
FailForkOperation(context.Context, ForkOperationFailureRequest) (ForkOperationRecord, bool, error)
}
type MemoryForkOperationStore ¶
type MemoryForkOperationStore struct {
// contains filtered or unexported fields
}
func NewMemoryForkOperationStore ¶
func NewMemoryForkOperationStore(authority *sessiontree.MemoryRepo) *MemoryForkOperationStore
func (*MemoryForkOperationStore) CommitForkOperation ¶
func (s *MemoryForkOperationStore) CommitForkOperation(ctx context.Context, req ForkOperationCommitRequest) (ForkOperationRecord, bool, error)
func (*MemoryForkOperationStore) FailForkOperation ¶
func (s *MemoryForkOperationStore) FailForkOperation(ctx context.Context, req ForkOperationFailureRequest) (ForkOperationRecord, bool, error)
func (*MemoryForkOperationStore) ForkOperation ¶
func (s *MemoryForkOperationStore) ForkOperation(_ context.Context, operationID string) (ForkOperationRecord, error)
func (*MemoryForkOperationStore) PrepareForkOperation ¶
func (s *MemoryForkOperationStore) PrepareForkOperation(ctx context.Context, rec ForkOperationRecord) (ForkOperationRecord, bool, error)
type MetadataRecord ¶
type MetadataStore ¶
type Store ¶
type Store interface {
sessiontree.Repo
cache.Store
MetadataStore
ForkOperationStore
sessiontree.ProviderStateStore
Close() error
}
type StoreLeasePolicyMismatchError ¶
type StoreLeasePolicyMismatchError struct {
Configured sessiontree.LeasePolicy
Persisted sessiontree.LeasePolicy
}
func (*StoreLeasePolicyMismatchError) Error ¶
func (e *StoreLeasePolicyMismatchError) Error() string
type StoreSchemaIdentity ¶
type StoreSchemaMigrationRequirement ¶
type StoreSchemaMigrationRequirement string
const ( StoreSchemaMigrationRequirementNone StoreSchemaMigrationRequirement = "none" StoreSchemaMigrationRequirementQuiescentAuthority StoreSchemaMigrationRequirement = "quiescent_authority" )
type StoreSchemaMigrationSource ¶
type StoreSchemaMigrationSource struct {
Identity StoreSchemaIdentity
Requirement StoreSchemaMigrationRequirement
}
type UnsupportedStoreSchemaError ¶
type UnsupportedStoreSchemaError struct {
Observed StoreSchemaIdentity
Current StoreSchemaIdentity
Migratable []StoreSchemaMigrationSource
}
UnsupportedStoreSchemaError reports an exact schema contract mismatch. Store open must return this error without modifying the observed database.
func (*UnsupportedStoreSchemaError) Error ¶
func (e *UnsupportedStoreSchemaError) Error() string
Click to show internal directories.
Click to hide internal directories.