0xBUFF / retention

Contracts and limits

Understand result variants, diagnostic codes, schema versions and resource ceilings.

Results

Each public operation is synchronous and returns a discriminated result. Check ok before accessing the value.

type Result<T> =
  | { readonly ok: true; readonly value: T }
  | { readonly ok: false; readonly errors: readonly Diagnostic[] };

Diagnostics contain a code and, where applicable, a safe field name or numeric limit. They do not carry raw learner payloads. A failure has no partial authoritative projection. Use your own user-facing messages for diagnostic codes.

CodeMeaning
INVALID_EVENTEvent shape or event-related field is invalid.
SCOPE_MISMATCHSupplied scope differs from the event or projection scope.
EVENT_ID_CONFLICTDifferent event content shares an event ID.
SEQUENCE_CONFLICTDifferent event IDs share a durable sequence.
INVALID_CORRECTIONA lifecycle target or decision chain is invalid.
MISSING_CORRECTION_TARGETA required earlier credit decision is absent.
INVALID_POLICYPolicy shape or field is invalid.
POLICY_MISMATCHThe supplied policy is incompatible with the projection.
INVALID_RELATIONRelation shape, endpoint or prerequisite graph is invalid.
INVALID_TIMESTAMPTimestamp or checked time arithmetic is invalid.
UNSUPPORTED_VERSIONSchema or algorithm version is unsupported.
REBUILD_REQUIREDAdvance cannot verify the supplied prior identity and history.
CALENDAR_PROFILE_MISMATCHSupplied calendar coverage or resolution is insufficient.
RESOURCE_LIMIT_EXCEEDEDAn input or derived bound was exceeded.

Versions and identity

Schema version is the number 1; algorithm version is the string "1". Author policy and eligibility versions explicitly. Policy identity includes the complete normalized content with ordered arrays, so changing intervals under the same version still changes identity. Rebuild after a policy change.

Input limits

InputBound
Raw event entries20,000
Distinct events10,000
Distinct concepts1,000
Raw relations10,000
Calendar transitions4,096
Review intervals1 to 64
Interval, retry or maintenance days1 to 3,650
Identifier length128 ASCII characters
Reason code length1 to 256 UTF-16 code units
Ordinary aggregate string values4,000,000 UTF-16 code units per applicable operation
Support threshold and qualifying successes1 to 1,000
Hints, ladder and ranking weights0 to 1,000
Calendar offsets-1,440 to 1,440 minutes
Unix millisecond instants-8,640,000,000,000,000 to 8,640,000,000,000,000

Identifiers start with an ASCII letter or digit and may subsequently contain letters, digits, period, underscore, colon or hyphen. Sequences are nonnegative safe integers. The candidate qualifying span is checked against the supported instant bound; the eligibility minimum span accepts nonnegative safe integers. Derived identity encodings have separate size bounds.

Aggregate budgets depend on the operation and include raw duplicate entries where applicable. See events, replay and due ranking.

Validation boundary

Supply inert JSON data with own enumerable data properties and dense ordinary arrays. The host must limit untrusted serialized input before materialization. JavaScript reflection can allocate according to the width of malformed already-materialized objects. Validation is not a sandbox for hostile objects or proxies.

The public source contracts and installed declarations define the exact types. Retention does not authenticate the source of an event or prove a history complete.

On this page