Documentation
¶
Index ¶
- Constants
- Variables
- func EpisodeRef(scope Scope, runRef, sourceGroupRef string) string
- func ValidStableRef(ref string) bool
- func Validate(event SourceEvent, binding EpisodeBinding) error
- func ValidateMemoryDelivery(delivery MemoryDelivery) error
- func ValidateOutcomeReport(report OutcomeReport) error
- type ActorKind
- type Constitution
- type Episode
- type EpisodeBinding
- type Ledger
- type MemoryDelivery
- type MemoryDeliveryReceipt
- type ObserveReceipt
- type OutcomeReceipt
- type OutcomeReport
- type Scope
- type ScopeKind
- type SourceEvent
- type SourceLink
- type SourceRole
Constants ¶
const MaxSourceTextBytes = 64 * 1024
MaxSourceTextBytes bounds one immutable observation before it can poison every later overlap window. It is an operational byte limit, not a semantic confidence or importance score.
const MaxStableRefBytes = 384
MaxStableRefBytes is the shared PostgreSQL/MySQL acceptance boundary for every persisted identity and idempotency reference. It is a storage interoperability limit, not a semantic weight.
Variables ¶
var ( ErrInvalidMemoryDelivery = errors.New("invalid memory delivery") ErrMemoryDeliveryConflict = errors.New("memory delivery key already identifies a different request") ErrInvalidOutcomeReport = errors.New("invalid outcome report") ErrOutcomeReportConflict = errors.New("outcome key already identifies a different request") )
var ( ErrInvalidSourceEvent = errors.New("invalid source event") ErrInvalidEpisodeBinding = errors.New("invalid episode binding") ErrSourceEventConflict = errors.New("source event ref already identifies different immutable input") ErrIdempotencyConflict = errors.New("idempotency key already identifies different request") ErrEpisodeSealed = errors.New("materialized episode only accepts existing links or new outcomes") )
Functions ¶
func EpisodeRef ¶
EpisodeRef derives the stable identity of one exact scope/run/source group.
func ValidStableRef ¶
ValidStableRef reports whether a required reference is safe and identical across every relational adapter.
func Validate ¶
func Validate(event SourceEvent, binding EpisodeBinding) error
Validate deterministically validates one causal intake command without reading or mutating storage.
func ValidateMemoryDelivery ¶
func ValidateMemoryDelivery(delivery MemoryDelivery) error
func ValidateOutcomeReport ¶
func ValidateOutcomeReport(report OutcomeReport) error
Types ¶
type ActorKind ¶
type ActorKind string
ActorKind is trusted provenance supplied after transport authentication.
type Constitution ¶
Constitution is an immutable external normative snapshot, never writable Memory. The zero value represents an unknown baseline.
type Episode ¶
type Episode struct {
Ref string
Scope Scope
RunRef string
SourceGroupRef string
Links []SourceLink
}
Episode is the deterministic envelope for one stable run/source group. Links are returned in role then source-ref order.
type EpisodeBinding ¶
type EpisodeBinding struct {
RunRef string
SourceGroupRef string
Role SourceRole
}
EpisodeBinding requests one typed provenance link in a stable run/source group. An incomplete binding admits the SourceEvent without guessing a boundary and can be retried later with all fields present.
type Ledger ¶
type Ledger struct {
// contains filtered or unexported fields
}
Ledger runs after transport request-idempotency. It admits immutable SourceEvents and materializes Episodes once distinct sources provide a situation and an actual agent act. It deliberately contains no semantic or time-based boundary inference.
func (*Ledger) Observe ¶
func (l *Ledger) Observe(event SourceEvent, binding EpisodeBinding) (Episode, bool, error)
Observe admits event, then appends binding when it is complete. Reusing one immutable source with a different binding is a separate relation command, not a retry of the transport request. Complete invalid bindings fail before either the source or relation is mutated.
type MemoryDelivery ¶
type MemoryDelivery struct {
IdempotencyKey string
Scope Scope
RunRef string
MemoryContextRef string
DeliveredMemoryRefs []string
}
MemoryDelivery states only which stable memories a Harness can prove were exposed. It does not claim that the model used them.
type MemoryDeliveryReceipt ¶
type MemoryDeliveryReceipt struct {
Ref string
}
type ObserveReceipt ¶
ObserveReceipt is the immutable result frozen by one transport idempotency key. EpisodeRef is empty until that request materializes or appends to an already materialized Episode.
type OutcomeReceipt ¶
type OutcomeReport ¶
type OutcomeReport struct {
IdempotencyKey string
Event SourceEvent
RunRef string
SourceGroupRef string
DeliveryReceiptRefs []string
RelatedSourceEventRefs []string
}
OutcomeReport is an observed source-bound result, never a reinforcement instruction. Delivery attribution remains optional.
type ScopeKind ¶
type ScopeKind string
Scope is the exact authorization boundary shared by an Episode and all of its SourceEvents. SessionRef may be empty, but when present is part of the exact boundary and Episode identity.
type SourceEvent ¶
type SourceEvent struct {
Ref string
Scope Scope
ActorKind ActorKind
ActorRef string
Text string
Constitution Constitution
}
SourceEvent is an immutable input value within its exact Scope. Episode membership and role are separate relations, not properties of the source.
type SourceLink ¶
type SourceLink struct {
SourceEventRef string
Role SourceRole
}
SourceLink is a typed provenance edge from an Episode to a SourceEvent.
type SourceRole ¶
type SourceRole string
SourceRole states how a SourceEvent is linked to an Episode.
const ( RoleSituation SourceRole = "situation" RoleAgentAct SourceRole = "agent_act" RoleOutcome SourceRole = "outcome" )