Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ValidTypes = []Type{ TypeFact, TypeDecision, TypePreference, TypeContext, TypeSkill, TypeIntent, TypeObservation, TypeNote, TypeDivergence, }
Functions ¶
func ContentHash ¶ added in v0.5.0
ContentHash returns the SHA-256 hash of a trace body, prefixed with "sha256:" for algorithm-explicitness. Used for integrity verification and federation sync optimization.
func IsValidType ¶
func NewID ¶
NewID generates a trace ID from a title: YYYYMMDD-slugified-title.
If the slugified title already begins with a date prefix (either `YYYYMMDD-` or `YYYY-MM-DD-`), the leading date is stripped before today's date is prepended. This is a defensive measure: agents commonly include dates in titles to mark when an event occurred (e.g., "20260402 dadbot heartbeat check"), and without the strip the resulting ID would carry two date prefixes (`20260402-20260402-dadbot-heartbeat-check`). The strip does not validate that the digits form a real calendar date — its only job is to prevent visual prefix duplication in the final ID.
Types ¶
type Frontmatter ¶
type Frontmatter struct {
ID string `yaml:"id"`
Title string `yaml:"title"`
Type string `yaml:"type"`
Author string `yaml:"author,omitempty"`
Tags []string `yaml:"tags,omitempty"`
DerivedFrom []string `yaml:"derived_from,omitempty"`
Origin string `yaml:"origin,omitempty"`
Created string `yaml:"created"`
Updated string `yaml:"updated"`
ContentHash string `yaml:"content_hash,omitempty"`
SourceHash string `yaml:"source_hash,omitempty"`
SourceLocked bool `yaml:"source_locked,omitempty"`
}
type Trace ¶
type Trace struct {
Frontmatter
Body string
}