dsh-cortex-memory 0.4.22 → 0.4.147

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.
Files changed (154) hide show
  1. package/CHANGELOG.md +2390 -154
  2. package/README.md +11 -9
  3. package/bench/migration-bench.mjs +1 -1
  4. package/bench/semantic-cn.js +10 -10
  5. package/bench/synthetic.js +3 -3
  6. package/bin/copy-db.mjs +47 -0
  7. package/bin/repair.mjs +328 -0
  8. package/bin/verify.mjs +202 -0
  9. package/client.js +1 -1
  10. package/cordis.patch.yml +1 -1
  11. package/docs/install-windows.md +2 -2
  12. package/docs/models.md +1 -1
  13. package/docs/quota-compaction-design.md +175 -0
  14. package/icon.svg +12 -2
  15. package/index.js +27 -3
  16. package/package.json +3 -3
  17. package/src/adapters/shiori.js +1 -1
  18. package/src/api/routes.js +1 -1
  19. package/src/core/feature-overrides.js +2 -2
  20. package/src/engines/compression.js +172 -3
  21. package/src/engines/consolidate.js +397 -26
  22. package/src/engines/encode.js +16 -3
  23. package/src/engines/extract.js +72 -8
  24. package/src/engines/fact-guard.js +51 -0
  25. package/src/engines/health.js +263 -3
  26. package/src/engines/inhibition.js +39 -0
  27. package/src/engines/life.js +14 -3
  28. package/src/engines/llm-facts.js +12 -9
  29. package/src/engines/narrative.js +150 -13
  30. package/src/engines/reflect.js +172 -14
  31. package/src/engines/retrieve.js +44 -5
  32. package/src/engines/summary-coverage.js +62 -0
  33. package/src/engines/summary-dedupe.js +77 -0
  34. package/src/engines/summon-rank.js +132 -0
  35. package/src/host/runtime.js +64 -4
  36. package/src/host/scheduler.js +224 -3
  37. package/src/llm/adapter.js +29 -8
  38. package/src/memory/query.js +1 -1
  39. package/src/memory/spacing.js +15 -0
  40. package/src/memory/tokenizer.js +1 -1
  41. package/src/prompt/tiers.js +88 -12
  42. package/src/self/alias.js +25 -0
  43. package/src/self/emotion.js +3 -1
  44. package/src/self/relationship.js +44 -13
  45. package/src/self/state.js +20 -2
  46. package/src/self/working.js +34 -3
  47. package/src/service/cortex.js +493 -53
  48. package/src/store/repositories/facts.js +34 -1
  49. package/src/store/repositories/summaries.js +8 -1
  50. package/src/store/repositories/traces.js +22 -2
  51. package/src/tools/definitions.js +118 -4
  52. package/src/vector/index.js +96 -7
  53. package/test/integration/_helpers.js +0 -128
  54. package/test/integration/acceptance.test.js +0 -803
  55. package/test/integration/ann-load.test.js +0 -61
  56. package/test/integration/api-contract.test.js +0 -1476
  57. package/test/integration/backup-privacy.test.js +0 -214
  58. package/test/integration/consolidate.test.js +0 -75
  59. package/test/integration/edge-cases.test.js +0 -1088
  60. package/test/integration/exchange.test.js +0 -326
  61. package/test/integration/life-loop.test.js +0 -188
  62. package/test/integration/load.test.js +0 -751
  63. package/test/integration/markdown-sync.test.js +0 -35
  64. package/test/integration/policy-query-api.test.js +0 -306
  65. package/test/integration/resilience-writes.test.js +0 -241
  66. package/test/integration/tools-contract.test.js +0 -1324
  67. package/test/unit/ann-edge.test.js +0 -102
  68. package/test/unit/ann.test.js +0 -77
  69. package/test/unit/api-client.test.js +0 -576
  70. package/test/unit/api-validate.test.js +0 -19
  71. package/test/unit/api.test.js +0 -555
  72. package/test/unit/appraisal.test.js +0 -48
  73. package/test/unit/attachments.test.js +0 -33
  74. package/test/unit/autonomy.test.js +0 -53
  75. package/test/unit/batch.test.js +0 -46
  76. package/test/unit/bench.test.js +0 -40
  77. package/test/unit/benchmark-synthetic.test.js +0 -52
  78. package/test/unit/cli-default-root.test.js +0 -21
  79. package/test/unit/client-contract.test.js +0 -32
  80. package/test/unit/compression.test.js +0 -76
  81. package/test/unit/core.test.js +0 -77
  82. package/test/unit/develop.test.js +0 -130
  83. package/test/unit/development.test.js +0 -68
  84. package/test/unit/digest.test.js +0 -26
  85. package/test/unit/dsr.test.js +0 -111
  86. package/test/unit/edges-candidates.test.js +0 -113
  87. package/test/unit/emotion.test.js +0 -61
  88. package/test/unit/encode.test.js +0 -98
  89. package/test/unit/evolution.test.js +0 -130
  90. package/test/unit/external-ann-search.test.js +0 -50
  91. package/test/unit/external-ann.test.js +0 -29
  92. package/test/unit/facts-belief.test.js +0 -32
  93. package/test/unit/facts.test.js +0 -107
  94. package/test/unit/feature-overrides.test.js +0 -42
  95. package/test/unit/fts-migration.test.js +0 -42
  96. package/test/unit/graph.test.js +0 -79
  97. package/test/unit/growth-reflect.test.js +0 -123
  98. package/test/unit/guard-runtime.test.js +0 -40
  99. package/test/unit/guardian.test.js +0 -91
  100. package/test/unit/health-privacy.test.js +0 -102
  101. package/test/unit/hnsw.test.js +0 -35
  102. package/test/unit/host-runtime.test.js +0 -142
  103. package/test/unit/host.test.js +0 -58
  104. package/test/unit/identity.test.js +0 -98
  105. package/test/unit/induct-evaluate.test.js +0 -41
  106. package/test/unit/ingest-extracted.test.js +0 -35
  107. package/test/unit/initiative.test.js +0 -90
  108. package/test/unit/jobs.test.js +0 -93
  109. package/test/unit/json-snapshot.test.js +0 -57
  110. package/test/unit/life-consolidate.test.js +0 -34
  111. package/test/unit/life.test.js +0 -149
  112. package/test/unit/llm-facts-integration.test.js +0 -27
  113. package/test/unit/llm-facts.test.js +0 -16
  114. package/test/unit/llm.test.js +0 -45
  115. package/test/unit/locomo.test.js +0 -45
  116. package/test/unit/longmemeval.test.js +0 -56
  117. package/test/unit/markdown-import.test.js +0 -44
  118. package/test/unit/markdown.test.js +0 -34
  119. package/test/unit/memory-edit.test.js +0 -112
  120. package/test/unit/metrics.test.js +0 -26
  121. package/test/unit/migration.test.js +0 -38
  122. package/test/unit/model-config.test.js +0 -52
  123. package/test/unit/narrative.test.js +0 -62
  124. package/test/unit/playbook-consolidate.test.js +0 -24
  125. package/test/unit/privacy-scope.test.js +0 -39
  126. package/test/unit/profile-paths.test.js +0 -21
  127. package/test/unit/profile.test.js +0 -26
  128. package/test/unit/prompt.test.js +0 -42
  129. package/test/unit/providers.test.js +0 -42
  130. package/test/unit/qa.test.js +0 -100
  131. package/test/unit/query.test.js +0 -53
  132. package/test/unit/retention.test.js +0 -31
  133. package/test/unit/retrieval-ranking.test.js +0 -31
  134. package/test/unit/retrieve.test.js +0 -117
  135. package/test/unit/rotation.test.js +0 -25
  136. package/test/unit/scanner.test.js +0 -50
  137. package/test/unit/scenario.test.js +0 -78
  138. package/test/unit/scheduler.test.js +0 -136
  139. package/test/unit/self-state.test.js +0 -94
  140. package/test/unit/service.test.js +0 -72
  141. package/test/unit/shiori-import.test.js +0 -77
  142. package/test/unit/skills.test.js +0 -104
  143. package/test/unit/store.test.js +0 -111
  144. package/test/unit/temporal-graph.test.js +0 -44
  145. package/test/unit/tiers.test.js +0 -39
  146. package/test/unit/tokenizer-fts.test.js +0 -35
  147. package/test/unit/tools.test.js +0 -122
  148. package/test/unit/upgrade-0412.test.js +0 -104
  149. package/test/unit/upgrade-0413.test.js +0 -84
  150. package/test/unit/upgrade-0414.test.js +0 -101
  151. package/test/unit/vector-ann.test.js +0 -53
  152. package/test/unit/vector-async.test.js +0 -69
  153. package/test/unit/vector.test.js +0 -68
  154. package/test/unit/working.test.js +0 -80
package/CHANGELOG.md CHANGED
@@ -1,157 +1,2393 @@
1
- # Changelog
2
-
3
- ## 0.4.22 — 2026-11-14
4
-
5
- - Fix CLI default data root: use profileDataRoot (cortex-memory) instead of legacy ~/.dsh/cortex.
6
- - Add CLI root regression tests for default, --data and CORTEX_HOME.
7
- - Document that tests/bench require the DSH bundled Node 24; system Node 22 is below engines.
8
- - No loader-id, data-path or UI changes.
9
-
10
- ## 0.4.21 — 2026-11-14
11
-
12
- - Documentation-only release: replace the README with a current-version capability guide, install/download flow, add-on matrix and honest performance boundaries.
13
- - Update package description and search keywords; no engine, icon, loader-id or data-path changes.
14
-
15
- ## 0.4.20 — 2026-11-14
16
-
17
- - Replace the plugin icon with the owner-provided whale-girl avatar (embedded 256 JPEG).
18
- - Keep the sidebar icon offline: no remote image URL.
19
- - No engine, loader-id or data-path changes.
20
-
21
- ## 0.4.19 — 2026-11-13
22
-
23
- - Revert client bundle id to `dsh-cortex`. It is intentionally different from loader row id `dsh-cortex-memory`.
24
- - 0.4.18 set both to `dsh-cortex-memory`, causing duplicate factory registration and web boot failure; 0.4.19 removes that change.
25
- - Loader id, local/public patch names and `~/.dsh/cortex-memory` data path remain unchanged.
26
- - Add contract assertion that client id is `dsh-cortex` and not the loader id.
27
- - Tests: 437/437.
28
- ## 0.4.18 — 2026-11-13
29
-
30
- - Fix client bundle id: `dsh-cortex` -> `dsh-cortex-memory`.
31
- - Host can be active while the sidebar panel is absent if the client module id does not match the loader row; this release aligns them.
32
- - Local package keeps `patch.name: dsh-cortex`; public package keeps `patch.name: dsh-cortex-memory`.
33
- - Tests: 437/437.
34
- ## 0.4.17 — 2026-11-13
35
-
36
- - Loader id and bundle row change to `dsh-cortex-memory`; `ctx.provide('cortex')` remains as a compatibility alias.
37
- - Existing profile rows must migrate from `cortex` to `dsh-cortex-memory`; a migration script backs up the profile and verifies exactly one target row.
38
- - Data root remains `DSH_HOME/cortex-memory`; legacy data is copied, never moved.
39
- - Tests: 437/437.
40
- ## 0.4.16 — 2026-11-13
41
-
42
- - Default data root moves to `DSH_HOME/cortex-memory` (desktop) and `DSH_HOME/cortex-memory/profiles/<profile>` for other profiles.
43
- - Legacy `DSH_HOME/cortex` is never moved or deleted. Migration scripts copy it, keep a backup, and verify the copy before DSH opens the new root.
44
- - Loader id stays `cortex` in this release; a later migration-scripted release will rename it.
45
- - README extractor version corrected to 0.3.5; mojibake repaired.
46
-
47
- ## 0.4.13 — 2026-11-13
48
-
49
- ### Added
50
- - `evolution` guard in Config schema (`autoActivate`, `maxPerDay`, `minIntervalMs`, `canaryTicks`, `rollbackOnError`).
51
- - Persistent canaries: `policies.canary_json` survives restart and rehydrates on engine creation.
52
- - `recallSharing` opt-in recall block sharing across sessions.
53
- - Persona-aware first-person extraction; markdown-fragment rejection retained.
54
- - Built-in Wikipedia/SearXNG fallback when `features.webSearch` is on and no host `web` service exists.
55
-
56
- ### Fixed
57
- - Automatic rollback without a previous policy now retires the failed policy as `superseded`, instead of leaving it as `candidate`.
58
- - Canary ticks are persisted, not just kept in memory.
59
- - Schema version bumped to 7 for the additive `canary_json` column.
60
-
61
- ## 0.4.12 — 2026-11-13
62
-
63
- ### Fixed
64
- - `promptBudget` is normalized instead of being silently dropped and falling back to 1600.
65
- - Injection gate moved into retrieval: weak recency/soft-FTS candidates are filtered before consuming the result budget. Full search/API/CLI remain available.
66
- - Guardian light check runs structural invariants + FTS counts; deep `integrity_check` and the event-chain walk stay on the six-hour/startup path.
67
- - Identity traces surface as `L0` in search results.
68
- - `npm test` / `npm run test:unit` use explicit test globs so Node 22 can run them.
69
- - Package `files` now includes `docs`, `examples`, `bench`, `test` and `CHANGELOG.md`; README install points at 0.4.12.
70
- - Security/privacy docs now match the code: no bearer token; model keys are plaintext in `model-config.json` mode 0600, outside `cortex.sqlite`.
71
-
72
- ### Added
73
- - `recentImportanceFloor` config (default 0.8, preserving 0.4.11's importance exemption).
74
- - `gated` count in the retrieval trace.
75
- - Regression tests for the prompt gate, importance exposure, identity L0, per-session recall, light/deep guardian, and configurable `promptBudget`.
76
-
77
- ## 0.4.11 — 2026-11-12
78
-
79
- - Life/date fixes, graph candidate labels, neutral public package surface.
80
- - Recent timeline endpoint and incremental summon rebuild.
81
-
82
- ## 0.4.0 — 2026-11-12
83
-
84
- ### Fixed
85
- - Prompt-only injection gate; full search/API/CLI remain available.
86
- - Search items now expose `importance`, `confidence`, `match`, `kind`; perm tier works.
87
- - Removed cross-session single-cache fallback.
88
- - `autoGraphCandidates` is the canonical graph flag; old name is an alias.
89
- - Guardian scheduler uses light checks per tick and full checks at startup/6h.
90
- - Guard backup/restore/export/prune/sync are constrained to `dataRoot` by default.
91
- - Tests and docs are included in the package; `npm test` works after install.
92
-
93
- ### Added
94
- - `persona.selfName` / `persona.userAddress`; neutral public defaults (`助手` / `用户`).
95
- - `injectionGate`, `recentMinMatch`, `allowRestoreOutsideRoot` config.
96
-
97
- ### Compatibility
98
- - Additive config only; no schema migration.
99
- - Existing 0.3.x databases open in place.
100
- - Local profiles can restore the 本鲸 / 主人 persona through config.
101
-
102
- ## 0.3.1 — 026-11-12
103
-
104
- - AI diary entries no longer append a 閳ユ粌寮懓鍐b偓?footer; web sources still inform the model but are not stored in the diary body.
105
- - Manual dream generation timeout raised from 4s to 20s; `aiOnlyLife` still fails closed instead of falling back to a template.
106
- - No schema change; compatible with 0.3.0 databases and DSH `>=0.2.1-rc.2 <0.4.0`, Node `>=24`.
107
- ## 0.3.0 闁?2026-11-12
108
-
109
- ### Added
110
-
111
- - Summon cards (L2): left-brain emotion cards and right-brain work cards with trigger words.
112
- - Summon volumes (L3): side/category/day indexes with representative text.
113
- - Summon book: independent daily page; read-only by default, owner-gated editing with audit.
114
- - Runtime summon injection: at most 3 cards / 900 tokens, labelled as untrusted historical references.
115
- - Explicit card feedback (`helpful` / `ignored`) writes back to source-trace DSR. Injection alone never changes strength.
116
- - Diagnostics panel: health issues, disputed-fact confirm/dismiss, and candidate-only skill extraction.
117
- - Graph entity labels use names instead of ids; bounded LLM renaming for clearly broken names with confidence gate and audit.
118
-
119
- ### Changed
120
-
121
- - Scheduler review runs every 90 minutes and generates pending intentions.
122
- - AI diary is limited to 12:00/22:00; idle hourly writing is a feeling, not a diary.
123
- - Identity capacity is enforced (L0 default 360 tokens); today's additions are prepended so they survive truncation.
124
-
125
- ### Compatibility
126
-
127
- - Additive SQLite schema; existing 0.2.x databases migrate in place.
128
- - DSH `>=0.2.1-rc.2 <0.4.0`; Node `>=24`.
129
- - No API keys, personal paths, or private data are shipped.
130
-
131
- ## 0.2.2 闁?2026-11-12
132
-
133
- - Public README and install commands.
134
- - License metadata and package metadata fixes.
135
- - No memory-engine behavior change.
136
-
137
- ## 0.2.0 闁?2026-11-12
138
-
139
- - First stable release of the rc line.
140
- - Trace UI extraction with layout selection.
141
- - Windows OCR / Tesseract layout-aware column ordering.
142
- - Permission confirmations and restart requirement documented.
143
-
144
-
145
-
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
-
154
-
1
+ # Changelog
2
+
3
+ ## 0.4.147 — 2026-11-19
4
+
5
+ Second privacy pass: real-life wording out of the public text, a neutral icon and a smaller tarball.
6
+
7
+ ### Changed
8
+ - **Real-life wording removed from CHANGELOG, source comments and fixtures.**
9
+ Quoted fragments from private conversations are gone; examples are abstract
10
+ ("a long truncated title") instead of copied text. Review attribution and
11
+ live-store counts are generalized, so this changelog no longer reads like a
12
+ private work log.
13
+ - **Fixtures neutralized.** The health-theme, ocean-themed and character-name
14
+ fixtures are replaced with neutral topics; the transcript fixtures no longer
15
+ mirror anyone's real life.
16
+ - **Neutral icon.** The embedded portrait is replaced with a plain node-graph
17
+ logo, saving about 32 KB twice (`icon.svg` and the sidebar icon in `client.js`).
18
+ - **Tarball excludes `test/`** (`package.json.files`): smaller package, and the
19
+ largest audit surface moves out of the shipped artifact. Tests stay in the
20
+ repository and in CI.
21
+ - Template diary/feeling wording no longer uses a water/whale metaphor.
22
+
23
+ ### Verified
24
+ - Unit: 520/520, twice.
25
+ - Integration: 126/126.
26
+ - Package scan: no names, local paths, credentials, real quotes or journal text.
27
+
28
+ ## 0.4.146 — 2026-11-19
29
+
30
+ First public release since 0.4.22: the same engine, a neutral public surface.
31
+
32
+ ### Changed
33
+ - **Private surface removed from the published package.** Persona defaults stay
34
+ neutral (助手 / 你); a new optional `persona.description` config carries a custom
35
+ self-description for LLM prompts. The migration script that rewrote local
36
+ identity boundaries is gone — `bin/repair.mjs` covers the same data step.
37
+ - **Test corpus and benches are neutralized in this pass.** Fixtures use generic
38
+ names and foods; persona defaults and local nicknames are out of the package.
39
+ (0.4.147 is the second pass that removes the remaining real-life wording from
40
+ this changelog and a few fixtures.)
41
+ - **README states the real shipped numbers**: version 0.4.146, 520/520 unit tests,
42
+ DSH `>=0.2.1-rc.2 <0.5.0`.
43
+ - `src/engines/narrative.js` strips the configured `persona.selfName` speaker
44
+ prefix instead of a hard-coded one; `src/self/alias.js` no longer ships a local
45
+ nickname in `DEFAULT_USER_ALIASES`.
46
+
47
+ ### Verified
48
+ - Unit: 520/520, twice.
49
+ - Integration: 116/126 — 10 pre-existing tool-contract/host-journey failures
50
+ (documentation lag and host fixtures, not this release); the emotion target
51
+ contract now passes, one more than 0.4.145.
52
+
53
+ ## 0.4.145 — 2026-11-18
54
+
55
+ The speaker prefix hid the quote marker from the stripper.
56
+
57
+ ### Fixed
58
+ - **"用户:> …" lost only half of its decoration.** The content was `用户:> 要彻底跟时间走…`:
59
+ the stripper saw a leading `用户:`, not a `> `, so after the prefix came off the quote
60
+ marker stayed and both the topic and the last clause began with "> ". A single
61
+ `stripDecoration()` pass now removes speaker prefix and quote marker together, looping
62
+ until stable (max three passes).
63
+
64
+ ### Verified
65
+ - Unit: 520/520, twice. New: "用户:> " is stripped in either order.
66
+ - Integration: 115/126, unchanged — same 11 pre-existing environment failures.
67
+
68
+
69
+ ## 0.4.144 — 2026-11-18
70
+
71
+ The quoted seed topic still came from the captured title.
72
+
73
+ ### Fixed
74
+ - **The seed topic reads content too.** `cleanTitle(seed.title || …)` still preferred the
75
+ 40-char captured title, so a topic ended mid-sentence ("…某段被截断的长标题"). It now
76
+ takes `seed.content` first (quote marker and speaker prefix stripped), cuts at 60 chars on a
77
+ punctuation boundary, and only falls back to the title when content is empty.
78
+ - Carries 0.4.143's fix: the "> " quote marker is stripped from both body clauses and the
79
+ seed topic.
80
+
81
+ ### Verified
82
+ - Unit: 519/519, twice. Assertion updated: the seed topic carries the whole sentence.
83
+ - Integration: 115/126, unchanged — same 11 pre-existing environment failures.
84
+
85
+
86
+ ## 0.4.143 — 2026-11-18
87
+
88
+ A quoted turn left a "> " marker in the paragraph topic.
89
+
90
+ ### Fixed
91
+ - **The quote marker is stripped from thread text and the seed topic.** A turn captured from
92
+ a quoted reply read as 「一段关于「> (某括号…)…」的经历」; `clean()` and `cleanTitle()` now
93
+ drop a leading "> " before the speaker prefix, so it never reaches the paragraph.
94
+
95
+ ### Verified
96
+ - Unit: 519/519, twice. New assertion: no "> " in thread content.
97
+ - Integration: 115/126, unchanged — same 11 pre-existing environment failures.
98
+
99
+
100
+ ## 0.4.142 — 2026-11-18
101
+
102
+ The paragraphs were still cutting capture's 40-char titles in half.
103
+
104
+ ### Fixed
105
+ - **Thread text reads `content`, not `title`.** Capture stores a short title that stops
106
+ mid-parenthesis ("…验收(工具名:desk") while the content holds the whole turn, so the
107
+ paragraph kept a stump even after the sentence-splitting fix. `clean()` now takes the
108
+ content first, strips capture's "用户:/助手:" speaker prefix, and falls back to the title.
109
+ The 90-char truncation lands on a punctuation boundary and never inside an open bracket.
110
+
111
+ ### Verified
112
+ - Unit: 519/519, twice. Assertions updated to the content-based text; new coverage: speaker
113
+ prefix stripping and unclosed-bracket trimming.
114
+ - Integration: 115/126, unchanged — same 11 pre-existing environment failures.
115
+
116
+
117
+ ## 0.4.141 — 2026-11-18
118
+
119
+ Thread paragraphs: the last three rough edges seen in the live sample.
120
+
121
+ ### Fixed
122
+ - **Long titles are cut at punctuation, not mid-bracket.** `truncate(90)` produced tails like
123
+ "…验收(工具名:desk". The cut now drops an unclosed bracket tail first, then falls back to
124
+ the last ,;。:、 inside the budget.
125
+ - **Markdown emphasis is stripped from thread text and from the seed topic.** `**…**` and
126
+ backticks no longer leak into the paragraph or the quoted seed title.
127
+ - **A sentence ending in an English dot is no longer treated as a fragment.** `clean()` keeps
128
+ the dot it split at, while the fragment filter rejected every `/\.$/` — so a complete
129
+ sentence like "项目观察日志." was dropped. The dot rule now only catches digit-dot stumps
130
+ ("dsh-cortex 0.").
131
+
132
+ ### Verified
133
+ - Unit: 519/519, twice. New coverage: punctuation-safe truncation, markdown stripping, and an
134
+ English-dot sentence surviving.
135
+ - Integration: 115/126, unchanged — same 11 pre-existing environment failures.
136
+
137
+
138
+ ## 0.4.140 — 2026-11-18
139
+
140
+ Thread paragraphs were cutting version numbers in half.
141
+
142
+ ### Fixed
143
+ - **`sentence()` treated the dot in "0.4.139" as a full stop**, so every paragraph came out
144
+ as a column of stumps ("20:49:dsh-cortex 0.;接着,21:05 0.;…"). The narrative engine now
145
+ splits sentences with `[。!?!?]|\.(?![0-9])` — a dot only ends a sentence when it is not
146
+ followed by a digit — and truncates at 90 chars instead of 60.
147
+ - **Stump fragments are dropped from the paragraph**: entries ending in a bare digit-dot or
148
+ an open bracket ("dsh-cortex 0.", "(尾巴一摆)…") no longer become beats in the story.
149
+ Short human titles ("两天前") are kept.
150
+
151
+ ### Verified
152
+ - Unit: 517/517, twice. New coverage: version numbers survive; paragraph shape; short titles
153
+ are not treated as fragments.
154
+ - Integration: 115/126, unchanged — same 11 pre-existing environment failures.
155
+
156
+
157
+ ## 0.4.139 — 2026-11-18
158
+
159
+ Four polish items: threads read like a paragraph, the deep pass sees the whole store, the
160
+ extractor stops quoting and commanding, and backfill samples 80% of a window.
161
+
162
+ ### Changed
163
+ - **Threads are written as one flowing paragraph**, not a bullet dump. The date is stated
164
+ once in the opener ("11月18日,…") and the clauses are joined with 接着 / 后来 / 最后, so a
165
+ thread is something you read back instead of a list you scan.
166
+ - **The daily deep pass spreads across importance bands.** Ranking from the low end put all
167
+ 60 candidates at importance 0.7 (the next untouched band); `spread: true` takes half from
168
+ the low end and samples the rest evenly, so one pass sees the store's shape.
169
+ - **Backfill samples 80% of each window (the 0.4.129 policy).** 24 of 40 left a structural
170
+ 40% of every window uncovered; it is now 32 of 40, and no extra windows are needed to
171
+ raise that ceiling.
172
+
173
+ ### Fixed
174
+ - **The rule extractor ignores quoted speech and imperatives.** 「他说:「小明喜欢白猫」」no
175
+ longer produces `likes(小明 → 白猫)` about the speaker, and instructions ("记得把桥修好")
176
+ no longer produce facts.
177
+
178
+ ### Verified
179
+ - Unit: 516/516, twice. New coverage: paragraph shape, spread sampling, quoted/imperative
180
+ filtering, and the 80% backfill budget.
181
+ - Integration: 115/126, unchanged — same 11 pre-existing environment failures.
182
+
183
+
184
+ ## 0.4.138 — 2026-11-18
185
+
186
+ The last truncation edge in the narrative pool.
187
+
188
+ ### Fixed
189
+ - **The 24h pass no longer caps at 300 rows.** A busy day already reaches ~320 active traces
190
+ in 24h (a production store: 315), so `around(24h)` with `limit 300` silently dropped the newest
191
+ neighbours — exactly the ones a thread about "tonight" needs. Each pass now carries
192
+ headroom above its own traffic: 24h → 600 rows, 72h → 1200, 7 days → 2000.
193
+ - Live check after 0.4.137: the first two threads woven at 14:04:10 UTC had bullets from
194
+ 18:0x–21:14 of the same evening and none of the 11-12/11-13 residue (`coverage 8/297`).
195
+
196
+ ### Verified
197
+ - Unit: 514/514, twice. New regression test: 400 traces inside 24h with the seed last — the
198
+ newest neighbour must still make the line.
199
+ - Integration: 115/126, unchanged — same 11 pre-existing environment failures.
200
+
201
+
202
+ ## 0.4.137 — 2026-11-18
203
+
204
+ The threads were reading last week's diary because of a pool bug, not the scoring.
205
+
206
+ ### Fixed
207
+ - **`buildThread` queries the seed's own time range instead of "the first N traces since
208
+ epoch".** `traces.listSince()` walks forward from its start and stops at `limit`; with a
209
+ store older than the limit, the pool for a tonight-seed was the 300 oldest active traces
210
+ (11-11 → 11-13), so the 24h window found nothing, the 72h window found nothing, and every
211
+ thread fell through to the 7-day fallback — which held that same old residue. That is why
212
+ 0.4.136's hardening still produced threads full of "2026-11-12 …" bullets: the data source
213
+ was truncated, not the ranking. `traces.range()` now queries `recorded_at` bounds directly,
214
+ and the widest fallback allows 2000 rows so it is not truncated again.
215
+ - Live evidence before the fix: `listSince('2026-11-11', limit 300)` ended at
216
+ `2026-11-13T09:15Z`, while the store had 1437 active traces through 11-18.
217
+
218
+ ### Verified
219
+ - Unit: 513/513, twice. New regression test: 310 old traces plus a tonight seed — the nearby
220
+ traces must win and the old ones must stay out of the line.
221
+ - Integration: 115/126, unchanged — same 11 pre-existing environment failures.
222
+
223
+
224
+ ## 0.4.136 — 2026-11-18
225
+
226
+ Narrative threads now follow the clock instead of importance.
227
+
228
+ ### Changed
229
+ - **`buildThread` uses a hard time window.** It used to rank every trace from the last 7 days
230
+ by `importance*0.35 + recency*0.3 + tags*0.2 + content*0.15`, so a 1.0 identity trace from
231
+ last week could still crowd the seed's neighbours out of the line. A thread is "what
232
+ happened around this moment", not "the heaviest things I remember": candidates now come
233
+ from `seed ± windowHours` (default 24h), widening to 72h and finally the whole 7-day pool
234
+ only when the window holds fewer than two other traces (a silent night still gets a line).
235
+ - The scoring formula is unchanged — with a bounded pool its only job is "which of these
236
+ neighbours is most relevant", which it does fine.
237
+ - `windowHours` is configurable via `threadWindowHours` (maintain path and the same key on
238
+ the sleep path); the returned summary records the window it actually used. Existing
239
+ threads are not rewritten.
240
+
241
+ ### Verified
242
+ - Unit: 512/512, twice. New coverage: nearby traces win over far-away high-importance ones;
243
+ the widening fallback still produces a line when the neighbourhood is quiet.
244
+ - Integration: 115/126, unchanged — same 11 pre-existing environment failures.
245
+
246
+
247
+ ## 0.4.135 — 2026-11-18
248
+
249
+ The four optimizations agreed after 0.4.134.
250
+
251
+ ### Added
252
+ - **A daily deep consolidation pass.** Once a day, after `deepConsolidateHour` (local, default
253
+ 4am), the scheduler runs one wider pass (`deepConsolidateLimit`, default 60 rows) with
254
+ `caller: 'deep-daily'`. The 30-minute delta trigger stays; this is the "one proper
255
+ housekeeping a day" pass. A mid-day restart does not repeat it — the audit row records the
256
+ caller. Disable with `deepConsolidateOnSchedule: false`.
257
+ - **Health shows today's housekeeping**: `consolidation.today` = `{ runs, archived, merged }`
258
+ since local midnight, rendered as "今日整理:N 趟 · 归档 X 条 · 合并 Y 条". A pass that
259
+ changed nothing is not counted as a run, so the number answers "did memory get tidier today".
260
+
261
+ ### Changed
262
+ - **Narrative seeds are picked by recency, not importance.** Sorting by importance kept
263
+ threading the same old identity traces, so every thread read like "about the build" or
264
+ "about the promise". The line now follows what actually happened lately.
265
+ - **The rule extractor ignores design discussions.** Pasted drafts and plan posts
266
+ ("新坑 3:…", "设计草案:…", "待办:…") talk about what might happen, not what did; they no
267
+ longer produce fact rows.
268
+
269
+ ### Verified
270
+ - Unit: 510/510, twice. New coverage: deep-pass timing / once-a-day / limit / disable, today
271
+ counters, recency seeding, discussion-text filtering.
272
+ - Integration: 115/126, unchanged — the same 11 pre-existing environment failures.
273
+
274
+
275
+ ## 0.4.134 — 2026-11-18
276
+
277
+ The two retention/coverage gaps recorded during the 0.4.131 self-review.
278
+
279
+ ### Fixed
280
+ - **Narrative threads have a retention cap.** Threads were rebuilt from recurring topics every
281
+ 6h (and immediately after every restart, since the timer is in-process), so `summaries` grew
282
+ without bound — 5 threads in one evening for essentially two topics. `weave()` now keeps the
283
+ newest `maxTotal` (default 24) and drops the oldest tail (`pruneThreads`).
284
+ - **Thread bullets no longer repeat the date.** Trace titles often start with their own date,
285
+ so lines read "2026-11-12 2026-11-12 上午…". The prefix is omitted when the text already
286
+ starts with it.
287
+ - **Dedupe samples the whole distribution.** Taking only the lowest-importance 80 rows meant a
288
+ duplicate pair in the middle of the store was never seen. Candidates are now half from the
289
+ low end and half evenly sampled across the rest (window 80 → 160).
290
+
291
+ ### Verified
292
+ - Unit: 501/501, twice. New coverage: date prefix, thread cap, dedupe sampling across
293
+ importance.
294
+ - Integration: 115/126, unchanged — same 11 pre-existing environment failures.
295
+ - Live check after 0.4.133: the first applied consolidation. 11 traces merged (one 10-way
296
+ merge of repeated-delivery receipts plus two pairs), `summaries.level='merge'` 0 → 3,
297
+ active 1441 → 1430. A preview no longer blocks the real pass; the model produced correct
298
+ multi-id merge shapes.
299
+
300
+
301
+ ## 0.4.133 — 2026-11-18
302
+
303
+ Two idempotence-gate holes found by self-review right after 0.4.132 shipped.
304
+
305
+ ### Fixed
306
+ - **A `skipped` row only blocks a retry while there is no adapter.** 0.4.132 made
307
+ `skipped` / `preview` / `rejected` all pass the gate, which would have brought back the
308
+ 0.4.130 noise ("no-llm" row on every tick). The gate now distinguishes: without an adapter
309
+ an identical skipped row is reused; with an adapter a skipped row may retry. `applied` and
310
+ `degraded` (a real answer) are still reused; `preview` and `rejected` always pass.
311
+ - **`dedupe`'s idempotence gate ignores preview rows too.** It read the latest
312
+ `model='dedupe'` row without filtering `preview`, so a rehearsal blocked the real dedupe
313
+ pass on the identical decision set.
314
+
315
+ ### Verified
316
+ - Unit: 498/498, twice. New coverage: a skipped row written without an LLM does not block a
317
+ later real run (verified across two store instances); a dedupe preview does not block the
318
+ real dedupe pass.
319
+ - Integration: 115/126, unchanged — the same 11 pre-existing environment failures.
320
+
321
+
322
+ ## 0.4.132 — 2026-11-18
323
+
324
+ Closes the four gaps 0.4.131 exposed on its first day in a production store.
325
+
326
+ ### Fixed
327
+ - **A dry run is recorded as `preview`, not `degraded`/`applied`.** 0.4.131 made preview rows
328
+ stop counting as "asked", but `consolidation.run({ dryRun: true })` still wrote a real
329
+ status, so that half of the fix never fired. A rehearsal no longer pushes its batch out of
330
+ the next real pass, and the idempotence gate lets the same batch through afterwards.
331
+ - **`health` ignores preview rows** when reporting "the last consolidation", so a rehearsal
332
+ cannot masquerade as a real pass.
333
+ - **The consolidation prompt spells out merge shape**: `ids` must contain at least two traces,
334
+ `targetId` must be one of them, and a one-id merge is rejected. The live model kept
335
+ answering `merge` with a single id (6 times in one run) and the validator correctly refused
336
+ it — the fix belongs in the instruction, not in the validator.
337
+ - **Dedupe ranks candidates lowest-importance first.** Near-duplicates cluster at the low end
338
+ (one-off acknowledgements, repeated-delivery receipts) and the old importance-descending
339
+ order never reached them inside the 80-row window. Merge targets are still the most
340
+ informative copy.
341
+
342
+ ### Verified
343
+ - Unit: 496/496, twice. New coverage: a preview does not occupy the next batch, merge prompt
344
+ rules, dedupe candidate order.
345
+ - Integration: 115/126; one stale assertion fixed (`no-llm` → `no-llm-adapter`), the remaining
346
+ 11 failures are the same environment failures present on 0.4.130.
347
+
348
+
349
+ ## 0.4.131 — 2026-11-18
350
+
351
+ Consolidation stops asking the one question it can never answer differently.
352
+
353
+ ### Fixed
354
+ - **Candidate selection ranks the other end of the store.** 0.4.116→0.4.130 sorted active
355
+ traces by importance descending, so every run handed the model the batch its own prompt
356
+ protects (99% of a production store is >= 0.7 and the top slice is all 1.0) and the only
357
+ possible answer was keep. Candidates now rank: no summary cites the trace yet → not shown
358
+ to the model in the last 24h → lowest importance, oldest first. Asked traces sink instead
359
+ of disappearing, so a fully asked pool rotates back over the stale end.
360
+ - **The protection line is one fixed threshold again (0.9).** A percentile of a
361
+ self-selected top slice always equals the batch maximum; the line covered every candidate.
362
+ >= 0.9 is protected from archive/merge, 0.7–0.9 may merge, < 0.7 may archive.
363
+ - **The idempotence gate covers every status, not just `skipped`.** An applied run whose
364
+ decisions were all keep used to burn a fresh LLM call every 30 minutes on an identical
365
+ input. A rejected batch is still retried — that was the model's own bad output.
366
+ - **`health` compares FTS rows per scope.** It counted the global traces against the whole
367
+ FTS index, so any second scope (`agency` in a production store) produced a permanent FTS_DRIFT
368
+ warning for exactly those rows.
369
+ - **`maintain()` no longer closes a dispute while both facts are `disputed`.** `disputed` is
370
+ not "not active"; the old condition resolved the dispute and left the facts unqueryable
371
+ forever. Disputes closed by older versions leave orphan `disputed` facts; those are now
372
+ invalidated on the next maintain pass (`report.orphanDisputes`).
373
+ - **The rule extractor does not turn questions or conditionals into facts.** "你会有感觉吗"
374
+ became will(助手 → 有感觉吗) and "要是想聊两句" became is(要 → 想聊两句). Questions (?/?
375
+ or a final 吗/呢/吧) and if-clauses (要是/如果/假如/万一/倘若/若) are skipped; a
376
+ single-character subject is only allowed for pronouns and address words.
377
+
378
+ ### Added
379
+ - **Narrative threads are actually woven.** `narrative.weave()` existed but nothing called
380
+ it, so `summaries` never held a level='thread' row. `maintain()` weaves up to two threads
381
+ every six hours (config `narrativeWeaveGapHours`); `life.sleep()` weaves as part of its
382
+ report (`narrative` field).
383
+ - **Dedupe runs on a schedule** every six hours (config `dedupeGapHours`, `dedupeLimit`;
384
+ `dedupeOnSchedule: false` disables it), so the merge layer no longer stays empty until
385
+ someone asks by hand.
386
+
387
+ ### Verified
388
+ - Unit: 493/493, twice. Integration: 114/126 pass; the 12 failures are the same pre-existing
389
+ environment failures as 0.4.130 (tool registry count, persona default, journey fixtures).
390
+ - New coverage: selection order, idempotence across statuses, rejected retry, FTS per scope,
391
+ question/conditional extraction, orphan disputes, weave in maintain and sleep, scheduled
392
+ dedupe.
393
+
394
+
395
+ ## 0.4.130 — 2026-11-16
396
+
397
+ Housekeeping release: closes the four P3 items that were deliberately deferred during
398
+ the 0.4.116→0.4.128 chain. No new features.
399
+
400
+ ### Fixed
401
+ - **Consolidation and dedupe see 500 active traces, not 200.** The old pool silently hid
402
+ anything older than the newest 200; the LLM still receives at most `limit` rows.
403
+ - **`dedupe` has the same idempotence gate as `run()`.** Re-preparing an identical decision
404
+ set returns `skipped: 'unchanged'` instead of appending another dream_runs row + audit
405
+ on every call (`force: true` overrides).
406
+ - The `invalid-json` branch now records `groups` / `groupsDropped` like every other exit.
407
+ - `cortex_consolidate action: "run"` refuses a non-dry run on a read-only scope (dedupe
408
+ already did).
409
+
410
+ ### Verified
411
+ - Tests: invalid-json carries group counts; identical dedupe runs report `unchanged`.
412
+ Suite: 477/477, twice.
413
+
414
+
415
+ ## 0.4.128 — 2026-11-16
416
+
417
+ ### Fixed (accounting only; no behaviour change to backfill)
418
+ - The tool schema's `maxWindows` still said `maximum: 20` while the engine allowed 64.
419
+ Both are 64 now; 0.4.127's "20 → 64" note is corrected to "engine 64 / tool 64".
420
+ - `already-reflected` skip rows now also carry `matchedEpisodes` (how many episodes
421
+ contributed to the union coverage), alongside `coveredRatio`.
422
+
423
+ ### Live state after the 21-window backfill
424
+ - episodes 26 (5 old + 21 backfilled), union coverage 507/855 = 59.3%.
425
+ - The remaining 348 uncovered traces are the structural remainder of sampling 24 of every
426
+ 40 traces (21 × 16) plus the 3-trace tail: **60% is this sampler's ceiling**, not a
427
+ threshold problem. Raising it means changing the per-window source budget (0.4.129,
428
+ a policy choice), not more windows.
429
+
430
+ ### Verified
431
+ - Suite: 475/475, twice.
432
+
433
+
434
+ ## 0.4.127 — 2026-11-16
435
+
436
+ ### Fixed
437
+ - **Backfill can resume from a cursor.** Every call restarted at epoch, so a second batch
438
+ spent its whole `maxWindows` quota re-walking already-written windows and could never
439
+ reach the tail — 851 non-reflection traces exceed 20 windows × 40. `backfillEpisodes`
440
+ now accepts `since` (the previous batch's `until`), the tool exposes it, and the ceiling
441
+ is raised to 64.
442
+ - **Same-millisecond windows made the 0.5 coverage bar fragile.** A production store's first
443
+ window contains 51 traces sharing one timestamp (bulk import) while reflect samples 24,
444
+ so coverage = 24/51 ≈ 0.47 — below the bar, meaning a re-run would write a duplicate.
445
+ Resume (`since`) removes that path; the coverage bar stays as a second guard.
446
+
447
+ ### Verified
448
+ - Live: first real segment written (`period 2026-11-11T03:31:26.778Z`, 584 chars,
449
+ 24 sourceIds, active 961→962, episodes 5→6), backup taken first.
450
+ - Tests: new resume test (batch 2 continues from batch 1's `until`; re-running the same
451
+ `since` writes nothing). Suite: 475/475, twice.
452
+
453
+
454
+ ## 0.4.126 — 2026-11-16
455
+
456
+ ### Fixed
457
+ - **The stale comment 0.4.125 said it removed is actually gone now.** 0.4.125 added the
458
+ correct "threshold 0.5" note but left the old "covers >=80% … (50% would skip a
459
+ half-covered stretch)" paragraph above it, so the function still contradicted itself.
460
+ This release deletes the old lines (verified: no `>=80%` left in the file).
461
+ - Skip diagnostics now include `coveredRatio` (e.g. `skipped: already-reflected,
462
+ coveredRatio: 0.62`), so a preview can be explained without guessing which episode
463
+ accepted the window.
464
+
465
+ ### Verified
466
+ - Suite: 474/474, twice; `reflect.js` syntax clean and no stale threshold text remains.
467
+
468
+
469
+ ## 0.4.125 — 2026-11-16
470
+
471
+ ### Fixed
472
+ - **The comment claimed a threshold the code did not use.** It said "≥80% of its trace ids
473
+ (50% would skip a half-covered stretch)", while the code compared against 0.5. The
474
+ comment now states 0.5 and explains why: reflect samples ~60% of a window (24/40), so a
475
+ fully reflected window scores ~0.6 and an 0.8 bar would never fire.
476
+ - **Coverage uses the union of all episode sources.** It was per-episode (`find`), so a
477
+ window split between two episodes (30% + 30%) was judged "not written" and rebuilt. The
478
+ union of every episode's `sourceIds` is computed once per window; the exact
479
+ `findPeriod` check still runs first.
480
+
481
+ ### Verified
482
+ - Suite: 474/474, twice; backfill tests unchanged and green.
483
+
484
+
485
+ ## 0.4.124 — 2026-11-16
486
+
487
+ ### Fixed
488
+ - **Idempotency is measured in traces, not wall-clock time.** 0.4.123 compared period
489
+ spans, but the first window starts at 1970 (a 56-year span), so a summary covering
490
+ recent traces could look <50% on the timeline and get re-written. A window now counts
491
+ as already reflected when an episode's `sourceIds` cover ≥50% of the window's trace ids
492
+ (reflect samples ~60% of a window, so a fully reflected one scores ~0.6; a 0.8 bar would
493
+ never fire). `force: true` still rewrites.
494
+ - The `maxWindows` schema description said "默认 3" while the code used 8.
495
+
496
+ ### Note
497
+ - The earlier time-overlap approach could also *over*-skip: a summary covering half the
498
+ wall-clock span but few traces would block a window whose traces were never captured.
499
+ Trace ids do not have that failure mode.
500
+
501
+ ### Verified
502
+ - Backfill tests use distinct trace texts so sampling spreads (near-identical seeds made
503
+ reflect keep a single source, which hid the effect). Suite: 474/474, twice.
504
+
505
+
506
+ ## 0.4.123 — 2026-11-16
507
+
508
+ ### Fixed
509
+ - **Backfill idempotency now accepts overlap, not just equality.** Re-walking the same
510
+ stretch with a different `windowSize` (40 → 32) produced different period boundaries and
511
+ therefore a second overlapping episode — declared coverage would inflate while the store
512
+ said "covered". A window is now skipped as `already-reflected` when an existing episode
513
+ covers ≥50% of it; `force: true` still rewrites.
514
+ - The backfill tool's `maxWindows` default is 8 (was 3), so reaching 24 windows no longer
515
+ silently needs eight calls with the default.
516
+
517
+ ### Verified
518
+ - Tests: re-running with a different window size skips the overlapping windows and adds at
519
+ most the genuinely new tail; boundary-millisecond traces still group; 473→474 suite
520
+ passes, twice.
521
+
522
+
523
+ ## 0.4.122 — 2026-11-16
524
+
525
+ ### Fixed
526
+ - **Backfill is idempotent by default.** It passed `force: true` unconditionally, so
527
+ re-running the same window wrote a second episode. Each window now consults
528
+ `summaries.findPeriod()` first and reports `already-reflected`; `force: true` is only
529
+ for "the window genuinely changed, recompute".
530
+ - **Same-millisecond boundaries are no longer dropped.** `until` used `last + 1ms`, so if
531
+ several traces shared the boundary millisecond, the rest fell forever between windows
532
+ (the next window starts at `>=` that timestamp). The window now extends to include every
533
+ trace with the boundary timestamp and ends at the *next* distinct timestamp.
534
+ - The tool's span text tolerates a trailing `{ skipped: 'not-enough-traces' }` entry
535
+ (it has no `since`/`until`) instead of printing `—`.
536
+
537
+ ### Note
538
+ - The 3.4K-char summary budget concern does not apply to this path: episode summaries are
539
+ extractive (no LLM call), so there is no `maxTokens` to exhaust here.
540
+
541
+ ### Verified
542
+ - Tests: a second identical run adds zero summaries and reports `already-reflected`;
543
+ three traces sharing the boundary millisecond all land in the same window. Suite:
544
+ 473/473, twice.
545
+
546
+
547
+ ## 0.4.121 — 2026-11-16
548
+
549
+ ### Added
550
+ - **Timeline backfill for episode summaries.** Declared coverage was 3.4% because only
551
+ five episodes existed; `reflect.backfillEpisodes()` now walks the timeline in windows of
552
+ 32–60 traces (default 40, clamped) and writes one episode per window, with `until` as an
553
+ exclusive end so one episode cannot swallow the whole history. Exposed as
554
+ `cortex_consolidate action: "backfill"` with `dryRun` defaulting to true; each window's
555
+ `sourceIds` stays within the existing 24-source budget (`maxSources` clamp 1–40 is
556
+ respected by construction).
557
+
558
+ ### Verified on a production store (read-only copy)
559
+ - `windowSize 40, maxWindows 6` → planned 6 windows, covering 1970-01-01 → 2026-11-12
560
+ (the first 240 traces). To reach the compressible subset's ~60% the plan needs roughly
561
+ 20–24 windows, matching the reviewer's estimate.
562
+
563
+ ### Verified
564
+ - `reflect-backfill.test.js`: preview writes nothing; a real run writes episodes with
565
+ ≤24 sources and distinct periods; `windowSize < 32` is clamped to 32. Suite: 471/471,
566
+ twice.
567
+
568
+
569
+ ## 0.4.120 — 2026-11-16
570
+
571
+ ### Fixed
572
+ - **`bin/verify.mjs` labels the installed version, not the source tree.** It used to read
573
+ `../package.json` (the checkout), so the 0.4.118 snapshot recorded `0.4.119` once the
574
+ source was bumped — the baseline label for a whole version was wrong. It now reads
575
+ `<profile>/node_modules/dsh-cortex/package.json`, reports `versionSource:
576
+ installed|source` plus `sourceVersion`, and `--installed` exits 1 when nothing is
577
+ installed. Verified against the live profile: `version 0.4.119 / versionSource
578
+ installed` while the checkout is at 0.4.120.
579
+
580
+ ### Verified
581
+ - Unit suite unchanged: 468/468, twice. `verify.mjs --installed` fails closed, plain
582
+ `verify.mjs` still succeeds.
583
+
584
+
585
+ ## 0.4.119 — 2026-11-16
586
+
587
+ ### Fixed (review of 0.4.118 — do not install 118)
588
+ - **The fact channel was silently dead.** It built fact text from `fact.subject`, which facts
589
+ do not expose; the text was an English predicate plus a literal, so Chinese traces never
590
+ matched (factCovered = 6). It now resolves subject/object names through the entities repo,
591
+ appends `objectLiteral` and `evidence`, and reuses the precompiled token sets (the unused
592
+ `factScoreFor` duplicate is deleted).
593
+ - **Preview no longer hands out single-evidence candidates.** `wouldCut` is `strongPool`
594
+ only; when a pool exists but has no row with two evidence kinds the reason is
595
+ `single-evidence-only`.
596
+ - The preview threshold is a parameter (`coverageThreshold`, clamped 0.2–0.9) instead of a
597
+ hardcoded 0.35, and is echoed back in the report.
598
+
599
+ ### Verified on a production store (read-only copy)
600
+ - active 945 · summaryCovered 423 · **factCovered 67** · both 52 · pool 67 · strongPool 52
601
+ - r p50 0.022 / p90 0.537, spread 0.515 · **`usable: true`**
602
+ - First time the gate opened: fixing the fact fields lifted fact coverage from 6 to 67 rows.
603
+ Execution is still preview-only; 0.4.120 will target summary windows (episode count), not
604
+ a lower threshold.
605
+
606
+ ### Verified
607
+ - Suite: 468/468, twice.
608
+
609
+
610
+ ## 0.4.118 — 2026-11-16
611
+
612
+ ### Changed
613
+ - **Preview thresholds are reachable.** With `0.92 * rate` a 0.75 line needs rate 0.815, so the
614
+ pool was structurally empty; the preview now uses an absolute `0.35` line and reports a
615
+ `strongPool` that additionally requires two evidence kinds.
616
+ - **Facts are a first-class coverage channel.** Facts are grouped by `sourceEventId` and
617
+ scored against the trace text (≥2 shared content tokens, `0.5 + 0.4*rate`); the preview
618
+ reports `summaryCovered`, `factCovered` and `bothCovered` separately.
619
+ - **DF cutoff 10%, not 60%**: with 945 documents the old cutoff (567) filtered nothing; a
620
+ synthetic test now pins that generic bigrams like 「我们」 are dropped.
621
+ - Removed the dead `rate < 0.15 → ≤0.2` cap (0.92×0.15 is already below it) and the
622
+ fallback that returned the *unfiltered* set for short traces.
623
+ - `reason` is evaluated as `no_signal → empty_pool → flat`; the tool default is now 5000
624
+ (it was still 500, silently truncating).
625
+
626
+ ### Verified on a production store
627
+ - active 942 · summaryCovered 423 · factCovered 6 · both 5 · pool 6 · strongPool 5
628
+ - r p50 0.02 / p90 0.048, spread 0.028 → **`reason: flat`, `usable: false`**
629
+ - So the pool is no longer structurally empty, but the signal is still too thin: the next
630
+ move is summary **granularity** (session/day-level), not a lower threshold.
631
+
632
+ ### Verified
633
+ - Suite: 467/467, twice.
634
+
635
+
636
+ ## 0.4.117 — 2026-11-16
637
+
638
+ ### Fixed (review of 0.4.116's scorer — do not install 116)
639
+ - **The flat distribution was the formula, not the summaries.** `score = 0.45 + 0.45*rate`
640
+ turned any 2-token overlap into 47% coverage, so p50 sat at its floor and the spread
641
+ collapsed to 0.013. The score is now `0.92 * rate` with a rate-based cap only
642
+ (`rate < 0.15 → ≤0.2`); there is no additive floor and no length-based penalty that
643
+ used to pin long traces at 0.35.
644
+ - **Content tokens are filtered by document frequency.** `tokens()` keeps raw CJK
645
+ bigrams with no stopword pass, so 「我们 / 可以 / 这个」 made any two sentences look
646
+ similar. High-frequency tokens (in >60% of the batch) are dropped before scoring, with
647
+ a small character stop-set as a second guard. Sets are built once per preview run.
648
+ - **`usable` now explains itself**: `no_signal` (scored <10) / `flat` (p90−p50 <0.05) /
649
+ `empty_pool` (no row over threshold), instead of one ambiguous boolean.
650
+ - The preview scans all active traces by default (limit 5000) and reports
651
+ `scanned`, so the 500-row truncation cannot hide the store size; the protection line
652
+ is now the same `max(0.9, min(0.95, p75))` as consolidation.
653
+
654
+ ### Verified on a production store (read-only copy)
655
+ - active 940 · skipped 293 protected / 179 recent · scored 461 · 5 summaries
656
+ - r p50 **0.041** / p75 0.059 / p90 0.088, spread 0.047 · best row **0.33**
657
+ - **`reason: flat`** — with the honest scorer the current summaries really do cover very
658
+ little. The next move is summary quality, not quota archiving.
659
+
660
+ ### Verified
661
+ - Suite: 466/466, twice.
662
+
663
+
664
+ ## 0.4.116 — 2026-11-16
665
+
666
+ ### Added
667
+ - **Read-only compaction preview** (`cortex_consolidate action: "preview"`), the first
668
+ step of the quota-compaction plan. It computes a *verifiable* coverage score
669
+ (`coverage2`): a summary only counts when its own tokens overlap the trace, thin
670
+ summaries are capped at 0.35, and `sourceIds` membership alone no longer grants 1.0.
671
+ Protected traces (importance ≥ max(0.9, p75), reflection, promise) and recently
672
+ accessed ones (`last_access_at` within 30 days) are skipped, then the r distribution
673
+ (p50/p75/p90) and the would-be cut list are reported. It writes nothing.
674
+
675
+ ### Verified on a production store (read-only copy via `VACUUM INTO`)
676
+ - 939 active · skipped 293 protected / 178 recent · 461 scored · 5 summaries
677
+ - r p50 0.472 / p75 0.481 / p90 0.494; **spread 0.013 < 0.05 → `usable: false`, pool 0**
678
+ - Conclusion: the coverage signal is not usable yet. Per the design, 0.4.117 (gray-zone
679
+ judgements) must **not** start until coverage quality improves — exactly the gate the
680
+ reviewer asked for.
681
+
682
+ ### Verified
683
+ - `compaction-preview.test.js`: coverage2 scoring/caps, preview is read-only. Suite:
684
+ 466/466, twice.
685
+
686
+
687
+ ## 0.4.115 — 2026-11-16
688
+
689
+ ### Fixed
690
+ - **The threshold clamp actually clamps.** 0.4.114 computed `simThreshold` but both
691
+ comparison sites still used the raw `threshold`, so the clamp was dead code. It is now
692
+ `clampThreshold(value)` (exported and unit-tested: 0.1 → 0.5, 1.5 → 0.99, 0 / NaN →
693
+ 0.8) and both the clustering loop and the target-similarity filter use it. The tool
694
+ schema now declares `minimum: 0.5, maximum: 0.99`.
695
+ - **`cortex_health` no longer shows a dedupe preview as the last consolidation.** The
696
+ consolidation line now excludes rows with `model = 'dedupe'`, so a manual preview
697
+ cannot hide the last real LLM run.
698
+
699
+ ### Verified
700
+ - New `dedupe-threshold.test.js`; Suite: 464/464, twice.
701
+
702
+
703
+ ## 0.4.114 — 2026-11-16
704
+
705
+ ### Fixed
706
+ - **Dedupe no longer merges by transitive accident.** Union-find is transitive: A~B and
707
+ B~C could pull an A that is not similar to C into the same merge. Every member must
708
+ now also be a near-duplicate *of the chosen target* (Jaccard ≥ threshold), otherwise
709
+ it stays active and the group is counted as dropped.
710
+ - **Provenance on merge summaries.** The summary now lists the titles that were merged
711
+ away (`去重合并 2 条到 X(含:A / B)`), so an audit can tell what disappeared without
712
+ opening every archived row.
713
+
714
+ ### Fixed (review pass from the reviewer teammate)
715
+ - `protectedCount` now uses `isProtected`, so a low-importance reflection is counted as
716
+ protected (it used to slip past the all-protected check and burn an LLM call).
717
+ - **All-protected batches keep `update`/`conflict`.** The short-circuit that skipped the
718
+ model also killed the only non-destructive action; the batch is still sent, with a
719
+ prompt that forbids `archive`/`merge` and allows `update`/`conflict`.
720
+ - dedupe previews record `status: 'preview'` instead of `degraded`, so `cortex_health` no
721
+ longer shows a dry run as a failed consolidation.
722
+ - `dryRun` is normalised once (`Boolean`), threshold is clamped to 0.5–0.99, the dedupe
723
+ digest is namespaced (`dedupe:` / `run:`) so it cannot collide with the unchanged
724
+ gate, summary provenance insert is best-effort, and a non-dry dedupe on a read-only
725
+ scope is refused at the tool layer.
726
+
727
+ ### Verified
728
+ - Property test: every archived trace is still ≥ threshold similar to an active trace
729
+ after a dedupe run. Suite: 463/463, twice.
730
+
731
+
732
+
733
+
734
+
735
+ ## 0.4.113 — 2026-11-16
736
+
737
+ ### Changed
738
+ - **Dedupe may merge traces that sit on the protection line.** A production store has 75% of
739
+ active traces at importance ≥ 0.95, so "two protected members" is the normal case and
740
+ the old rule dropped every group — dedupe could not merge a single pair. Since dedupe
741
+ has already proved the members are near-duplicates (Jaccard ≥ threshold) and
742
+ reflections are excluded from the pool entirely, keeping N copies buys nothing:
743
+ `validateDecision` gains `allowProtectedMerge`, used only by dedupe. The LLM path
744
+ keeps the strict rule (a protected trace may never be a merge source).
745
+
746
+ ### Verified
747
+ - Tests: a protected pair is now merged; a reflection never takes part in dedupe and
748
+ survives untouched; an LLM merge proposal over protected traces is still rejected.
749
+ Suite: 462/462, twice.
750
+
751
+
752
+ ## 0.4.112 — 2026-11-16
753
+
754
+ ### Fixed
755
+ - **All-protected batches no longer waste a call or look alarming.** On 2026-11-16 the
756
+ automatic trigger hit a batch whose 30 candidates were all ≥ 0.93, so every proposal
757
+ was rejected and the run read `rejected 20`. When every candidate is on the
758
+ protection line the run now records `skipped / all-protected` without calling the
759
+ model at all.
760
+ - **Rejection counts carry their reasons**: the error label is now
761
+ `rejected 3(protected×2 · unknown-id×1)` instead of a bare number.
762
+ - **One protection predicate.** `validateDecision`'s archive branch checked
763
+ `importance >= protect || kind === 'reflection'`, but the merge branch only checked
764
+ importance — so a low-importance reflection could be merged away as a merge *source*.
765
+ Both branches, the duplicate-group builder and the deterministic dedupe now use the
766
+ same `isProtected(trace, protect)` helper; reflections may only ever be the target.
767
+
768
+ ### Added
769
+ - **Deterministic dedupe.** The LLM kept answering `keep` even when handed duplicate
770
+ groups, so the mechanical half of consolidation no longer asks it: `consolidation.dedupe()`
771
+ clusters active traces by 2-gram Jaccard (threshold 0.8 by default), picks the
772
+ best-preserved member as the merge target, refuses any group with two protected
773
+ members, and archives the rest with `compression: merged` plus a `dedupe` merge
774
+ summary. Exposed as `cortex_consolidate action: "dedupe"` with `dryRun` defaulting
775
+ to true.
776
+ - `record()` now returns `groups` / `groupsDropped` on the run object, so callers (and
777
+ the tool output) can read them without a second SQL query.
778
+
779
+ ### Verified
780
+ - Tests: dry run reports one group without touching the store; a real run archives one
781
+ trace and leaves a merge summary; two protected members are never merged. Suite:
782
+ 457/457, twice.
783
+
784
+
785
+ ## 0.4.111 — 2026-11-16
786
+
787
+ ### Fixed
788
+ - **The protected member is now a structural merge target.** 0.4.110 dropped groups
789
+ with two protected members but only *asked* the model to keep the protected one as
790
+ `targetId`; if it picked another member the whole decision was rejected as
791
+ `protected-merge`. Groups are now offered as `{ ids, mustBeTarget }` and the prompt
792
+ says the target must be the `mustBeTarget` id.
793
+ - **Dropped groups are counted.** The audit row now carries `groupsDropped` next to
794
+ `groups`, so `groups: 0` no longer hides "there were duplicates but the protection
795
+ line removed them".
796
+
797
+ ### Verified
798
+ - Tests: two-protected group → `groups: 0`, `groupsDropped: 1` and no group in the
799
+ prompt; one-protected group → `groups: 1` and `mustBeTarget` present. Suite:
800
+ 454/454, twice.
801
+
802
+
803
+ ## 0.4.110 — 2026-11-16
804
+
805
+ ### Fixed
806
+ - **Duplicate groups are filtered by the protection line before they reach the
807
+ model.** `validateDecision` rejects a `merge` whose non-target member is protected,
808
+ so a group with two protected traces could only produce a decision that fails —
809
+ and the rejection read like "there were duplicates but it kept them". Groups with
810
+ two or more protected members are dropped; a group with exactly one keeps that one
811
+ as the target and the rest as sources.
812
+
813
+ ### Added
814
+ - Every consolidation audit row now records `groups`, the number of duplicate groups
815
+ actually offered. Without it there was no way to tell "no duplicates" apart from
816
+ "duplicates that were dropped".
817
+
818
+ ### Verified
819
+ - Tests: a two-protected group is withheld (`groups: 0`); a one-protected group is
820
+ offered (`groups: 1`). Suite: 454/454, twice.
821
+
822
+
823
+ ## 0.4.109 — 2026-11-16
824
+
825
+ ### Fixed
826
+ - **The per-tick path is no longer a per-minute LLM call.** `features.consolidateOnTick`
827
+ was silently `true` in `feature-overrides.json` since 11-12 (the profile yml never
828
+ mentioned it), so the scheduler ran a full consolidation every tick — hundreds of `no-llm`
829
+ rows are that history, not a broken adapter. The tick path now honours
830
+ `consolidateTraceGapMinutes` (default 30) and reports `too-soon` instead.
831
+ - `lastRealConsolidationAt` joins `dream_runs` so the audit lookup is scoped; with
832
+ several scopes it no longer reads another scope's run.
833
+
834
+ ### Added
835
+ - **Duplicate groups are handed to the model.** Capture already rejects
836
+ byte-identical traces, so exact matching finds nothing; candidates are clustered by
837
+ 2-gram Jaccard ≥ 0.6 and the groups are listed in the prompt with an instruction to
838
+ `merge` the best-preserved one. Without this the model kept answering `keep` even
839
+ when nothing was protected.
840
+
841
+ ### Verified
842
+ - Tests: tick gate skips within the gap and runs after it; paraphrased duplicates
843
+ reach the prompt as a merge group. Suite: 452/452, twice.
844
+
845
+
846
+ ## 0.4.108 — 2026-11-16
847
+
848
+ ### Changed
849
+ - **The protection line is now relative.** Live data had 99% of active traces at
850
+ `importance >= 0.7`, while the prompt and validator both protected everything at
851
+ `>= 0.7` — so consolidation could only ever answer `keep`. The line is now
852
+ `max(0.9, min(0.95, p75))` of the current batch: the top slice stays protected
853
+ (reflections always), everything below it may be merged or archived, and the
854
+ prompt states the actual line and how many items it protects. Same lesson as the
855
+ cold tier: absolute thresholds vs. an absolute-heavy distribution.
856
+
857
+ ### Fixed
858
+ - **`consolidateOnTick` can no longer starve the delta trigger.** The tick path has
859
+ no interval gate, so it would write a run every minute and make
860
+ `runAutoConsolidate` permanently `too-soon`. The delta trigger now measures the
861
+ gap from the last *non-tick* `consolidation.run` audit row, falling back to
862
+ `dream_runs` when no audit exists.
863
+ - `tool` and `api` call sites now pass `caller`, so every consolidation run names
864
+ its actor.
865
+
866
+ ### Verified
867
+ - New tests: quantile line protects the top and archives the bottom; the prompt no
868
+ longer hardcodes 0.7; tick-written runs do not starve the trigger; audit-less
869
+ stores fall back to the table. Suite: 449/449, twice.
870
+
871
+
872
+ ## 0.4.107 — 2026-11-16
873
+
874
+ ### Changed
875
+ - **Consolidation budget raised again, with evidence.** After 0.4.106 shipped, the
876
+ automatic trigger produced two real runs within a minute and both were still
877
+ `empty-text:max-tokens` at 2400 — the answer keeps being cut off by the cap, not
878
+ rejected. Budgets are now 6000 for the bounded and retry attempts, 3000 for the
879
+ plain attempt (a cap is a ceiling, not spend).
880
+
881
+ ### Added
882
+ - **Consolidation records who called it.** `dream_runs` has no caller column, so
883
+ each run now writes `audit(consolidation.run, { caller })`; callers pass
884
+ `auto-trace-delta` / `tick` / `sleep` / `tool`. Two runs a minute apart used to be
885
+ unexplainable from the data alone.
886
+
887
+ ### Fixed
888
+ - `health`'s `LLM_EMPTY` buckets no longer render `llm-empty:empty-text:max-tokens`
889
+ and `llm-empty-retry:empty-text:max-tokens` as two identical entries; the retry
890
+ bucket reads `…(重试)`.
891
+
892
+ ### Verified
893
+ - New tests: caller lands in the audit row; retry bucket is distinguishable.
894
+ Suite: 445/445, twice.
895
+
896
+
897
+ ## 0.4.106 — 2026-11-16
898
+
899
+ ### Added
900
+ - **Consolidation gets its own trigger.** Until now it only ran inside sleep, which
901
+ is gated to once per 20 h — so every version's acceptance test waited a day.
902
+ With `features.consolidateOnTraceDelta` on, each scheduler tick checks whether
903
+ at least `consolidateTraceDelta` (default 20) new active traces appeared since
904
+ the last consolidation and at least `consolidateTraceGapMinutes` (default 30)
905
+ passed; if so it runs a real consolidation and records
906
+ `report.steps.autoConsolidate` (`fresh / status / model / decisions / applied`,
907
+ or a skip reason `too-soon` / `not-enough-new-traces`).
908
+
909
+ ### Fixed
910
+ - **Per-call failure reasons.** The adapter now accepts `onReason`, so a failure is
911
+ reported to the caller that caused it; an interleaved dream/feeling call can no
912
+ longer reset or overwrite another call's reason. `ask()`'s outer catch records
913
+ `exception-outer` instead of swallowing silently.
914
+ - `health`'s consolidation line now shows `决策 N(keep M)· 应用 K`, so an
915
+ `applied` run where every decision was `keep` reads as the no-op it is.
916
+
917
+ ### Verified
918
+ - `scheduler-autoconsolidate.test.js`: runs when fresh ≥ threshold and gap passed;
919
+ skips with a reason otherwise; off by default. `consolidate-reason.test.js`
920
+ covers `exception-outer` and reason scoping across calls. Suite: 443/443, twice.
921
+
922
+
923
+ ## 0.4.105 — 2026-11-16
924
+
925
+ ### Fixed
926
+ - **The output budget was cutting the answer off.** The installed 0.4.103 recorded
927
+ `llm-empty:empty-text:max-tokens` — the model's reply was truncated at the token
928
+ cap, not rejected, so the text came back empty. Consolidation budgets are raised:
929
+ bounded attempt 2400 (was 1400), plain attempt 1600 (was 900), retry 2400
930
+ (was 1600). With reasoning tokens sharing the same budget, 900 was simply too
931
+ small.
932
+
933
+ ### Verified
934
+ - `consolidate-retry.test.js` asserts the bounded attempt now requests ≥2000 tokens.
935
+ Suite: 437/437, twice.
936
+
937
+
938
+ ## 0.4.104 — 2026-11-16
939
+
940
+ ### Changed
941
+ - **Big payloads now start bounded instead of failing first.** Live evidence from the
942
+ installed 0.4.102: a ~10k-char payload produced an empty answer, while the slim
943
+ retry (10 × 220 chars) returned a valid array with 10 `keep` decisions and was
944
+ recorded as `llm-retry`. So candidates over 5000 chars now begin with a bounded
945
+ attempt (20 items × 300 chars, `maxTokens` 1400) and are recorded as
946
+ `llm-bounded`; if that still comes back empty, the 10 × 220 retry runs and is
947
+ marked `llm-retry`. Small payloads keep the original single call.
948
+
949
+ ### Verified
950
+ - `consolidate-retry.test.js`: 40 long traces → one bounded call, model `-bounded`;
951
+ retry path and reason labels unchanged. Suite: 437/437, twice.
952
+
953
+
954
+ ## 0.4.103 — 2026-11-16
955
+
956
+ ### Added
957
+ - **`cortex_health` reports consolidation and sleep.** `dream_runs.error` is the
958
+ only place that says *why* consolidation did nothing; leaving it in a table
959
+ meant remembering to look. `health` now exposes
960
+ `consolidation { dream, sleep }` and the text adds one line, e.g.
961
+ `巩固 2026-11-16T09:34 空转(llm-empty:empty-text:length) · 睡眠 …(skipped,反思 1)`.
962
+
963
+ ### Verified
964
+ - `health-consolidation.test.js`: a run without an adapter shows `空转(no-llm-adapter)`
965
+ and `睡眠 还没有记录`. Suite: 436/436, twice.
966
+
967
+
968
+ ## 0.4.102 — 2026-11-16
969
+
970
+ ### Fixed
971
+ - **Empty answers now say why.** The adapter keeps the failure reason
972
+ (`no-selection`, `finish-error`, `exception`, `empty-text:<finish kind>`) and
973
+ consolidation records `llm-empty:<reason>`. When the slim retry already ran and
974
+ still came back empty the label is `llm-empty-retry:<reason>`, so "retried and
975
+ still empty" is no longer indistinguishable from "empty on the first try".
976
+ (Both P2s from the 0.4.101 review.)
977
+ - `health` matches the `llm-empty%` family and reports the reason buckets, so one
978
+ glance shows whether the fix is about prompt size, purpose, or wiring.
979
+
980
+ ### Verified
981
+ - `consolidate-reason.test.js`: reason carried through; retry-exhausted label;
982
+ health buckets by reason. Suite: 435/435, twice.
983
+
984
+
985
+ ## 0.4.101 — 2026-11-16
986
+
987
+ ### Changed
988
+ - **Consolidation retries once with a slimmer prompt.** A production store's payload
989
+ averages ~5k characters; when the first call comes back empty and the payload
990
+ exceeds 4000 chars, it retries with the top 10 items and 220-char contents. A
991
+ successful retry is recorded as `llm-retry` in the model column, so the extra
992
+ path is visible instead of indistinguishable from a plain success. Short
993
+ payloads do not retry (a retry would only repeat the same empty answer).
994
+
995
+ ### Verified
996
+ - `consolidate-retry.test.js`: 16 long traces → two calls, second prompt shorter,
997
+ status `applied` with a `-retry` model; 3 short traces → one call, `llm-empty`.
998
+ Suite: 432/432, twice.
999
+
1000
+
1001
+ ## 0.4.100 — 2026-11-16
1002
+
1003
+ ### Fixed
1004
+ - **`labelEntities` still returned the old `no-llm` skip label.** It now returns
1005
+ `no-llm-adapter`, matching `consolidation.run`, so one word no longer covers two
1006
+ different failures. (P3 from the 0.4.98 review; the historical rows stay
1007
+ as they are.)
1008
+
1009
+ ### Verified
1010
+ - `label-entities-skip.test.js`: without an adapter the skip label is
1011
+ `no-llm-adapter`. Suite: 430/430, twice.
1012
+
1013
+
1014
+ ## 0.4.99 — 2026-11-16
1015
+
1016
+ ### Added
1017
+ - **`autoSleep`: the scheduler can now start a sleep pass.** Nothing used to call
1018
+ `life.sleep()` on a schedule, so `consolidateOnSleep` never had a chance to run
1019
+ (`sleep-runs` had been stuck at 11-12). When `features.autoSleep` is on and the
1020
+ host is idle, the scheduler sleeps if no sleep exists or the last one is ≥20h
1021
+ old; the profile patch enables it.
1022
+
1023
+ ### Changed
1024
+ - `features.autoSleep` added to the config schema and the override keys, so it can
1025
+ be toggled from `feature-overrides.json` without a rebuild.
1026
+
1027
+ ### Verified
1028
+ - `scheduler-autosleep.test.js` (4 cases): never slept → sleeps; 3h ago → does not;
1029
+ 21h ago → sleeps; flag off → never calls. Suite: 429/429, twice.
1030
+
1031
+
1032
+ ## 0.4.98 — 2026-11-16
1033
+
1034
+ ### Fixed
1035
+ - **`no-llm` was two different failures under one label.** A missing adapter and an
1036
+ adapter that answered nothing both recorded `no-llm`, so the unexpected rows gave no
1037
+ clue which one to fix. They are now `no-llm-adapter` and `llm-empty`, and
1038
+ `health` warns `LLM_EMPTY` when ≥5 empty answers pile up within 6 hours.
1039
+
1040
+ ### Found while investigating (not fixed here)
1041
+ - **Nothing calls `life.sleep()` on a schedule.** `sleep-runs` stops at 11-12
1042
+ because `sleep` only runs through the tool/API; `consolidateOnSleep` therefore
1043
+ never fires. The next version should add an `autoSleep` scheduler hook (idle +
1044
+ ≥20h since last sleep) rather than pretending the flag alone is enough.
1045
+
1046
+ ### Verified
1047
+ - `consolidate-errors.test.js`: no adapter → `no-llm-adapter`, empty answer →
1048
+ `llm-empty`, six empties → `LLM_EMPTY` warning. Suite: 425/425, twice.
1049
+
1050
+
1051
+ ## 0.4.97 — 2026-11-15
1052
+
1053
+ ### Fixed
1054
+ - **Why consolidation never ran: the LLM feature was off.** The live profile had
1055
+ `features.llm` unset, so the adapter was `null` and every consolidation tick
1056
+ recorded `no-llm` (hundreds of rows in `dream_runs`); the same flag gates sleep
1057
+ consolidation. The profile patch now sets `features.llm: true` and
1058
+ `consolidateOnSleep: true` (backup: `cordis.patch.yml.bak-noisefix-*`), and
1059
+ `health` raises `LLM_DISABLED` when the flag is off so this can never be silent
1060
+ again.
1061
+ - **Facts polluted by sentence fragments.** The rule extractor now filters
1062
+ single-character function words (`的了着过等儿…`) and a `NOISE_OBJECTS` list
1063
+ (`等`, `收一收`, `水里`, …). `repair --drop-noise-facts` (opt-in) archives the
1064
+ existing garbage through the backup gate: 255 candidates live, 255 invalidated on
1065
+ a copy (`828 → 650` active).
1066
+
1067
+ ### Verified
1068
+ - `fact-noise-llm.test.js`: fragment text yields zero facts, a normal sentence
1069
+ still yields `likes`, and `LLM_DISABLED` appears only when the feature is off.
1070
+ Suite: 422/422, twice.
1071
+
1072
+
1073
+ ## 0.4.96 — 2026-11-15
1074
+
1075
+ ### Fixed
1076
+ - **`SLOW_MAINTAIN` no longer becomes permanent.** A slow pass row used to linger
1077
+ until the next *changed* pass overwrote it, which read as "currently stalling"
1078
+ forever. Only passes within `maintainSlowWindowHours` (default 6) count now, and
1079
+ the message carries `距现在 N 分钟` so the age is visible.
1080
+ - **Timestamp comparison uses `Date.parse`, not string order.** An injected
1081
+ `2026-11-15 14:36:00` sorted before `2026-11-15T14:36:00Z` purely because of the
1082
+ space, so the same instant looked older; unparsable values now fall back to the
1083
+ in-memory pass.
1084
+ - **The summon book could drop its own left card.** When the slots were full the
1085
+ left (emotional) card was pushed and then sliced off — the block looked frozen.
1086
+ It now displaces a chosen card whose removal keeps day diversity (its day is
1087
+ duplicated, or equals the left card's day); the displaced card is reported via
1088
+ `onDrop` → `summon.drop` metric. If no such card exists the left card is skipped
1089
+ rather than sacrificing the day spread.
1090
+
1091
+ ### Verified
1092
+ - `maintain-duration.test.js` (10 cases): an 8h-old slow pass raises nothing; a
1093
+ space-formatted timestamp equal to the in-memory one is treated as the same pass.
1094
+ - `summon-left-slot.test.js`: full slots → left card present, displaced card
1095
+ reported and absent from the result; free slot → no drop.
1096
+ Suite: 418/418, twice.
1097
+
1098
+
1099
+ ## 0.4.95 — 2026-11-15
1100
+
1101
+ ### Changed
1102
+ - **A slow pass now leaves durable evidence.** Quiet passes write no audit row, so
1103
+ a stall that happened between two heartbeats had nothing to read later. A pass
1104
+ slower than `maintainSlowMs` (default 2000) now writes its `maintain.run` row even
1105
+ when it changed nothing; changed passes behave exactly as before.
1106
+
1107
+ ### Why
1108
+ - A production store still holds only the 08:24:56Z row (9 keys, no `ms`): no passing
1109
+ `maintain` has actually changed anything since 0.4.89, and the "过期意图 1 条" in
1110
+ the 0.4.93 install was `repair`, not `maintain`. Without this change the first
1111
+ real timing sample could stay missing for days.
1112
+
1113
+ ### Verified
1114
+ - `maintain-duration.test.js` (8 cases): with `maintainSlowMs: 0` a no-change pass
1115
+ still writes an audit row carrying `ms`. Suite: 414/414, twice.
1116
+
1117
+
1118
+ ## 0.4.94 — 2026-11-15
1119
+
1120
+ ### Fixed
1121
+ - **A slow pass was hidden by the next quiet one.** `SLOW_MAINTAIN` only judged the
1122
+ newest pass, but `maintain()` runs on the heartbeat, so a stall is followed by a
1123
+ fast pass within minutes and the warning effectively never fired — defeating the
1124
+ whole point of adding it in 0.4.86. It now evaluates the newest pass *and* the
1125
+ last pass that changed anything, warns on the slowest, and reports that pass's
1126
+ timestamp alongside its duration. (Found by review against a production store.)
1127
+
1128
+ ### Verified
1129
+ - `maintain-duration.test.js` (7 cases): a fake 8500ms audit row followed by a fast
1130
+ quiet pass still raises `SLOW_MAINTAIN` with `ms: 8500` and a timestamp.
1131
+ Suite: 413/413, twice.
1132
+
1133
+
1134
+ ## 0.4.93 — 2026-11-15
1135
+
1136
+ ### Fixed
1137
+ - **"最近一趟维护" could point at the older run.** The line was chosen by
1138
+ "does it have `ms`", so after a change pass followed by a quiet one the audit row
1139
+ won and the genuinely newest (quiet) pass never appeared; the second line then
1140
+ repeated the first one. Selection is now by recency (`recorded.passAt` vs
1141
+ `memory.at`), and the second line only prints when the audit row is strictly
1142
+ older.
1143
+ - Maintenance timestamps in `cortex_health` now include seconds (`slice(0, 19)`);
1144
+ two different passes in the same minute used to render identically.
1145
+
1146
+ ### Verified
1147
+ - `maintain-duration.test.js` (6 cases, new one included): change pass then quiet
1148
+ pass → first line is the quiet pass, `maintainLastChanged` is the change pass,
1149
+ the two are not the same source. Suite: 412/412, twice.
1150
+
1151
+
1152
+ ## 0.4.92 — 2026-11-15
1153
+
1154
+ ### Fixed
1155
+ - **The maintenance readout was invisible in the tool that matters.**
1156
+ `cortex_health`'s text formatter printed a fixed line and ignored `report.ok`,
1157
+ so the 0.4.91 two-line detail (and the duration) never reached the caller. It
1158
+ now renders `维护:最近一趟 <time>(意图 x · 工作记忆 y · Nms)` and, when the
1159
+ newest audit row belongs to a different pass, `最近一次有变更:<time>(…)`.
1160
+
1161
+ ### Verified
1162
+ - `health-text-maintain.test.js`: a 6h-old row + a quiet pass → the rendered text
1163
+ contains both the duration and the separate "最近一次有变更" line.
1164
+ Suite: 411/411, twice.
1165
+
1166
+
1167
+ ## 0.4.91 — 2026-11-15
1168
+
1169
+ ### Changed
1170
+ - **`health` says both things about maintenance.** It reports `最近一趟维护`
1171
+ (the in-memory last pass, including its duration) and, when the newest audit row
1172
+ comes from a different pass, `最近一次有变更的维护` with that row's counts. A
1173
+ quiet heartbeat writes no row, so one stale timestamp used to read as "nothing
1174
+ has run for hours".
1175
+ - `health` exposes `maintainLastChanged` (that audit row) for tooling, and
1176
+ `maintainReport()` carries `passAt` from `detail.at` so the comparison uses the
1177
+ pass's own timestamp rather than the row's write time. (Review suggestion.)
1178
+
1179
+ ### Verified
1180
+ - `maintain-duration.test.js` (5 cases): a 6-hour-old row with `working: 7` plus a
1181
+ quiet pass → both lines appear and `maintainLastChanged.working` is 7.
1182
+ Suite: 410/410, twice.
1183
+
1184
+
1185
+ ## 0.4.90 — 2026-11-15
1186
+
1187
+ ### Fixed
1188
+ - **No more mixed maintenance numbers during the upgrade window.** When the audit
1189
+ row predated `ms`, `health` kept that row's counts and borrowed the latest
1190
+ pass's duration — a combination no single run produced. `lastMaintain` is now a
1191
+ full report snapshot and `health` falls back to it wholesale (counts and duration
1192
+ from the same pass). (Review finding.)
1193
+
1194
+ ### Note
1195
+ - The displayed "上次维护" time still comes from the audit row's write time rather
1196
+ than `detail.at`; within one tick they are equal, across ticks it is a few ms
1197
+ early. Cosmetic, left as is.
1198
+
1199
+ ### Verified
1200
+ - `maintain-duration.test.js` (4 cases): an old 9-key row with `working: 7` plus a
1201
+ fresh pass → `health.maintain.working` equals the new pass, not 7, and `ms` is
1202
+ finite. Suite: 409/409, twice.
1203
+
1204
+
1205
+ ## 0.4.89 — 2026-11-15
1206
+
1207
+ ### Fixed
1208
+ - **`SLOW_MAINTAIN` could not fire on the passes that mattered.** The audit row was
1209
+ written *before* `report.ms` was computed, so every real pass stored a detail
1210
+ without `ms`; `health` then preferred that row and fell back to memory only when
1211
+ no row existed — i.e. the warning worked on idle passes and failed exactly when
1212
+ maintenance did real work. Timing is now computed before the audit write, and
1213
+ `health` merges `ms` from the in-memory pass when the row lacks it.
1214
+ (Found by review against a production store: the single `maintain.run` row had keys
1215
+ `aliases/at/disputes/errors/goalRounds/intentions/playbook/summaries/working`
1216
+ and no `ms`.)
1217
+ - `maintainSlowMs` is config (default 2000) instead of a hardcoded threshold.
1218
+
1219
+ ### Verified
1220
+ - `maintain-duration.test.js` (3 cases): idle pass reports `ms`; a pass that
1221
+ actually changes something writes `ms` into the audit detail and health reads it;
1222
+ a 50ms row with `maintainSlowMs: 5` raises `SLOW_MAINTAIN`. Suite: 408/408, twice.
1223
+
1224
+
1225
+ ## 0.4.88 — 2026-11-15
1226
+
1227
+ ### Added
1228
+ - **`maintain()` measures itself.** The pass returns `report.ms`, keeps an
1229
+ in-memory `lastMaintain`, records a `maintain.ms` metric, and the audit detail
1230
+ now carries the duration. `health` exposes `maintain.ms` and raises
1231
+ `SLOW_MAINTAIN` above 2s — the 0.4.86 O(n²) regression would have shown up here
1232
+ instead of as a frozen host.
1233
+ - `health` falls back to the in-memory last pass when `maintain()` changed
1234
+ nothing (and therefore wrote no audit row).
1235
+
1236
+ ### Verified
1237
+ - `maintain-duration.test.js`: a no-op pass still reports `ms` and health reads
1238
+ the same number; a synthetic 8500ms audit row raises `SLOW_MAINTAIN`.
1239
+ Suite: 407/407, twice.
1240
+
1241
+
1242
+ ## 0.4.87 — 2026-11-15
1243
+
1244
+ ### Fixed
1245
+ - **The dedupe pass was O(n²) inside a synchronous `maintain()`.** 0.4.86 compared
1246
+ every pair to build the unique list: 148 traces → 10,878 jaccard calls ≈ 908ms,
1247
+ and the 500-trace cap would be ≈10s, freezing the host. The near-duplicate
1248
+ filter now runs only over the head of the ranked list (3× the budget); the tail
1249
+ is sampled by position, where duplicates are rare. Cost is (3×budget)²
1250
+ comparisons regardless of window size.
1251
+ - **Tail sampling was unreachable.** `rest[0] + k·floor(rest/remaining)` only
1252
+ reached ~83% of the list. Picks are now bucket-centred:
1253
+ `floor((slot + 0.5) * rest.length / remaining)`.
1254
+
1255
+ ### Verified
1256
+ - `reflect-sampling.test.js`: cold topics take most of the remaining slots
1257
+ (10 hot + 50 cold → 9 hot + 6 cold); the last-quarter traces (23–29) are
1258
+ reached; 500 candidates finish under 3s with ≤24 sources. Suite: 405/405, twice.
1259
+
1260
+ ### Note
1261
+ - Coverage dropping ~0.005 versus pure top-k is the intended cost of stratifying;
1262
+ it is not a regression and not a red line.
1263
+
1264
+
1265
+ ## 0.4.86 — 2026-11-15
1266
+
1267
+ ### Changed
1268
+ - **Sampling is stratified instead of pure top-k.** 60% of the source budget is
1269
+ filled by score, then the remaining slots are taken from the rest of the ranked
1270
+ list with a stride, so one loud strand of the day cannot occupy every slot.
1271
+ (Suggested by review after measuring a production store: max pairwise jaccard is 0.37,
1272
+ so the near-duplicate filter is a no-op there and the only real levers left are
1273
+ the caps and the sampling strategy.)
1274
+ - The composed `一句话` line now uses the first two **distinct** bullets (two
1275
+ traces can share a title, and `X;X` is not a summary).
1276
+
1277
+ ### Note
1278
+ - A first attempt keyed samples by a `topicSignature()` of the rarest tokens; it
1279
+ failed because synthetic `alpha1/alpha2` texts produced different signatures, so
1280
+ the cap did nothing. Replaced with the position-based stride, which does not
1281
+ depend on topic detection at all; `topicSignature` was removed rather than left
1282
+ as dead code.
1283
+
1284
+ ### Verified
1285
+ - `reflect-sampling.test.js`: 30 hot + 30 cold traces → the summary contains both
1286
+ (hot majority, cold non-empty). Suite: 403/403, twice.
1287
+
1288
+
1289
+ ## 0.4.85 — 2026-11-15
1290
+
1291
+ ### Fixed
1292
+ - **The `一句话` line was dead code.** `gistOf()` returns one of the bullets
1293
+ verbatim, so `!bullets.includes(gist)` could never be true: the line never
1294
+ rendered and the O(n²) similarity pass was wasted. It is now composed from the
1295
+ two most central bullets (joined with `;`, truncated to 90 chars) and omitted
1296
+ when there are fewer than three bullets; `gistOf()` is gone.
1297
+ - **The phrasing test now defends the real defect.** It asserted only that `· `
1298
+ lines were unique, which the `一句话:X` + `· X` shape passes. It now asserts
1299
+ each bullet appears exactly once in the content and that any `一句话` line
1300
+ differs from every bullet, plus a case with ≥3 distinct bullets that actually
1301
+ exercises the composed line.
1302
+ - Reflect config numbers are validated (`Number.isFinite` fallback): a typo used
1303
+ to become `NaN`, silently turning the dense-day follow-up off.
1304
+
1305
+ ### Verified
1306
+ - Suite: 402/402, twice.
1307
+
1308
+
1309
+ ## 0.4.84 — 2026-11-15
1310
+
1311
+ ### Changed
1312
+ - **Segments sample more of their window.** The source budget is now
1313
+ `sourceBudgetFor(n, { segment })`: 25% of the window capped at 24 for a segment,
1314
+ 12% capped at 16 for a whole-day window (floor 8 in both). Segments are short by
1315
+ construction, so the old flat 12% summarized a 40-trace segment from 8 rows and
1316
+ left coverage near 20% no matter how the phrasing improved.
1317
+ - The budget moved into an exported pure function, so it is unit-tested directly
1318
+ instead of being buried in the selection loop. It is a ceiling, not a quota: the
1319
+ near-duplicate filter (jaccard > 0.7) can still select fewer.
1320
+
1321
+ ### Verified
1322
+ - `reflect-source-budget.test.js`: 10/40/100/200/500 → whole-day 8/8/12/16/16,
1323
+ segment 8/10/24/24/24; explicit `maxSources` overrides both.
1324
+ Suite: 401/401, twice.
1325
+
1326
+
1327
+ ## 0.4.83 — 2026-11-15
1328
+
1329
+ ### Changed
1330
+ - **Episode summaries speak in the first person.** `这段时间里,记住了:` +
1331
+ `- bullet` became `这一段里,我记下了:` + `· bullet`, and the `一句话:` gist
1332
+ line is dropped when it duplicates a bullet verbatim. This is phrasing only:
1333
+ the coverage maths is untouched, and a test recomputes the stored coverage from
1334
+ the stored source ids to prove it.
1335
+ - The dense-day follow-up thresholds moved into config:
1336
+ `reflectFollowUpMin` (default 150) and `reflectFollowUpGapHours` (default 6).
1337
+ (Review finding.)
1338
+
1339
+ ### Verified
1340
+ - `reflect-phrasing.test.js`: first-person heading, `·` bullets with no
1341
+ duplicates, and `coverage == importance-weighted formula`. Suite: 399/399,
1342
+ twice.
1343
+
1344
+
1345
+ ## 0.4.82 — 2026-11-15
1346
+
1347
+ ### Changed
1348
+ - **Episodes are segmented, not overlapping.** The auto-reflection window now
1349
+ starts at `max(now − 24h, previous episode's periodEnd + 1ms)`, so two
1350
+ consecutive episodes cover different stretches of time. Segment summaries are
1351
+ marked `extractive-v2-segment` (still `-v2`, so coverage-rewrite skips them).
1352
+ A dense day may get a second episode, but only as a separate segment: ≥150 new
1353
+ traces since the last episode **and** ≥6h since it was written; otherwise the
1354
+ pass reports `skipped: 'covered'`.
1355
+ - `reflect({ since, segment })`: explicit window start, default behaviour
1356
+ unchanged.
1357
+ - Extracted `isPerm()` in the tier code — the 0.8 threshold was duplicated three
1358
+ times (review finding).
1359
+
1360
+ ### Verified
1361
+ - `auto-reflect.test.js`: 60 traces → episode 1; +7h with 160 new traces →
1362
+ second episode whose `periodStart` is **after** the first `periodEnd`, marked
1363
+ `extractive-v2-segment`; with only 60 new traces it stays `covered`.
1364
+ Suite: 398/398, twice.
1365
+
1366
+
1367
+ ## 0.4.81 — 2026-11-15
1368
+
1369
+ ### Fixed
1370
+ - **A perm-heavy recall no longer empties the hot tier.** The cold cut counted
1371
+ *all* candidates, so 8 candidates with 6 of them at importance ≥ 0.8 produced 2
1372
+ cold rows and 0 hot ones. The cut now ranks inside the non-perm pool only
1373
+ (`relativeTotal = candidates − permCount`), and still requires ≥ 4 non-perm
1374
+ candidates before splitting. (Review finding.)
1375
+
1376
+ ### Verified
1377
+ - `tiers-gist.test.js`: 6 perm + 2 mid → 0 cold, 2 hot; 2 perm + 6 mid → 2 cold,
1378
+ 4 hot. Suite: 396/396, twice.
1379
+
1380
+
1381
+ ## 0.4.80 — 2026-11-15
1382
+
1383
+ ### Changed
1384
+ - **Auto-reflection cadence follows the material, not the clock.** The fixed 6
1385
+ hour gate is gone (it was redundant with the 24h `covered` check — a summary
1386
+ written 5h ago already means the window is covered), and the minimum material
1387
+ is now 50 non-reflection traces (config `reflectMinMaterial`). A quiet day no
1388
+ longer gets an episode for showing up; a busy day is no longer delayed 6 hours
1389
+ before it can be summarized. `skipped: 'few-traces'` reports both `count` and
1390
+ `minMaterial` so the reason is visible.
1391
+
1392
+ ### Verified
1393
+ - `auto-reflect.test.js`: 60 traces → one episode then `covered`; 40 traces →
1394
+ `few-traces` with `minMaterial: 50`; 60 traces spread across 24h → still
1395
+ `covered` 7h later; next day writes a second; 3 traces → nothing.
1396
+ Suite: 394/394, twice.
1397
+
1398
+
1399
+ ## 0.4.79 — 2026-11-15
1400
+
1401
+ ### Fixed
1402
+ - **Cold-tier count was cut short by rounding.** `ceil(total * 0.75)` rounded the
1403
+ *cut* up, so common recall sizes under-filled the tier: 5 candidates → 1 cold
1404
+ (20%), 7 → 1 (14%), 10 → 2 (20%). It now counts first —
1405
+ `max(1, ceil(total * 0.25))` — and slides the cut: 4→1, 5→2, 6→2, 7→2, 8→2,
1406
+ 10→3, 20→5.
1407
+ - **Stable tier assignment.** Equal `utility` now breaks ties by importance and
1408
+ then id, so the same candidate set cannot shuffle between cold and hot on
1409
+ consecutive turns.
1410
+
1411
+ ### Verified
1412
+ - `tiers-gist.test.js`: the 4/5/6/7/8/10/20 → 1/2/2/2/2/3/5 table, plus a
1413
+ reversed-input determinism test. Suite: 394/394, twice.
1414
+
1415
+
1416
+ ## 0.4.78 — 2026-11-15
1417
+
1418
+ ### Fixed
1419
+ - **The cold tier was unreachable on real data.** It required importance < 0.4,
1420
+ but every live trace sits in 0.6–1.0 (measured: 0.6×5, 0.7×307, 0.8×184,
1421
+ 0.9×76, 1.0×211), so the tier was decorative. `tierOf` now also sends the
1422
+ lowest quarter of the current turn's candidates to `cold` (relative cut, at
1423
+ least 4 candidates), while keeping the absolute cutoff for genuinely small
1424
+ importance values. Fewer than 4 candidates means no relative split, so a tiny
1425
+ recall never gets pushed into index-only. (Reported during review.)
1426
+
1427
+ ### Verified
1428
+ - `tiers-gist.test.js` adds: 8 candidates all at 0.6 → the last 2 land in cold
1429
+ with `字面命中` and 6 stay hot; 3 candidates → 0 cold. Suite: 392/392, twice.
1430
+
1431
+
1432
+ ## 0.4.77 — 2026-11-15
1433
+
1434
+ ### Added
1435
+ - **Health reports the narrative layer.** `health` now exposes
1436
+ `summaryLayers { episode, merge, thread, lastEpisodeAt }`, the `cortex_health`
1437
+ text shows `摘要:每日 N 条(最近 …)· 合并记录 M · 线 K`, and a store with
1438
+ ≥100 active traces but zero episode summaries gets a `NO_EPISODE_SUMMARIES`
1439
+ warning — a thin narrative layer is now visible instead of silent.
1440
+
1441
+ ### Verified
1442
+ - `test/unit/health-summaries.test.js`: empty store reports 0, after inserting an
1443
+ episode + merge row it reports 1/1 with a timestamp. Suite: 390/390, twice.
1444
+
1445
+
1446
+ ## 0.4.76 — 2026-11-15
1447
+
1448
+ ### Changed
1449
+ - **Low-importance memories are index-only even when they were relevant hits.**
1450
+ `tierOf` used to promote any fts/vector/graph hit to `hot`, so the cold tier
1451
+ could never actually show its reason line (`语义相近` / `字面命中` /
1452
+ `共享实体` were unreachable branches). Now anything below 0.4 importance goes
1453
+ to `cold`, where the reason tells the reader whether fetching is worth it and
1454
+ the 120-char gist does not eat hot budget. Mid-importance hits stay hot.
1455
+ (Review finding.)
1456
+
1457
+ ### Verified
1458
+ - `tiers-gist.test.js` adds: importance 0.2 + vector → cold with `语义相近` and
1459
+ nothing in hot; importance 0.55 + vector → hot. Suite: 389/389, twice.
1460
+
1461
+
1462
+ ## 0.4.75 — 2026-11-15
1463
+
1464
+ ### Changed
1465
+ - **Cold-tier lines say why a memory might be worth fetching.** `[cold] id ·
1466
+ title(正文按需取回)` was a table of contents; it now reads
1467
+ `(语义相近 / 字面命中 / 共享实体 / 命中 <source>,正文按需 cortex_get)`,
1468
+ derived from the match source. A timestamp ("last read 3 days ago") gives no
1469
+ basis for deciding, the reason does.
1470
+
1471
+ ### Fixed
1472
+ - An empty gist (body identical to its title) no longer renders a dangling
1473
+ `- [L2] 标题:`.
1474
+ - `CHANGELOG.md` for 0.4.74 was written after packing, so it is missing from the
1475
+ 0.4.74 tarball; this entry and the 0.4.74 one are both present from here on
1476
+ (changelog is written before `pnpm pack`).
1477
+
1478
+ ### Verified
1479
+ - `tiers-gist.test.js` (6 cases: gist truncation, short snippet passthrough,
1480
+ title de-duplication, exact-equal body, cold reason, cold index-only).
1481
+ Suite: 387/387, twice.
1482
+
1483
+
1484
+ ## 0.4.74 — 2026-11-15
1485
+
1486
+ ### Fixed
1487
+ - **Recall lines no longer repeat the title.** Titles are usually the first line
1488
+ of the body, so `- 标题:要点` printed the same words twice
1489
+ (`2026-11-15 17:35:0.4.60 打包…:2026-11-15 17:35:0.4.60 打包…`). The gist now
1490
+ strips a leading title before choosing its sentence, and any remaining long
1491
+ shared prefix is removed at render time.
1492
+
1493
+ ### Verified
1494
+ - `tiers-gist.test.js`: a snippet that opens with its own title renders the title
1495
+ once and keeps the following sentence. Suite: 385/385, twice.
1496
+
1497
+
1498
+ ## 0.4.73 — 2026-11-15
1499
+
1500
+ ### Fixed
1501
+ - **`repair` keeps stdout machine-readable.** The readable report added in 0.4.71
1502
+ went to stdout, so any consumer doing `node repair.mjs | ConvertFrom-Json`
1503
+ broke (`handoff/rehearsal.ps1` did exactly that and the whole drill went red).
1504
+ The human block now goes to stderr; stdout is exactly one JSON document.
1505
+ - `rehearsal.ps1`: captures node stdout only (`2>$null`), tolerates native
1506
+ stderr (`ErrorActionPreference = Continue`), and trims `verify` output to its
1507
+ JSON object before parsing.
1508
+ - `ready.ps1` gains `-SkipRehearsalCheck`; `rehearsal.ps1` passes it. Without
1509
+ this a single failed drill poisoned the readiness gate that the drill itself
1510
+ runs first — a deadlock.
1511
+
1512
+ ### Verified
1513
+ - `node repair.mjs --dry-run | ConvertFrom-Json` parses; `rehearsal.ps1` now ends
1514
+ `REHEARSAL OK` 5/5 on the live copy (active 773, goalRounds 0, legacy gone).
1515
+
1516
+
1517
+ ## 0.4.72 — 2026-11-15
1518
+
1519
+ ### Added
1520
+ - **`repair --dedupe-episodes` (opt-in).** Merges episode summaries whose periods
1521
+ overlap by ≥90% *and* whose content is ≥0.8 jaccard: keeps the newest, deletes
1522
+ the rest, and records a `level='merge'` summary with the union of source ids so
1523
+ provenance survives. Dry runs report the clusters. Conservative on purpose.
1524
+ - The human-readable report now prints the dedupe line.
1525
+
1526
+ ### Measured on a production store
1527
+ - Pairwise episode similarity is 0.388 / 0.594 / 0.708 with overlap 0.553 / 0.627
1528
+ / 0.927 — the three old summaries share their **opening sentence** but not
1529
+ their bodies, so nothing is a true duplicate: `clusters: 0`. They stay; only
1530
+ future duplicates are prevented (0.4.67).
1531
+
1532
+ ### Verified
1533
+ - `dedupe-episodes.test.js`: same window + identical content → one cluster keeping
1534
+ the newer row, source ids unioned; a different window is untouched. Suite:
1535
+ 384/384, twice.
1536
+
1537
+
1538
+ ## 0.4.71 — 2026-11-15
1539
+
1540
+ ### Added
1541
+ - **`repair` prints a human-readable report after the JSON.** The JSON stays
1542
+ stable for scripts; the trailing block answers "what actually changed" for a
1543
+ person: goal-round/injected archives, title backfill, duplicate summaries,
1544
+ intentions, playbook, disputes, alias merges, the coverage-rewrite sample
1545
+ (`id: from → to (covered/window)`) and the backup path.
1546
+
1547
+ ### Verified
1548
+ - Dry run against a live-store copy prints the block with the right numbers.
1549
+ Suite: 383/383, twice.
1550
+
1551
+
1552
+ ## 0.4.70 — 2026-11-15
1553
+
1554
+ ### Added
1555
+ - **`repair --rewrite-coverage` (opt-in).** Brings pre-v2 episode summaries onto
1556
+ the importance-weighted coverage definition: for each v1 episode it recomputes
1557
+ `covered / total` from the summary's own `source_ids` and the traces inside its
1558
+ period, then (with `--apply`) writes the value and marks the row
1559
+ `extractive-v2-recomputed`. Dry runs report `candidates / changed / sample`
1560
+ without touching a row. Deliberately *not* part of `maintain()`: this is a data
1561
+ change and runs only through the repair backup gate. (Requested during review.)
1562
+
1563
+ ### Verified
1564
+ - `coverage-rewrite.test.js`: 2 important + 2 trivial traces, v1 summary covering
1565
+ the important pair → recomputed coverage 0.9; v2 rows are left alone. Live copy:
1566
+ 4 candidates → 4 applied, all rows re-marked. Suite: 383/383, twice.
1567
+
1568
+
1569
+ ## 0.4.69 — 2026-11-15
1570
+
1571
+ ### Fixed
1572
+ - **`reflectOverview` no longer averages two different meanings of `coverage`.**
1573
+ v1 summaries stored a count share (~0.03–0.05) and v2 stores an importance
1574
+ share (0.5–0.9), so an average over both reported a number that meant
1575
+ neither. It now averages v2 rows only and reports `legacy` (v1 count)
1576
+ separately.
1577
+
1578
+ ### Verified
1579
+ - `reflect-overview.test.js`: one v1 (0.04) + one v2 (0.8) → `coverage` 0.8,
1580
+ `legacy` 1. Suite: 382/382, twice.
1581
+
1582
+
1583
+ ## 0.4.68 — 2026-11-15
1584
+
1585
+ ### Fixed
1586
+ - **The auto-reflection dedupe used a condition that could never be true on real
1587
+ data.** `period_start` is the *earliest* trace in the window, so on a full day
1588
+ it sits ~24h before the run; comparing it against `now - 24h` only matched at
1589
+ the instant of writing. The anchor is now the summary's own `createdAt` (with
1590
+ `periodEnd` as fallback), so "one episode per 24h window" actually holds.
1591
+ (Review finding; the previous test passed only because its traces
1592
+ were all clustered at T0.)
1593
+
1594
+ ### Verified
1595
+ - `auto-reflect.test.js` now includes a realistic shape: traces spread over the
1596
+ full 24 hours, then a pass 7 hours later must be `skipped: 'covered'`; and a
1597
+ next-day pass with fresh material writes again. Suite: 381/381, twice.
1598
+
1599
+
1600
+ ## 0.4.67 — 2026-11-15
1601
+
1602
+ ### Fixed
1603
+ - **Auto-reflection no longer re-summarizes the same day.** The candidate window
1604
+ is always "the last 24 hours", so the 6-hour gate alone would have written
1605
+ roughly four overlapping episode summaries a day (the stored history already
1606
+ had near-duplicate rows). `maybeAutoReflect` now also skips when an existing
1607
+ episode summary starts inside that window (`skipped: 'covered'`). (Review
1608
+ finding.)
1609
+
1610
+ ### Verified
1611
+ - `auto-reflect.test.js` gains "same window, 7 hours later → covered";
1612
+ suite: 379/379, twice.
1613
+
1614
+
1615
+ ## 0.4.66 — 2026-11-15
1616
+
1617
+ ### Changed
1618
+ - **Episode summaries record which `coverage` semantics they use.** The column
1619
+ changed from "share of traces sampled" to "share of importance sampled", so
1620
+ old rows are not comparable with new ones; new summaries now carry
1621
+ `model: 'extractive-v2-weighted'` instead of a schema migration. (Review
1622
+ finding P2.)
1623
+
1624
+ ### Verified
1625
+ - `reflect-coverage.test.js` asserts the marker is set. Suite: 378/378, twice.
1626
+
1627
+
1628
+ ## 0.4.65 — 2026-11-15
1629
+
1630
+ ### Added
1631
+ - **Maintenance now keeps the narrative layer alive.** Reflections piled up
1632
+ (106) while episode summaries stayed at a handful, so long-term memory had no
1633
+ short version of itself. `maintain()` now writes one episode summary when the
1634
+ last one is older than 6 hours and the day has at least 10 non-reflection
1635
+ traces; it reports `reflection: {created|skipped}` in the maintain report.
1636
+
1637
+ ### Verified
1638
+ - `test/unit/auto-reflect.test.js` (2 cases: enough material → one summary then
1639
+ `recent` for 6h; too few traces → `few-traces`). Suite: 378/378, twice.
1640
+
1641
+
1642
+ ## 0.4.64 — 2026-11-15
1643
+
1644
+ ### Fixed
1645
+ - **The revive budget counted the wrong window.** `reviveBudget()` used
1646
+ `audit.list({ targetType: 'trace', limit: 200 })`, and without a target id that
1647
+ returns the newest 200 audit rows *overall* — with hundreds of `dream.run`
1648
+ rows a day, "24 hours" really meant about five hours. It now runs
1649
+ `SELECT COUNT(*) FROM audit WHERE action='trace.revive' AND at >= ?`, so the
1650
+ cap is the full day as intended. (Review finding.)
1651
+
1652
+ ### Verified
1653
+ - `test/unit/revive-on-read.test.js` gains a regression case: 3 revives, then
1654
+ 260 unrelated audit rows, then the 4th revive must stay blocked. Suite:
1655
+ 376/376, twice.
1656
+
1657
+
1658
+ ## 0.4.63 — 2026-11-15
1659
+
1660
+ ### Changed
1661
+ - **Revive-on-read has a daily budget.** Reading an archived memory still
1662
+ brings it back, but at most 3 revives per 24 hours (counted from the audit
1663
+ log); after that reads are read-only, so "archive" cannot be silently undone
1664
+ by a busy retrieval loop.
1665
+
1666
+ ### Verified
1667
+ - `test/unit/revive-on-read.test.js` (3 cases: explicit read revives, only three
1668
+ per day, merged traces stay archived). Suite: 375/375, twice.
1669
+
1670
+
1671
+ ## 0.4.62 — 2026-11-15
1672
+
1673
+ ### Changed
1674
+ - **Reflection coverage is importance-weighted, and it samples more on busy
1675
+ days.** A fixed `maxSources = 8` meant a 160-trace day was reflected from 5%
1676
+ of it; the source count now scales gently (`max(8, min(16, 12% of window))`)
1677
+ and `coverage` reports the share of total importance seen, with
1678
+ `countCoverage` kept for debugging. A day with three big events and many
1679
+ trivial ones now reads as well covered instead of "5%".
1680
+
1681
+ ### Verified
1682
+ - `test/unit/reflect-coverage.test.js`: 3 important + 17 trivial traces →
1683
+ weighted coverage ≥ 0.5 while count coverage stays low, and ≥ 8 sources are
1684
+ sampled. Suite: 374/374, twice.
1685
+
1686
+
1687
+ ## 0.4.61 — 2026-11-15
1688
+
1689
+ ### Added
1690
+ - **Reading an archived memory can bring it back.** `cortex_get` now revives the
1691
+ trace it displays (unless it was folded into another trace by a merge), so a
1692
+ memory that keeps getting looked up does not stay buried. Other callers keep
1693
+ the old behaviour unless they pass `{ revive: true }`.
1694
+
1695
+ ### Verified
1696
+ - `test/unit/revive-on-read.test.js` (2 cases: revive on explicit read, merged
1697
+ traces stay archived). Suite: 373/373, twice.
1698
+
1699
+
1700
+ ## 0.4.60 — 2026-11-15
1701
+
1702
+ ### Fixed
1703
+ - **`repair` silently skipped scheduler-reminder traces.** The cleanup pattern
1704
+ used `GLOB '用户:[SCHEDULE REMINDER*'`, and in GLOB `[...]` is a character
1705
+ class, so it never matched the literal `[`. Those rows stayed active and kept
1706
+ showing up in recall even though the capture filter was correct. The reminder
1707
+ and goal-complete patterns now use `LIKE`; 3 stale rows were archived on the
1708
+ production store (backed up first).
1709
+
1710
+
1711
+ ## 0.4.59 — 2026-11-15
1712
+
1713
+ ### Changed
1714
+ - **Consolidation stops recording identical skipped runs.** Without an LLM the
1715
+ engine wrote a `skipped / no-llm` row into `dream_runs` on every scheduler
1716
+ tick (every couple of minutes), filling the log with the same digest. It now
1717
+ reuses the previous run when the candidate digest has not changed; `force: true`
1718
+ still records.
1719
+
1720
+ ### Verified
1721
+ - `test/unit/consolidate-gate.test.js`: first run records, second is
1722
+ `skipped: unchanged`, `force` records again. Suite: 371/371, twice.
1723
+
1724
+
1725
+ ## 0.4.58 — 2026-11-15
1726
+
1727
+ ### Fixed
1728
+ - **Assistant-side captures no longer get the title "会话 N".** Turns whose user
1729
+ part was pure injected context were titled only by the turn number; the title
1730
+ now falls back to the assistant line (with the persona name stripped). On the
1731
+ production store `repair.mjs` derived titles for 15 of 16 such traces.
1732
+
1733
+ ### Verified
1734
+ - `capture-filter.test.js`: persona-prefixed title derived; `会话 N` only when
1735
+ there is nothing else. Suite: 370/370, twice.
1736
+
1737
+
1738
+ ## 0.4.57 — 2026-11-15
1739
+
1740
+ ### Fixed
1741
+ - **Scheduler reminders and goal-complete blocks were stored as user messages.**
1742
+ `[SCHEDULE REMINDER BATCH] … reminders_json: …` and `<goal_complete>` are
1743
+ harness automation, but they were captured like speech and then resurfaced in
1744
+ every recall block. They are now dropped at capture (`stripInjected` /
1745
+ `isInjectedNoise`), and `repair.mjs` archives the copies already stored
1746
+ (4 rows on a production store, backed up first).
1747
+
1748
+ ### Verified
1749
+ - `capture-filter.test.js` covers both shapes. Suite: 369/369, twice.
1750
+
1751
+
1752
+ ## 0.4.56 — 2026-11-15
1753
+
1754
+ ### Changed
1755
+ - **Relationship trust/care move asymmetrically.** A good interaction adds a
1756
+ fraction of the remaining room (the hundredth kindness weighs less than the
1757
+ first), while a disappointment takes a bigger bite (loss weight 1.6×), so the
1758
+ numbers can actually move instead of sitting at a clamped 65/65.
1759
+ - Familiarity is now grow-only and saturating: it counts shared time, so no
1760
+ delta can reduce it.
1761
+
1762
+ ### Verified
1763
+ - `test/unit/relationship-dynamics.test.js` (4 cases: diminishing gains, losses
1764
+ weigh more, bounds hold, familiarity never decreases). Suite: 368/368, twice.
1765
+
1766
+
1767
+ ## 0.4.55 — 2026-11-15
1768
+
1769
+ ### Changed
1770
+ - **Mood updates saturate.** Each appraisal now moves valence/arousal a fraction
1771
+ of the remaining distance to the bound instead of adding a flat amount, so
1772
+ repeated good (or bad) news approaches the limit without parking there and the
1773
+ tenth event matters less than the first. Energy still drains with arousal.
1774
+
1775
+ ### Verified
1776
+ - `test/unit/mood-saturation.test.js` (4 cases: smaller push near the bound,
1777
+ repeated pushes stay below the ceiling, one negative event cannot slam the
1778
+ floor, arousal stays inside 0..1). Suite: 364/364, twice.
1779
+
1780
+
1781
+ ## 0.4.54 — 2026-11-15
1782
+
1783
+ ### Fixed
1784
+ - **Vector coverage can no longer exceed 100%.** `health` and `verify` counted
1785
+ every embedding row, including ones belonging to archived traces, so a
1786
+ fully-indexed store reported e.g. `1.056`. They now count only embeddings whose
1787
+ trace is active (`health` also scopes by `scope_id`).
1788
+
1789
+ ### Verified
1790
+ - `test/unit/vector-coverage.test.js`: one active + one archived trace with
1791
+ embeddings → `embedded: 1`, coverage ≤ 1. Suite: 360/360, twice.
1792
+
1793
+
1794
+ ## 0.4.53 — 2026-11-15
1795
+
1796
+ ### Changed
1797
+ - **Summon cards are ranked by freshness and diversity, not just keyword
1798
+ score.** Scoring now adds a recency term and importance; selection prefers one
1799
+ card per day and one per category (falling back only when nothing else is
1800
+ left), and still guarantees a left/emotional card when one exists. Before, one
1801
+ busy day could fill the whole block with near-duplicates.
1802
+ - The ranking lives in `src/engines/summon-rank.js` as a pure function, so it is
1803
+ testable without a database.
1804
+
1805
+ ### Fixed
1806
+ - Gist rendering no longer silently hard-truncates the raw text when the first
1807
+ sentence is shorter than 24 chars: it takes the next sentence too (review
1808
+ review, 0.4.50 交接备注).
1809
+
1810
+ ### Verified
1811
+ - `summon-rank.test.js` (4 cases) + `tiers-gist.test.js` (3 cases). Suite:
1812
+ 359/359, twice.
1813
+
1814
+
1815
+ ## 0.4.51 — 2026-11-15
1816
+
1817
+ ### Fixed
1818
+ - **Runtime boilerplate leaked into memory.** The harness line
1819
+ `Elapsed since the preceding step context: …` was captured as a user message
1820
+ and came back in every recall block. `stripInjected` / `isInjectedNoise` now
1821
+ match any `Time sampled…` or `Elapsed since the preceding…` head, and
1822
+ `repair.mjs` archives the copies that are already stored.
1823
+
1824
+ ### Verified
1825
+ - `capture-filter.test.js`: the new head is stripped and flagged; discussing the
1826
+ marker in normal text is still safe. Suite: 355/355, twice.
1827
+
1828
+
1829
+ ## 0.4.50 — 2026-11-15
1830
+
1831
+ ### Changed
1832
+ - **Recall injects a gist instead of the whole snippet.** The permanent and hot
1833
+ tiers now render one sentence (default 120 chars, `selectTiers({ gistChars })`
1834
+ to change) and leave the body to `cortex_get`; before, each entry carried up to
1835
+ 220 chars of engineering detail on every turn. Short snippets pass through
1836
+ unchanged, cold entries stay index-only.
1837
+
1838
+ ### Verified
1839
+ - `test/unit/tiers-gist.test.js` (3 cases: long → gist + ellipsis, short →
1840
+ untouched, cold → index only). Suite: 354/354, twice.
1841
+
1842
+
1843
+ ## 0.4.49 — 2026-11-15
1844
+
1845
+ ### Changed
1846
+ - **`verify` tells "still climbing" apart from "stuck".** Low embedding coverage
1847
+ is now judged after the baseline comparison: with `--expect` and a positive
1848
+ delta it is printed as a note and the report stays `HEALTHY`; with a delta of
1849
+ zero or less it stays in `NEEDS ATTENTION` with the hint to check the vector
1850
+ feature and Ollama; without a baseline it says movement is unknown and
1851
+ suggests saving one.
1852
+
1853
+ ### Verified
1854
+ - Copy store: no baseline → note + `HEALTHY`; same snapshot → `NEEDS ATTENTION`
1855
+ ("not climbing (0 vs baseline)"). Suite: 351/351.
1856
+
1857
+
1858
+ ## 0.4.48 — 2026-11-15
1859
+
1860
+ ### Changed
1861
+ - **Vector backfill is ~15× faster.** One drain pass now gets 45 s instead of
1862
+ 20 s, and while the queue still has a backlog the maintenance pass repeats
1863
+ every 2 minutes instead of every 10 (it falls back to 10 automatically once
1864
+ the queue is empty). Measured single-thread throughput: ~1.03 embeddings/s,
1865
+ so ~550 missing traces go from roughly 4.5 hours to about 25 minutes.
1866
+ - `scheduler.status()` now reports `maintenanceGapMs` so the cadence is
1867
+ observable.
1868
+
1869
+ ### Verified
1870
+ - `test/unit/scheduler-cadence.test.js` (2 cases: backlog → 120 s, empty → 600 s
1871
+ and the immediate second pass is gated). Suite: 351/351, twice.
1872
+
1873
+
1874
+ ## 0.4.47 — 2026-11-15
1875
+
1876
+ ### Fixed
1877
+ - **Vector backfill never stored a single embedding.** The remote embedder
1878
+ returns a `Float32Array`, and `drainQueue` validated it with `Array.isArray`,
1879
+ so every item failed with "embedding dimension mismatch" and was retried
1880
+ forever — coverage stayed at 22% no matter how long it ran.
1881
+ - A single retryable failure no longer aborts the whole drain pass: it is
1882
+ logged (`debug`/`info`) and the loop continues with the next item.
1883
+ - The vector engine now reads the settings-panel override through
1884
+ `effectiveFeatures()`, which resolves the default data root on its own
1885
+ (`config.dataRoot` is normally undefined at runtime).
1886
+
1887
+ ### Verified
1888
+ - Live-store copy, source modules: `drain { ok: 3, failed: 0, pending: 0 }`
1889
+ (before the fix: `ok: 0`, every item "dimension mismatch").
1890
+ - `test/unit/vector-typed-array.test.js` (2 cases). Suite: 349/349, twice.
1891
+
1892
+
1893
+ ## 0.4.46 — 2026-11-15
1894
+
1895
+ ### Added
1896
+ - `repair.mjs` now backfills unreadable titles (`会话 N 的对话` and empty ones)
1897
+ from the first real line of the trace; reports `titles` (candidates) and
1898
+ `titleFixes` (actually written). Content too short to derive a title is left
1899
+ alone instead of being renamed into something meaningless.
1900
+
1901
+ ### Fixed
1902
+ - (released together with 0.4.45) the settings-panel `vector` override now
1903
+ really enables the vector engine, so the backfill queue runs.
1904
+
1905
+ ### Rehearsed
1906
+ - On a live-store copy: `titles: 2`, `titleFixes: 1`; the one left was a trace
1907
+ whose whole content is "用户:?".
1908
+
1909
+
1910
+ ## 0.4.45 — 2026-11-15
1911
+
1912
+ ### Fixed
1913
+ - **The settings-panel `vector` override now actually enables the vector
1914
+ engine.** The engine was created from `config.features.vector` only, while the
1915
+ status getter also consulted `feature-overrides.json` — so with `vector: true`
1916
+ in overrides the UI showed vector as on, but the index was `null` and the
1917
+ backfill queue never ran (coverage stuck at 22%). `vectorEnabled` now also
1918
+ reads the overrides file (`.current.vector`).
1919
+ - Tests: `test/unit/vector-override.test.js` (2 cases). Suite: 347/347, twice.
1920
+
1921
+
1922
+ ## 0.4.44 — 2026-11-15
1923
+
1924
+ ### Added
1925
+ - `bin/copy-db.mjs`: consistent copy of a store via `VACUUM INTO`
1926
+ (`--source` / `--target`), prints the copy's active trace count. Read-only
1927
+ against the source; used by the delivery rehearsal.
1928
+ - `handoff/rehearsal.ps1` (delivery drill): runs ready-check → install dry-run →
1929
+ copy live DB → repair the copy → verify the copy, and reports PASS/FAIL per
1930
+ stage. Full drill on the current store: 5/5 PASS —
1931
+ `active=817`, `goalRounds=121` archived, legacy goal-rounds gone, only the
1932
+ expected coverage item left.
1933
+
1934
+
1935
+ ## 0.4.43 — 2026-11-15
1936
+
1937
+ ### Added
1938
+ - **`verify.mjs` can compare against a baseline.** `--save <file>` writes the
1939
+ current snapshot; `--expect <file>` prints deltas (embedding coverage, active
1940
+ traces, legacy goal-round traces, capture stripped count) plus a one-line
1941
+ Chinese summary. An upgrade can now be judged by movement instead of a single
1942
+ snapshot.
1943
+ - Verified on the repaired copy: baseline saved, second run reported
1944
+ `覆盖 +0 · active +0 · 旧 goal_round +0`.
1945
+
1946
+
1947
+ ## 0.4.42 — 2026-11-15
1948
+
1949
+ ### Changed
1950
+ - **`verify.mjs` explains the expected post-upgrade warning.** Low embedding
1951
+ coverage is still reported, but the message now says it is expected right
1952
+ after an upgrade and that backfill needs about an hour, so a reviewer does
1953
+ not read it as a broken install.
1954
+ - Rehearsed end-to-end on a live-database copy: `repair --apply` archived 116
1955
+ legacy goal-round traces + 1 injected trace, after which `verify` reported
1956
+ only the expected coverage item.
1957
+
1958
+
1959
+ ## 0.4.41 — 2026-11-15
1960
+
1961
+ ### Fixed
1962
+ - **Same subject+predicate no longer means "conflict".** Two free-text literals
1963
+ like `一直存在着` and `一直在——记忆不丢` say compatible things, but the old
1964
+ rule marked both facts `disputed` and opened a dispute. Now, when both sides
1965
+ are literals and there is no *leading* negation flip (`会一直在` vs
1966
+ `不会一直在`), the new fact is stored as active and no dispute is opened.
1967
+ Entity-to-entity conflicts (`likes 米饭` vs `likes 米饭`) keep the old
1968
+ behaviour, because those really are alternatives.
1969
+ - Tests: `test/unit/facts-compat.test.js`; suite 345/345, run twice.
1970
+
1971
+
1972
+ ## 0.4.40 — 2026-11-15
1973
+
1974
+ ### Added
1975
+ - **The last maintenance pass is visible.** `cortex_health` reports
1976
+ `maintain` (read from the latest `maintain.run` audit record): when it ran and
1977
+ how many disputes/summaries/intentions/rules/goal-rounds/aliases/working
1978
+ items it touched. The health line gains `维护:上次 …(意图 N · 工作记忆 M)`.
1979
+ A silent maintain is now distinguishable from one that never ran.
1980
+ - Tests: 342/342, run twice; the working-memory TTL case asserts
1981
+ `health.maintain.working === 1`.
1982
+
1983
+
1984
+ ## 0.4.39 — 2026-11-15
1985
+
1986
+ ### Added
1987
+ - **Working memory gets a shelf life.** `maintain()` now deletes unpinned
1988
+ working items untouched for `workingTtlDays` (default 14); pinned items are
1989
+ never removed. The audit found items from 11-11 still sitting at priority 1
1990
+ long after their task had moved on. `report.working` counts what was dropped.
1991
+ - Tests: 342/342, run twice; one case checks the old item is gone and the
1992
+ pinned one survives.
1993
+
1994
+
1995
+ ## 0.4.38 — 2026-11-15
1996
+
1997
+ ### Changed
1998
+ - **Recall bookkeeping follows a spacing curve.** `touchResults` no longer uses
1999
+ one fixed 5-minute throttle: the interval doubles per recorded recall
2000
+ (`touchInterval` in `src/memory/spacing.js`), capped by
2001
+ `touchMaxIntervalMs` (default 6 h) and configurable via
2002
+ `touchMinIntervalMs`. A hot memory is written less often; a cold one stays
2003
+ easy to pick up.
2004
+ - Tests: `test/unit/spacing.test.js`; suite 341/341, run twice.
2005
+
2006
+
2007
+ ## 0.4.37 — 2026-11-15
2008
+
2009
+ ### Added
2010
+ - **Vector coverage is visible.** `cortex_health` reports `vectors`
2011
+ (`embedded`, `coverage`) and warns `VECTOR_COVERAGE` when coverage is under
2012
+ 50% with 100+ active traces; the health line gains
2013
+ `向量:20%(157/793)`. `bin/verify.mjs` raises the same condition as a
2014
+ `NEEDS ATTENTION` item, so a lagging index cannot hide behind an otherwise
2015
+ green report.
2016
+ - Tests: 340/340, run twice; live verify now reports both remaining issues
2017
+ (`legacyGoalRounds 110`, `coverage 0.198`).
2018
+
2019
+
2020
+ ## 0.4.36 — 2026-11-15
2021
+
2022
+ ### Changed
2023
+ - **Vector drain has a time budget.** `drainQueue`/`vectorMaintain` now accept
2024
+ `budgetMs` (default `vectorDrainBudgetMs: 20000`): a maintenance pass stops
2025
+ after 20 seconds and leaves the rest queued for the next heartbeat. Return
2026
+ values gain `elapsedMs` and `stoppedBy` (`done` / `time`) so the behaviour is
2027
+ visible instead of guessed. A first pass can finish a backlog without ever
2028
+ holding the heartbeat for minutes.
2029
+ - Tests: 340/340, run twice; the vector-maintain assertion checks
2030
+ `stoppedBy === 'done'` and an elapsed time.
2031
+
2032
+
2033
+ ## 0.4.35 — 2026-11-15
2034
+
2035
+ ### Changed
2036
+ - **Vector backfill is no longer a trickle.** The heartbeat used to queue 40 and
2037
+ embed 20 per maintenance pass (~10 min), so a store with ~800 missing vectors
2038
+ needed hours. Defaults are now `vectorBackfillBatch: 200` and
2039
+ `vectorDrainBatch: 50`, both configurable. Embedding stays async and the pass
2040
+ is rare, so the cost is bounded; the same backlog now clears in well under an
2041
+ hour.
2042
+ - Tests: 340/340, run twice; `vectorMaintain` is asserted to backfill+drain and
2043
+ land the expected embedding count in one pass.
2044
+
2045
+
2046
+ ## 0.4.34 — 2026-11-15
2047
+
2048
+ ### Added
2049
+ - `bin/verify.mjs`: read-only health snapshot for an installed store. Prints
2050
+ version, SQLite integrity, schema version, trace/fact/dispute counts, capture
2051
+ hygiene (total, stripped, per-day, ratio), inhibition marks, embedding
2052
+ coverage, and still-active legacy goal-round traces. Exit 1 with a
2053
+ `NEEDS ATTENTION` list when something is wrong.
2054
+ - `handoff/verify.cmd`: double-click wrapper.
2055
+ - Live run on the current store: `legacyGoalRounds: 107` → correctly flagged,
2056
+ capture ratio 0.004, embedding coverage 0.199.
2057
+
2058
+
2059
+ ## 0.4.33 — 2026-11-15
2060
+
2061
+ ### Added
2062
+ - `bin/repair.mjs`: one-shot, idempotent offline repair for an existing store.
2063
+ Dry-run by default; `--apply` takes a `VACUUM INTO` backup first. It archives
2064
+ goal-round traces (105 on a production store) and any remaining injected-context
2065
+ traces, collapses duplicate summaries, expires stale intentions, retires
2066
+ fragment playbook rules, closes both-invalidated disputes, and merges alias
2067
+ targets when `--user-address` is given. Supersedes `migrate-0.4.23.mjs`.
2068
+ - Verified on a live-database copy: first `--apply` archived 105 + 1, second run
2069
+ reported 0 and 0 (idempotent), each with its own backup.
2070
+
2071
+
2072
+ ## 0.4.32 — 2026-11-15
2073
+
2074
+ ### Added
2075
+ - **Capture stats per day.** `cortex_health`'s `capture` now carries `days`
2076
+ (last 14): host turns, stripped and truncated counts per recorded day, so the
2077
+ upgrade can be judged directly — pollution ratio before vs after. The health
2078
+ line gains `按天:2026-11-15 12轮/剥9 · …`.
2079
+ - Tests: 340/340, run twice.
2080
+
2081
+
2082
+ ## 0.4.31 — 2026-11-15
2083
+
2084
+ ### Added
2085
+ - **Capture hygiene is measurable.** `cortex_health` now reports `capture`:
2086
+ host turns stored, how many needed the injected-context stripper, and how many
2087
+ were truncated. This is the number that proves the 0.4.23 pollution fix is
2088
+ actually running. The human-readable health line gains
2089
+ `捕获:N 轮 · 剥掉 M · 截断 K`.
2090
+ - Accepts both flat (`stripped: true`) and nested (`capture.stripped`)
2091
+ metadata shapes, so a writer change cannot silently report zero.
2092
+ - Tests: 339/339, run twice.
2093
+
2094
+
2095
+ ## 0.4.30 — 2026-11-15
2096
+
2097
+ ### Fixed
2098
+ - **Auto-continuation rounds are no longer stored as user speech.** The goal
2099
+ round message repeats the objective every round; capture stored it verbatim,
2100
+ so recall started returning identical `<goal_round>` blocks. `stripInjected`
2101
+ now removes the `<goal_round>` block (and bare `Objective: "…" / Round: n/m`
2102
+ envelopes), and the encode guard rejects it as injected context. A turn that
2103
+ contains only the envelope is skipped; if the assistant replied, that reply
2104
+ is still stored.
2105
+ - `maintain()` archives goal-round traces written by older versions
2106
+ (`report.goalRounds`), keeping the rows for inspection.
2107
+ - Tests: 339/339, run twice.
2108
+
2109
+
2110
+ ## 0.4.29 — 2026-11-15
2111
+
2112
+ ### Added
2113
+ - **Manual control over suppression.** `cortex_inhibition` tool: `list` shows
2114
+ suppressed traces with their decayed strength, `clear` removes the mark from
2115
+ one trace (`id`) or all (`all: true`). Clearing writes an audit record.
2116
+ Service surface: `cortex.inhibition.list()` / `.clear()`.
2117
+ - Tests: 336/336, run twice; the inhibition test now clears one, then all, and
2118
+ asserts the health count returns to zero.
2119
+
2120
+
2121
+ ## 0.4.28 — 2026-11-15
2122
+
2123
+ ### Added
2124
+ - **Inhibition is now measurable.** `cortex_health` reports `inhibition`:
2125
+ whether the experiment is on, how many active traces are suppressed right
2126
+ now, the decayed average, and the top three. Over 60 suppressed traces raises
2127
+ a `INHIBITION_HIGH` warning, so the experiment cannot quietly bury memory.
2128
+ The human-readable health line gains `抑制:N 条 · 均值 X`.
2129
+ - Tests: 336/336, run twice; assert the count is 0 when the flag is off.
2130
+
2131
+
2132
+ ## 0.4.27 — 2026-11-15
2133
+
2134
+ ### Added
2135
+ - **Inhibition experiment (off by default).** `features.inhibition` enables a
2136
+ retrieval-induced-forgetting pass: after a recall, candidates that lost and
2137
+ are near-duplicates of something selected gain a small `inhibition` in their
2138
+ trace metadata (default step 0.15, cap 1). The penalty halves every
2139
+ `inhibitionHalfLifeDays` (14) and multiplies retrieval utility by at most
2140
+ `inhibitionStrength` (35%). Suppression is throttled to once per trace per
2141
+ 24h and at most three per recall, so a busy loop cannot bury a memory.
2142
+ - Config: `inhibitionStrength`, `inhibitionHalfLifeDays`, `inhibitionStep`,
2143
+ `inhibitionCompetitorSim`.
2144
+ - Tests: `test/unit/inhibition.test.js` (3 cases). Suite: 336/336, twice,
2145
+ with and without the flag.
2146
+
2147
+
2148
+ ## 0.4.26 — 2026-11-15
2149
+
2150
+ ### Fixed
2151
+ - **One person, one target.** The audit found `用户` and `用户` tracked as two
2152
+ separate entities: the relationship model only knew 用户, while affect counts
2153
+ split (30 vs 5). A target resolver (`src/self/alias.js`) now folds
2154
+ `用户/用户/你/您` (plus `persona.userAliases`) onto `persona.userAddress` for
2155
+ every relationship and emotion write. `maintain()` merges rows that already
2156
+ exist under an alias and recomputes the attitude.
2157
+ - Default behaviour is unchanged for codes that never configured a persona:
2158
+ aliases fold onto the neutral `你`.
2159
+ - Tests: 333/333, run twice.
2160
+
2161
+
2162
+ ## 0.4.25 — 2026-11-15
2163
+
2164
+ ### Fixed
2165
+ - **Working memory no longer piles up near-duplicates.** The audit found the
2166
+ same todo stored twice (two shiori items, two bili-caps items). `working.add`
2167
+ now compares the new text against the scope's items (jaccard ≥ 0.82) and, on a
2168
+ hit, refreshes priority/pinned/text on the existing row instead of inserting a
2169
+ second one. `dedupe: false` remains available for explicit additions.
2170
+ - Tests: 329/329, run twice.
2171
+
2172
+
2173
+ ## 0.4.24 — 2026-11-15
2174
+
2175
+ Quality pass on facts and recall accounting. No schema changes, no data-path
2176
+ changes; an existing store opens unchanged.
2177
+
2178
+ ### Fixed
2179
+ - **Fact noise.** A single guard (`src/engines/fact-guard.js`) now validates
2180
+ every extracted candidate before it can become a fact: the predicate must be
2181
+ ASCII snake_case, subject/object must not be punctuation or a function word,
2182
+ and lengths are bounded. This is what produced rows like `(现, at, :)` and
2183
+ `(只, is, …)` in 0.4.22 — the LLM extractor accepted whatever JSON came back.
2184
+ Both the rule extractor and the LLM extractor go through it.
2185
+ - **Recall accounting.** `touchResults` now respects `touchMinIntervalMs`
2186
+ (default 5 minutes) per trace, so building a recall block on every step no
2187
+ longer inflates `access_count` into a meaningless number.
2188
+ - **Gist summaries.** Reflection summaries now carry an `大意:` line — the most
2189
+ central sentence among the sources (fuzzy-trace: gist outlives verbatim) —
2190
+ before the bullet list.
2191
+
2192
+ ### Added
2193
+ - `touchMinIntervalMs` config (300000).
2194
+ - Tests: `test/unit/fact-guard.test.js` (4 cases). Suite: 328/328, run twice.
2195
+
2196
+
2197
+ ## 0.4.23 — 2026-11-15
2198
+
2199
+ Data-quality release. No new tools and no UI changes; the loader id, data path
2200
+ and SQLite schema stay the same, so an existing store opens unchanged.
2201
+
2202
+ ### Fixed
2203
+ - Host capture no longer stores the host's own injected context (runtime
2204
+ snapshot, `<system-reminder>` blocks, skill catalogs, subagent/checkpoint
2205
+ notices). `stripInjected()` keeps only what the user and the assistant
2206
+ actually said; a turn that is pure injected context is skipped. New config
2207
+ `captureMaxChars` (default 4000) caps a captured turn.
2208
+ - `encode` gets a second-line guard: content that *starts* with a host marker is
2209
+ rejected as `injected-context`, so capture paths that bypass the host runtime
2210
+ cannot reintroduce the pollution. Users discussing those markers are still
2211
+ stored. New config `maxContentChars` (default 8000) truncates oversized text.
2212
+ - Titles: host turns are no longer stamped `会话 N 的对话`; a readable title is
2213
+ derived from the first real line (`deriveHostTitle` / service `deriveTitle`).
2214
+ - Recall now records access (`access_count`, `last_access_at`) for the top
2215
+ results, so DSR recency and calibration stop being frozen. New config
2216
+ `touchOnRecall` (default true).
2217
+ - Vector indexing no longer fire-and-forgets. Failed embeds enter an in-process
2218
+ queue with exponential backoff and a bounded attempt count; `backfillMissing()`
2219
+ queues active traces that never got a vector; `vectorMaintain()` drains both.
2220
+ The scheduler calls it every 10 minutes (40 backfill / 20 drain per pass).
2221
+ - Housekeeping `maintain()` (scheduler, every 10 minutes): closes disputes whose
2222
+ both facts are already invalidated, removes duplicate summaries, expires stale
2223
+ pending intentions, retires chat-fragment playbook candidates.
2224
+ - `engines.dsh` widened to `>=0.2.1-rc.2 <0.5.0` (was `<0.4.0`).
2225
+
2226
+ ### Added
2227
+ - `bin/migrate-0.4.23.mjs`: one-shot, idempotent repair of an existing store
2228
+ (archive injected-context traces, retitle, fix identity boundaries, dedupe
2229
+ summaries, expire intentions, retire fragment rules, close zombie disputes).
2230
+ Dry-run by default; `--apply` takes a `VACUUM INTO` backup first.
2231
+ - Tests: `test/unit/capture-filter.test.js` (10 cases). Suite: 324/324.
2232
+
2233
+ ### Hooks
2234
+ - `cortex.onTick(fn)` / `cortex.emitTick(report)`: the host scheduler now emits
2235
+ one heartbeat to registered listeners after every pass. Companion plugins
2236
+ (dsh-cortex-agency) ride that heartbeat instead of starting a second clock.
2237
+
2238
+
2239
+ ## 0.4.22 — 2026-11-14
2240
+
2241
+ - Fix CLI default data root: use profileDataRoot (cortex-memory) instead of legacy ~/.dsh/cortex.
2242
+ - Add CLI root regression tests for default, --data and CORTEX_HOME.
2243
+ - Document that tests/bench require the DSH bundled Node 24; system Node 22 is below engines.
2244
+ - No loader-id, data-path or UI changes.
2245
+
2246
+ ## 0.4.21 — 2026-11-14
2247
+
2248
+ - Documentation-only release: replace the README with a current-version capability guide, install/download flow, add-on matrix and honest performance boundaries.
2249
+ - Update package description and search keywords; no engine, icon, loader-id or data-path changes.
2250
+
2251
+ ## 0.4.20 — 2026-11-14
2252
+
2253
+ - Replace the plugin icon with the owner-provided whale-girl avatar (embedded 256 JPEG).
2254
+ - Keep the sidebar icon offline: no remote image URL.
2255
+ - No engine, loader-id or data-path changes.
2256
+
2257
+ ## 0.4.19 — 2026-11-13
2258
+
2259
+ - Revert client bundle id to `dsh-cortex`. It is intentionally different from loader row id `dsh-cortex-memory`.
2260
+ - 0.4.18 set both to `dsh-cortex-memory`, causing duplicate factory registration and web boot failure; 0.4.19 removes that change.
2261
+ - Loader id, local/public patch names and `~/.dsh/cortex-memory` data path remain unchanged.
2262
+ - Add contract assertion that client id is `dsh-cortex` and not the loader id.
2263
+ - Tests: 437/437.
2264
+ ## 0.4.18 — 2026-11-13
2265
+
2266
+ - Fix client bundle id: `dsh-cortex` -> `dsh-cortex-memory`.
2267
+ - Host can be active while the sidebar panel is absent if the client module id does not match the loader row; this release aligns them.
2268
+ - Local package keeps `patch.name: dsh-cortex`; public package keeps `patch.name: dsh-cortex-memory`.
2269
+ - Tests: 437/437.
2270
+ ## 0.4.17 — 2026-11-13
2271
+
2272
+ - Loader id and bundle row change to `dsh-cortex-memory`; `ctx.provide('cortex')` remains as a compatibility alias.
2273
+ - Existing profile rows must migrate from `cortex` to `dsh-cortex-memory`; a migration script backs up the profile and verifies exactly one target row.
2274
+ - Data root remains `DSH_HOME/cortex-memory`; legacy data is copied, never moved.
2275
+ - Tests: 437/437.
2276
+ ## 0.4.16 — 2026-11-13
2277
+
2278
+ - Default data root moves to `DSH_HOME/cortex-memory` (desktop) and `DSH_HOME/cortex-memory/profiles/<profile>` for other profiles.
2279
+ - Legacy `DSH_HOME/cortex` is never moved or deleted. Migration scripts copy it, keep a backup, and verify the copy before DSH opens the new root.
2280
+ - Loader id stays `cortex` in this release; a later migration-scripted release will rename it.
2281
+ - README extractor version corrected to 0.3.5; mojibake repaired.
2282
+
2283
+ ## 0.4.13 — 2026-11-13
2284
+
2285
+ ### Added
2286
+ - `evolution` guard in Config schema (`autoActivate`, `maxPerDay`, `minIntervalMs`, `canaryTicks`, `rollbackOnError`).
2287
+ - Persistent canaries: `policies.canary_json` survives restart and rehydrates on engine creation.
2288
+ - `recallSharing` opt-in recall block sharing across sessions.
2289
+ - Persona-aware first-person extraction; markdown-fragment rejection retained.
2290
+ - Built-in Wikipedia/SearXNG fallback when `features.webSearch` is on and no host `web` service exists.
2291
+
2292
+ ### Fixed
2293
+ - Automatic rollback without a previous policy now retires the failed policy as `superseded`, instead of leaving it as `candidate`.
2294
+ - Canary ticks are persisted, not just kept in memory.
2295
+ - Schema version bumped to 7 for the additive `canary_json` column.
2296
+
2297
+ ## 0.4.12 — 2026-11-13
2298
+
2299
+ ### Fixed
2300
+ - `promptBudget` is normalized instead of being silently dropped and falling back to 1600.
2301
+ - Injection gate moved into retrieval: weak recency/soft-FTS candidates are filtered before consuming the result budget. Full search/API/CLI remain available.
2302
+ - Guardian light check runs structural invariants + FTS counts; deep `integrity_check` and the event-chain walk stay on the six-hour/startup path.
2303
+ - Identity traces surface as `L0` in search results.
2304
+ - `npm test` / `npm run test:unit` use explicit test globs so Node 22 can run them.
2305
+ - Package `files` now includes `docs`, `examples`, `bench`, `test` and `CHANGELOG.md`; README install points at 0.4.12.
2306
+ - Security/privacy docs now match the code: no bearer token; model keys are plaintext in `model-config.json` mode 0600, outside `cortex.sqlite`.
2307
+
2308
+ ### Added
2309
+ - `recentImportanceFloor` config (default 0.8, preserving 0.4.11's importance exemption).
2310
+ - `gated` count in the retrieval trace.
2311
+ - Regression tests for the prompt gate, importance exposure, identity L0, per-session recall, light/deep guardian, and configurable `promptBudget`.
2312
+
2313
+ ## 0.4.11 — 2026-11-12
2314
+
2315
+ - Life/date fixes, graph candidate labels, neutral public package surface.
2316
+ - Recent timeline endpoint and incremental summon rebuild.
2317
+
2318
+ ## 0.4.0 — 2026-11-12
2319
+
2320
+ ### Fixed
2321
+ - Prompt-only injection gate; full search/API/CLI remain available.
2322
+ - Search items now expose `importance`, `confidence`, `match`, `kind`; perm tier works.
2323
+ - Removed cross-session single-cache fallback.
2324
+ - `autoGraphCandidates` is the canonical graph flag; old name is an alias.
2325
+ - Guardian scheduler uses light checks per tick and full checks at startup/6h.
2326
+ - Guard backup/restore/export/prune/sync are constrained to `dataRoot` by default.
2327
+ - Tests and docs are included in the package; `npm test` works after install.
2328
+
2329
+ ### Added
2330
+ - `persona.selfName` / `persona.userAddress`; neutral public defaults (`助手` / `用户`).
2331
+ - `injectionGate`, `recentMinMatch`, `allowRestoreOutsideRoot` config.
2332
+
2333
+ ### Compatibility
2334
+ - Additive config only; no schema migration.
2335
+ - Existing 0.3.x databases open in place.
2336
+ - Local profiles can restore the 我 / 用户 persona through config.
2337
+
2338
+ ## 0.3.1 — 026-11-12
2339
+
2340
+ - AI diary entries no longer append a 閳ユ粌寮懓鍐b偓?footer; web sources still inform the model but are not stored in the diary body.
2341
+ - Manual dream generation timeout raised from 4s to 20s; `aiOnlyLife` still fails closed instead of falling back to a template.
2342
+ - No schema change; compatible with 0.3.0 databases and DSH `>=0.2.1-rc.2 <0.4.0`, Node `>=24`.
2343
+ ## 0.3.0 闁?2026-11-12
2344
+
2345
+ ### Added
2346
+
2347
+ - Summon cards (L2): left-brain emotion cards and right-brain work cards with trigger words.
2348
+ - Summon volumes (L3): side/category/day indexes with representative text.
2349
+ - Summon book: independent daily page; read-only by default, owner-gated editing with audit.
2350
+ - Runtime summon injection: at most 3 cards / 900 tokens, labelled as untrusted historical references.
2351
+ - Explicit card feedback (`helpful` / `ignored`) writes back to source-trace DSR. Injection alone never changes strength.
2352
+ - Diagnostics panel: health issues, disputed-fact confirm/dismiss, and candidate-only skill extraction.
2353
+ - Graph entity labels use names instead of ids; bounded LLM renaming for clearly broken names with confidence gate and audit.
2354
+
2355
+ ### Changed
2356
+
2357
+ - Scheduler review runs every 90 minutes and generates pending intentions.
2358
+ - AI diary is limited to 12:00/22:00; idle hourly writing is a feeling, not a diary.
2359
+ - Identity capacity is enforced (L0 default 360 tokens); today's additions are prepended so they survive truncation.
2360
+
2361
+ ### Compatibility
2362
+
2363
+ - Additive SQLite schema; existing 0.2.x databases migrate in place.
2364
+ - DSH `>=0.2.1-rc.2 <0.4.0`; Node `>=24`.
2365
+ - No API keys, personal paths, or private data are shipped.
2366
+
2367
+ ## 0.2.2 闁?2026-11-12
2368
+
2369
+ - Public README and install commands.
2370
+ - License metadata and package metadata fixes.
2371
+ - No memory-engine behavior change.
2372
+
2373
+ ## 0.2.0 闁?2026-11-12
2374
+
2375
+ - First stable release of the rc line.
2376
+ - Trace UI extraction with layout selection.
2377
+ - Windows OCR / Tesseract layout-aware column ordering.
2378
+ - Permission confirmations and restart requirement documented.
2379
+
2380
+
2381
+
2382
+
2383
+
2384
+
2385
+
2386
+
2387
+
2388
+
2389
+
2390
+
155
2391
 
156
2392
 
157
2393