corpus

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 21 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

View Source
const MaterialFormatVersion = 3

MaterialFormatVersion is the portable material descriptor version. It stores identity, provenance, hashes and material-root-relative bindings without a machine-local location.

Variables

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

Functions

func CheckMaterialFiles added in v0.2.0

func CheckMaterialFiles(root string, artifact Material) error

CheckMaterialFiles verifies a descriptorless legacy package against the identity and hashes held by the current fixture index.

func CheckMaterialInventory

func CheckMaterialInventory(root string, artifact Material) error

func ChildObservationArgs added in v0.2.0

func ChildObservationArgs(plan tool.Object) ([]string, error)

func DefaultArchive

func DefaultArchive() (string, error)

func Digest

func Digest(p string) (string, error)

func DriverSDKIdentity added in v0.3.0

func DriverSDKIdentity(provider, caseID string, sdk tool.Object) bool

DriverSDKIdentity validates a new official invocation's business report.

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 MaterialPlanBytes added in v0.2.0

func MaterialPlanBytes(source []byte, runtime tool.Object) ([]byte, error)

MaterialPlanBytes preserves unknown source values, including numeric literals. Only defined preparation facts may replace values from the source document.

func MaterialPlanFromRuntime added in v0.2.0

func MaterialPlanFromRuntime(runtime tool.Object) tool.Object

MaterialPlanFromRuntime keeps recording facts and removes only values that describe one local preparation. The source plan remains a separate immutable binding; this projection is what replay and qualification may consume.

func Phases

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

func Read

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

func RecordedSDKIdentity added in v0.3.0

func RecordedSDKIdentity(provider, caseID string, sdk tool.Object) bool

RecordedSDKIdentity validates SDK identities in persisted capture, replay, and publication evidence.

func RecordingAgentType

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

RecordingAgentType reconciles every saved agent identity before fixture import.

func RecordingRoot added in v0.2.0

func RecordingRoot(root string) (core string, completePackage bool, err error)

RecordingRoot recognizes layouts, never a recursively discovered plan.

func Regular

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

func Resolved

func Resolved(p string) (string, error)

func SDKOutcomeMatches added in v0.3.0

func SDKOutcomeMatches(sdk, outcome tool.Object) bool

SDKOutcomeMatches binds the TypeScript driver's result to its business report. Python and Codex evidence retain their original SDK report contract.

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 SealCoreInventory added in v0.2.0

func SealCoreInventory(root string) error

SealCoreInventory is called only after all core writers have closed.

func SeedBusinessReport added in v0.2.0

func SeedBusinessReport(core string) (tool.Object, error)

SeedBusinessReport reads the explicitly selected official record. A sealed core alone proves capture, never the business qualification of a history seed.

func SelectionProvenance

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

func SelfSeededChildren added in v0.2.0

func SelfSeededChildren(plan tool.Object) bool

func ValidateChildSetup added in v0.2.0

func ValidateChildSetup(root string, plan tool.Object) error

func ValidateCore added in v0.2.0

func ValidateCore(root string, material Material) error

ValidateCore verifies the closed format 3 inventory. The two envelopes are excluded from that inventory: the descriptor hashes the manifest, and the caller hashes the descriptor. No object hashes itself.

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 ValidateOfficialVerification added in v0.2.0

func ValidateOfficialVerification(root, id string, material Material) error

func ValidatePackage added in v0.2.0

func ValidatePackage(root string, material Material) error

ValidatePackage validates imported immutable domains without registering any imported execution in the new fixture's scheduling index.

func ValidatePackageSelection added in v0.2.0

func ValidatePackageSelection(root string, material Material) error

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 {
	FormatVersion         int               `json:"formatVersion,omitempty"`
	LegacyInventorySHA256 string            `json:"legacyInventorySHA256,omitempty"`
	SourcePlanSHA256      string            `json:"sourcePlanSHA256,omitempty"`
	OriginSHA256          string            `json:"originSHA256,omitempty"`
	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:"-"`
	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.

func ReadMaterialDescriptor added in v0.2.0

func ReadMaterialDescriptor(root string) (*Material, error)

ReadMaterialDescriptor loads the descriptor owned by a supported material format. The caller supplies the material root explicitly; a stored legacy path is retained in the file bytes but is never used to locate content. A nil descriptor means a supported legacy package without material.json.

func (Material) MarshalJSON added in v0.2.0

func (m Material) MarshalJSON() ([]byte, error)

MarshalJSON never persists a machine-local material location.

func (Material) SameDescriptor added in v0.2.0

func (m Material) SameDescriptor(other Material) bool

SameDescriptor compares persisted material identity without treating the caller-resolved root as part of the descriptor.

func (*Material) UnmarshalJSON added in v0.2.0

func (m *Material) UnmarshalJSON(data []byte) error

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)

func InspectMaterialWithoutDescriptor added in v0.2.0

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

InspectMaterialWithoutDescriptor validates a supported legacy package whose identity is stored only in the caller's fixture index. The material directory must not gain a descriptor during the import.

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 CaptureOrigin added in v0.2.0

func CaptureOrigin(material Material) (*OfficialOrigin, error)

CaptureOrigin resolves the one canonical origin object for format 3. The returned pointer is an in-memory view and is never embedded in new metadata.

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 PackageSelection added in v0.2.0

type PackageSelection struct {
	SchemaVersion int                         `json:"schemaVersion"`
	MaterialID    string                      `json:"materialId"`
	Material      PackageSelectionReference   `json:"material"`
	Record        PackageSelectionReference   `json:"record"`
	Verification  PackageSelectionReference   `json:"verification"`
	Executions    []PackageSelectionReference `json:"executions"`
}

PackageSelection is the schema 2 reader contract shared with admission. The domain envelopes own inventories; review only selects their exact hashes.

type PackageSelectionReference added in v0.2.0

type PackageSelectionReference struct {
	Path   string `json:"path"`
	SHA256 string `json:"sha256"`
}

PackageSelectionReference selects one sealed domain envelope. References are package-relative and preserve the identity already present in that envelope.

type Validation

type Validation struct {
	Err error
	// contains filtered or unexported fields
}

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