@0xbuff/retention 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/README.md +35 -87
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
Notable changes to Retention are recorded here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the
|
|
3
|
+
Notable changes to Retention are recorded here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the package uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.0.2] - 2026-11-29
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Updated public documentation, installation guidance, event reference and architecture diagrams.
|
|
12
|
+
- Made packed-package verification use the version in the package manifest.
|
|
13
|
+
- Added protected, stage-only npm trusted publishing with exact CI artifact checks and synthetic preflight tests.
|
|
14
|
+
- Added a read-only release audit for registry version availability and locked development dependencies.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Retry temporary browser profile removal on transient filesystem errors during package verification.
|
|
19
|
+
|
|
20
|
+
## [0.0.1] - 2026-11-29
|
|
21
|
+
|
|
7
22
|
### Added
|
|
8
23
|
|
|
9
24
|
- Repository development instructions, contribution and security policies, issue and pull request templates.
|
package/README.md
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
# Retention
|
|
2
2
|
|
|
3
|
-
[](https://github.com/0xbuffdev/retention/actions/workflows/ci.yml) [](https://github.com/0xbuffdev/retention/blob/main/LICENSE)
|
|
3
|
+
[](https://github.com/0xbuffdev/retention/actions/workflows/ci.yml) [](https://www.npmjs.com/package/@0xbuff/retention) [](https://github.com/0xbuffdev/retention/blob/main/LICENSE) [](https://github.com/0xbuffdev/retention/blob/main/package.json)
|
|
4
4
|
|
|
5
|
-
Retention is a review-scheduling engine for learning applications. It uses
|
|
5
|
+
Retention is a review-scheduling engine for learning applications. It uses a review policy and a history of learning observations to calculate when concepts are due for review, when learners need more practice and which reviews to prioritize.
|
|
6
6
|
|
|
7
|
-
Use it in
|
|
8
|
-
|
|
9
|
-
Retention has no runtime dependencies. The first release candidate is `@0xbuff/retention@0.0.1`. Registry publication is subject to maintainer approval.
|
|
7
|
+
Use it in flashcard apps or learning tools for mathematics and programming. Retention works offline, has no runtime dependencies and gives the same result for the same policy, history and clock. Applications own the learning records and any official assessment decisions.
|
|
10
8
|
|
|
11
9
|
## Installation
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
Retention requires Node.js 24 or later and ESM. Browser applications can use the ESM entry with an ES2022-compatible environment.
|
|
14
12
|
|
|
15
13
|
```sh
|
|
16
|
-
npm install @0xbuff/retention
|
|
14
|
+
npm install @0xbuff/retention
|
|
17
15
|
```
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
Pin the version you have tested when deploying an application.
|
|
20
18
|
|
|
21
19
|
## Quick start
|
|
22
20
|
|
|
23
|
-
Schedule a
|
|
21
|
+
Schedule a review for a successfully recalled concept. This example uses elapsed days and evaluates the history one day after the observation.
|
|
24
22
|
|
|
25
23
|
```ts
|
|
26
24
|
import {
|
|
@@ -69,116 +67,66 @@ if (!due.ok || due.value[0]?.dueAtMs !== day) {
|
|
|
69
67
|
console.log(due.value);
|
|
70
68
|
```
|
|
71
69
|
|
|
72
|
-
The
|
|
73
|
-
|
|
74
|
-
## How it works
|
|
75
|
-
|
|
76
|
-
Suppose a learner successfully recalls a concept on Monday. A review policy can schedule the next attempt for Tuesday, then increase the interval after each successful review. If the learner struggles, the policy can schedule an earlier retry or recommend additional practice.
|
|
77
|
-
|
|
78
|
-
For example, with intervals of 1, 3, 7, 16 and 35 elapsed days, a learner who passes each review when due follows this schedule:
|
|
79
|
-
|
|
80
|
-
| Retrieval succeeds on | Next review |
|
|
81
|
-
| --------------------- | ----------------------------------------- |
|
|
82
|
-
| Day 0 | Day 1 |
|
|
83
|
-
| Day 1 | Day 4 |
|
|
84
|
-
| Day 4 | Day 11 |
|
|
85
|
-
| Day 11 | Day 27 |
|
|
86
|
-
| Day 27 | Day 62 |
|
|
87
|
-
| Day 62 | After the configured maintenance interval |
|
|
88
|
-
|
|
89
|
-
Practicing early does not advance an existing interval. A missed review follows the configured retry, restart and support rules. Choose intervals and maintenance rules appropriate to the material. This example is not a universal learning standard.
|
|
70
|
+
The concept is due one day after the observation. The application can present the returned queue to the learner.
|
|
90
71
|
|
|
91
|
-
##
|
|
72
|
+
## Features
|
|
92
73
|
|
|
93
|
-
- Configurable
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
- Replay of duplicated, reordered, corrected, revoked or deleted observations.
|
|
74
|
+
- Configurable review intervals, retries, maintenance and support recommendations.
|
|
75
|
+
- Delayed retrieval probes and deterministic due-review ranking.
|
|
76
|
+
- Elapsed-time or local-calendar scheduling with explicit timezone rules.
|
|
77
|
+
- History replay with duplicate detection, corrections, revocations and deletion controls.
|
|
98
78
|
- Optional advisory readiness based on independently admitted evidence.
|
|
99
79
|
|
|
100
|
-
Given the same validated history, policy, algorithm revision and clock, Retention produces the same result. Retention does not inspect answers, authenticate learners, issue grades, certify mastery or deliver notifications.
|
|
101
|
-
|
|
102
80
|
## Architecture
|
|
103
81
|
|
|
104
|
-
The application records practice, supplies a policy and calls Retention with an explicit clock. Retention reconciles the history and calculates review projections. The application decides how to present and store the results.
|
|
105
|
-
|
|
106
82
|
```mermaid
|
|
107
83
|
flowchart LR
|
|
108
84
|
H["History, policy, clock"] --> R["Reconcile"]
|
|
109
|
-
R -->
|
|
85
|
+
R --> P["Practice schedule"]
|
|
110
86
|
R --> C["Optional readiness"]
|
|
111
|
-
|
|
112
|
-
C -->
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
### Replay
|
|
116
|
-
|
|
117
|
-
Review histories can arrive out of order. An application may also need to correct a previous result or remove a learner's data. Retention validates the scope, schema and limits, then uses stable event identities and a durable sequence to reconcile corrections, revocations and deletions. It orders surviving observations and excludes future observations before rebuilding the practice and optional candidate projections. Invalid inputs return typed errors.
|
|
118
|
-
|
|
119
|
-
```mermaid
|
|
120
|
-
flowchart LR
|
|
121
|
-
H["Scoped history"] --> V["Validate and deduplicate"]
|
|
122
|
-
V --> C["Apply lifecycle controls"]
|
|
123
|
-
C --> R["Replay active observations"]
|
|
87
|
+
P --> Q["Review result"]
|
|
88
|
+
C --> Q
|
|
89
|
+
Q --> D["Rank due reviews"]
|
|
124
90
|
```
|
|
125
91
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
Full replay is the reference calculation. The advance operation verifies the previous projection identity and complete event prefix before rebuilding. Policy changes require explicit replay.
|
|
129
|
-
|
|
130
|
-
### Readiness and evidence
|
|
131
|
-
|
|
132
|
-
Practice observations and admitted evidence can influence due dates and support recommendations. Only host-admitted evidence enters the separate advisory readiness calculation under an eligibility policy.
|
|
92
|
+
The host supplies the complete history, policy and clock. Retention validates the input, applies lifecycle controls and replays surviving observations. Ranking selects due concepts from the resulting projection.
|
|
133
93
|
|
|
134
94
|
```mermaid
|
|
135
95
|
flowchart LR
|
|
136
|
-
P["Practice"] --> S["
|
|
96
|
+
P["Practice"] --> S["Practice schedule"]
|
|
137
97
|
E["Admitted evidence"] --> S
|
|
138
|
-
E --> C["
|
|
98
|
+
E --> C["Candidate readiness"]
|
|
139
99
|
K["Eligibility policy"] --> C
|
|
140
100
|
```
|
|
141
101
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
Retention cannot establish whether evidence is authentic. The application admits evidence and makes any official assessment or credit decision independently.
|
|
145
|
-
|
|
146
|
-
## API
|
|
147
|
-
|
|
148
|
-
| Operation | Purpose |
|
|
149
|
-
| ------------------- | ------------------------------------------------------------------------- |
|
|
150
|
-
| `validatePolicy` | validate scheduling and optional eligibility policy. |
|
|
151
|
-
| `validateEvents` | validate scoped events and detect identity conflicts. |
|
|
152
|
-
| `rebuildReview` | Reconstruct review projections from complete history. |
|
|
153
|
-
| `advanceReview` | Verify the prior identity and event prefix, then rebuild with new events. |
|
|
154
|
-
| `evaluateReadiness` | Calculate advisory readiness from reconciled eligible evidence. |
|
|
155
|
-
| `scheduleDue` | Select and rank due concepts. |
|
|
156
|
-
| `explainReview` | Return structured reasons for a recommendation. |
|
|
157
|
-
|
|
158
|
-
See [due ranking](https://github.com/0xbuffdev/retention/blob/main/docs/priority.md), [policy validation](https://github.com/0xbuffdev/retention/blob/main/docs/policies.md), [event validation](https://github.com/0xbuffdev/retention/blob/main/docs/events.md) and [replay and readiness](https://github.com/0xbuffdev/retention/blob/main/docs/replay.md) for implemented behavior and limitations.
|
|
159
|
-
|
|
160
|
-
The [review scheduling specification](https://github.com/0xbuffdev/context/blob/main/repos/retention/specs/0001-review-scheduling.md) defines the event schemas, policy fields, transition rules, resource limits and error behavior.
|
|
102
|
+
Only admitted credited evidence can qualify for candidate readiness. Retention cannot authenticate evidence, grant credit or certify mastery. The host handles persistence, authorization, erasure and notifications. See the [architecture guide](https://github.com/0xbuffdev/retention/blob/main/docs/architecture.md).
|
|
161
103
|
|
|
162
104
|
## Documentation
|
|
163
105
|
|
|
164
|
-
|
|
106
|
+
| Guide | Contents |
|
|
107
|
+
| ------------------------------------------------------------------------------------- | ------------------------------------------------------ |
|
|
108
|
+
| [API](https://github.com/0xbuffdev/retention/blob/main/docs/api.md) | Public operations and results |
|
|
109
|
+
| [Policies](https://github.com/0xbuffdev/retention/blob/main/docs/policies.md) | Review intervals, time arithmetic and eligibility |
|
|
110
|
+
| [Events](https://github.com/0xbuffdev/retention/blob/main/docs/events.md) | Observations, lifecycle controls and validation |
|
|
111
|
+
| [Replay](https://github.com/0xbuffdev/retention/blob/main/docs/replay.md) | History reconstruction, readiness and explanations |
|
|
112
|
+
| [Due ranking](https://github.com/0xbuffdev/retention/blob/main/docs/priority.md) | Priority weights, concept relations and queue ordering |
|
|
113
|
+
| [Integration](https://github.com/0xbuffdev/retention/blob/main/docs/integration.md) | Application responsibilities, failures and privacy |
|
|
114
|
+
| [Architecture](https://github.com/0xbuffdev/retention/blob/main/docs/architecture.md) | Module boundaries and data flow |
|
|
165
115
|
|
|
166
116
|
## Development
|
|
167
117
|
|
|
168
|
-
Install Node.js 24+ and pnpm 11.2.2, then run:
|
|
169
|
-
|
|
170
118
|
```sh
|
|
119
|
+
git clone https://github.com/0xbuffdev/retention.git
|
|
120
|
+
cd retention
|
|
171
121
|
corepack enable
|
|
172
122
|
pnpm install --frozen-lockfile
|
|
173
123
|
pnpm check
|
|
174
124
|
```
|
|
175
125
|
|
|
176
|
-
The check covers architecture,
|
|
177
|
-
|
|
178
|
-
See the [source architecture](https://github.com/0xbuffdev/context/blob/main/repos/retention/architecture.md) for the repository layout, module dependencies, build configuration and testing conventions. The [implementation tickets](https://github.com/0xbuffdev/context/blob/main/repos/retention/tickets.md) track progress toward the first release, including independent Node.js and browser consumer checks.
|
|
126
|
+
Use Node.js 24 or later and pnpm 11.2.2. The full check covers architecture, typechecking, Biome, tests, the build and independent offline package consumers. CI also tests the installed package in Chromium.
|
|
179
127
|
|
|
180
|
-
|
|
128
|
+
See the [development guide](https://github.com/0xbuffdev/retention/blob/main/docs/development.md), [contribution guidelines](https://github.com/0xbuffdev/retention/blob/main/CONTRIBUTING.md), [security policy](https://github.com/0xbuffdev/retention/blob/main/SECURITY.md) and [release policy](https://github.com/0xbuffdev/retention/blob/main/docs/releasing.md). Report bugs or propose changes through the [issue tracker](https://github.com/0xbuffdev/retention/issues).
|
|
181
129
|
|
|
182
130
|
## License
|
|
183
131
|
|
|
184
|
-
|
|
132
|
+
[Apache-2.0](https://github.com/0xbuffdev/retention/blob/main/LICENSE). See [copyright and attribution](https://github.com/0xbuffdev/retention/blob/main/COPYRIGHT.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xbuff/retention",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Deterministic review scheduling for learning and long-term retention",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"check:architecture": "node scripts/check-architecture.mjs",
|
|
41
41
|
"verify:dist": "node scripts/verify-dist.mjs",
|
|
42
42
|
"check": "pnpm check:architecture && pnpm typecheck && pnpm check:style && pnpm test && pnpm build && pnpm verify:package",
|
|
43
|
-
"verify:package": "node scripts/verify-package.mjs"
|
|
43
|
+
"verify:package": "node scripts/verify-package.mjs",
|
|
44
|
+
"check:release-preflight": "bash tests/release-preflight.sh"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"@biomejs/biome": "2.6.8",
|