proposal

package
v0.0.0-...-11ebad3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentCaller

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 (*PostgresContentStore) GetExecutionResult

func (*PostgresContentStore) GetRequestContent

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) Reconcile

func (r *ProposalReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

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.

Jump to

Keyboard shortcuts

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