pack

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPostgresIndexSQL

func BuildPostgresIndexSQL(record ExportRecord, options PostgresSQLOptions) ([]byte, error)

func ExtractRunpack

func ExtractRunpack(path string) ([]byte, error)

ExtractRunpack returns legacy runpack bytes or the embedded source runpack bytes from a PackSpec run artifact.

func LoadRunpackManifest

func LoadRunpackManifest(path string) (schemarunpack.Manifest, error)

func WriteOTelJSONL

func WriteOTelJSONL(path string, record ExportRecord) error

Types

type BuildCallOptions

type BuildCallOptions struct {
	CallRecordPath    string
	OutputPath        string
	ProducerVersion   string
	SigningPrivateKey ed25519.PrivateKey
}

type BuildJobOptions

type BuildJobOptions struct {
	State             jobruntime.JobState
	Events            []jobruntime.Event
	OutputPath        string
	ProducerVersion   string
	SigningPrivateKey ed25519.PrivateKey
}

type BuildResult

type BuildResult struct {
	Path     string
	Manifest schemapack.Manifest
}

func BuildCallPack

func BuildCallPack(options BuildCallOptions) (BuildResult, error)

func BuildJobPack

func BuildJobPack(options BuildJobOptions) (BuildResult, error)

func BuildJobPackFromPath

func BuildJobPackFromPath(root string, jobID string, outputPath string, producerVersion string, signKey ed25519.PrivateKey) (BuildResult, error)

func BuildRunPack

func BuildRunPack(options BuildRunOptions) (BuildResult, error)

type BuildRunOptions

type BuildRunOptions struct {
	RunpackPath       string
	OutputPath        string
	ProducerVersion   string
	SigningPrivateKey ed25519.PrivateKey
}

type BuildType

type BuildType string
const (
	BuildTypeRun  BuildType = "run"
	BuildTypeJob  BuildType = "job"
	BuildTypeCall BuildType = "call"
)

type DiffResult

type DiffResult struct {
	Result schemapack.DiffResult
}

func Diff

func Diff(leftPath string, rightPath string) (DiffResult, error)

type ExportMetrics

type ExportMetrics struct {
	ToolCallsTotal       int     `json:"tool_calls_total"`
	ToolCallsSuccess     int     `json:"tool_calls_success"`
	ToolCallsSuccessRate float64 `json:"tool_calls_success_rate"`
	PolicyBlocked        int     `json:"policy_blocked"`
	ApprovalRequired     int     `json:"approval_required"`
	RegressFailures      int     `json:"regress_failures"`
}

type ExportRecord

type ExportRecord struct {
	PackID          string        `json:"pack_id,omitempty"`
	PackType        string        `json:"pack_type,omitempty"`
	SourceRef       string        `json:"source_ref,omitempty"`
	ManifestDigest  string        `json:"manifest_digest,omitempty"`
	FilesChecked    int           `json:"files_checked"`
	HashMismatches  int           `json:"hash_mismatches"`
	MissingFiles    int           `json:"missing_files"`
	UndeclaredFiles int           `json:"undeclared_files"`
	SignatureStatus string        `json:"signature_status,omitempty"`
	SignaturesTotal int           `json:"signatures_total"`
	SignaturesValid int           `json:"signatures_valid"`
	CreatedAt       time.Time     `json:"created_at"`
	Metrics         ExportMetrics `json:"metrics"`
}

func BuildExportRecord

func BuildExportRecord(path string) (ExportRecord, error)

type HashMismatch

type HashMismatch struct {
	Path     string `json:"path"`
	Expected string `json:"expected"`
	Actual   string `json:"actual"`
}

type InspectResult

type InspectResult struct {
	PackID      string                  `json:"pack_id,omitempty"`
	PackType    string                  `json:"pack_type,omitempty"`
	SourceRef   string                  `json:"source_ref,omitempty"`
	Manifest    *schemapack.Manifest    `json:"manifest,omitempty"`
	RunPayload  *schemapack.RunPayload  `json:"run_payload,omitempty"`
	JobPayload  *schemapack.JobPayload  `json:"job_payload,omitempty"`
	CallPayload *schemapack.CallPayload `json:"call_payload,omitempty"`
	RunLineage  *RunLineage             `json:"run_lineage,omitempty"`
	JobLineage  *JobLineage             `json:"job_lineage,omitempty"`
	LegacyType  string                  `json:"legacy_type,omitempty"`
}

func Inspect

func Inspect(path string) (InspectResult, error)

type JobCheckpointRef

type JobCheckpointRef struct {
	CheckpointID string `json:"checkpoint_id"`
	Type         string `json:"type"`
	ReasonCode   string `json:"reason_code"`
}

type JobLineage

type JobLineage struct {
	EventCount     int                `json:"event_count"`
	LastEventType  string             `json:"last_event_type,omitempty"`
	CheckpointRefs []JobCheckpointRef `json:"checkpoint_refs,omitempty"`
}

type PostgresSQLOptions

type PostgresSQLOptions struct {
	Table      string
	IncludeDDL bool
}
type RunIntentResultLink struct {
	IntentID string `json:"intent_id"`
	ToolName string `json:"tool_name,omitempty"`
	Status   string `json:"status,omitempty"`
}

type RunLineage

type RunLineage struct {
	TimelineEvents int                   `json:"timeline_events"`
	ReceiptCount   int                   `json:"receipt_count"`
	IntentResults  []RunIntentResultLink `json:"intent_results,omitempty"`
}

type VerifyOptions

type VerifyOptions struct {
	PublicKey        ed25519.PublicKey
	RequireSignature bool
}

type VerifyResult

type VerifyResult struct {
	PackID          string         `json:"pack_id,omitempty"`
	PackType        string         `json:"pack_type,omitempty"`
	SourceRef       string         `json:"source_ref,omitempty"`
	FilesChecked    int            `json:"files_checked"`
	ProofRecords    int            `json:"proof_records_verified,omitempty"`
	MissingFiles    []string       `json:"missing_files,omitempty"`
	HashMismatches  []HashMismatch `json:"hash_mismatches,omitempty"`
	UndeclaredFiles []string       `json:"undeclared_files,omitempty"`
	SignatureStatus string         `json:"signature_status,omitempty"`
	SignatureErrors []string       `json:"signature_errors,omitempty"`
	SignaturesTotal int            `json:"signatures_total,omitempty"`
	SignaturesValid int            `json:"signatures_valid,omitempty"`
	LegacyType      string         `json:"legacy_type,omitempty"`
}

func Verify

func Verify(path string, options VerifyOptions) (VerifyResult, error)

Jump to

Keyboard shortcuts

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