memory

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ExpectedSchemaContractSHA256 = "064ad5ef7fcdaacd086a0bf21ae4de6b62006498f6a451a2fcf7b9bcbdb05f5b"

Variables

This section is empty.

Functions

func Decode

func Decode(data []byte) (Memory, []SchemaProblem)

func Discover

func Discover(root string) (sidecars []string, markdown []string, err error)

func DiscoverStrict added in v0.8.0

func DiscoverStrict(root string) (sidecars []string, markdown []string, err error)

DiscoverStrict discovers canonical memory pairs only after proving the whole memories tree is composed of real directories and regular files.

func Load

func Load(path string) (Memory, []SchemaProblem)

func LoadUnder added in v0.8.0

func LoadUnder(root, rel string) (Memory, []SchemaProblem)

LoadUnder reads a repository-relative memory sidecar without following symbolic links in the repository root, ancestor directories, or final file.

func ValidateSchemaContract

func ValidateSchemaContract(root string) error

func ValidateSchemaContractStrict added in v0.8.0

func ValidateSchemaContractStrict(root string) error

ValidateSchemaContractStrict verifies the vendored schema without following repository-root, ancestor, or leaf symbolic links.

Types

type Entity

type Entity struct {
	Kind string `json:"kind"`
	Name string `json:"name"`
}

type Memory

type Memory struct {
	SchemaVersion  int            `json:"schema_version"`
	ID             string         `json:"id"`
	Title          string         `json:"title"`
	Type           string         `json:"type"`
	Lifecycle      string         `json:"lifecycle"`
	Summary        string         `json:"summary"`
	Projects       []string       `json:"projects"`
	Topics         []string       `json:"topics"`
	Tags           []string       `json:"tags"`
	Aliases        []string       `json:"aliases"`
	Entities       []Entity       `json:"entities"`
	Importance     string         `json:"importance"`
	Temporal       Temporal       `json:"temporal"`
	Provenance     Provenance     `json:"provenance"`
	Relationships  []Relationship `json:"relationships"`
	ContentPath    string         `json:"content_path"`
	Sensitivity    string         `json:"sensitivity"`
	OpenLoopStatus *string        `json:"open_loop_status,omitempty"`
}

type Provenance

type Provenance struct {
	Basis                 string   `json:"basis"`
	Confidence            string   `json:"confidence"`
	ExplicitMemoryRequest bool     `json:"explicit_memory_request"`
	Sources               []Source `json:"sources"`
}

type Record

type Record struct {
	Path   string
	Memory Memory
}

func LoadAll

func LoadAll(root string) ([]Record, error)

func LoadAllStrict added in v0.8.0

func LoadAllStrict(root string) ([]Record, error)

LoadAllStrict loads all canonical sidecars from a strict memories tree.

type Relationship

type Relationship struct {
	Type     string  `json:"type"`
	TargetID string  `json:"target_id"`
	Note     *string `json:"note"`
}

type SchemaProblem

type SchemaProblem struct {
	Field   string
	Message string
}

func (SchemaProblem) Error

func (p SchemaProblem) Error() string

type Source

type Source struct {
	Kind     string  `json:"kind"`
	Locator  string  `json:"locator"`
	Revision *string `json:"revision"`
	Note     *string `json:"note"`
}

type Temporal

type Temporal struct {
	CreatedAt      string  `json:"created_at"`
	UpdatedAt      string  `json:"updated_at"`
	EffectiveFrom  *string `json:"effective_from"`
	EffectiveUntil *string `json:"effective_until"`
}

Jump to

Keyboard shortcuts

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