corpus

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SourceEvidence = []string{"plan.json", "manifest.json", "report.json", "result.json", "summary.json"}

Functions

func CheckMaterialInventory

func CheckMaterialInventory(root string, artifact Material) error

func DefaultArchive

func DefaultArchive() (string, error)

func Digest

func Digest(p string) (string, error)

func Inventory

func Inventory(root string, empty bool) (tool.Object, error)

func Keys

func Keys(m tool.Object) []string

func Local

func Local(name string) bool

func Phases

func Phases(plan tool.Object) [][2]string

func Read

func Read(p string) (tool.Object, error)

func RecordingAgentType

func RecordingAgentType(plan, manifest, rawManifest tool.Object) (string, error)

RecordingAgentType reconciles every saved agent identity before fixture import.

func Regular

func Regular(root, name string) (string, error)

func Resolved

func Resolved(p string) (string, error)

func ScanCaptureCredentials

func ScanCaptureCredentials(root string) (string, error)

The scan describes this capture only. It never sanitizes or rewrites evidence.

func ScanCaptureCredentialsWithEnvironment

func ScanCaptureCredentialsWithEnvironment(root string, env map[string]string) (string, error)

ScanCaptureCredentialsWithEnvironment is for prepared actions whose selected environment is already represented by a descriptor and must not be copied into material as a private native.env file.

func SelectionProvenance

func SelectionProvenance(plan, manifest tool.Object) (string, error)

func ValidateOfficialCapture

func ValidateOfficialCapture(artifact Material) error

ValidateOfficialCapture checks portable, sealed capture ownership. It does not read the originating fixture or imply that the parent's business passed.

func ValidateOfficialRecord

func ValidateOfficialRecord(root string, artifact Material) error

ValidateOfficialRecord is the downstream qualification seam. Capture ownership alone is insufficient: verify/admission must require the exact successful run, business report, supervised connections and unchanged material hashes.

func ValidateVerificationSource

func ValidateVerificationSource(material Material, inventory tool.Object) error

Legacy material keeps its original evidence contract. New public recordings seal capture provenance before the parent business report exists.

func VerifyAdoptedFiles

func VerifyAdoptedFiles(root string) (tool.Object, error)

VerifyAdoptedFiles validates the reduced immutable view. External mock may reuse its saved-history hashes without claiming official/publication eligibility.

func VerifyFile

func VerifyFile(root, path, digest string) error

func VerifyMaterials

func VerifyMaterials(root string, requireComplete bool) error

Check source bytes, not runtime identities: current drivers, SDK versions and peer binaries remain freely selectable. Shared/synthetic materials need no recording manifest. Existing manifests, when present, must remain truthful.

func VerifySourcePhase

func VerifySourcePhase(root string, requireComplete bool) error

func Within

func Within(p, root string) bool

func Write

func Write(p string, value any) error

func WriteSourceManifest

func WriteSourceManifest(root string, outcome tool.Result) error

New captures are reusable as materials; hashes describe source bytes, never the versions or binary identities selected for a later run.

Types

type Corpus

type Corpus struct {
	Index, Scenarios, Archive string
}

Corpus policy belongs to the Go tool, not to an SDK driver. Paths are explicit so the compiled binary can operate outside its source checkout.

func (*Corpus) Adopt

func (c *Corpus) Adopt(source, replay, reviewPath string) (target string, err error)

func (*Corpus) AdoptWithIndexReplacement

func (c *Corpus) AdoptWithIndexReplacement(source, replay, reviewPath string, replace func(string, string) error) (target string, err error)

func (*Corpus) Catalog

func (c *Corpus) Catalog() (tool.Object, error)

func (*Corpus) LoadIndex

func (c *Corpus) LoadIndex() (tool.Object, error)

func (*Corpus) Normalize

func (c *Corpus) Normalize() error

func (*Corpus) Qualification

func (c *Corpus) Qualification(source, replay string, manual bool) (tool.Object, error)

func (*Corpus) ValidateAdmission

func (c *Corpus) ValidateAdmission(source, replay string, review tool.Object) (tool.Object, error)

func (*Corpus) VerifyAdopted

func (c *Corpus) VerifyAdopted(entry tool.Object) (string, error)

type Material

type Material struct {
	OfficialOrigin  *OfficialOrigin   `json:"officialOrigin,omitempty"`
	Files           map[string]string `json:"files,omitempty"`
	ID              string            `json:"id"`
	Kind            string            `json:"kind"`
	Action          string            `json:"action"`
	Provenance      string            `json:"provenance"`
	Path            string            `json:"path"`
	PlanSHA256      string            `json:"planSHA256"`
	ManifestSHA256  string            `json:"manifestSHA256"`
	RecordingSHA256 string            `json:"recordingSHA256"`
	Connections     []string          `json:"connections"`
	CreatedAt       string            `json:"createdAt"`
}

func ReadMaterial

func ReadMaterial(root, provenance string) (*Material, error)

ReadMaterial describes an imported payload. Its caller assigns fixture-local identity and checks any builtin snapshot against the builtin contract.

type MaterialInspection

type MaterialInspection struct {
	Plan         tool.Object
	Manifest     tool.Object
	Provenance   string
	HistoryFiles map[string]string
}

func InspectMaterial

func InspectMaterial(artifact Material) (*MaterialInspection, error)

type OfficialOrigin

type OfficialOrigin struct {
	RunID              string   `json:"runId"`
	FixtureID          string   `json:"fixtureId"`
	CaseID             string   `json:"caseId"`
	AgentType          string   `json:"agentType"`
	RecordSourceSHA256 string   `json:"recordSourceSHA256"`
	SourceSHA256       string   `json:"sourceSHA256"`
	DriverSHA256       string   `json:"driverSHA256"`
	Connections        []string `json:"connections"`
}

OfficialOrigin identifies capture ownership, not a business pass. It is sealed into the material before publication; the later run result is separate evidence.

func (*OfficialOrigin) UnmarshalJSON

func (o *OfficialOrigin) UnmarshalJSON(data []byte) error

UnmarshalJSON keeps immutable repository evidence readable after the tool-owned identity moved from sessionId to fixtureId. MarshalJSON remains the default struct encoding and therefore never writes the old field.

type Validation

type Validation struct{ Err error }

Validation keeps the first error. Subsequent reads/checks cannot turn a missing or malformed artifact into a successful qualification.

func (*Validation) Check

func (v *Validation) Check(ok bool, message string)

func (*Validation) Digest

func (v *Validation) Digest(root, name string) string

func (*Validation) Hashes

func (v *Validation) Hashes(root string, hashes tool.Object)

func (*Validation) Inventory

func (v *Validation) Inventory(root string, empty bool) tool.Object

func (*Validation) Read

func (v *Validation) Read(root, name string) tool.Object

func (*Validation) Replay

func (v *Validation) Replay(source, replay string, plan tool.Object, mode string)

func (*Validation) ReplayEvidence

func (v *Validation) ReplayEvidence(replay string, plan tool.Object) tool.Object

func (*Validation) Required

func (v *Validation) Required(source string, plan tool.Object) tool.Object

func (*Validation) Summary

func (v *Validation) Summary(root, mode string, plan tool.Object) tool.Object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL