0xBUFF / retention

Architecture

Follow the deterministic replay pipeline and host authority boundaries.

Retention calculates review projections from a policy, a clock and a bounded history for one scope. Its seven public operations are described in the API guide. The package root also exports TypeScript contracts. Internal modules are not public entry points.

Reconciliation validates event identities, applies controls in durable sequence order and sorts surviving observations for replay. The scheduling layer computes due dates and support recommendations. Candidate readiness uses only surviving credited evidence and the optional eligibility policy. Ranking checks a compatible current projection; explanation reads reason codes without rerunning the scheduler.

Module boundaries

ModuleResponsibility
src/index.tsExplicit public exports
src/contracts/ and src/errors.tsVersioned data shapes and safe diagnostics
src/validation/Closed schemas, input bounds and compatibility checks
src/time/Checked elapsed and local-calendar arithmetic
src/events/Canonical identity, ordering and lifecycle resolution
src/replay/Reconciliation, watermark and public replay orchestration
src/scheduling/Practice transitions and interval arithmetic
src/readiness/Eligible-only qualification and streak aggregation
src/priority/Relation validation and deterministic due ranking
src/explanation/Fixed reason codes and lifecycle explanations

The core is synchronous and does not mutate caller inputs. Lower layers do not import public orchestration or the root entry. Time arithmetic uses the supplied clock and calendar profile, without reading the environment or system timezone data. The runtime has no external dependencies, filesystem or network access.

Data and authority

Practice and admitted evidence both influence the practice schedule. Only credited observations can satisfy the eligibility policy. A candidate result is advisory. The host authenticates evidence and scope, maintains complete history, handles storage and physical erasure, rejects stale generations and makes official decisions.

Integration

Use the integration guide to connect Retention to an application. See events, policies, replay and due ranking for the behavior of each operation. The development guide covers the test suites, build and architecture checks.

On this page