artifact

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultKind              = "tool_output"
	DefaultMIME              = "text/plain; charset=utf-8"
	DefaultSafeLabelMaxChars = 80
)

Variables

This section is empty.

Functions

func ClosureFingerprint added in v0.18.0

func ClosureFingerprint(sourceThreadID, destinationThreadID string, items []ManifestItem) (string, error)

func EqualClosure added in v0.18.0

func EqualClosure(left, right Closure) bool

func IsZeroClosure added in v0.18.0

func IsZeroClosure(closure Closure) bool

func RefFingerprint added in v0.18.0

func RefFingerprint(ref Ref) (string, error)

func SafeLabel

func SafeLabel(value string, maxChars int) string

func TextSHA256 added in v0.18.0

func TextSHA256(text string) string

func ValidateClosure added in v0.18.0

func ValidateClosure(closure Closure) error

ValidateClosure rejects non-canonical manifests. Callers must bind even an empty fork path to its exact source and destination thread identities.

func ValidateRef added in v0.18.0

func ValidateRef(ref Ref) error

Types

type Closure added in v0.18.0

type Closure struct {
	SourceThreadID      string         `json:"source_thread_id"`
	DestinationThreadID string         `json:"destination_thread_id"`
	Items               []ManifestItem `json:"items"`
	Fingerprint         string         `json:"fingerprint"`
}

Closure is the deterministic deduplicated artifact manifest for one exact source path and one destination thread.

func CloneClosure added in v0.18.0

func CloneClosure(in Closure) Closure

type Content added in v0.18.0

type Content struct {
	Ref  Ref
	Text string
}

Content is the only artifact read result exposed above the storage kernel.

type FullOutput added in v0.18.0

type FullOutput struct {
	Text string `json:"text"`
	Kind string `json:"kind"`
	MIME string `json:"mime"`
}

FullOutput is the immutable full-text payload presented to the artifact authority as part of one effect-dispatch terminal commit.

func NormalizeFullOutput added in v0.18.0

func NormalizeFullOutput(in FullOutput) FullOutput

NormalizeFullOutput returns the canonical payload policy values.

type ManifestItem added in v0.18.0

type ManifestItem struct {
	SourceEntryID  string `json:"source_entry_id"`
	ArtifactID     string `json:"artifact_id"`
	Ref            Ref    `json:"ref"`
	RefFingerprint string `json:"ref_fingerprint"`
	PayloadSHA256  string `json:"payload_sha256"`
}

ManifestItem pins one on-path canonical entry/reference/payload relation for a root or SubAgent fork copy.

func CloneManifest added in v0.18.0

func CloneManifest(items []ManifestItem) []ManifestItem

type Record added in v0.18.0

type Record struct {
	ThreadID         string
	Ref              Ref
	Text             string
	CanonicalEntryID string
	CreatedAt        time.Time
}

Record is one immutable thread-scoped artifact row. CanonicalEntryID binds the payload to the exact tool-result entry admitted in the same transaction.

func CloneRecord added in v0.18.0

func CloneRecord(in Record) Record

type Ref

type Ref struct {
	ID        string `json:"id,omitempty"`
	SafeLabel string `json:"safe_label,omitempty"`
	Kind      string `json:"kind,omitempty"`
	MIME      string `json:"mime,omitempty"`
	SizeBytes int64  `json:"size_bytes,omitempty"`
	SHA256    string `json:"sha256,omitempty"`
}

Ref is the immutable public-safe identity of one Floret-owned artifact. It intentionally contains no host route, filesystem path, or product key.

func CloneRefPtr added in v0.18.0

func CloneRefPtr(in *Ref) *Ref

func RefForEffect added in v0.18.0

func RefForEffect(effectAttemptID, toolName string, full FullOutput) (Ref, error)

RefForEffect deterministically derives a thread-scoped reference from the Store-assigned effect-attempt identity and immutable payload.

Jump to

Keyboard shortcuts

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