remoteresults

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package remoteresults defines the durable import boundary for node journals.

Index

Constants

View Source
const (
	MaxEventCollectionItems  = 32_768
	MaxReportCollectionItems = 131_072
	// 10000 samples may contribute up to 30000 sparse time slices. Preserve
	// their complete DTOs within the independent 32 MiB archive byte budget.
	MaxPerformanceCollectionItems = 4_194_304
)

Variables

View Source
var (
	ErrInvalid  = errors.New("invalid remote result batch")
	ErrConflict = errors.New("remote result identity or content conflict")
	ErrNotFound = errors.New("remote result mirror not found")
)
View Source
var ErrCollectionBudget = errors.New("remote result exceeds collection budget")

Functions

func CheckEventBudget

func CheckEventBudget(raw []byte) error

CheckEventBudget bounds allocations before any typed domain decoding.

func CheckPerformanceBudget

func CheckPerformanceBudget(raw []byte) error

func CheckRunReportBudget

func CheckRunReportBudget(raw []byte) error

Types

type Batch

type Batch struct {
	Origin        Origin
	JobID         string
	AfterSequence uint64
	Events        []jobcontract.Event
}

func (Batch) Validate

func (batch Batch) Validate() error

type DocumentClass

type DocumentClass string
const (
	DocumentFocus   DocumentClass = "focus"
	DocumentHistory DocumentClass = "history"
)

type DocumentCursor

type DocumentCursor struct {
	JobID         string
	ReferenceType jobcontract.EventKind
	ReportID      string
}

func (DocumentCursor) Validate

func (cursor DocumentCursor) Validate() error

type DocumentPage

type DocumentPage struct {
	Items      []DocumentWork
	NextCursor DocumentCursor
	HasMore    bool
}

type DocumentQuery

type DocumentQuery struct {
	Origin Origin
	Class  DocumentClass
	After  DocumentCursor
	Limit  uint32
}

func (DocumentQuery) Validate

func (query DocumentQuery) Validate() error

type DocumentReference

type DocumentReference struct {
	Kind      jobcontract.EventKind       `json:"kind"`
	Reference jobcontract.ReportReference `json:"reference"`
	Imported  bool                        `json:"imported"`
}

Kind distinguishes the complete PerformanceResult from its optional archive. Reference always identifies the original bytes; Imported does not imply that separate evidence or attachment files have been downloaded.

type DocumentWork

type DocumentWork struct {
	JobID    string
	Document DocumentReference
}

type Mirror

type Mirror struct {
	Origin   Origin               `json:"origin"`
	Spec     jobcontract.JobSpec  `json:"spec"`
	Snapshot jobcontract.Snapshot `json:"snapshot"`
}

type Origin

type Origin struct {
	ConfigurationID string `json:"configuration_id"`
	NodeID          string `json:"node_id"`
	InstallationID  string `json:"installation_id"`
}

ConfigurationID identifies the local node record. NodeID and InstallationID identify the actual server and never change when an observer reconnects.

func (Origin) Validate

func (origin Origin) Validate() error

type PerformanceDocumentImport

type PerformanceDocumentImport struct {
	Origin   Origin
	JobID    string
	Kind     jobcontract.EventKind
	Document []byte
}

type PriorityPage

type PriorityPage struct {
	JobIDs     []string
	NextCursor string
	HasMore    bool
}

PriorityPage contains bounded active shared-job IDs used as scheduling hints. Terminal jobs leave fact priority; history still revisits them for late facts. The page does not authenticate or project remote execution facts.

type Repository

type Repository interface {
	ApplyRemoteBatch(context.Context, Batch) (Mirror, error)
	GetRemoteMirror(context.Context, string) (Mirror, error)
	ImportRemoteRunReport(context.Context, RunReportImport) error
	RemoteRunReportImported(context.Context, string, string) (bool, error)
	ImportRemotePerformanceDocument(context.Context, PerformanceDocumentImport) error
	ReadRemotePerformanceResult(context.Context, string) (jobcontract.PerformanceResult, error)
	ListRemoteDocuments(context.Context, string) ([]DocumentReference, error)
}

type RunReportImport

type RunReportImport struct {
	Origin   Origin
	JobID    string
	Document []byte
}

type WorkRepository

type WorkRepository interface {
	ListRemoteFactPriorityIDs(context.Context, Origin, string, uint32) (PriorityPage, error)
	ListRemoteDocumentWork(context.Context, DocumentQuery) (DocumentPage, error)
}

WorkRepository returns scheduling hints. Import still authenticates the durable source, immutable reference, original bytes and typed document.

Jump to

Keyboard shortcuts

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