Documentation
¶
Index ¶
- type AgentCaller
- type ContentStore
- type PostgresContentStore
- func (s *PostgresContentStore) CreateAnalysisResult(ctx context.Context, name string, spec agenticv1alpha1.AnalysisResultSpec) error
- func (s *PostgresContentStore) CreateExecutionResult(ctx context.Context, name string, spec agenticv1alpha1.ExecutionResultSpec) error
- func (s *PostgresContentStore) CreateRequestContent(ctx context.Context, name string, spec agenticv1alpha1.RequestContentSpec) error
- func (s *PostgresContentStore) CreateVerificationResult(ctx context.Context, name string, spec agenticv1alpha1.VerificationResultSpec) error
- func (s *PostgresContentStore) GetAnalysisResult(ctx context.Context, name string) (*agenticv1alpha1.AnalysisResultSpec, error)
- func (s *PostgresContentStore) GetExecutionResult(ctx context.Context, name string) (*agenticv1alpha1.ExecutionResultSpec, error)
- func (s *PostgresContentStore) GetRequestContent(ctx context.Context, name string) (*agenticv1alpha1.RequestContentSpec, error)
- func (s *PostgresContentStore) GetVerificationResult(ctx context.Context, name string) (*agenticv1alpha1.VerificationResultSpec, error)
- type ProposalReconciler
- type StubAgentCaller
- func (s *StubAgentCaller) Analyze(_ context.Context, _ *agenticv1alpha1.Proposal, _ resolvedStep, ...) (*agenticv1alpha1.AnalysisResultSpec, error)
- func (s *StubAgentCaller) Execute(_ context.Context, _ *agenticv1alpha1.Proposal, _ resolvedStep, ...) (*agenticv1alpha1.ExecutionResultSpec, error)
- func (s *StubAgentCaller) Verify(_ context.Context, _ *agenticv1alpha1.Proposal, _ resolvedStep, ...) (*agenticv1alpha1.VerificationResultSpec, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentCaller ¶
type AgentCaller interface {
Analyze(ctx context.Context, proposal *agenticv1alpha1.Proposal, step resolvedStep, request *agenticv1alpha1.RequestContentSpec) (*agenticv1alpha1.AnalysisResultSpec, error)
Execute(ctx context.Context, proposal *agenticv1alpha1.Proposal, step resolvedStep, option *agenticv1alpha1.RemediationOption) (*agenticv1alpha1.ExecutionResultSpec, error)
Verify(ctx context.Context, proposal *agenticv1alpha1.Proposal, step resolvedStep, option *agenticv1alpha1.RemediationOption, exec *agenticv1alpha1.ExecutionResultSpec) (*agenticv1alpha1.VerificationResultSpec, error)
}
AgentCaller abstracts the agent invocation path. The reconciler passes structured data; the implementation decides how to format it for the LLM (text-only prompt vs multimodal with binary attachments). In production this manages sandbox lifecycle + HTTP calls; in tests a stub returns canned results.
type ContentStore ¶
type ContentStore interface {
// GetRequestContent reads the request payload for a proposal.
GetRequestContent(ctx context.Context, name string) (*agenticv1alpha1.RequestContentSpec, error)
// CreateRequestContent stores a request payload. Called by adapters
// (AlertManager webhook, ACS adapter) when creating a proposal.
CreateRequestContent(ctx context.Context, name string, spec agenticv1alpha1.RequestContentSpec) error
// GetAnalysisResult reads the full analysis output.
GetAnalysisResult(ctx context.Context, name string) (*agenticv1alpha1.AnalysisResultSpec, error)
// CreateAnalysisResult stores analysis output after a successful analysis step.
CreateAnalysisResult(ctx context.Context, name string, spec agenticv1alpha1.AnalysisResultSpec) error
// GetExecutionResult reads the full execution output.
GetExecutionResult(ctx context.Context, name string) (*agenticv1alpha1.ExecutionResultSpec, error)
// CreateExecutionResult stores execution output after the execution step.
CreateExecutionResult(ctx context.Context, name string, spec agenticv1alpha1.ExecutionResultSpec) error
// GetVerificationResult reads the full verification output.
GetVerificationResult(ctx context.Context, name string) (*agenticv1alpha1.VerificationResultSpec, error)
// CreateVerificationResult stores verification output after the verification step.
CreateVerificationResult(ctx context.Context, name string, spec agenticv1alpha1.VerificationResultSpec) error
}
ContentStore abstracts read/write access to content resources (request text, step results). Backed by the PostgreSQL instance provisioned by the lightspeed-operator (Deployment: lightspeed-postgres-server, Service: lightspeed-postgres-server:5432, credentials: Secret lightspeed-postgres-secret, namespace: openshift-lightspeed).
The aggregated content API server and this interface share the same backing store — they are two access paths to the same data.
type PostgresContentStore ¶
type PostgresContentStore struct {
// contains filtered or unexported fields
}
PostgresContentStore implements ContentStore backed by PostgreSQL. In production, this connects to the PostgreSQL instance provisioned by the lightspeed-operator (lightspeed-postgres-server:5432 in the openshift-lightspeed namespace).
Binary data (ContentPayload.Data) is stored in a separate BYTEA column to avoid base64 bloat in JSONB. The JSONB spec column holds structured metadata and text content only.
func NewPostgresContentStore ¶
func NewPostgresContentStore(db *sql.DB) (*PostgresContentStore, error)
NewPostgresContentStore creates a PostgresContentStore and ensures the required tables exist. The caller owns the *sql.DB lifecycle.
func (*PostgresContentStore) CreateAnalysisResult ¶
func (s *PostgresContentStore) CreateAnalysisResult(ctx context.Context, name string, spec agenticv1alpha1.AnalysisResultSpec) error
func (*PostgresContentStore) CreateExecutionResult ¶
func (s *PostgresContentStore) CreateExecutionResult(ctx context.Context, name string, spec agenticv1alpha1.ExecutionResultSpec) error
func (*PostgresContentStore) CreateRequestContent ¶
func (s *PostgresContentStore) CreateRequestContent(ctx context.Context, name string, spec agenticv1alpha1.RequestContentSpec) error
func (*PostgresContentStore) CreateVerificationResult ¶
func (s *PostgresContentStore) CreateVerificationResult(ctx context.Context, name string, spec agenticv1alpha1.VerificationResultSpec) error
func (*PostgresContentStore) GetAnalysisResult ¶
func (s *PostgresContentStore) GetAnalysisResult(ctx context.Context, name string) (*agenticv1alpha1.AnalysisResultSpec, error)
func (*PostgresContentStore) GetExecutionResult ¶
func (s *PostgresContentStore) GetExecutionResult(ctx context.Context, name string) (*agenticv1alpha1.ExecutionResultSpec, error)
func (*PostgresContentStore) GetRequestContent ¶
func (s *PostgresContentStore) GetRequestContent(ctx context.Context, name string) (*agenticv1alpha1.RequestContentSpec, error)
func (*PostgresContentStore) GetVerificationResult ¶
func (s *PostgresContentStore) GetVerificationResult(ctx context.Context, name string) (*agenticv1alpha1.VerificationResultSpec, error)
type ProposalReconciler ¶
type ProposalReconciler struct {
client.Client
Log logr.Logger
Content ContentStore
Agent AgentCaller
}
ProposalReconciler reconciles Proposal objects.
Content and Agent must be set before calling SetupWithManager.
func (*ProposalReconciler) SetupWithManager ¶
func (r *ProposalReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type StubAgentCaller ¶
type StubAgentCaller struct{}
StubAgentCaller returns canned success results. Wire in a real implementation (sandbox + HTTP) when the agent infrastructure is ready.
func (*StubAgentCaller) Analyze ¶
func (s *StubAgentCaller) Analyze(_ context.Context, _ *agenticv1alpha1.Proposal, _ resolvedStep, _ *agenticv1alpha1.RequestContentSpec) (*agenticv1alpha1.AnalysisResultSpec, error)
func (*StubAgentCaller) Execute ¶
func (s *StubAgentCaller) Execute(_ context.Context, _ *agenticv1alpha1.Proposal, _ resolvedStep, _ *agenticv1alpha1.RemediationOption) (*agenticv1alpha1.ExecutionResultSpec, error)
func (*StubAgentCaller) Verify ¶
func (s *StubAgentCaller) Verify(_ context.Context, _ *agenticv1alpha1.Proposal, _ resolvedStep, _ *agenticv1alpha1.RemediationOption, _ *agenticv1alpha1.ExecutionResultSpec) (*agenticv1alpha1.VerificationResultSpec, error)