registry

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package registry resolves normalized item artifacts into immutable grounding data for future D&D consumers.

Index

Constants

View Source
const (
	ReferenceSlot = "item_registry"
	MaxBytes      = 1048576
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

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

Registry is an immutable, validated item registry prepared for grounding. All accessors return defensive copies.

func Resolve

func Resolve(references contracts.ReferenceSet) (*Registry, error)

Resolve prepares the optional item registry reference. An absent slot uses the exact empty prompt input and has no durable registry identity.

func (*Registry) Bound

func (r *Registry) Bound() bool

Bound reports whether an item reference was supplied and validated.

func (*Registry) CanonicalBytes

func (r *Registry) CanonicalBytes() []byte

CanonicalBytes returns a defensive copy of the canonical durable JSON.

func (*Registry) Count

func (r *Registry) Count() int

Count returns the number of validated item records.

func (*Registry) Digest

func (r *Registry) Digest() string

Digest returns the semantic SHA-256 digest of the canonical JSON, or an empty string when the registry is unbound.

func (*Registry) Items

func (r *Registry) Items() []dnd.Item

Items returns a defensive copy of the validated item records.

func (*Registry) List

func (r *Registry) List() dnd.ItemRegistry

List returns a defensive copy of the validated item registry.

func (*Registry) Lookup

func (r *Registry) Lookup(value string) (dnd.Item, bool)

Lookup returns the canonical item for an exact canonical-name match under the item identity comparison policy.

func (*Registry) LookupID

func (r *Registry) LookupID(value string) (dnd.Item, bool)

LookupID returns the canonical item for an exact durable ID.

func (*Registry) ProjectionDigest

func (r *Registry) ProjectionDigest() string

ProjectionDigest returns the SHA-256 digest of the exact names-only prompt projection, including for an unbound or empty registry.

func (*Registry) PromptInput

func (r *Registry) PromptInput() contracts.LLMInputMaterial

PromptInput returns the ordered names-only registry projection as a content-safe prompt input. Durable IDs, evidence, and provenance are omitted.

type Resolver

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

Resolver selects and memoizes immutable item registry views.

func NewResolver

func NewResolver(references contracts.ReferenceSet) (*Resolver, error)

NewResolver validates the optional construction-time item reference and prepares the operation-time registry cache.

func (*Resolver) Resolve

func (r *Resolver) Resolve(references contracts.ReferenceSet) (*Registry, error)

Resolve returns the generated operation-time registry when supplied, otherwise it returns the construction-time registry.

func (*Resolver) Seeded

func (r *Resolver) Seeded() *Registry

Seeded returns the immutable construction-time registry.

Jump to

Keyboard shortcuts

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