Documentation
¶
Overview ¶
Package sqlite owns the local operational SQLite schema.
Package sqlite implements the durable operational repositories for the Go Core.
Index ¶
- Constants
- Variables
- func CurrentSchemaIdentity() (version int, name, checksum string)
- func ExportUpgradeHistory(ctx context.Context, path, destination string) (result error)
- func FinalizeRecoveryDirectory(ctx context.Context, directory string) (string, error)
- func Migrate(ctx context.Context, path string, options MigrateOptions) error
- func SchemaVersion(ctx context.Context, path string) (int, error)
- type MigrateOptions
- type MigrationProgress
- type RecoveryBackup
- type Repository
- func (repository *Repository) AcceptJob(ctx context.Context, input jobhost.Acceptance) (jobcontract.Snapshot, bool, error)
- func (repository *Repository) ActiveJobs(ctx context.Context) ([]jobcontract.Snapshot, error)
- func (repository *Repository) AppendResults(ctx context.Context, results ...domain.Result) error
- func (repository *Repository) ApplyJobCommand(ctx context.Context, command jobcontract.Command, at time.Time) (jobcontract.CommandConfirmation, bool, error)
- func (repository *Repository) ApplyRemoteBatch(ctx context.Context, batch remoteresults.Batch) (remoteresults.Mirror, error)
- func (repository *Repository) AvailableReports(ctx context.Context, ids []string) ([]string, error)
- func (repository *Repository) ChangeJob(ctx context.Context, change jobhost.Change) (jobcontract.Snapshot, error)
- func (repository *Repository) CheckIntegrity(ctx context.Context) error
- func (repository *Repository) CheckWritable(ctx context.Context) error
- func (repository *Repository) Close() error
- func (repository *Repository) ComparisonHistory(ctx context.Context, after string, refresh []string) (comparisons.HistoryPage, error)
- func (repository *Repository) ContentPublication(ctx context.Context, storeID, sha256 string) (jobcontent.Generation, error)
- func (repository *Repository) CreateComparison(ctx context.Context, comparison domain.Comparison) error
- func (repository *Repository) CreateControl(ctx context.Context, record jobs.ControlRecord) (jobs.ControlRecord, error)
- func (repository *Repository) CreateEvidence(ctx context.Context, evidence domain.Evidence) error
- func (repository *Repository) CreateReport(ctx context.Context, report domain.Report) error
- func (repository *Repository) CreateRun(ctx context.Context, run domain.Run) error
- func (repository *Repository) CreateSubmission(ctx context.Context, record jobs.SubmissionRecord) (jobs.SubmissionRecord, error)
- func (repository *Repository) GetComparison(ctx context.Context, id string) (domain.Comparison, error)
- func (repository *Repository) GetControl(ctx context.Context, id string) (jobs.ControlRecord, error)
- func (repository *Repository) GetEvidence(ctx context.Context, id string) (domain.Evidence, error)
- func (repository *Repository) GetJob(ctx context.Context, id string) (jobcontract.Snapshot, error)
- func (repository *Repository) GetJobCommand(ctx context.Context, id string) (jobcontract.CommandConfirmation, error)
- func (repository *Repository) GetJobSpec(ctx context.Context, id string) (jobcontract.JobSpec, error)
- func (repository *Repository) GetPerformanceObservation(ctx context.Context, id string) (jobcontract.PerformanceObservation, error)
- func (repository *Repository) GetQuickPerformanceReport(ctx context.Context, reportID string) (quicktest.PerformanceReport, error)
- func (repository *Repository) GetRemoteMirror(ctx context.Context, id string) (remoteresults.Mirror, error)
- func (repository *Repository) GetReport(ctx context.Context, id string) (domain.Report, error)
- func (repository *Repository) GetResult(ctx context.Context, id string) (domain.Result, error)
- func (repository *Repository) GetRun(ctx context.Context, id string) (domain.Run, error)
- func (repository *Repository) GetRunRevision(ctx context.Context, id string, revision uint64) (domain.Run, error)
- func (repository *Repository) GetSubmission(ctx context.Context, id string) (jobs.SubmissionRecord, error)
- func (repository *Repository) ImportRemotePerformanceDocument(ctx context.Context, input remoteresults.PerformanceDocumentImport) error
- func (repository *Repository) ImportRemoteRunReport(ctx context.Context, input remoteresults.RunReportImport) error
- func (repository *Repository) IsLocalComparison(ctx context.Context, id string) (bool, error)
- func (repository *Repository) Job(ctx context.Context, id string) (jobs.JobView, error)
- func (repository *Repository) JobContent(ctx context.Context, id string) (jobcontent.Inventory, error)
- func (repository *Repository) JobControls(ctx context.Context, jobID string, after string, limit uint32) (jobs.ControlPageView, error)
- func (repository *Repository) JobEvents(ctx context.Context, id string, after uint64, limit uint32) (jobhost.EventPage, error)
- func (repository *Repository) Jobs(ctx context.Context, after string, limit uint32) (jobs.JobPage, error)
- func (repository *Repository) ListComparisons(ctx context.Context) ([]domain.Comparison, error)
- func (repository *Repository) ListEvidence(ctx context.Context, runID string) ([]domain.Evidence, error)
- func (repository *Repository) ListJobs(ctx context.Context, query jobhost.JobListQuery) (jobhost.JobPage, error)
- func (repository *Repository) ListPendingControls(ctx context.Context, after string, limit uint32) (jobs.ControlPage, error)
- func (repository *Repository) ListPendingSubmissions(ctx context.Context, after string, limit uint32) (jobs.SubmissionPage, error)
- func (repository *Repository) ListQuickHistory(ctx context.Context, after string) (quickhistory.Projection, error)
- func (repository *Repository) ListQuickPerformanceReportSummaries(ctx context.Context) ([]quicktest.PerformanceArchiveSummary, error)
- func (repository *Repository) ListRecentQuickPerformanceSummaries(ctx context.Context, limit int) ([]quicktest.PerformanceArchiveSummary, error)
- func (repository *Repository) ListRecentReportProjections(ctx context.Context, limit int) ([]reporting.ReportProjection, error)
- func (repository *Repository) ListRecoveryRuns(ctx context.Context) ([]domain.Run, error)
- func (repository *Repository) ListRecycledHistory(ctx context.Context, after string) (historyrecycle.Page, error)
- func (repository *Repository) ListRemoteDocumentWork(ctx context.Context, query remoteresults.DocumentQuery) (remoteresults.DocumentPage, error)
- func (repository *Repository) ListRemoteDocuments(ctx context.Context, jobID string) ([]remoteresults.DocumentReference, error)
- func (repository *Repository) ListRemoteFactPriorityIDs(ctx context.Context, origin remoteresults.Origin, after string, limit uint32) (remoteresults.PriorityPage, error)
- func (repository *Repository) ListReportProjections(ctx context.Context) ([]reporting.ReportProjection, error)
- func (repository *Repository) ListReports(ctx context.Context) ([]domain.Report, error)
- func (repository *Repository) ListReportsForRuns(ctx context.Context, runIDs []string) ([]domain.Report, error)
- func (repository *Repository) ListResults(ctx context.Context, runID string) ([]domain.Result, error)
- func (repository *Repository) ListRunHistory(ctx context.Context, after string) ([]workspace.RunProjection, string, error)
- func (repository *Repository) ListRunProjections(ctx context.Context) ([]workspace.RunProjection, error)
- func (repository *Repository) ListRuns(ctx context.Context) ([]domain.Run, error)
- func (repository *Repository) LocalExecutorIdentity(ctx context.Context) (jobhost.LocalIdentity, error)
- func (repository *Repository) LookupJob(ctx context.Context, input jobhost.Acceptance) (jobcontract.Snapshot, error)
- func (repository *Repository) MarkJobSettled(ctx context.Context, id string) error
- func (repository *Repository) OpenDesktopReadOnlyView(ctx context.Context) (*Repository, error)
- func (repository *Repository) OpenReadOnlyView(ctx context.Context) (*Repository, error)
- func (repository *Repository) OverviewActivity(ctx context.Context) (overview.Activity, error)
- func (repository *Repository) PerformanceResult(ctx context.Context, id string) (jobs.PerformanceResultView, error)
- func (repository *Repository) PreviewHistoryRecycle(ctx context.Context, target historyrecycle.Target) (historyrecycle.Preview, error)
- func (repository *Repository) PublishContent(ctx context.Context, publication jobcontent.Publication) (jobcontent.Generation, bool, error)
- func (repository *Repository) ReadJob(ctx context.Context, id string) (jobs.JobRead, error)
- func (repository *Repository) ReadPerformanceArchive(ctx context.Context, jobID string, reportID string) (jobhost.PerformanceArchiveDocument, error)
- func (repository *Repository) ReadPerformanceResult(ctx context.Context, id string) (jobhost.PerformanceResultDocument, error)
- func (repository *Repository) ReadRemotePerformanceResult(ctx context.Context, jobID string) (jobcontract.PerformanceResult, error)
- func (repository *Repository) ReadRunReport(ctx context.Context, jobID string, reportID string) (jobhost.RunReportDocument, error)
- func (repository *Repository) ReadRunSummaries(ctx context.Context, ids []string) ([]workspace.RunProjection, error)
- func (repository *Repository) ReadUpgradeHistory(ctx context.Context, table string, after int64, limit int) (UpgradeHistoryPage, error)
- func (repository *Repository) RecordJobProgress(ctx context.Context, id string, progress quicktest.PerformanceProgress, ...) error
- func (repository *Repository) RecordPerformanceObservation(ctx context.Context, input jobhost.PerformanceObservationWrite) (jobcontract.PerformanceObservation, error)
- func (repository *Repository) RecoveryJobs(ctx context.Context) ([]jobcontract.Snapshot, error)
- func (repository *Repository) RecycleHistory(ctx context.Context, target historyrecycle.Target, at time.Time) (historyrecycle.Entry, error)
- func (repository *Repository) RegisterContentStore(ctx context.Context, store jobcontent.Store) error
- func (repository *Repository) RemoteNodeRemovalBlocked(ctx context.Context, configurationID string, nodeID string, ...) (bool, error)
- func (repository *Repository) RemoteRunReportImported(ctx context.Context, jobID, reportID string) (bool, error)
- func (repository *Repository) RestoreHistory(ctx context.Context, target historyrecycle.Target) (historyrecycle.Entry, error)
- func (repository *Repository) RunExecutionOrigin(ctx context.Context, runID string) (*domain.ExecutionOrigin, error)
- func (repository *Repository) SaveQuickPerformanceReport(ctx context.Context, report quicktest.PerformanceReport) error
- func (repository *Repository) SealPerformanceResult(ctx context.Context, id string, at time.Time) (jobhost.PerformanceResultDocument, error)
- func (repository *Repository) UpdateComparison(ctx context.Context, expectedRevision uint64, comparison domain.Comparison) error
- func (repository *Repository) UpdateControl(ctx context.Context, next jobs.ControlRecord, expected uint64) error
- func (repository *Repository) UpdateRun(ctx context.Context, expectedRevision uint64, run domain.Run) error
- func (repository *Repository) UpdateSubmission(ctx context.Context, next jobs.SubmissionRecord, expected uint64) error
- type RepositoryOptions
- type RunnerBackup
- type RunnerBackupRows
- type UpgradeHistoryPage
Constants ¶
const ( MaxReportProjectionDocumentBytes = 32 << 20 MaxReportProjectionItemBytes = 8 << 20 )
const (
CurrentSchemaVersion = 4
)
Variables ¶
var ( ErrNotFound = errors.New("sqlite repository record not found") ErrConflict = errors.New("sqlite repository revision conflict") ErrCorrupt = errors.New("sqlite repository data is corrupt") )
var ErrHistoricalJob = errors.New("historical job is read-only after upgrade; create a new job to execute again")
ErrHistoricalJob identifies preserved, read-only jobs which cannot safely be resumed because their original producer did not record executor provenance.
var ErrMigrationDataIncompatible = errors.New("historical sqlite data is incompatible with migration")
ErrMigrationDataIncompatible identifies historical content that a migration cannot safely transform. It does not authorize overwriting the source.
var ErrSchemaResetRequired = errors.New("unsupported sqlite schema; preserve this database and explicitly upgrade it before opening")
ErrSchemaResetRequired classifies unsupported or invalid persisted formats. The name is retained for callers; this error never authorizes a data reset.
Functions ¶
func CurrentSchemaIdentity ¶
CurrentSchemaIdentity returns the single operational schema marker.
func ExportUpgradeHistory ¶
ExportUpgradeHistory writes a lossless JSONL archive from a consistent, read-only snapshot. It never migrates the source or overwrites an existing destination. A complete export always ends with a complete record.
func FinalizeRecoveryDirectory ¶
FinalizeRecoveryDirectory makes completed recovery files durable before the desktop selector can reference them, including Windows directory publication.
Types ¶
type MigrateOptions ¶
type MigrateOptions struct {
AppVersion string
BusyTimeout time.Duration
// Progress reports the current stage without exposing paths or user data.
Progress func(MigrationProgress)
}
MigrateOptions identifies the application creating the operational schema and controls how long SQLite waits for a competing writer.
type MigrationProgress ¶
type RecoveryBackup ¶
func BackupIncompatibleDatabase ¶
func BackupIncompatibleDatabase(ctx context.Context, path, destination string) (RecoveryBackup, error)
BackupIncompatibleDatabase preserves a consistent SQLite snapshot without interpreting its application schema. The source and its sidecars stay in place.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Each Repository uses a one-connection pool. Desktop and runner history use a separate read-only view, leaving execution's connection for critical work.
func OpenRepository ¶
func OpenRepository(ctx context.Context, path string, options RepositoryOptions) (*Repository, error)
func (*Repository) AcceptJob ¶
func (repository *Repository) AcceptJob( ctx context.Context, input jobhost.Acceptance, ) (jobcontract.Snapshot, bool, error)
func (*Repository) ActiveJobs ¶
func (repository *Repository) ActiveJobs(ctx context.Context) ([]jobcontract.Snapshot, error)
func (*Repository) AppendResults ¶
AppendResults writes a batch atomically. Callers resolve suite and case identities from the validated run snapshot before writing; appends do not reload run documents.
func (*Repository) ApplyJobCommand ¶
func (repository *Repository) ApplyJobCommand( ctx context.Context, command jobcontract.Command, at time.Time, ) (jobcontract.CommandConfirmation, bool, error)
func (*Repository) ApplyRemoteBatch ¶
func (repository *Repository) ApplyRemoteBatch( ctx context.Context, batch remoteresults.Batch, ) (remoteresults.Mirror, error)
ApplyRemoteBatch imports only already committed facts. It never creates an execution_jobs owner, submits traffic, or infers failure from disconnection.
func (*Repository) AvailableReports ¶
AvailableReports checks local archive existence without decoding report bodies.
func (*Repository) ChangeJob ¶
func (repository *Repository) ChangeJob(ctx context.Context, change jobhost.Change) (jobcontract.Snapshot, error)
func (*Repository) CheckIntegrity ¶
func (repository *Repository) CheckIntegrity(ctx context.Context) error
CheckIntegrity explicitly audits the whole database. Normal startup and object reads validate their own schema and data without scanning all history.
func (*Repository) CheckWritable ¶
func (repository *Repository) CheckWritable(ctx context.Context) error
CheckWritable acquires the current writer and validates a write statement without changing any task or journal. Disk headroom is checked separately.
func (*Repository) Close ¶
func (repository *Repository) Close() error
func (*Repository) ComparisonHistory ¶
func (repository *Repository) ComparisonHistory( ctx context.Context, after string, refresh []string, ) (comparisons.HistoryPage, error)
ComparisonHistory projects only a bounded window and explicitly refreshed active identities. It never loads report bodies into Go or validates history.
func (*Repository) ContentPublication ¶
func (repository *Repository) ContentPublication( ctx context.Context, storeID, sha256 string, ) (jobcontent.Generation, error)
func (*Repository) CreateComparison ¶
func (repository *Repository) CreateComparison(ctx context.Context, comparison domain.Comparison) error
func (*Repository) CreateControl ¶
func (repository *Repository) CreateControl( ctx context.Context, record jobs.ControlRecord, ) (jobs.ControlRecord, error)
func (*Repository) CreateEvidence ¶
func (*Repository) CreateReport ¶
func (*Repository) CreateSubmission ¶
func (repository *Repository) CreateSubmission( ctx context.Context, record jobs.SubmissionRecord, ) (jobs.SubmissionRecord, error)
func (*Repository) GetComparison ¶
func (repository *Repository) GetComparison(ctx context.Context, id string) (domain.Comparison, error)
func (*Repository) GetControl ¶
func (repository *Repository) GetControl(ctx context.Context, id string) (jobs.ControlRecord, error)
func (*Repository) GetEvidence ¶
func (*Repository) GetJob ¶
func (repository *Repository) GetJob(ctx context.Context, id string) (jobcontract.Snapshot, error)
func (*Repository) GetJobCommand ¶
func (repository *Repository) GetJobCommand(ctx context.Context, id string) (jobcontract.CommandConfirmation, error)
func (*Repository) GetJobSpec ¶
func (repository *Repository) GetJobSpec(ctx context.Context, id string) (jobcontract.JobSpec, error)
func (*Repository) GetPerformanceObservation ¶
func (repository *Repository) GetPerformanceObservation( ctx context.Context, id string, ) (jobcontract.PerformanceObservation, error)
func (*Repository) GetQuickPerformanceReport ¶
func (repository *Repository) GetQuickPerformanceReport(ctx context.Context, reportID string) (quicktest.PerformanceReport, error)
func (*Repository) GetRemoteMirror ¶
func (repository *Repository) GetRemoteMirror(ctx context.Context, id string) (remoteresults.Mirror, error)
func (*Repository) GetRunRevision ¶
func (*Repository) GetSubmission ¶
func (repository *Repository) GetSubmission(ctx context.Context, id string) (jobs.SubmissionRecord, error)
func (*Repository) ImportRemotePerformanceDocument ¶
func (repository *Repository) ImportRemotePerformanceDocument(ctx context.Context, input remoteresults.PerformanceDocumentImport) error
func (*Repository) ImportRemoteRunReport ¶
func (repository *Repository) ImportRemoteRunReport(ctx context.Context, input remoteresults.RunReportImport) error
ImportRemoteRunReport verifies the original downloaded bytes against the committed reference. Report, attachments, seal and download state commit together. File publication and fsync remain the cache owner's responsibility.
func (*Repository) IsLocalComparison ¶
func (*Repository) JobContent ¶
func (repository *Repository) JobContent(ctx context.Context, id string) (jobcontent.Inventory, error)
func (*Repository) JobControls ¶
func (repository *Repository) JobControls( ctx context.Context, jobID string, after string, limit uint32, ) (jobs.ControlPageView, error)
func (*Repository) ListComparisons ¶
func (repository *Repository) ListComparisons(ctx context.Context) ([]domain.Comparison, error)
func (*Repository) ListEvidence ¶
func (*Repository) ListJobs ¶
func (repository *Repository) ListJobs(ctx context.Context, query jobhost.JobListQuery) (jobhost.JobPage, error)
func (*Repository) ListPendingControls ¶
func (repository *Repository) ListPendingControls( ctx context.Context, after string, limit uint32, ) (jobs.ControlPage, error)
func (*Repository) ListPendingSubmissions ¶
func (repository *Repository) ListPendingSubmissions( ctx context.Context, after string, limit uint32, ) (jobs.SubmissionPage, error)
func (*Repository) ListQuickHistory ¶
func (repository *Repository) ListQuickHistory(ctx context.Context, after string) (quickhistory.Projection, error)
ListQuickHistory selects a bounded mixed ID window before projecting results. It never loads report bodies, evidence payloads, or authored catalog files.
func (*Repository) ListQuickPerformanceReportSummaries ¶
func (repository *Repository) ListQuickPerformanceReportSummaries(ctx context.Context) ([]quicktest.PerformanceArchiveSummary, error)
func (*Repository) ListRecentQuickPerformanceSummaries ¶
func (repository *Repository) ListRecentQuickPerformanceSummaries(ctx context.Context, limit int) ([]quicktest.PerformanceArchiveSummary, error)
func (*Repository) ListRecentReportProjections ¶
func (repository *Repository) ListRecentReportProjections(ctx context.Context, limit int) ([]reporting.ReportProjection, error)
func (*Repository) ListRecoveryRuns ¶
ListRecoveryRuns reads only unmanaged current non-terminal runs. Job hosts and remote sync recover their own runs; archived documents remain lazy.
func (*Repository) ListRecycledHistory ¶
func (repository *Repository) ListRecycledHistory(ctx context.Context, after string) (historyrecycle.Page, error)
func (*Repository) ListRemoteDocumentWork ¶
func (repository *Repository) ListRemoteDocumentWork( ctx context.Context, query remoteresults.DocumentQuery, ) (remoteresults.DocumentPage, error)
ListRemoteDocumentWork reads only bounded headers and immutable references. One statement keeps sources, references and control anchors in one snapshot. Eligibility is checked after validation, so malformed terminal history cannot disappear through a filter. SQL may scan scoped history; ctx bounds that work.
func (*Repository) ListRemoteDocuments ¶
func (repository *Repository) ListRemoteDocuments(ctx context.Context, jobID string) ([]remoteresults.DocumentReference, error)
func (*Repository) ListRemoteFactPriorityIDs ¶
func (repository *Repository) ListRemoteFactPriorityIDs( ctx context.Context, origin remoteresults.Origin, after string, limit uint32, ) (remoteresults.PriorityPage, error)
ListRemoteFactPriorityIDs returns active shared-job scheduling hints. Terminal jobs leave this queue even while documents remain unimported. Go validates bounded rows until limit+1 eligible IDs. SQLite may scan and sort the scoped small headers/snapshots first; total work depends on scoped history and respects ctx. Full spec/submission blobs stay out of the sort and Go. Actual synchronization still authenticates full specs and the event journal.
func (*Repository) ListReportProjections ¶
func (repository *Repository) ListReportProjections(ctx context.Context) ([]reporting.ReportProjection, error)
ListReportProjections reads only the latest report-list scalars. Full document, history and relation validation belongs to GetReport, when the user opens it.
func (*Repository) ListReports ¶
func (*Repository) ListReportsForRuns ¶
func (*Repository) ListResults ¶
func (*Repository) ListRunHistory ¶
func (repository *Repository) ListRunHistory(ctx context.Context, after string) ([]workspace.RunProjection, string, error)
ListRunHistory pages standalone runs. Managed children are fetched only for the jobs the user has loaded, through ReadRunSummaries.
func (*Repository) ListRunProjections ¶
func (repository *Repository) ListRunProjections(ctx context.Context) ([]workspace.RunProjection, error)
ListRunProjections transfers only the list's scalar fields and compact entry progress. Full snapshots, Case definitions and revision history stay behind GetRun/GetRunRevision and the report/result detail read boundaries.
func (*Repository) LocalExecutorIdentity ¶
func (repository *Repository) LocalExecutorIdentity(ctx context.Context) (jobhost.LocalIdentity, error)
LocalExecutorIdentity initializes only an unused execution/outbox namespace. Missing or damaged identity beside existing work requires explicit recovery; startup must never mint another owner and abandon its pending jobs.
func (*Repository) LookupJob ¶
func (repository *Repository) LookupJob(ctx context.Context, input jobhost.Acceptance) (jobcontract.Snapshot, error)
func (*Repository) MarkJobSettled ¶
func (repository *Repository) MarkJobSettled(ctx context.Context, id string) error
Settlement is a durable boundary after Core report work and reservation release. A crash before this write must retry settlement, never execution.
func (*Repository) OpenDesktopReadOnlyView ¶
func (repository *Repository) OpenDesktopReadOnlyView(ctx context.Context) (*Repository, error)
OpenDesktopReadOnlyView omits locally recycled history from desktop lists. Protocol and execution reads continue to use the complete stored history.
func (*Repository) OpenReadOnlyView ¶
func (repository *Repository) OpenReadOnlyView(ctx context.Context) (*Repository, error)
OpenReadOnlyView isolates history reads from execution's connection. Both roles use the same current repository implementation and validation. The owner must stop readers and close this view before closing writer.
func (*Repository) OverviewActivity ¶
func (*Repository) PerformanceResult ¶
func (repository *Repository) PerformanceResult( ctx context.Context, id string, ) (jobs.PerformanceResultView, error)
func (*Repository) PreviewHistoryRecycle ¶
func (repository *Repository) PreviewHistoryRecycle( ctx context.Context, target historyrecycle.Target, ) (historyrecycle.Preview, error)
func (*Repository) PublishContent ¶
func (repository *Repository) PublishContent( ctx context.Context, publication jobcontent.Publication, ) (jobcontent.Generation, bool, error)
func (*Repository) ReadPerformanceArchive ¶
func (repository *Repository) ReadPerformanceArchive( ctx context.Context, jobID string, reportID string, ) (jobhost.PerformanceArchiveDocument, error)
func (*Repository) ReadPerformanceResult ¶
func (repository *Repository) ReadPerformanceResult( ctx context.Context, id string, ) (jobhost.PerformanceResultDocument, error)
func (*Repository) ReadRemotePerformanceResult ¶
func (repository *Repository) ReadRemotePerformanceResult(ctx context.Context, jobID string) (jobcontract.PerformanceResult, error)
func (*Repository) ReadRunReport ¶
func (repository *Repository) ReadRunReport( ctx context.Context, jobID string, reportID string, ) (jobhost.RunReportDocument, error)
func (*Repository) ReadRunSummaries ¶
func (repository *Repository) ReadRunSummaries(ctx context.Context, ids []string) ([]workspace.RunProjection, error)
func (*Repository) ReadUpgradeHistory ¶
func (repository *Repository) ReadUpgradeHistory( ctx context.Context, table string, after int64, limit int, ) (UpgradeHistoryPage, error)
func (*Repository) RecordJobProgress ¶
func (repository *Repository) RecordJobProgress( ctx context.Context, id string, progress quicktest.PerformanceProgress, at time.Time, ) error
func (*Repository) RecordPerformanceObservation ¶
func (repository *Repository) RecordPerformanceObservation( ctx context.Context, input jobhost.PerformanceObservationWrite, ) (jobcontract.PerformanceObservation, error)
func (*Repository) RecoveryJobs ¶
func (repository *Repository) RecoveryJobs(ctx context.Context) ([]jobcontract.Snapshot, error)
Include terminal Jobs whose command or shutdown decision committed before their child Run/Comparison cleanup. Recovery never executes their requests.
func (*Repository) RecycleHistory ¶
func (repository *Repository) RecycleHistory( ctx context.Context, target historyrecycle.Target, at time.Time, ) (historyrecycle.Entry, error)
func (*Repository) RegisterContentStore ¶
func (repository *Repository) RegisterContentStore(ctx context.Context, store jobcontent.Store) error
func (*Repository) RemoteNodeRemovalBlocked ¶
func (repository *Repository) RemoteNodeRemovalBlocked( ctx context.Context, configurationID string, nodeID string, installationID string, ) (bool, error)
RemoteNodeRemovalBlocked reads this desktop's durable submissions, mirrors and controls. It does not contact or alter jobs on the remote runner. Empty executor IDs identify an unbound configuration, which must have no jobs.
func (*Repository) RemoteRunReportImported ¶
func (repository *Repository) RemoteRunReportImported(ctx context.Context, jobID, reportID string) (bool, error)
RemoteRunReportImported distinguishes a pending reference from a verified report without loading its full document or claiming evidence files exist.
func (*Repository) RestoreHistory ¶
func (repository *Repository) RestoreHistory(ctx context.Context, target historyrecycle.Target) (historyrecycle.Entry, error)
func (*Repository) RunExecutionOrigin ¶
func (repository *Repository) RunExecutionOrigin(ctx context.Context, runID string) (*domain.ExecutionOrigin, error)
RunExecutionOrigin returns only the executor frozen by durable admission. A current run without a Job owner is explicitly unmanaged and returns nil.
func (*Repository) SaveQuickPerformanceReport ¶
func (repository *Repository) SaveQuickPerformanceReport(ctx context.Context, report quicktest.PerformanceReport) error
func (*Repository) SealPerformanceResult ¶
func (repository *Repository) SealPerformanceResult( ctx context.Context, id string, at time.Time, ) (jobhost.PerformanceResultDocument, error)
func (*Repository) UpdateComparison ¶
func (repository *Repository) UpdateComparison(ctx context.Context, expectedRevision uint64, comparison domain.Comparison) error
func (*Repository) UpdateControl ¶
func (repository *Repository) UpdateControl(ctx context.Context, next jobs.ControlRecord, expected uint64) error
func (*Repository) UpdateSubmission ¶
func (repository *Repository) UpdateSubmission( ctx context.Context, next jobs.SubmissionRecord, expected uint64, ) error
type RepositoryOptions ¶
type RunnerBackup ¶
type RunnerBackup struct {
SchemaVersion int `json:"schema_version"`
SchemaName string `json:"schema_name"`
SchemaSHA256 string `json:"schema_sha256"`
DatabaseSHA256 string `json:"database_sha256"`
DatabaseBytes int64 `json:"database_bytes"`
BusinessSHA256 string `json:"business_sha256"`
Rows RunnerBackupRows `json:"rows"`
}
RunnerBackup contains only safe verification facts, suitable for an upgrade journal. DatabaseSHA256 identifies the file bytes; BusinessSHA256 identifies every typed SQLite value in the consistent snapshot, including WAL content.
func BackupRunnerDatabase ¶
func BackupRunnerDatabase(ctx context.Context, sourcePath, destinationPath string) (RunnerBackup, error)
BackupRunnerDatabase explicitly snapshots a current database. The caller stops admission and the service before invoking it; this helper never does so. It never migrates, checkpoints, or writes the source. An existing destination or SQLite sidecar is a conflict. The caller must own a private destination directory so another process cannot replace files during SQLite's path open.
func VerifyRunnerDatabase ¶
func VerifyRunnerDatabase(ctx context.Context, path string) (RunnerBackup, error)
VerifyRunnerDatabase validates the single current schema and all stored runner facts through a read-only transaction. No schema is created or upgraded. For an arbitrary WAL database, DatabaseSHA256 is the main file's hash; only BusinessSHA256 includes the transaction's WAL-visible values.
type RunnerBackupRows ¶
type RunnerBackupRows struct {
TotalRows int64 `json:"total_rows"`
Jobs int64 `json:"jobs"`
JobEvents int64 `json:"job_events"`
Runs int64 `json:"runs"`
RunRevisions int64 `json:"run_revisions"`
CaseResults int64 `json:"case_results"`
Evidence int64 `json:"evidence"`
Reports int64 `json:"reports"`
Comparisons int64 `json:"comparisons"`
PerformanceReports int64 `json:"performance_reports"`
Submissions int64 `json:"submissions"`
}
RunnerBackupRows counts current business records. TotalRows also includes relation tables, the schema marker, and SQLite's AUTOINCREMENT high water marks.
type UpgradeHistoryPage ¶
type UpgradeHistoryPage struct {
SourceChecksum string
Columns []string
TotalRows int64
After int64
Rows [][]any
}
UpgradeHistoryPage exposes losslessly preserved SQL cells for inspection and export. Blob cells are []byte, integer cells int64, and original JSON remains raw text/blob. These values must never be sent to current job admission.
Source Files
¶
- comparison_history.go
- history_recycle.go
- history_visibility.go
- migration.go
- migration_archive.go
- migration_backup.go
- migration_backup_other.go
- migration_catalog.go
- migration_documents.go
- migration_history_recycle.go
- migration_operational.go
- migration_query_indexes.go
- migration_state.go
- overview.go
- quick_history.go
- quick_performance_report.go
- recovery_backup.go
- report_projection.go
- report_validation.go
- repository_admission_cache.go
- repository_comparison.go
- repository_content.go
- repository_content_validation.go
- repository_control_outbox.go
- repository_control_targets.go
- repository_core.go
- repository_document_work.go
- repository_execution.go
- repository_execution_origin.go
- repository_job_commands.go
- repository_job_events.go
- repository_job_host.go
- repository_job_page.go
- repository_job_page_performance.go
- repository_job_page_sources.go
- repository_job_reads.go
- repository_jobs.go
- repository_local_identity.go
- repository_performance_archive.go
- repository_performance_jobs.go
- repository_performance_origin.go
- repository_remote_batch.go
- repository_remote_documents.go
- repository_remote_events.go
- repository_remote_mirror.go
- repository_remote_node_usage.go
- repository_remote_ownership.go
- repository_remote_performance.go
- repository_remote_reports.go
- repository_report_relations.go
- repository_submission_query.go
- repository_submissions.go
- repository_submitted_pages.go
- repository_sync_priority.go
- repository_upgrade_history.go
- run_history.go
- runner_backup.go
- runner_health.go
- runner_read_view.go
- schema_content.go
- schema_upgrade_history.go
- schema_v1.go
- upgrade_history_export.go
- workspace_projection.go