Documentation
¶
Overview ¶
Package baseline is what makes a committed oracle baseline checkable without the Java validators: every baseline records which pin, which bridge sources and which corpora its run measured, and this package both writes that record and compares a committed one against the repository as it stands now.
Index ¶
- Constants
- func CheckCommitted(committedPath, refresh string, current Record) error
- func Differences(was, now any) []string
- func DigestFile(path string) (string, error)
- func DigestFiles(dir string, rel []string) (string, error)
- func DigestStrings(lines []string) string
- func ErrataDigest(entries []errata.Entry) string
- func Explain(baselinePath, refresh string, mismatches []Mismatch) string
- func Reproduces(committedPath string, fresh []byte) error
- func Today() string
- func Validate(recorded Record) error
- func Write(committedPath string, fresh []byte) error
- type Cause
- type Input
- type Mismatch
- type Pin
- type Record
- type Tool
Constants ¶
const ( OriginOurs = "ours" OriginPinned = "pinned" )
Origin says who owns an input, which is what decides the action a mismatch calls for: our own material moving is a movement to adjudicate, the pinned reference moving underneath a baseline is a provisioning defect to investigate.
const PinPath = "scripts/pilot-pin.sh"
PinPath is the single source of the pilot pin every oracle resolves its validators and corpora from.
Variables ¶
This section is empty.
Functions ¶
func CheckCommitted ¶
CheckCommitted is the Java-free guard: it reads a committed baseline's provenance and reports how it differs from the repository as it stands, naming the command that re-records it.
func Differences ¶
Differences reports where two decoded reports differ, as field paths with their values, deepest-first per member so the first line names a real leaf.
func DigestFile ¶
DigestFile is the digest of one file's bytes.
func DigestFiles ¶
DigestFiles is the digest of a named set of files: a hash over each path and the digest of its contents, so a renamed, added or edited file all move it. The paths are slash-separated and relative to dir.
func DigestStrings ¶
DigestStrings is the digest of a list of already-canonical strings, used for registries that live in code rather than on disk.
func ErrataDigest ¶
ErrataDigest identifies the declared overlay: what it corrects is part of what the oracles read, so a changed registry is a changed measurement.
func Explain ¶
Explain is the failure a provenance guard prints: which baseline, which fields, what each mismatch means and the command that re-records it.
func Reproduces ¶
Reproduces reports whether a fresh report still matches the committed baseline. The recording date is excluded: it states when the baseline was committed, not what was measured.
Types ¶
type Input ¶
type Input struct {
Name string `json:"name"`
Dir string `json:"dir"`
Origin string `json:"origin"`
Files int `json:"files"`
Digest string `json:"digest"`
}
Input is one compared corpus root, identified by the digest of the files the run actually read rather than by its directory's contents on any one machine.
type Mismatch ¶
Mismatch is one field of a committed provenance record that no longer matches the repository.
type Pin ¶
Pin is the resolved pilot pin.
type Record ¶
type Record struct {
PilotTag string `json:"pilotTag"`
// PilotCommit is the commit the tag resolved to when the run's material was
// fetched; the tag alone is a mutable name for it.
PilotCommit string `json:"pilotCommit"`
PilotArtifact string `json:"pilotArtifact"`
// Errata is the digest of the declared overlay, which changes what the
// oracles read and therefore what they measure.
Errata string `json:"errataRegistry"`
Tools []Tool `json:"tools,omitempty"`
Inputs []Input `json:"inputs"`
// Recorded is the date the baseline was committed, stamped by the -update
// flag. A plain run leaves it empty so two runs stay byte-identical.
Recorded string `json:"recorded,omitempty"`
}
Record is the provenance block a baseline carries: the identities of the run's inputs, never their machine-specific paths, so any checkout can check it.