Documentation
¶
Overview ¶
Package operator shares typed request adapters between HTTP and dashboard transports. Every read retains the optimizer's current caller and scope checks.
Index ¶
- type ActivateInput
- type ActivationRouteInput
- type ActivationsInput
- type CapabilitiesInput
- type CatalogInput
- type ChildInput
- type Commands
- func (c Commands) Activate(ctx context.Context, in ActivateInput, key string) (*opt.Activation, error)
- func (c Commands) Cancel(ctx context.Context, in LifecycleInput, key string) (opt.Experiment, error)
- func (c Commands) Create(ctx context.Context, in CreateInput, key string) (opt.Experiment, error)
- func (c Commands) Deactivate(ctx context.Context, in ActivationRouteInput, key string) (*opt.Activation, error)
- func (c Commands) Resume(ctx context.Context, in LifecycleInput, key string) (opt.Experiment, error)
- func (c Commands) Retain(ctx context.Context, in RetainInput, key string) (opt.Experiment, error)
- func (c Commands) RetryLesson(ctx context.Context, in RetryLessonInput, key string) (opt.Publication, error)
- func (c Commands) RevokeLesson(ctx context.Context, in RevokeLessonInput, key string) (opt.Lesson, error)
- func (c Commands) Rollback(ctx context.Context, in RollbackInput, key string) (*opt.Activation, error)
- func (c Commands) Start(ctx context.Context, in LifecycleInput, key string) (opt.Experiment, error)
- type CreateInput
- type ErrorResponse
- type ExperimentPageInput
- type ExperimentsInput
- type IDInput
- type LessonsInput
- type LifecycleInput
- type PageInput
- type PublicationsInput
- type Reader
- func (r Reader) Activations(ctx context.Context, in ActivationsInput) (opt.ResourcePage[opt.Activation], error)
- func (r Reader) Candidate(ctx context.Context, in ChildInput) (opt.Candidate, error)
- func (r Reader) Candidates(ctx context.Context, in ExperimentPageInput) (opt.ResourcePage[opt.Candidate], error)
- func (r Reader) Capabilities(ctx context.Context, in CapabilitiesInput) (opt.CapabilitySnapshot, error)
- func (r Reader) Catalog(ctx context.Context, in CatalogInput) (opt.ResourcePage[opt.CatalogChoice], error)
- func (r Reader) Comparison(ctx context.Context, in ExperimentPageInput) (opt.ComparisonDetail, error)
- func (r Reader) Events(ctx context.Context, in ExperimentPageInput) (opt.ResourcePage[opt.Event], error)
- func (r Reader) Experiment(ctx context.Context, in IDInput) (opt.Experiment, error)
- func (r Reader) Experiments(ctx context.Context, in ExperimentsInput) (opt.ResourcePage[opt.Experiment], error)
- func (r Reader) Lesson(ctx context.Context, in IDInput) (opt.Lesson, error)
- func (r Reader) Lessons(ctx context.Context, in LessonsInput) (opt.ResourcePage[opt.Lesson], error)
- func (r Reader) Publications(ctx context.Context, in PublicationsInput) (opt.ResourcePage[opt.Publication], error)
- func (r Reader) Trial(ctx context.Context, in ChildInput) (opt.Trial, error)
- func (r Reader) Trials(ctx context.Context, in TrialsInput) (opt.ResourcePage[opt.Trial], error)
- func (r Reader) Version(ctx context.Context, in IDInput) (opt.HarnessVersion, error)
- func (r Reader) Versions(ctx context.Context, in VersionsInput) (opt.ResourcePage[opt.HarnessVersion], error)
- type RetainInput
- type RetryLessonInput
- type RevokeLessonInput
- type RollbackInput
- type TrialsInput
- type VersionsInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivateInput ¶
type ActivateInput struct {
ActivationRouteInput
VersionID string `json:"version_id"`
VersionDigest string `json:"version_digest"`
DecisionID string `json:"decision_id"`
}
ActivateInput names immutable version and decision evidence for a route change.
type ActivationRouteInput ¶
type ActivationRouteInput struct {
AgentID string `json:"agent_id"`
Channel string `json:"channel,omitempty"`
Kind opt.HarnessKind `json:"kind,omitempty"`
ExpectedGeneration int64 `json:"expected_generation" optional:"true"`
Reason string `json:"reason"`
}
ActivationRouteInput identifies the production route and its reviewed generation. The command ID is derived from the transport key, never from payload fields.
type ActivationsInput ¶
type ActivationsInput struct {
PageInput
AgentID string `json:"agent_id" query:"agent_id"`
Channel string `json:"channel,omitempty" query:"channel" optional:"true"`
Kind opt.HarnessKind `json:"kind,omitempty" query:"kind" optional:"true"`
}
ActivationsInput identifies the route whose immutable history is requested.
type CapabilitiesInput ¶
type CapabilitiesInput struct {
ExperimentID string `json:"experiment_id,omitempty" query:"experiment_id" optional:"true"`
}
CapabilitiesInput optionally selects a frozen experiment for readiness checks.
type CatalogInput ¶
type CatalogInput struct {
PageInput
Kind opt.CatalogKind `json:"kind,omitempty" query:"kind" optional:"true"`
}
CatalogInput filters approved creation references without requesting snapshots.
type ChildInput ¶
type ChildInput struct {
ExperimentID string `json:"experiment_id" path:"experiment_id"`
ID string `json:"id" path:"id"`
}
ChildInput binds a child detail to its original parent experiment.
type Commands ¶
Commands adapts lifecycle requests to durable optimizer commands.
func (Commands) Activate ¶
func (c Commands) Activate(ctx context.Context, in ActivateInput, key string) (*opt.Activation, error)
Activate records a reviewed route change. Retries return its immutable receipt, not a new generation or a claim that this receipt is still the current route.
func (Commands) Cancel ¶
func (c Commands) Cancel(ctx context.Context, in LifecycleInput, key string) (opt.Experiment, error)
Cancel invalidates pending work while retaining original accounting evidence.
func (Commands) Create ¶
func (c Commands) Create(ctx context.Context, in CreateInput, key string) (opt.Experiment, error)
Create saves a host-frozen draft using the separate transport command identity.
func (Commands) Deactivate ¶
func (c Commands) Deactivate(ctx context.Context, in ActivationRouteInput, key string) (*opt.Activation, error)
Deactivate disables the current route without requiring its old evidence to remain available. A retry cannot disable a subsequently restored generation.
func (Commands) Resume ¶
func (c Commands) Resume(ctx context.Context, in LifecycleInput, key string) (opt.Experiment, error)
Resume queues a paused experiment after the original requester's current grants.
func (Commands) Retain ¶
func (c Commands) Retain(ctx context.Context, in RetainInput, key string) (opt.Experiment, error)
Retain closes a pending review while preserving measured evidence and routes.
func (Commands) RetryLesson ¶
func (c Commands) RetryLesson(ctx context.Context, in RetryLessonInput, key string) (opt.Publication, error)
RetryLesson queues another bounded delivery cycle without calling Fabriq.
func (Commands) RevokeLesson ¶
func (c Commands) RevokeLesson(ctx context.Context, in RevokeLessonInput, key string) (opt.Lesson, error)
RevokeLesson withdraws local eligibility and queues remote revocation atomically.
func (Commands) Rollback ¶
func (c Commands) Rollback(ctx context.Context, in RollbackInput, key string) (*opt.Activation, error)
Rollback rechecks current authority, evidence and compatibility before restoring a historical version. Its receipt key shares the activation command namespace.
func (Commands) Start ¶
func (c Commands) Start(ctx context.Context, in LifecycleInput, key string) (opt.Experiment, error)
Start queues a frozen draft without executing trial or controller work.
type CreateInput ¶
type CreateInput struct {
Selection opt.CreationSelection `json:"selection"`
}
CreateInput accepts catalog choices, never executable bundles or host policy.
type ErrorResponse ¶
type ErrorResponse struct {
Code string `json:"code"`
Message string `json:"message"`
Status int `json:"-"`
}
ErrorResponse contains public failure codes, never provider or storage text. Status is transport metadata and is omitted from response bodies.
func Failure ¶
func Failure(err error) ErrorResponse
Failure maps a non-nil service error to a stable public response. Unknown failures remain unavailable; callers must not infer that a command was undone.
type ExperimentPageInput ¶
ExperimentPageInput selects a bounded child collection of one experiment.
type ExperimentsInput ¶
type ExperimentsInput struct {
PageInput
AgentID string `json:"agent_id,omitempty" query:"agent_id" optional:"true"`
State opt.State `json:"state,omitempty" query:"state" optional:"true"`
}
ExperimentsInput filters the experiment collection.
type IDInput ¶
type IDInput struct {
ID string `json:"id" path:"id"`
}
IDInput identifies one resource in the caller's exact scope.
type LessonsInput ¶
type LessonsInput struct {
PageInput
Domain string `json:"domain,omitempty" query:"domain" optional:"true"`
EvidenceClass opt.EvidenceClass `json:"evidence_class,omitempty" query:"evidence_class" optional:"true"`
EligibleOnly bool `json:"eligible_only,omitempty" query:"eligible_only" optional:"true"`
}
LessonsInput filters locally retained learning records.
type LifecycleInput ¶
type LifecycleInput struct {
ID string `json:"id" path:"id"`
ExpectedRevision int64 `json:"expected_revision"`
}
LifecycleInput contains command payload fields. The idempotency key comes separately from the REST header or dashboard envelope, never from this body.
type PageInput ¶
type PageInput struct {
Limit int `json:"limit,omitempty" query:"limit" optional:"true"`
Cursor string `json:"cursor,omitempty" query:"cursor" optional:"true"`
}
PageInput carries the opaque continuation returned by the preceding page.
type PublicationsInput ¶
type PublicationsInput struct {
PageInput
ExperimentID string `json:"experiment_id,omitempty" query:"experiment_id" optional:"true"`
LessonID string `json:"lesson_id,omitempty" query:"lesson_id" optional:"true"`
Operation opt.PublicationOperation `json:"operation,omitempty" query:"operation" optional:"true"`
PendingOnly bool `json:"pending_only,omitempty" query:"pending_only" optional:"true"`
}
PublicationsInput filters durable delivery records independently of remote indexes.
type Reader ¶
Reader adapts operator requests without owning workers or persistence. A nil Optimizer reports unavailable, including for empty collections.
func (Reader) Activations ¶
func (r Reader) Activations(ctx context.Context, in ActivationsInput) (opt.ResourcePage[opt.Activation], error)
Activations reads history for an explicit execution or controller route.
func (Reader) Candidates ¶
func (r Reader) Candidates(ctx context.Context, in ExperimentPageInput) (opt.ResourcePage[opt.Candidate], error)
Candidates reads accepted and rejected proposals.
func (Reader) Capabilities ¶
func (r Reader) Capabilities(ctx context.Context, in CapabilitiesInput) (opt.CapabilitySnapshot, error)
Capabilities reads current integration checks without starting external work.
func (Reader) Catalog ¶
func (r Reader) Catalog(ctx context.Context, in CatalogInput) (opt.ResourcePage[opt.CatalogChoice], error)
Catalog reads currently authorized host choices using a bound continuation.
func (Reader) Comparison ¶
func (r Reader) Comparison(ctx context.Context, in ExperimentPageInput) (opt.ComparisonDetail, error)
Comparison reads the recorded decision and bounded original evaluations.
func (Reader) Events ¶
func (r Reader) Events(ctx context.Context, in ExperimentPageInput) (opt.ResourcePage[opt.Event], error)
Events continues the durable event sequence using its opaque cursor.
func (Reader) Experiment ¶
Experiment reads the frozen experiment and current lifecycle state.
func (Reader) Experiments ¶
func (r Reader) Experiments(ctx context.Context, in ExperimentsInput) (opt.ResourcePage[opt.Experiment], error)
Experiments reads an authorized collection with current resource grants.
func (Reader) Lessons ¶
func (r Reader) Lessons(ctx context.Context, in LessonsInput) (opt.ResourcePage[opt.Lesson], error)
Lessons reads local eligibility and revocation state.
func (Reader) Publications ¶
func (r Reader) Publications(ctx context.Context, in PublicationsInput) (opt.ResourcePage[opt.Publication], error)
Publications reads the retained publication outbox and acknowledgment state.
func (Reader) Trials ¶
func (r Reader) Trials(ctx context.Context, in TrialsInput) (opt.ResourcePage[opt.Trial], error)
Trials reads original trial attempts without replaying execution.
func (Reader) Versions ¶
func (r Reader) Versions(ctx context.Context, in VersionsInput) (opt.ResourcePage[opt.HarnessVersion], error)
Versions reads immutable versions visible to the current caller.
type RetainInput ¶
type RetainInput struct {
ID string `json:"id"`
ExpectedRevision int64 `json:"expected_revision"`
DecisionID string `json:"decision_id"`
Reason string `json:"reason"`
}
RetainInput identifies the measured decision and the reviewer's reason. The command key comes separately from the transport envelope.
type RetryLessonInput ¶
type RetryLessonInput struct {
ID string `json:"id" path:"id"`
LocalRevision int64 `json:"local_revision"`
ExpectedGeneration int64 `json:"expected_generation"`
Reason string `json:"reason"`
}
RetryLessonInput identifies the local outbox payload and last delivery attempt. The transport supplies the command key separately from these payload fields.
type RevokeLessonInput ¶
type RevokeLessonInput struct {
ID string `json:"id" path:"id"`
ExpectedRevision int64 `json:"expected_revision"`
Reason string `json:"reason"`
}
RevokeLessonInput withdraws a lesson at its current local revision.
type RollbackInput ¶
type RollbackInput struct {
ActivationRouteInput
TargetID string `json:"target_id"`
}
RollbackInput selects an existing activation for current policy revalidation.
type TrialsInput ¶
type TrialsInput struct {
PageInput
ID string `json:"id" path:"id"`
VersionID string `json:"version_id,omitempty" query:"version_id" optional:"true"`
Split opt.Split `json:"split,omitempty" query:"split" optional:"true"`
State opt.TrialState `json:"state,omitempty" query:"state" optional:"true"`
}
TrialsInput selects original attempts for one experiment.
type VersionsInput ¶
type VersionsInput struct {
PageInput
AgentID string `json:"agent_id,omitempty" query:"agent_id" optional:"true"`
Kind opt.HarnessKind `json:"kind,omitempty" query:"kind" optional:"true"`
}
VersionsInput filters immutable versions by owner and purpose.