artifacts

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DraftVersion          = "0.1.0-draft"
	EvaluatorDraftVersion = "0.2.0-draft"
)

DraftVersion is the specification version every surface selects when a caller names none. EvaluatorDraftVersion is the newer bundled draft, whose Core adds the evaluator conformance class (§3.4) and publishes the evaluation corpus (§3.4.1); bundling it changes no default. It is also the exact version the claim in CONFORMANCE.md is made against and the only version this runtime's evaluator admits (§11), and a claim is not inherited by any other version, so bundling a third version would claim nothing by itself either.

Variables

This section is empty.

Functions

func SupportedVersions

func SupportedVersions() []string

Types

type Digest

type Digest struct {
	Algorithm string `json:"algorithm"`
	Value     string `json:"value"`
}

type ExampleInfo added in v0.1.0

type ExampleInfo struct {
	Name        string
	Focus       string
	SpecSection string
}

ExampleInfo describes one bundled valid example: its stable name (the case file stem), the one-line focus from the manifest, and the specification section it exercises. It is metadata only; Example returns the bytes.

type FileLock

type FileLock struct {
	Path   string `json:"path"`
	Bytes  int    `json:"bytes"`
	SHA256 string `json:"sha256"`
}

type Lock

type Lock struct {
	FormatVersion int        `json:"formatVersion"`
	SpecVersion   string     `json:"specVersion"`
	Source        LockSource `json:"source"`
	BundleDigest  Digest     `json:"bundleDigest"`
	Files         []FileLock `json:"files"`
}

type LockSource

type LockSource struct {
	Repository    string `json:"repository"`
	Kind          string `json:"kind"`
	BaseCommit    string `json:"baseCommit"`
	Ref           string `json:"ref,omitempty"`
	WorktreeDirty bool   `json:"worktreeDirty"`
}

type Set

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

func Load

func Load(version string) (*Set, error)

func (*Set) Case

func (s *Set) Case(relative string) ([]byte, error)

func (*Set) EvaluationManifest added in v0.4.0

func (s *Set) EvaluationManifest() ([]byte, error)

EvaluationManifest returns the bundled evaluation-corpus manifest bytes.

func (*Set) EvaluationManifestSchema added in v0.4.0

func (s *Set) EvaluationManifestSchema() ([]byte, error)

EvaluationManifestSchema returns the schema the evaluation-corpus manifest is carried by.

func (*Set) EvaluationPack added in v0.4.0

func (s *Set) EvaluationPack(relative string) ([]byte, error)

EvaluationPack returns one evaluation-corpus pack fixture by its manifest path, which is always a single file directly under packs/. Anything else is refused before a path is built, so a manifest cannot reach an artifact outside the corpus even though every read is also checked against the lock.

func (*Set) Example added in v0.1.0

func (s *Set) Example(name string) ([]byte, ExampleInfo, error)

Example returns one bundled valid example's document bytes and metadata by name. The name is resolved against the enumerated examples, never used to build a path from caller input, so it cannot escape the embedded valid-case set; an unknown name yields *UnknownExampleError.

func (*Set) Examples added in v0.1.0

func (s *Set) Examples() ([]ExampleInfo, error)

Examples enumerates the bundled valid conformance cases as examples, sorted by name. These are the digest-locked fixtures the set already embeds, offered read-only; they are version-pinned corpus fixtures, not authored templates.

func (*Set) File

func (s *Set) File(relative string) (FileLock, bool)

func (*Set) HasEvaluationCorpus added in v0.4.0

func (s *Set) HasEvaluationCorpus() bool

HasEvaluationCorpus reports whether this set bundles the evaluation corpus of JPS §3.4.1. A specification version whose Core defines no evaluator class publishes none.

func (*Set) Lock

func (s *Set) Lock() Lock

func (*Set) Manifest

func (s *Set) Manifest() ([]byte, error)

func (*Set) ManifestSchema

func (s *Set) ManifestSchema() ([]byte, error)

func (*Set) Read

func (s *Set) Read(relative string) ([]byte, error)

func (*Set) Schema

func (s *Set) Schema() ([]byte, error)

type UnknownExampleError added in v0.1.0

type UnknownExampleError struct {
	Name string
}

UnknownExampleError reports a request for an example name that is not one of the bundled valid examples.

func (*UnknownExampleError) Error added in v0.1.0

func (e *UnknownExampleError) Error() string

type UnsupportedVersionError

type UnsupportedVersionError struct {
	Version string
}

func (*UnsupportedVersionError) Error

func (e *UnsupportedVersionError) Error() string

Jump to

Keyboard shortcuts

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