runstore

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package runstore persists immutable, canonical local run artifacts. It does not upload data or interpret compatibility results.

Index

Constants

View Source
const (
	RecordSchema = "urn:agentapi-doctor:local-run-record:v1alpha2"

	DefaultMaxRecordBytes int64 = 64 << 20
)

Variables

View Source
var (
	ErrExists          = errors.New("run already exists")
	ErrCorrupt         = errors.New("local run record is corrupt")
	ErrLatestForbidden = errors.New("latest run reference requires explicit --allow-latest")
	ErrRootReplaced    = errors.New("run store root identity changed")
)

Functions

This section is empty.

Types

type Payload

type Payload struct {
	Bundle []byte
	Plan   []byte
}

Payload keeps the two canonical documents named at the call site so bundle and plan bytes cannot be silently swapped.

type Record

type Record struct {
	SchemaVersion string            `json:"schema_version"`
	RunID         schema.InstanceID `json:"run_id"`
	BundleDigest  schema.Digest     `json:"bundle_digest"`
	Bundle        json.RawMessage   `json:"bundle"`
	PlanDigest    schema.Digest     `json:"plan_digest,omitempty"`
	Plan          json.RawMessage   `json:"plan,omitempty"`
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func Open

func Open(root string, maxBytes int64) (*Store, error)

func (*Store) Get

func (store *Store) Get(reference string, allowLatest bool) (Record, error)

func (*Store) List

func (store *Store) List() ([]schema.InstanceID, error)

func (*Store) Put

func (store *Store) Put(runID schema.InstanceID, payload Payload) (schema.Digest, error)

Put publishes one canonical JSON bundle and canonical plan snapshot together under the immutable UUIDv7 run ID. PlanDigest is the digest of the complete embedded snapshot bytes, distinct from any nested ResolvedRunPlan digest.

func (*Store) Resolve

func (store *Store) Resolve(reference string, allowLatest bool) (schema.InstanceID, error)

Jump to

Keyboard shortcuts

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