Documentation
¶
Overview ¶
Package oracle owns the frozen legacy evidence format and its integrity checks.
Index ¶
- Constants
- func ConfigureCommand(cmd *exec.Cmd)
- func CountSymbols(data []byte) (functions int, definedSymbols int, auditFunctions int, err error)
- func Digest(data []byte) string
- func Directory() string
- func Inventory(dir string) (map[string]bool, []string, error)
- func JSON(value any) ([]byte, error)
- func ModelSnapshot(value any) string
- func Publish(dir string, b Bundle, refreeze bool) error
- func ReadJSON(path string, value any) error
- func SelectedSites(dir string, tests []string) (map[string]bool, error)
- func Snapshot(value any) string
- func Unconsumed(b Bundle, prefix string, consumed map[string]bool, selection Selection) ([]string, error)
- func Validate(b Bundle) error
- type AuditedSource
- type BuildEnvironment
- type Bundle
- type ComparisonAudit
- type Provenance
- type Record
- type Replay
- type Selection
- type State
Constants ¶
const Version = 1
Variables ¶
This section is empty.
Functions ¶
func ConfigureCommand ¶
ConfigureCommand cancels all compiler descendants with their command owner.
func CountSymbols ¶
CountSymbols is shared by the live footprint gate and the legacy recorder.
func Directory ¶
func Directory() string
Directory returns FOUNDRY_ORACLE_READ when set, otherwise locates the oracle directory from the working directory. Lookup failures panic.
func ModelSnapshot ¶
ModelSnapshot returns the oracle's model snapshot representation.
func SelectedSites ¶
SelectedSites returns the assertion sites selected by the supplied tests.
func Snapshot ¶
Snapshot records structure, not Go formatting. Named model identities are intentionally erased so separately generated and handwritten models compare. Kind tags, lengths, field names and presence survive that normalization.
Types ¶
type AuditedSource ¶
type AuditedSource struct {
PostgresTests []string `json:"postgres_tests,omitempty"`
SHA256 string `json:"sha256"`
Tests []string `json:"paired_tests,omitempty"`
}
AuditedSource records a source hash and its paired test inventories.
type BuildEnvironment ¶
type BuildEnvironment struct {
GOFLAGS string
GOWORK string
GOENV string
GOOS string
GOARCH string
CGO_ENABLED string
GOEXPERIMENT string
GOTOOLCHAIN string
GOMOD string
GOROOT string
GOVERSION string
GCFlags string
}
BuildEnvironment is the effective `go env -json` snapshot in each module. GOFLAGS is fixed: overlays, alternate modfiles, tags, gcflags and ldflags are not accepted inputs to an oracle freeze. Workspace and persistent GOENV are off.
func (BuildEnvironment) Validate ¶
func (b BuildEnvironment) Validate(dir string) error
Validate checks the required canonical build provenance and absolute paths.
type Bundle ¶
type Bundle struct {
Version int `json:"version"`
Sources map[string]string `json:"source_sha256"`
Records map[string]Record `json:"records"`
}
Bundle contains versioned frozen oracle records and their source hashes.
type ComparisonAudit ¶
type ComparisonAudit struct {
Files map[string]AuditedSource `json:"files"`
}
ComparisonAudit is the historical capture census. Its PostgreSQL entry points remain the source of backend requirements for replay; source hashes describe the retired checkout and are not regenerated from replacement declarations.
type Provenance ¶
type Provenance struct {
WorkingDirectory string `json:"working_directory"`
Build BuildEnvironment `json:"build"`
Commit string `json:"commit"`
Sources string `json:"source_manifest_sha256"`
Command []string `json:"command"`
Toolchain string `json:"toolchain"`
Platform string `json:"platform"`
}
Provenance records the source, command, toolchain, platform, and build environment for oracle evidence.
type Record ¶
type Record struct {
Package string `json:"package,omitempty"`
Site string `json:"site"`
Kind string `json:"kind"`
Transcript string `json:"transcript"`
Provenance Provenance `json:"provenance"`
}
Record contains an oracle transcript, assertion identity, kind, and provenance.
type Replay ¶
Replay is owned by one test package; the prefix separates identical test names in different fixture packages. Main enforces consumption after all subtests exit.
func NewReplayAt ¶
NewReplayAt selects an independent frozen bundle, without changing fixture defaults.
func (*Replay) Equal ¶
Equal compares the current transcript with its indexed frozen record and reports missing or differing evidence to the test.
func (*Replay) Finish ¶
Finish checks consumption after a test runner shared by internal and external tests.
type Selection ¶
type Selection struct {
// contains filtered or unexported fields
}
Selection follows Go's slash-separated test regex syntax. Expected records come only from the frozen inventory and flags, never from observed callbacks.
func SelectTests ¶
SelectTests parses test run and skip patterns into an oracle selection.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
freeze-oracles
command
Command freeze-oracles publishes a reviewed framework legacy capture bundle.
|
Command freeze-oracles publishes a reviewed framework legacy capture bundle. |