Documentation
¶
Overview ¶
Package sourcebundle implements the provider-neutral recording half of the candidate evidence plug-in. It retains only newly executed attempts, seals a credential-free source bundle, and leaves advisory model evaluation to a separately composed offline review plug-in.
Index ¶
- Constants
- func Verify(ctx context.Context, directory, receiptPath string) (Manifest, Receipt, error)
- func VerifyReceiptPayload(ctx context.Context, payload []byte) (Manifest, Receipt, error)
- type Artifact
- type AttemptEntry
- type Bundle
- func (bundle *Bundle) BeginAttempt(ctx context.Context, specification candidate.Attempt) (candidate.AttemptEvidence, error)
- func (bundle *Bundle) BindRun(ctx context.Context, suite string, cell bench.Cell, ...) (bench.Provenance, error)
- func (bundle *Bundle) Close() error
- func (bundle *Bundle) FinishSuite(ctx context.Context, result bench.Result) (resultErr error)
- func (bundle *Bundle) RecoverAttempt(ctx context.Context, specification candidate.Attempt) (candidate.Recovery, bool, error)
- type Manifest
- type Options
- type Receipt
- type ReviewSource
- func (source *ReviewSource) Close(ctx context.Context) error
- func (source *ReviewSource) Manifest() (Manifest, error)
- func (source *ReviewSource) Next(ctx context.Context, sensitiveValues []string) (request review.Request, found bool, resultErr error)
- func (source *ReviewSource) Receipt() (Receipt, error)
- type SourceFile
Constants ¶
const ( ManifestFormat = "openrealtime.candidate-source-bundle" ManifestFormatVersion = 1 ReceiptFormat = "openrealtime.candidate-source-receipt" ReceiptFormatVersion = 1 )
Variables ¶
This section is empty.
Functions ¶
func VerifyReceiptPayload ¶
VerifyReceiptPayload reopens a candidate source tree against exact canonical receipt bytes already read by an outer closure. It avoids a second path read and the corresponding receipt-replacement race.
Types ¶
type AttemptEntry ¶
type AttemptEntry struct {
AttemptID string `json:"attempt_id"`
Suite string `json:"suite"`
Case string `json:"case"`
Trial int `json:"trial"`
Directory string `json:"directory"`
MediaSource string `json:"media_source"`
AttemptPath string `json:"attempt_path"`
AttemptSHA256 string `json:"attempt_sha256"`
CompletionPath string `json:"completion_path,omitempty"`
CompletionSHA256 string `json:"completion_sha256,omitempty"`
ContextPath string `json:"review_context_path,omitempty"`
ContextSHA256 string `json:"review_context_sha256,omitempty"`
Media *review.Media `json:"review_media,omitempty"`
Artifacts []Artifact `json:"artifacts"`
Deterministic bench.TaskOutcome `json:"deterministic_outcome,omitempty"`
EvidenceComplete bool `json:"evidence_complete"`
Terminal string `json:"terminal"`
}
type Bundle ¶
type Bundle struct {
// contains filtered or unexported fields
}
func Resume ¶
Resume reopens an interrupted, unsealed current-run source bundle. Only an attempt with a canonical entry.json commit marker written after every other file is recoverable. A directory without that marker is preserved under interruptions/ and its identity becomes available for a clean retry.
A final manifest or external receipt is deliberately not a partial source: callers must use Verify/review-candidate for a sealed campaign. This keeps deterministic execution recovery separate from advisory-review recovery.
func (*Bundle) BeginAttempt ¶
func (*Bundle) BindRun ¶
func (bundle *Bundle) BindRun( ctx context.Context, suite string, cell bench.Cell, provenance bench.Provenance, origin candidate.RunOrigin, ) (bench.Provenance, error)
BindRun binds a fresh or resumed source bundle to exactly one candidate run. A resumed process may have a new wall-clock start observation, but it must be the same immutable build on the same host. The original start time remains authoritative for the final campaign provenance.
func (*Bundle) Close ¶
Close releases an unsealed bundle after a pre-run or attempt-admission failure. It never deletes retained partial evidence and cannot race an active attempt or a suite seal.
func (*Bundle) FinishSuite ¶
func (*Bundle) RecoverAttempt ¶
func (bundle *Bundle) RecoverAttempt( ctx context.Context, specification candidate.Attempt, ) (candidate.Recovery, bool, error)
RecoverAttempt returns one exact durable completion from a reopened bundle. Each retained identity can be claimed only once by the new lifecycle.
type Manifest ¶
type Manifest struct {
Format string `json:"format"`
FormatVersion int `json:"format_version"`
Complete bool `json:"complete"`
Suite string `json:"suite"`
Cell bench.Cell `json:"cell"`
Provenance bench.Provenance `json:"provenance"`
Origin candidate.RunOrigin `json:"run_origin"`
AttemptCount int `json:"attempt_count"`
ResultPath string `json:"result_path"`
ResultSHA256 string `json:"result_sha256"`
ReviewPath string `json:"review_path"`
ReviewSHA256 string `json:"review_sha256"`
FileSetSHA256 string `json:"file_set_sha256"`
Files []SourceFile `json:"files"`
Attempts []AttemptEntry `json:"attempts"`
Advisory string `json:"advisory_review_status"`
}
type Receipt ¶
type Receipt struct {
Format string `json:"format"`
FormatVersion int `json:"format_version"`
Directory string `json:"directory"`
ManifestSHA256 string `json:"manifest_sha256"`
FileSetSHA256 string `json:"file_set_sha256"`
AttemptCount int `json:"attempt_count"`
ReceiptSHA256 string `json:"receipt_sha256"`
}
type ReviewSource ¶
type ReviewSource struct {
// contains filtered or unexported fields
}
ReviewSource is a verified, credential-free cursor over reviewable attempts in one sealed candidate source bundle. It keeps only metadata in memory and emits one owned request at a time, allowing an evaluator to use bounded worker concurrency even for very large benchmark populations.
func OpenReviewSource ¶
func OpenReviewSource( ctx context.Context, directory, receiptPath string, ) (*ReviewSource, error)
OpenReviewSource verifies the complete source receipt before exposing any provider-ready input. Advisory provider credentials are deliberately not an option here and never become source-bundle state.
func (*ReviewSource) Close ¶
func (source *ReviewSource) Close(ctx context.Context) error
Close releases the cursor and re-verifies the source receipt after the last consumer read. A mutation during a long advisory campaign therefore fails the campaign even though each individual Evaluate call also snapshots and validates the exact bytes it sent.
func (*ReviewSource) Manifest ¶
func (source *ReviewSource) Manifest() (Manifest, error)
Manifest returns an owned metadata snapshot. The authoritative deterministic outcome remains result.json in the receipt-bound source tree.
func (*ReviewSource) Next ¶
func (source *ReviewSource) Next( ctx context.Context, sensitiveValues []string, ) (request review.Request, found bool, resultErr error)
Next returns the next reconstructable review request. Attempts without a complete context/media pair remain in the source manifest and REVIEW.md but are skipped because no multimodal provider can truthfully assess them.
func (*ReviewSource) Receipt ¶
func (source *ReviewSource) Receipt() (Receipt, error)
Receipt returns the exact portable receipt verified when the cursor opened.