Help us shape the future of Go! Take the 2026 Go Developer Survey

controlplane

package
v0.1.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package controlplane wires the public HTTP resource semantics to the PostgreSQL ledger and Temporal admission boundary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventService

type EventService struct {
	// contains filtered or unexported fields
}

EventService exposes filtered reads from the authoritative PostgreSQL event ledger.

func NewEventService

func NewEventService(store *pg.Store) *EventService

func (*EventService) Query

func (s *EventService) Query(
	ctx context.Context,
	sessionID string,
	query app.EventQuery,
) ([]domain.Event, error)

type MessageFileReader

type MessageFileReader interface {
	ReadMessageFile(context.Context, string) (domain.FileMessageContent, error)
}

MessageFileReader resolves one top-level File into a bounded UTF-8 snapshot before event admission.

type OutcomeRubricReader

type OutcomeRubricReader interface {
	ReadOutcomeRubric(context.Context, string) (string, error)
}

OutcomeRubricReader resolves and validates one reusable Files API rubric.

type SessionOrchestrator

type SessionOrchestrator interface {
	CreateAPISession(
		context.Context,
		domain.Session,
		[]domain.EventDraft,
		...[]app.PreparedSessionResource,
	) (domain.Session, []domain.Event, error)
	Admit(context.Context, string, []domain.EventDraft) ([]domain.Event, error)
	TerminateSession(context.Context, string) error
}

type SessionService

type SessionService struct {
	// contains filtered or unexported fields
}

SessionService owns public Session validation and delegates the atomic session/event admission boundary to PostgreSQL plus the Temporal outbox.

func NewSessionService

func NewSessionService(
	store *pg.Store,
	agents app.AgentRepository,
	environments app.EnvironmentRepository,
	orchestrator SessionOrchestrator,
	ids domain.IDGenerator,
	clock domain.Clock,
	skillRef app.SkillReferenceResolver,
) *SessionService

func (*SessionService) Archive

func (s *SessionService) Archive(ctx context.Context, id string) (domain.Session, error)

func (*SessionService) Create

func (*SessionService) Delete

func (s *SessionService) Delete(ctx context.Context, id string) error

func (*SessionService) EnableFileMessageContent

func (s *SessionService) EnableFileMessageContent(reader MessageFileReader)

EnableFileMessageContent installs the internal Files reader used to resolve and snapshot text-only document sources before event admission.

func (*SessionService) EnableFileOutcomeRubrics

func (s *SessionService) EnableFileOutcomeRubrics(reader OutcomeRubricReader)

EnableFileOutcomeRubrics installs the internal Files reader used to resolve and snapshot reusable rubric text before event admission. This capability is independent of sandbox File mounts.

func (*SessionService) EnableMemoryStoreResources

func (s *SessionService) EnableMemoryStoreResources(reader interface {
	GetStore(context.Context, string) (domain.MemoryStore, error)
})

EnableMemoryStoreResources installs the deployment's Memory Store reader. Self-hosted workers synchronize admitted Stores through the public API.

func (*SessionService) EnableVaults

func (s *SessionService) EnableVaults()

EnableVaults permits Session Vault attachments for deployments whose API and worker share a configured credential keyring.

func (*SessionService) Get

func (*SessionService) List

func (s *SessionService) List(
	ctx context.Context,
	query app.ListPage,
) (app.SessionListPage, error)

func (*SessionService) SendEvent

func (s *SessionService) SendEvent(
	ctx context.Context,
	id string,
	drafts []domain.EventDraft,
) ([]domain.Event, error)

func (*SessionService) Update

func (s *SessionService) Update(
	ctx context.Context,
	id string,
	update domain.SessionUpdate,
) (domain.Session, error)

Update applies the documented session update body. Validation of the merged result and the idle precondition for mid-session agent changes both run inside the store transaction that holds the session's admission lock, so a concurrent turn admission cannot slip between the check and the write.

type SessionThreadService

type SessionThreadService struct {
	// contains filtered or unexported fields
}

SessionThreadService exposes independently persisted execution projections. Child creation and execution remain a separate multi-agent runtime slice.

func NewSessionThreadService

func NewSessionThreadService(store *pg.Store) *SessionThreadService

func (*SessionThreadService) Archive

func (s *SessionThreadService) Archive(
	ctx context.Context,
	sessionID string,
	threadID string,
) (domain.SessionThread, error)

Archive maps the primary Thread lifecycle to the Session lifecycle and gives a child its independent PostgreSQL/Temporal shutdown path. A child must never archive the aggregate Session.

func (*SessionThreadService) Get

func (s *SessionThreadService) Get(
	ctx context.Context,
	sessionID string,
	threadID string,
) (domain.SessionThread, error)

func (*SessionThreadService) List

Jump to

Keyboard shortcuts

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