artifact

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package artifact defines immutable revisions, exact references, lineage, and the public persistence contracts shared by Artifact families.

Index

Constants

View Source
const (
	MaxGenerationEvidence      = 32
	MaxGenerationEvidenceChars = 64_000
)
View Source
const (
	MaxFamilyLength = 128
	MaxIDLength     = 128
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](artifactID string, revision int64, draft Draft[T]) (Artifact[T], error)

func Restore

func Restore[T any](ref Ref, content T, lineage Lineage) (Artifact[T], error)

func (Artifact[T]) Content

func (a Artifact[T]) Content() T

func (Artifact[T]) ContentValue

func (a Artifact[T]) ContentValue() any

func (Artifact[T]) Family

func (a Artifact[T]) Family() string

func (Artifact[T]) ID

func (a Artifact[T]) ID() string

func (Artifact[T]) Lineage

func (a Artifact[T]) Lineage() Lineage

func (Artifact[T]) Ref

func (a Artifact[T]) Ref() Ref

func (Artifact[T]) Revision

func (a Artifact[T]) Revision() int64

type Catalog

type Catalog[T any] interface {
	Get(context.Context, Artifact[T]) (Artifact[T], error)
	Latest(context.Context, Artifact[T]) (Artifact[T], error)
	Revisions(context.Context, Artifact[T]) ([]Artifact[T], error)
}

type Draft

type Draft[T any] struct {
	// contains filtered or unexported fields
}

func NewDraft

func NewDraft[T any](family string, content T, sources []source.Ref, artifacts []Ref) (Draft[T], error)

func (Draft[T]) Content

func (d Draft[T]) Content() T

func (Draft[T]) ContentValue

func (d Draft[T]) ContentValue() any

func (Draft[T]) Family

func (d Draft[T]) Family() string

func (Draft[T]) Lineage

func (d Draft[T]) Lineage() Lineage

type DraftSnapshot

type DraftSnapshot interface {
	Family() string
	ContentValue() any
	Lineage() Lineage
}

DraftSnapshot is the non-generic write view used by relational stores whose family registry may contain several concrete content types.

type EvidenceKind

type EvidenceKind string
const (
	SourceEvidence   EvidenceKind = "source"
	ArtifactEvidence EvidenceKind = "artifact"
)

type FamilyMismatchError

type FamilyMismatchError struct {
	ArtifactFamily string
	DraftFamily    string
}

func (*FamilyMismatchError) Error

func (e *FamilyMismatchError) Error() string

type GenerationEvidence

type GenerationEvidence struct {
	EvidenceID string
	Kind       EvidenceKind
	Content    string
	Truncated  bool
}

func NewGenerationEvidence

func NewGenerationEvidence(id string, kind EvidenceKind, content string, truncated bool) (GenerationEvidence, error)

type GenerationInput

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

func NewGenerationInput

func NewGenerationInput(evidence []GenerationEvidence, targetEvidenceID *string) (GenerationInput, error)

func (GenerationInput) Evidence

func (i GenerationInput) Evidence() []GenerationEvidence

func (GenerationInput) TargetEvidenceID

func (i GenerationInput) TargetEvidenceID() *string

type InvalidReferenceError

type InvalidReferenceError struct {
	Field  string
	Detail string
}

func (*InvalidReferenceError) Error

func (e *InvalidReferenceError) Error() string

type Lineage

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

func NewLineage

func NewLineage(sources []source.Ref, artifacts []Ref) (Lineage, error)

func (Lineage) Artifacts

func (l Lineage) Artifacts() []Ref

func (Lineage) Sources

func (l Lineage) Sources() []source.Ref

type NotFoundError

type NotFoundError struct{ Ref Ref }

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type Ref

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

func NewRef

func NewRef(family, artifactID string, revision int64) (Ref, error)

func (Ref) Family

func (r Ref) Family() string

func (Ref) ID

func (r Ref) ID() string

func (Ref) IsZero

func (r Ref) IsZero() bool

func (Ref) Revision

func (r Ref) Revision() int64

func (Ref) String

func (r Ref) String() string

func (Ref) Validate

func (r Ref) Validate() error

type RevisionConflictError

type RevisionConflictError struct {
	Requested Ref
	Current   Ref
}

func (*RevisionConflictError) Error

func (e *RevisionConflictError) Error() string

type Service

type Service[T any] struct {
	// contains filtered or unexported fields
}

func NewService

func NewService[T any](catalog Catalog[T], store Store[T]) *Service[T]

func (*Service[T]) Add

func (s *Service[T]) Add(ctx context.Context, draft Draft[T]) (Artifact[T], error)

func (*Service[T]) Get

func (s *Service[T]) Get(ctx context.Context, value Artifact[T]) (Artifact[T], error)

func (*Service[T]) Latest

func (s *Service[T]) Latest(ctx context.Context, value Artifact[T]) (Artifact[T], error)

func (*Service[T]) Revise

func (s *Service[T]) Revise(ctx context.Context, current Artifact[T], draft Draft[T]) (Artifact[T], error)

func (*Service[T]) Revisions

func (s *Service[T]) Revisions(ctx context.Context, value Artifact[T]) ([]Artifact[T], error)

type Snapshot

type Snapshot interface {
	Ref() Ref
	ContentValue() any
	Lineage() Lineage
}

Snapshot is the non-generic read view used when evidence may cite different Artifact families.

type Store

type Store[T any] interface {
	Add(context.Context, Draft[T]) (Artifact[T], error)
	Revise(context.Context, Artifact[T], Draft[T]) (Artifact[T], error)
}

Directories

Path Synopsis
Package experience implements the reviewed Experience Artifact family.
Package experience implements the reviewed Experience Artifact family.
prompts
Package prompts owns the frozen Experience inference instructions.
Package prompts owns the frozen Experience inference instructions.
Package handoff implements temporary and durable Handoff lifecycles.
Package handoff implements temporary and durable Handoff lifecycles.
prompts
Package prompts owns the frozen Handoff inference instructions.
Package prompts owns the frozen Handoff inference instructions.
Package memory implements the Memory Artifact family and deterministic retrieval behavior.
Package memory implements the Memory Artifact family and deterministic retrieval behavior.
prompts
Package prompts owns the frozen Memory inference instructions.
Package prompts owns the frozen Memory inference instructions.
Package skill implements managed Skills and host-native external Skill registration.
Package skill implements managed Skills and host-native external Skill registration.
prompts
Package prompts owns the frozen managed-Skill inference instructions.
Package prompts owns the frozen managed-Skill inference instructions.

Jump to

Keyboard shortcuts

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