Documentation
¶
Overview ¶
Package releasevalidation loads and validates the repository's fail-closed release matrix. It deliberately knows nothing about OpenRealtime runtime internals: a release gate is an executable contract around the public build, test, client, and benchmark entry points.
Index ¶
- Constants
- func MarshalBehavioralAcceptanceReport(report BehavioralAcceptanceReport) ([]byte, error)
- func MarshalCampaignArtifact(value any) ([]byte, error)
- func MarshalCampaignClosureDraft(closure CampaignClosure) ([]byte, error)
- func MarshalReport(report Report) ([]byte, error)
- func RequiredGateIDs(matrix Matrix) []string
- type AggregateTarget
- type Assertion
- type Availability
- type BehavioralAcceptanceReport
- type BehavioralCheck
- type BehavioralClosureInput
- type BehavioralExecutionReport
- type BehavioralOutcome
- type BehavioralResultInput
- type BehavioralSuiteReport
- type BehavioralSuiteTarget
- type BehavioralTargets
- type CampaignArtifact
- type CampaignArtifactReceipt
- type CampaignClosure
- type CampaignClosurePublication
- type CampaignNamedDigest
- type CampaignNamedValue
- type CampaignRunSpec
- type CampaignScorerManifest
- type CampaignSourceRequirement
- type CampaignTaskInventory
- type CaseTarget
- type CaseTargetSet
- type EvidenceTargetSet
- type FrozenCandidate
- type FrozenCandidateSuite
- type Gate
- type GateResult
- type Matrix
- type MetricExclusion
- type MetricRule
- type Mode
- type Options
- type Prerequisite
- type PrerequisiteResult
- type Registration
- type Report
- type RunLineage
- type Scope
- type Selection
- type SkipPolicy
- type Status
- type VerifiedCampaignClosure
Constants ¶
const ( BehavioralTargetsVersion = 1 FrozenCandidateVersion = 2 BehavioralAcceptanceVersion = 2 RegistrationRegistered = "registered" RegistrationNotApplicable = "not_applicable" ResultKindBench = "bench_result" ResultKindArchitecture = "architecture_result" CaseKeyExact = "exact" CaseKeyBeforeFinalHash = "before_final_hash" ComparisonAtLeast = "at_least" ComparisonAtMost = "at_most" StatisticSum = "sum" StatisticCount = "count" StatisticMin = "min" StatisticP50 = "p50" StatisticP90 = "p90" StatisticP95 = "p95" StatisticP99 = "p99" StatisticMax = "max" StatisticMean = "mean" RunFailedFull = "failed_full" RunFocusedDiagnostic = "focused_diagnostic" RunFinalFull = "final_full" )
const ( CampaignClosureFormat = "openrealtime.behavioral-campaign-closure" CampaignClosureVersion = 1 CampaignRunSpecFormat = "openrealtime.behavioral-run-spec" CampaignRunSpecVersion = 1 CampaignInventoryFormat = "openrealtime.behavioral-task-inventory" CampaignInventoryVersion = 1 CampaignScorerFormat = "openrealtime.behavioral-scorer" CampaignScorerVersion = 1 CampaignArtifactReceiptFormat = "openrealtime.behavioral-artifact-receipt" CampaignArtifactReceiptVersion = 1 )
const MatrixVersion = 1
Variables ¶
This section is empty.
Functions ¶
func MarshalBehavioralAcceptanceReport ¶
func MarshalBehavioralAcceptanceReport(report BehavioralAcceptanceReport) ([]byte, error)
func MarshalCampaignArtifact ¶
MarshalCampaignArtifact emits the canonical representation required by the closure contract. Supported values are run specs, inventories, scorers, and common source receipt wrappers.
func MarshalCampaignClosureDraft ¶
func MarshalCampaignClosureDraft(closure CampaignClosure) ([]byte, error)
MarshalCampaignClosureDraft emits the only accepted publisher input form.
func MarshalReport ¶
MarshalReport emits deterministic, indented JSON. Gate and prerequisite order is matrix order; maps never enter the evidence shape.
func RequiredGateIDs ¶
Types ¶
type AggregateTarget ¶
type AggregateTarget struct {
Registration Registration `json:"registration"`
MinimumPassed *int `json:"minimum_passed,omitempty"`
MinimumApplicable *int `json:"minimum_applicable,omitempty"`
}
type Availability ¶
type Availability string
const ( AvailabilityLocal Availability = "local" AvailabilityProvisioned Availability = "provisioned" )
type BehavioralAcceptanceReport ¶
type BehavioralAcceptanceReport struct {
FormatVersion int `json:"format_version"`
TargetsSHA256 string `json:"targets_sha256"`
FrozenCandidateSHA256 string `json:"frozen_candidate_sha256"`
CandidateID string `json:"candidate_id"`
Revision string `json:"revision"`
ExecutableSHA256 string `json:"executable_sha256"`
Machine bench.Machine `json:"machine"`
Outcome BehavioralOutcome `json:"outcome"`
Accepted bool `json:"accepted"`
BlockedBy []string `json:"blocked_by,omitempty"`
Failures []string `json:"failures,omitempty"`
Suites []BehavioralSuiteReport `json:"suites"`
}
func EvaluateBehavioralAcceptance ¶
func EvaluateBehavioralAcceptance( targets BehavioralTargets, targetsSHA256 string, candidate FrozenCandidate, candidateSHA256 string, inputs []BehavioralClosureInput, ) BehavioralAcceptanceReport
EvaluateBehavioralAcceptance creates one candidate-only acceptance report. Historical result files and bare final results are deliberately not inputs: checked target numbers are the comparison authority, while every observed row is reached through a verified final graph-native campaign closure.
type BehavioralCheck ¶
type BehavioralCheck struct {
Domain string `json:"domain"`
Name string `json:"name"`
Passed bool `json:"passed"`
Metric string `json:"metric,omitempty"`
Statistic string `json:"statistic,omitempty"`
Comparison string `json:"comparison,omitempty"`
Threshold float64 `json:"threshold,omitempty"`
Observed float64 `json:"observed,omitempty"`
Samples int `json:"samples,omitempty"`
Reason string `json:"reason,omitempty"`
}
type BehavioralClosureInput ¶
type BehavioralExecutionReport ¶
type BehavioralExecutionReport struct {
RequirementSHA256 string `json:"requirement_sha256"`
GraphFingerprint string `json:"graph_fingerprint"`
ConfigurationID string `json:"configuration_id"`
ConfigurationSHA256 string `json:"configuration_sha256"`
DeploymentID string `json:"deployment_id"`
DeploymentSHA256 string `json:"deployment_sha256"`
RuntimeSetSHA256 string `json:"runtime_set_sha256"`
}
type BehavioralOutcome ¶
type BehavioralOutcome string
const ( BehavioralPassed BehavioralOutcome = "passed" BehavioralFailed BehavioralOutcome = "failed" BehavioralBlocked BehavioralOutcome = "blocked" )
type BehavioralResultInput ¶
type BehavioralResultInput = BehavioralClosureInput
BehavioralResultInput remains as a source-compatible alias. Path now names a campaign closure, never a bare result; supplying result JSON fails closed.
type BehavioralSuiteReport ¶
type BehavioralSuiteReport struct {
ID string `json:"id"`
Suite string `json:"suite"`
ResultKind string `json:"result_kind"`
Outcome BehavioralOutcome `json:"outcome"`
ResultSHA256 string `json:"result_sha256,omitempty"`
ClosureSHA256 string `json:"closure_sha256,omitempty"`
ExpectedPopulation int `json:"expected_population"`
ObservedPopulation int `json:"observed_population"`
Completed int `json:"completed"`
Passed int `json:"passed"`
NotApplicable int `json:"not_applicable,omitempty"`
Execution *BehavioralExecutionReport `json:"execution,omitempty"`
Lineage []RunLineage `json:"lineage,omitempty"`
BlockedBy []string `json:"blocked_by,omitempty"`
Failures []string `json:"failures,omitempty"`
Checks []BehavioralCheck `json:"checks,omitempty"`
}
type BehavioralSuiteTarget ¶
type BehavioralSuiteTarget struct {
ID string `json:"id"`
ResultKind string `json:"result_kind"`
Suite string `json:"suite"`
ExpectedPopulation int `json:"expected_population"`
CaseKey string `json:"case_key"`
Aggregate AggregateTarget `json:"aggregate"`
Cases CaseTargetSet `json:"cases"`
Safety EvidenceTargetSet `json:"safety"`
Deadline EvidenceTargetSet `json:"deadline"`
Latency EvidenceTargetSet `json:"latency"`
}
type BehavioralTargets ¶
type BehavioralTargets struct {
FormatVersion int `json:"format_version"`
Suites []BehavioralSuiteTarget `json:"suites"`
}
BehavioralTargets is the checked, preregistered behavioral contract. An unavailable registration is explicit checked data, not an omitted field: it keeps acceptance blocked until the benchmark owner records a target.
func LoadBehavioralTargets ¶
func LoadBehavioralTargets(path string) (BehavioralTargets, string, error)
func (BehavioralTargets) Validate ¶
func (targets BehavioralTargets) Validate() error
type CampaignArtifact ¶
type CampaignArtifact struct {
Format string `json:"format"`
FormatVersion int `json:"format_version"`
Path string `json:"path"`
ArtifactSHA256 string `json:"artifact_sha256"`
}
CampaignArtifact identifies one typed, immutable artifact. Path is a locator resolved relative to the closure file and is deliberately excluded from ArtifactSHA256's meaning: identity is the digest, never the filename.
type CampaignArtifactReceipt ¶
type CampaignArtifactReceipt struct {
Format string `json:"format"`
FormatVersion int `json:"format_version"`
Kind string `json:"kind"`
ArtifactFormat string `json:"artifact_format"`
ArtifactPath string `json:"artifact_path"`
ArtifactSHA256 string `json:"artifact_sha256"`
PortableReceiptSHA256 string `json:"portable_receipt_sha256"`
ReceiptSHA256 string `json:"receipt_sha256"`
}
CampaignArtifactReceipt is the smallest common, externally verifiable source-evidence receipt. Suite-specific receipts can be wrapped by retaining their raw digest and semantic identity here. Acceptance verifies the wrapper and the exact raw receipt bytes; suite owners remain responsible for replay.
func SealCampaignArtifactReceipt ¶
func SealCampaignArtifactReceipt(receipt CampaignArtifactReceipt) (CampaignArtifactReceipt, error)
SealCampaignArtifactReceipt calculates the receipt's self digest.
func (CampaignArtifactReceipt) Validate ¶
func (receipt CampaignArtifactReceipt) Validate() error
type CampaignClosure ¶
type CampaignClosure struct {
Format string `json:"format"`
FormatVersion int `json:"format_version"`
SuiteID string `json:"suite_id"`
CampaignID string `json:"campaign_id"`
CandidateID string `json:"candidate_id"`
CandidateSHA256 string `json:"candidate_sha256"`
Revision string `json:"revision"`
ExecutableSHA256 string `json:"executable_sha256"`
Machine bench.Machine `json:"machine"`
ExecutionRequirementSHA256 string `json:"execution_requirement_sha256"`
RunSpec CampaignArtifact `json:"run_spec"`
Inventory CampaignArtifact `json:"inventory"`
SourceReceipts []CampaignArtifact `json:"source_receipts"`
Result CampaignArtifact `json:"result"`
Scorer CampaignArtifact `json:"scorer"`
ExpectedPopulation int `json:"expected_population"`
TaskPopulationSHA256 string `json:"task_population_sha256"`
Predecessors []CampaignArtifact `json:"predecessors,omitempty"`
ClosureSHA256 string `json:"closure_sha256"`
}
CampaignClosure is a post-run, create-only commit record. ClosureSHA256 is calculated over the canonical JSON representation with that field empty. Predecessors recursively close every declared failed/full and focused run; the current closure must correspond to the last frozen final_full row.
func LoadCampaignClosure ¶
func LoadCampaignClosure(path string) (CampaignClosure, error)
LoadCampaignClosure loads a strict canonical closure. Artifact paths remain relative to the closure's directory until VerifyCampaignClosure resolves them beneath that directory.
func LoadCampaignClosureDraft ¶
func LoadCampaignClosureDraft(path string) (CampaignClosure, error)
LoadCampaignClosureDraft reads the strict canonical input to the create-only publisher. A draft must carry an explicitly empty closure_sha256; publishing calculates it only after every referenced artifact verifies.
func PublishCampaignClosure ¶
func PublishCampaignClosure(publication CampaignClosurePublication) (CampaignClosure, error)
PublishCampaignClosure verifies the complete campaign before writing a canonical closure with O_EXCL. No existing receipt is ever replaced.
type CampaignClosurePublication ¶
type CampaignClosurePublication struct {
Closure CampaignClosure
Path string
}
CampaignClosurePublication supplies caller-owned artifact paths. Publishing validates and reopens all inputs before atomically creating the closure.
type CampaignNamedDigest ¶
type CampaignNamedValue ¶
type CampaignRunSpec ¶
type CampaignRunSpec struct {
Format string `json:"format"`
FormatVersion int `json:"format_version"`
SuiteID string `json:"suite_id"`
CampaignID string `json:"campaign_id"`
WorkingDirectory string `json:"working_directory"`
Arguments []string `json:"arguments"`
Environment []CampaignNamedValue `json:"environment,omitempty"`
Endpoints []CampaignNamedDigest `json:"endpoints,omitempty"`
}
CampaignRunSpec retains the behavior-affecting invocation as canonical argv, public environment bindings, and secret-free endpoint identities. Every collection is unique and sorted; positional argv order is preserved.
func (CampaignRunSpec) Validate ¶
func (spec CampaignRunSpec) Validate() error
type CampaignScorerManifest ¶
type CampaignScorerManifest struct {
Format string `json:"format"`
FormatVersion int `json:"format_version"`
SuiteID string `json:"suite_id"`
Identity string `json:"identity"`
Revision string `json:"revision"`
ImplementationSHA256 string `json:"implementation_sha256"`
Inputs []CampaignNamedDigest `json:"inputs,omitempty"`
}
CampaignScorerManifest identifies the deterministic code and all immutable inputs which own TaskOutcome.Passed. The named inputs are unique and sorted.
func (CampaignScorerManifest) Validate ¶
func (scorer CampaignScorerManifest) Validate() error
type CampaignSourceRequirement ¶
type CampaignSourceRequirement struct {
Kind string `json:"kind"`
ArtifactFormat string `json:"artifact_format"`
}
CampaignSourceRequirement is frozen before a final campaign. The receipt digest cannot exist yet, but its semantic kind and schema must already be fixed so a final run cannot substitute an unrelated evidence artifact.
type CampaignTaskInventory ¶
type CampaignTaskInventory struct {
Format string `json:"format"`
FormatVersion int `json:"format_version"`
SuiteID string `json:"suite_id"`
ExpectedPopulation int `json:"expected_population"`
TaskIDs []string `json:"task_ids"`
}
CampaignTaskInventory is the pre-run exact population. Task IDs must be unique and sorted. This prevents a result from choosing its own population.
func (CampaignTaskInventory) Validate ¶
func (inventory CampaignTaskInventory) Validate() error
type CaseTarget ¶
type CaseTargetSet ¶
type CaseTargetSet struct {
Registration Registration `json:"registration"`
Targets []CaseTarget `json:"targets,omitempty"`
}
type EvidenceTargetSet ¶
type EvidenceTargetSet struct {
Registration Registration `json:"registration"`
Rules []MetricRule `json:"rules,omitempty"`
Exclusions []MetricExclusion `json:"exclusions,omitempty"`
}
type FrozenCandidate ¶
type FrozenCandidate struct {
FormatVersion int `json:"format_version"`
CandidateID string `json:"candidate_id"`
Revision string `json:"revision"`
ExecutableSHA256 string `json:"executable_sha256"`
Machine bench.Machine `json:"machine"`
Suites []FrozenCandidateSuite `json:"suites"`
}
FrozenCandidate is authored before the final campaigns. It pins the build, machine and complete execution requirement for every suite. The acceptance report binds the resulting files by digest after they exist.
func LoadFrozenCandidate ¶
func LoadFrozenCandidate(path string) (FrozenCandidate, string, error)
func (FrozenCandidate) Validate ¶
func (candidate FrozenCandidate) Validate() error
type FrozenCandidateSuite ¶
type FrozenCandidateSuite struct {
ID string `json:"id"`
ExecutionRequirementSHA256 string `json:"execution_requirement_sha256"`
RunSpecSHA256 string `json:"run_spec_sha256"`
TaskInventorySHA256 string `json:"task_inventory_sha256"`
ScorerSHA256 string `json:"scorer_sha256"`
SourceReceipts []CampaignSourceRequirement `json:"source_receipts"`
Lineage []RunLineage `json:"lineage"`
}
type Gate ¶
type Gate struct {
ID string `json:"id"`
Description string `json:"description"`
Availability Availability `json:"availability"`
Selection Selection `json:"selection"`
Required bool `json:"required"`
WorkingDir string `json:"working_directory"`
Command []string `json:"command"`
Environment map[string]string `json:"environment,omitempty"`
Timeout string `json:"timeout"`
SkipPolicy SkipPolicy `json:"skip_policy"`
Prerequisites []Prerequisite `json:"prerequisites,omitempty"`
Assertions []Assertion `json:"assertions,omitempty"`
Covers []string `json:"covers,omitempty"`
}
Gate is one independently runnable release claim. Required means that the complete matrix cannot be green without a passing result for this gate. Selection controls only the convenient local default; it never changes the completeness calculation. Optional validation gates must be opt-in so they cannot silently become part of the default developer workflow.
type GateResult ¶
type GateResult struct {
ID string `json:"id"`
Description string `json:"description"`
Availability Availability `json:"availability"`
Required bool `json:"required"`
Selected bool `json:"selected"`
Status Status `json:"status"`
Reason string `json:"reason,omitempty"`
Command []string `json:"command"`
Prerequisites []PrerequisiteResult `json:"prerequisites,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
DurationMS int64 `json:"duration_ms,omitempty"`
ExitCode *int `json:"exit_code,omitempty"`
TimedOut bool `json:"timed_out,omitempty"`
ObservedSkips int `json:"observed_skips,omitempty"`
StdoutLog string `json:"stdout_log,omitempty"`
StderrLog string `json:"stderr_log,omitempty"`
FailedAssertion string `json:"failed_assertion,omitempty"`
}
type Matrix ¶
Matrix is the checked, versioned release definition.
func Load ¶
Load reads a strict matrix. Unknown fields and trailing JSON are errors so a misspelled prerequisite or policy cannot silently weaken a gate.
type MetricExclusion ¶
type MetricRule ¶
type Prerequisite ¶
type PrerequisiteResult ¶
type Registration ¶
type Report ¶
type Report struct {
Version int `json:"version"`
MatrixVersion int `json:"matrix_version"`
MatrixSHA256 string `json:"matrix_sha256"`
Mode Mode `json:"mode"`
Scope Scope `json:"scope"`
StartedAt time.Time `json:"started_at"`
FinishedAt time.Time `json:"finished_at"`
ArtifactsDirectory string `json:"artifacts_directory,omitempty"`
SelectedOutcome string `json:"selected_outcome"`
ReleaseComplete bool `json:"release_complete"`
MissingRequiredGates []string `json:"missing_required_gates,omitempty"`
Gates []GateResult `json:"gates"`
}
type RunLineage ¶
type RunLineage struct {
CampaignID string `json:"campaign_id"`
Kind string `json:"kind"`
Population int `json:"population"`
ArtifactSHA256 string `json:"artifact_sha256,omitempty"`
}
RunLineage is chronological. Earlier failed/full and focused rows bind the raw canonical bytes of their verified campaign closures. The last row is the predeclared final campaign; its post-run closure is supplied separately to acceptance and cannot be written into this pre-run candidate declaration.
type SkipPolicy ¶
type SkipPolicy string
const ( SkipForbid SkipPolicy = "forbid" SkipRecord SkipPolicy = "record" )
type VerifiedCampaignClosure ¶
type VerifiedCampaignClosure struct {
Closure CampaignClosure
Result bench.Result
SourceReceipts []CampaignArtifactReceipt
Predecessors []CampaignClosure
}
VerifiedCampaignClosure contains the verified final result and closure.
func VerifyCampaignClosure ¶
func VerifyCampaignClosure(path string) (VerifiedCampaignClosure, error)
VerifyCampaignClosure reopens all bound artifacts, recursively verifies the predecessor chain, and returns the exact final benchmark result.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
behavioracceptance
command
|
|
|
campaignclosure
command
|
|
|
releasevalidate
command
|