Versions in this module Expand all Collapse all v1 v1.10.4 Nov 4, 2026 v1.10.3 Oct 30, 2026 v1.10.2 Oct 30, 2026 v1.10.1 Oct 30, 2026 v1.10.0 Oct 30, 2026 v1.9.0 Oct 27, 2026 Changes in this version + const PrefixLesson + var ErrConflict = errors.New("cortex: learning: conflicting lesson revision") + var ErrDenied = errors.New("cortex: learning: access denied") + var ErrIneligible = errors.New("cortex: learning: evidence is not eligible") + var ErrInvalid = errors.New("cortex: learning: invalid lesson") + var ErrNotFound = errors.New("cortex: learning: lesson not found") + var ErrUnavailable = errors.New("cortex: learning: capability unavailable") + func Digest(lesson Lesson) (string, error) + func ValidateContent(domain, statement string, applicability, contraindications []string) error + func ValidateProvenance(provenance run.ExecutionProvenance) error + func ValidatePurpose(purpose run.ExecutionPurpose, state run.State, status verification.Status) error + func ValidateSnapshot(lesson Lesson, snapshot verification.ResultSnapshot, at time.Time) error + type AcceptRequest struct + Actor string + Applicability []string + Contraindications []string + Corrects *Ref + Domain string + ExpiresAt time.Time + ID id.ID + Result verification.ResultReadRequest + type Action string + const ActionDelete + const ActionPublish + const ActionRead + const ActionRetry + const ActionRevoke + type Authorizer interface + AuthorizeLesson func(context.Context, Action, Resource) error + type DeletionRequest struct + Actor string + ExpectedRevision int64 + ID id.ID + Reason string + type EvidenceClass string + const EvidenceContrastive + const EvidenceExploratory + const EvidenceFailedApproach + const EvidenceObservation + const EvidenceValidated + func ClassifyActivity(state run.State) EvidenceClass + type Guard struct + func NewGuard(config GuardConfig) (*Guard, error) + func (g *Guard) Accept(ctx context.Context, request AcceptRequest) (Publication, error) + func (g *Guard) AcceptResult(ctx context.Context, request AcceptRequest, ...) (PublicationSummary, error) + func (g *Guard) Authorize(ctx context.Context, action Action, identifier id.ID, domain string) error + func (g *Guard) Delete(ctx context.Context, request DeletionRequest) (Tombstone, error) + func (g *Guard) Publications(ctx context.Context, after string, limit int) (PublicationReviewPage, error) + func (g *Guard) Resolve(ctx context.Context, ref Ref) (Lesson, error) + func (g *Guard) Retry(ctx context.Context, identifier id.ID, revision, generation int64) error + func (g *Guard) Review(ctx context.Context, identifier id.ID) (LessonSummary, error) + func (g *Guard) Revoke(ctx context.Context, request RevokeRequest) (Publication, error) + func (g *Guard) WithLesson(ctx context.Context, ref Ref, action Action, ...) (Lesson, error) + type GuardConfig struct + Authority Authorizer + Clock verification.Clock + ContentAuthority verification.ResultContentAuthorizer + Fence verification.CommitFence + Repository Repository + Results verification.ResultContentStore + type Lesson struct + Applicability []string + Contraindications []string + Corrects *Ref + CreatedAt time.Time + DecisionIDs []id.ID + Domain string + EvidenceClass EvidenceClass + ExpiresAt time.Time + HarnessSchema int + ID id.ID + Result *verification.ResultReadRequest + Revision int64 + RevocationReason string + RevokedAt time.Time + Scope cortex.Scope + SourceReports []ReportRef + Statement string + SupersededBy *Ref + TrialIDs []id.ID + func (lesson Lesson) Validate(at time.Time) error + type LessonSummary struct + Corrects *Ref + CreatedAt time.Time + Domain string + EvidenceClass EvidenceClass + ExpiresAt time.Time + Ref Ref + RevokedAt time.Time + SourceResultID id.ID + SourceRunID id.AgentRunID + SupersededBy *Ref + type Page struct + Items []Lesson + Next string + type Publication struct + AcceptanceDigest string + Actor string + AggregateID string + Attempts int + ErrorCode string + Generation int64 + LeaseUntil time.Time + LessonID id.ID + NextAttempt time.Time + Operation string + Owner string + Payload Lesson + PayloadDigest string + Receipt *Receipt + Revision int64 + SourceID id.ID + type PublicationPage struct + After string + Items []Publication + type PublicationReviewPage struct + After string + Items []PublicationSummary + type PublicationSummary struct + Acknowledged bool + Attempts int + Domain string + ErrorCode string + Generation int64 + LeaseUntil time.Time + LessonID id.ID + NextAttempt time.Time + Operation string + PayloadDigest string + Revision int64 + type Publisher struct + func NewPublisher(repository Repository, sink Sink, guard *Guard, owner string) (*Publisher, error) + func (p *Publisher) Retry(ctx context.Context, publication Publication) error + func (p *Publisher) WorkPage(ctx context.Context, after string) (string, error) + type Query struct + Cursor string + Cutoff time.Time + Domain string + HarnessSchema int + Limit int + Query string + Scope cortex.Scope + type Receipt struct + AcknowledgedAt time.Time + AggregateID string + LessonID id.ID + PayloadDigest string + Version int64 + type Ref struct + Digest string + ID id.ID + Revision int64 + type ReportRef struct + Digest string + ID id.ID + type Repository interface + AcceptLesson func(context.Context, AcceptRequest) (Publication, error) + ClaimLessonPublication func(context.Context, id.ID, int64, string) (Publication, error) + CompleteLessonPublication func(context.Context, Publication, *Receipt, string) error + GetLesson func(context.Context, id.ID) (Lesson, error) + GetLessonPublication func(context.Context, id.ID, int64) (Publication, error) + ListLessonPublications func(context.Context, string, int) (PublicationPage, error) + ResolveLesson func(context.Context, Ref) (Lesson, error) + RetryLessonPublication func(context.Context, id.ID, int64, int64) error + RevokeLesson func(context.Context, RevokeRequest) (Publication, error) + type Resource struct + Domain string + ID id.ID + Scope cortex.Scope + type RetentionStore interface + DeleteLesson func(context.Context, DeletionRequest) (Tombstone, error) + GetLessonTombstone func(context.Context, id.ID) (Tombstone, error) + ListLessonTombstones func(context.Context, string, int) (TombstonePage, error) + type RevokeRequest struct + Actor string + ExpectedRevision int64 + ID id.ID + Reason string + type Sink interface + Deliver func(context.Context, Publication) (Receipt, error) + type Store interface + Publish func(context.Context, Lesson) (Receipt, error) + Recall func(context.Context, Query) (Page, error) + Revoke func(context.Context, RevokeRequest) error + type Tombstone struct + Actor string + AggregateID string + DeletedAt time.Time + Digest string + ID id.ID + Reason string + Revision int64 + Scope cortex.Scope + type TombstonePage struct + After string + Items []Tombstone