API reference
Look up all seven public operations and exported types.
Import from @0xbuff/retention. The root exports seven synchronous operations and their contract types; internal paths are not public.
| Operation | Result |
|---|---|
validatePolicy(policy) | Validated policy |
validateEvents(scopeId, events) | Validated distinct events |
rebuildReview(policy, scopeId, events, nowMs) | Complete review result |
advanceReview(policy, scopeId, identity, prior, appended, nowMs) | Rebuilt review after prefix verification |
evaluateReadiness(policy, scopeId, conceptId, events, nowMs) | Candidate projection or null |
scheduleDue(policy, scopeId, review, nowMs, relations?, limit?) | Ranked due recommendations |
explainReview(review) | Structured practice, candidate and lifecycle reasons |
Inputs are inert JSON data. Every operation returns Result<T>: either { ok: true, value } or { ok: false, errors }. Treat errors as stable codes and safe field names, not user-facing prose. Operations that need the current time require an explicit clock. A successful result does not authenticate evidence.
Guides
See policies, events, replay and due ranking for the input shapes, failure semantics and bounds.
Public types
| Area | Types |
|---|---|
| Events | CreditControl, CreditedDecisionCorrection, CreditedDecisionRevocation, CreditedEvidence, CreditedOutcome, DeletionControl, EligibleCreditedRetrieval, PracticeObservation, PracticeOutcome, ReviewControl, ReviewEvent, ReviewEventDeletion, ReviewObservation, ReviewScopeDeletion |
| Policies | CalendarProfile, CalendarTransition, EligibilityPolicy, Policy, PriorityWeights, SchedulingPolicy |
| Priority | ConceptRelation, DueRecommendation, PriorityFeatures, PriorityReason |
| Projections | CandidateProjection, CandidateReadiness, ConceptExplanation, ConceptProjection, PracticeProjection, PracticeReadiness, ProjectionIdentity, ReasonCode, RecommendationKind, ReviewExplanation, ReviewReason, ReviewResult, ScheduleState |
| Results | Diagnostic, ErrorCode, Result |
| Versions | AlgorithmVersion, SchemaVersion |
The v0.0.2 root entry defines the export list. Installed declarations give the exact signatures. See contracts for diagnostics and resource limits.