reportingrun

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("report run: not found")
	ErrInvalid  = errors.New("report run: invalid request")
	ErrConflict = errors.New("report run: conflict")
	ErrCAS      = errors.New("report run: stale revision")
)

Functions

This section is empty.

Types

type ActivateInput

type ActivateInput struct {
	ReportRunID             string `json:"reportRunId"`
	ConversationID          string `json:"conversationId"`
	ExpectedRunRevision     int64  `json:"expectedRunRevision"`
	ExpectedContextRevision int64  `json:"expectedContextRevision"`
	Source                  string `json:"source,omitempty"`
}

type AdoptInput

type AdoptInput struct {
	ReportRunID             string `json:"reportRunId"`
	ConversationID          string `json:"conversationId"`
	ExpectedRunRevision     int64  `json:"expectedRunRevision"`
	ExpectedContextRevision int64  `json:"expectedContextRevision"`
	Source                  string `json:"source,omitempty"`
}

type AdoptionResult

type AdoptionResult struct {
	Run     *reportrun.Record     `json:"run"`
	Context *reportcontext.Record `json:"context"`
}

type BeginInput

type BeginInput struct {
	ConversationID  string          `json:"conversationId,omitempty"`
	Origin          string          `json:"origin,omitempty"`
	BuilderRef      string          `json:"builderRef,omitempty"`
	PresetID        string          `json:"presetId,omitempty"`
	SourceKind      string          `json:"sourceKind,omitempty"`
	SourceID        string          `json:"sourceId,omitempty"`
	RequestedParams json.RawMessage `json:"requestedParams,omitempty"`
	EffectiveParams json.RawMessage `json:"effectiveParams,omitempty"`
	UIRunRequestID  string          `json:"uiRunRequestId"`
}

type BeginResult

type BeginResult struct {
	Run     *reportrun.Record     `json:"run"`
	Context *reportcontext.Record `json:"context,omitempty"`
}

type CompleteInput

type CompleteInput struct {
	ReportRunID      string          `json:"reportRunId"`
	ConversationID   string          `json:"conversationId,omitempty"`
	ExpectedRevision int64           `json:"expectedRevision"`
	ReportSpec       json.RawMessage `json:"reportSpec"`
	ReportFill       json.RawMessage `json:"reportFill"`
	ReportPrint      json.RawMessage `json:"reportPrint"`
}

type FailInput

type FailInput struct {
	ReportRunID      string `json:"reportRunId"`
	ConversationID   string `json:"conversationId,omitempty"`
	ExpectedRevision int64  `json:"expectedRevision"`
	FailureCode      string `json:"failureCode,omitempty"`
	FailureText      string `json:"failureText,omitempty"`
}

type Options

type Options struct {
	Store reportstore.RunClient
	Now   func() time.Time
	NewID func() string
}

type Service

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

Service owns durable browser report-run lifecycle invariants. It is called from the authenticated UI HTTP boundary and is deliberately not a tool service.

func New

func New(opts Options) *Service

func (*Service) Activate

func (s *Service) Activate(ctx context.Context, input *ActivateInput) (*reportcontext.Record, error)

func (*Service) Adopt

func (s *Service) Adopt(ctx context.Context, input *AdoptInput) (*AdoptionResult, error)

func (*Service) Begin

func (s *Service) Begin(ctx context.Context, input *BeginInput) (*BeginResult, error)

func (*Service) Complete

func (s *Service) Complete(ctx context.Context, input *CompleteInput) (*reportrun.Record, error)

func (*Service) Fail

func (s *Service) Fail(ctx context.Context, input *FailInput) (*reportrun.Record, error)

func (*Service) GetContext

func (s *Service) GetContext(ctx context.Context, conversationID string) (*reportcontext.Record, error)

func (*Service) GetRun

func (s *Service) GetRun(ctx context.Context, reportRunID, conversationID string) (*reportrun.Record, error)

func (*Service) ValidateDurableUIEvent

func (s *Service) ValidateDurableUIEvent(ctx context.Context, conversationID, kind string, detail map[string]interface{}) error

ValidateDurableUIEvent validates the two T1 browser lifecycle events against the persisted run. Other report event kinds deliberately remain outside the durable T1 contract.

func (*Service) WaitTerminal

func (s *Service) WaitTerminal(ctx context.Context, reportRunID, conversationID string) (*reportrun.Record, error)

WaitTerminal waits for one exact durable report run to reach completed or failed. Identity never falls back to a latest run, time window, active pointer, or UI window: every read remains scoped by the authenticated owner, trusted conversation, and exact reportRunId.

Jump to

Keyboard shortcuts

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