Skip to content

Commit 0e3f4e5

Browse files
authored
Merge pull request #7 from focaxisdev/codex/remember-writeback-lifecycle
Add remember writeback lifecycle tooling
2 parents a92a18d + bae4d36 commit 0e3f4e5

17 files changed

Lines changed: 488 additions & 26 deletions

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.5.0] - 2026-04-25
6+
7+
- Made remember/writeback a first-class companion to recall with a post-task writeback routing table in the README, protocol, workflow, and AGENTS template.
8+
- Added `writeback_hint` guidance to scripted memory scans so recall naturally leads into durable memory maintenance.
9+
- Added `deja-vu-feedback-report` to aggregate recall feedback into maintenance suggestions for aliases, weights, compaction, and route cleanup.
10+
- Expanded memory linting beyond JSONL into Markdown lifecycle checks for summaries, decisions, open loops, frontmatter, supersession, and transcript-like records.
11+
- Added tests for writeback hints, feedback reporting, Markdown memory linting, and package binary inclusion.
12+
513
## [0.4.1] - 2026-04-25
614

715
- Reaffirmed Deja Vu as an ultra-light protocol-first memory system rather than a required package, service, daemon, vector database, or engine.

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ Follow the Deja Vu rules in AGENTS.md. Before substantial work, scan memory/impr
2727

2828
That is the base product. Add scripts, feedback, decisions, open loops, or the optional TypeScript engine only when the project grows enough to justify them.
2929

30+
Post-task writeback should stay just as small:
31+
32+
```text
33+
Decision made -> memory/decisions/ + memory/impressions.jsonl
34+
Unresolved follow-up -> memory/open-loops/ + memory/impressions.jsonl
35+
Project-level truth changed -> memory/summary.md + memory/impressions.jsonl
36+
One-off low-value trace -> memory/events/ or skip
37+
Recall was missed, irrelevant, helpful, or overloaded -> memory/recall-feedback.jsonl
38+
```
39+
40+
If the outcome is not durable enough to help a future agent, do not write it into memory.
41+
3042
Use Deja Vu if your team keeps repeating:
3143

3244
- "We already decided this."
@@ -71,11 +83,14 @@ It answers:
7183
- how memory should be stored in ordinary project files
7284
- when memory should be updated, compacted, or retired
7385

74-
The minimum viable setup uses two project-local plain text files, with one optional feedback ledger when recall results should change future behavior:
86+
The minimum viable setup uses three project-local plain text files:
7587

88+
- `AGENTS.md`
7689
- `memory/summary.md`
7790
- `memory/impressions.jsonl`
7891

92+
Add one optional feedback ledger when recall results should change future behavior:
93+
7994
- `memory/recall-feedback.jsonl`
8095

8196
No npm package, embeddings, vector search, or database is required.
@@ -109,7 +124,6 @@ Deja Vu follows a cue-first lifecycle:
109124
4. Load one to three detailed records only when the scan finds strong familiarity or the task requires depth.
110125
5. Write back only durable outcomes that should change a future agent's behavior.
111126
6. Record whether recall was helpful, irrelevant, missed, or overloaded when that feedback should tune future memory.
112-
113127
7. Compact or supersede memories when detail becomes repetitive or stale.
114128

115129
This keeps memory project-local, readable, and easy to maintain across new conversations.
@@ -142,6 +156,12 @@ The canonical layout and field rules are specified in [docs/storage-markdown.md]
142156
- stable preferences
143157
- unresolved follow-up items
144158
- milestone summaries
159+
- Route writeback by artifact:
160+
- decisions -> `memory/decisions/` plus `memory/impressions.jsonl`
161+
- follow-ups -> `memory/open-loops/` plus `memory/impressions.jsonl`
162+
- project-level truth -> `memory/summary.md` plus `memory/impressions.jsonl`
163+
- cheap trace -> `memory/events/` or skip
164+
- recall quality -> `memory/recall-feedback.jsonl`
145165
- Default recall budget:
146166
- impression scan: always allowed
147167
- summary: at most one file
@@ -250,6 +270,7 @@ npm install
250270
npm run build
251271
npm run test:src
252272
npm run lint:memory
273+
npm run report:feedback
253274
```
254275

255276
## References
@@ -264,4 +285,5 @@ npm run lint:memory
264285
- [docs/release-v0.3.1.md](./docs/release-v0.3.1.md)
265286
- [docs/release-v0.4.0.md](./docs/release-v0.4.0.md)
266287
- [docs/release-v0.4.1.md](./docs/release-v0.4.1.md)
288+
- [docs/release-v0.5.0.md](./docs/release-v0.5.0.md)
267289
- [llms.txt](./llms.txt)

docs/protocol.md

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,28 @@ During the task:
104104

105105
After meaningful work completes:
106106

107-
1. Decide whether the outcome is durable.
108-
2. If it is durable, write or update the appropriate memory artifact.
109-
3. Update `memory/impressions.jsonl` with compact keywords for future cheap scans.
110-
4. Update `memory/summary.md` when the project-level understanding has changed.
111-
5. Update `memory/index.md` when the project uses one.
112-
6. Update `memory/events/` only when the work should remain discoverable without becoming a durable record.
107+
1. Decide whether the outcome is durable enough to help a future agent.
108+
2. Route the outcome through the writeback gate.
109+
3. If it is durable, write or update the appropriate memory artifact.
110+
4. Update `memory/impressions.jsonl` with compact keywords for future cheap scans.
111+
5. Update `memory/summary.md` when the project-level understanding has changed.
112+
6. Update `memory/index.md` when the project uses one.
113+
7. Update `memory/events/` only when the work should remain discoverable without becoming a durable record.
114+
115+
Writeback gate:
116+
117+
| Outcome | Action |
118+
| --- | --- |
119+
| no durable future value | `skip` |
120+
| happened once but may be useful to discover later | `event_only` |
121+
| changes an existing durable record | `update_existing` |
122+
| records an accepted decision | `new_decision` |
123+
| leaves unresolved follow-up work | `new_open_loop` |
124+
| changes project-level truth | `update_summary` |
125+
| replaces an older durable record | `supersede_old_record` |
126+
| recall quality should tune future behavior | `append_feedback` |
127+
128+
Every durable writeback must leave a future recall route. In practice, update `memory/impressions.jsonl` whenever a decision, open loop, context record, or project summary becomes the authoritative place to remember something.
113129

114130
### 4. Recall Feedback
115131

@@ -162,6 +178,15 @@ Write back when the work produces:
162178
- a stable working preference
163179
- a milestone-level summary worth reusing later
164180

181+
Route writeback by artifact:
182+
183+
- decision -> `memory/decisions/` plus `memory/impressions.jsonl`
184+
- unresolved follow-up -> `memory/open-loops/` plus `memory/impressions.jsonl`
185+
- project-level truth -> `memory/summary.md` plus `memory/impressions.jsonl`
186+
- low-cost trace -> `memory/events/` or skip
187+
- recall quality signal -> `memory/recall-feedback.jsonl`
188+
- replacement -> newer record plus supersession links
189+
165190
Do not write back:
166191

167192
- temporary notes that will obviously expire

docs/release-v0.5.0.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Deja Vu v0.5.0
2+
3+
Deja Vu now treats remember and recall as equal parts of the protocol loop.
4+
5+
Earlier releases made cue-first recall cheap and observable. This release closes the loop after work completes: agents now get clearer routing for what to remember, where to write it, when to skip it, and how recall feedback should become future memory maintenance.
6+
7+
## Highlights
8+
9+
- Added post-task writeback routing to the README, protocol, workflow, and AGENTS template.
10+
- Added `writeback_hint` to `deja-vu-scan-memory` output.
11+
- Added `deja-vu-feedback-report` for aggregating recall feedback into maintenance suggestions.
12+
- Expanded `deja-vu-lint-memory` to inspect Markdown memory lifecycle records, not only JSONL cues.
13+
- Added tests for writeback hints, feedback reporting, Markdown linting, and package binary inclusion.
14+
15+
## Why it matters
16+
17+
Recall without disciplined writeback eventually goes stale. Writeback without disciplined recall turns into noise.
18+
19+
Deja Vu v0.5.0 keeps the base product small while making the full loop explicit:
20+
21+
```text
22+
task cue -> familiarity score -> minimal recall -> durable writeback -> feedback-guided maintenance
23+
```
24+
25+
## Upgrade notes
26+
27+
No existing memory layout migration is required.
28+
29+
Recommended additions:
30+
31+
- Use the README writeback routing table after meaningful work.
32+
- Run `deja-vu-lint-memory` to catch Markdown lifecycle issues.
33+
- Run `deja-vu-feedback-report` when `memory/recall-feedback.jsonl` starts to accumulate actionable recall outcomes.

docs/templates/AGENTS.template.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,21 @@ Recall budget:
3232
After meaningful work completes:
3333

3434
1. Write back only durable, reusable memory.
35-
2. Update the relevant memory file.
36-
3. Update `memory/impressions.jsonl`.
37-
4. Update `memory/summary.md` when project understanding changes.
38-
5. Update `memory/index.md` if the project uses one.
39-
6. Add a short entry to `memory/events/` only when the work should remain discoverable without becoming durable memory.
40-
41-
7. Append `memory/recall-feedback.jsonl` only when recall was helpful, irrelevant, missed, or overloaded in a way that should tune future memory.
35+
2. Route the outcome through the writeback gate.
36+
3. Update the relevant memory file.
37+
4. Update `memory/impressions.jsonl`.
38+
5. Update `memory/summary.md` when project understanding changes.
39+
6. Update `memory/index.md` if the project uses one.
40+
7. Add a short entry to `memory/events/` only when the work should remain discoverable without becoming durable memory.
41+
8. Append `memory/recall-feedback.jsonl` only when recall was helpful, irrelevant, missed, or overloaded in a way that should tune future memory.
42+
43+
Writeback gate:
44+
45+
- accepted decision -> `memory/decisions/` plus `memory/impressions.jsonl`
46+
- unresolved follow-up -> `memory/open-loops/` plus `memory/impressions.jsonl`
47+
- project-level truth changed -> `memory/summary.md` plus `memory/impressions.jsonl`
48+
- low-value one-off trace -> `memory/events/` or skip
49+
- recall quality signal -> `memory/recall-feedback.jsonl`
4250

4351
Good writeback candidates:
4452

docs/templates/memory/decisions/decision-template.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ updated: 2026-04-20
88

99
# Decision Title
1010

11+
Use this record only for an accepted decision that should guide future work. Do not paste exploratory chat logs here.
12+
1113
## Date
1214

1315
2026-04-20

docs/templates/memory/open-loops/open-loop-template.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ updated: 2026-04-20
88

99
# Open Loop Title
1010

11+
Use this record only for unresolved follow-up work that should survive a new chat. Close or supersede it when the loop is no longer active.
12+
1113
## Owner
1214

1315
agent-or-person

docs/templates/memory/summary.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ updated: 2026-04-20
88

99
# Project Summary
1010

11+
Keep this as the compact project-level truth. Do not store turn-by-turn history or detailed decisions here.
12+
1113
## Current objective
1214

1315
Describe the current product objective in two or three sentences.

docs/workflow.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,24 @@ Default detailed reads:
4545
After meaningful work completes:
4646

4747
1. decide whether the outcome is durable
48-
2. create or update the relevant durable memory file
49-
3. update `memory/impressions.jsonl`
50-
4. update `memory/summary.md` if project understanding changed
51-
5. update `memory/index.md` if the project uses one
52-
6. add a short event ledger entry only when the work should remain discoverable without promotion into durable memory
53-
7. append `memory/recall-feedback.jsonl` only when recall was helpful, irrelevant, missed, or overloaded in a way that should tune future recall
48+
2. route the outcome through the writeback gate
49+
3. create or update the relevant durable memory file
50+
4. update `memory/impressions.jsonl`
51+
5. update `memory/summary.md` if project understanding changed
52+
6. update `memory/index.md` if the project uses one
53+
7. add a short event ledger entry only when the work should remain discoverable without promotion into durable memory
54+
8. append `memory/recall-feedback.jsonl` only when recall was helpful, irrelevant, missed, or overloaded in a way that should tune future recall
55+
56+
Writeback gate:
57+
58+
| Signal | Route |
59+
| --- | --- |
60+
| accepted decision | `memory/decisions/` plus `memory/impressions.jsonl` |
61+
| unresolved follow-up | `memory/open-loops/` plus `memory/impressions.jsonl` |
62+
| project-level truth changed | `memory/summary.md` plus `memory/impressions.jsonl` |
63+
| low-value one-off trace | `memory/events/` or skip |
64+
| recall quality changed future behavior | `memory/recall-feedback.jsonl` |
65+
| older record replaced | supersede old record and point indexes at the new one |
5466

5567
## Decision Rules
5668

encoding-status.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,14 @@
7575
| `docs/release-v0.4.1.md` | 編碼正常(新建,UTF-8) | New release note for protocol-first activation and the ultra-light three-file adoption path. |
7676
| `docs/templates/memory/recall-feedback.jsonl` | 編碼正常(新建,UTF-8) | New recall feedback template. |
7777
| `examples/protocol-project/memory/recall-feedback.jsonl` | 編碼正常(新建,UTF-8) | New example recall feedback ledger. |
78+
| `scripts/dejavu-feedback-report.mjs` | 編碼正常(新建,UTF-8) | New feedback aggregation CLI for recall maintenance suggestions. |
79+
| `docs/release-v0.5.0.md` | 編碼正常(新建,UTF-8) | New release note for remember/writeback lifecycle improvements. |
80+
| `scripts/dejavu-scan-memory.mjs` | 編碼正常(已檢查) | Updated in UTF-8; scan output now includes post-task writeback hints. |
81+
| `scripts/dejavu-lint-memory.mjs` | 編碼正常(已檢查) | Updated in UTF-8; linter now checks Markdown memory lifecycle records. |
82+
| `tests/memory-cli.test.ts` | 編碼正常(已檢查) | Updated in UTF-8; CLI tests now cover writeback hints, feedback reports, and Markdown lifecycle linting. |
83+
| `docs/protocol.md` | 編碼正常(已檢查) | Updated in UTF-8; protocol now defines the writeback gate and artifact routing. |
84+
| `docs/workflow.md` | 編碼正常(已檢查) | Updated in UTF-8; workflow now includes post-task writeback routing. |
85+
| `docs/templates/AGENTS.template.md` | 編碼正常(已檢查) | Updated in UTF-8; project rules template now includes the writeback gate. |
86+
| `docs/templates/memory/summary.md` | 編碼正常(已檢查) | Updated in UTF-8; summary template now warns against turn-by-turn history. |
87+
| `docs/templates/memory/decisions/decision-template.md` | 編碼正常(已檢查) | Updated in UTF-8; decision template now clarifies durable decision scope. |
88+
| `docs/templates/memory/open-loops/open-loop-template.md` | 編碼正常(已檢查) | Updated in UTF-8; open-loop template now clarifies unresolved follow-up scope. |

0 commit comments

Comments
 (0)