dsh-cortex-memory 0.4.15 → 0.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -7
- package/README.md +41 -16
- package/cordis.patch.yml +3 -3
- package/index.js +2 -2
- package/package.json +1 -1
- package/src/core/config.js +1 -1
- package/src/core/feature-overrides.js +1 -1
- package/src/core/profile.js +8 -1
- package/test/unit/profile-paths.test.js +21 -0
- package/test/unit/profile.test.js +11 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.4.
|
|
3
|
+
## 0.4.17 — 2026-11-13
|
|
4
|
+
|
|
5
|
+
- Loader id and bundle row change to `dsh-cortex-memory`; `ctx.provide('cortex')` remains as a compatibility alias.
|
|
6
|
+
- Existing profile rows must migrate from `cortex` to `dsh-cortex-memory`; a migration script backs up the profile and verifies exactly one target row.
|
|
7
|
+
- Data root remains `DSH_HOME/cortex-memory`; legacy data is copied, never moved.
|
|
8
|
+
- Tests: 437/437.
|
|
9
|
+
## 0.4.16 — 2026-11-13
|
|
10
|
+
|
|
11
|
+
- Default data root moves to `DSH_HOME/cortex-memory` (desktop) and `DSH_HOME/cortex-memory/profiles/<profile>` for other profiles.
|
|
12
|
+
- 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.
|
|
13
|
+
- Loader id stays `cortex` in this release; a later migration-scripted release will rename it.
|
|
14
|
+
- README extractor version corrected to 0.3.5; mojibake repaired.
|
|
15
|
+
|
|
16
|
+
## 0.4.13 — 2026-11-13
|
|
4
17
|
|
|
5
18
|
### Added
|
|
6
19
|
- `evolution` guard in Config schema (`autoActivate`, `maxPerDay`, `minIntervalMs`, `canaryTicks`, `rollbackOnError`).
|
|
@@ -14,7 +27,7 @@
|
|
|
14
27
|
- Canary ticks are persisted, not just kept in memory.
|
|
15
28
|
- Schema version bumped to 7 for the additive `canary_json` column.
|
|
16
29
|
|
|
17
|
-
## 0.4.12
|
|
30
|
+
## 0.4.12 — 2026-11-13
|
|
18
31
|
|
|
19
32
|
### Fixed
|
|
20
33
|
- `promptBudget` is normalized instead of being silently dropped and falling back to 1600.
|
|
@@ -30,12 +43,12 @@
|
|
|
30
43
|
- `gated` count in the retrieval trace.
|
|
31
44
|
- Regression tests for the prompt gate, importance exposure, identity L0, per-session recall, light/deep guardian, and configurable `promptBudget`.
|
|
32
45
|
|
|
33
|
-
## 0.4.11
|
|
46
|
+
## 0.4.11 — 2026-11-12
|
|
34
47
|
|
|
35
48
|
- Life/date fixes, graph candidate labels, neutral public package surface.
|
|
36
49
|
- Recent timeline endpoint and incremental summon rebuild.
|
|
37
50
|
|
|
38
|
-
## 0.4.0
|
|
51
|
+
## 0.4.0 — 2026-11-12
|
|
39
52
|
|
|
40
53
|
### Fixed
|
|
41
54
|
- Prompt-only injection gate; full search/API/CLI remain available.
|
|
@@ -47,15 +60,15 @@
|
|
|
47
60
|
- Tests and docs are included in the package; `npm test` works after install.
|
|
48
61
|
|
|
49
62
|
### Added
|
|
50
|
-
- `persona.selfName` / `persona.userAddress`; neutral public defaults (
|
|
63
|
+
- `persona.selfName` / `persona.userAddress`; neutral public defaults (`助手` / `用户`).
|
|
51
64
|
- `injectionGate`, `recentMinMatch`, `allowRestoreOutsideRoot` config.
|
|
52
65
|
|
|
53
66
|
### Compatibility
|
|
54
67
|
- Additive config only; no schema migration.
|
|
55
68
|
- Existing 0.3.x databases open in place.
|
|
56
|
-
- Local profiles can restore the
|
|
69
|
+
- Local profiles can restore the 本鲸 / 主人 persona through config.
|
|
57
70
|
|
|
58
|
-
## 0.3.1
|
|
71
|
+
## 0.3.1 — 026-11-12
|
|
59
72
|
|
|
60
73
|
- AI diary entries no longer append a 閳ユ粌寮懓鍐b偓?footer; web sources still inform the model but are not stored in the diary body.
|
|
61
74
|
- Manual dream generation timeout raised from 4s to 20s; `aiOnlyLife` still fails closed instead of falling back to a template.
|
|
@@ -110,3 +123,5 @@
|
|
|
110
123
|
|
|
111
124
|
|
|
112
125
|
|
|
126
|
+
|
|
127
|
+
|
package/README.md
CHANGED
|
@@ -9,13 +9,25 @@ core engine.
|
|
|
9
9
|
|
|
10
10
|
## Status
|
|
11
11
|
|
|
12
|
-
- Package: `dsh-cortex-memory@0.4.
|
|
13
|
-
- Optional extractor: `dsh-cortex-extractors@0.3.
|
|
12
|
+
- Package: `dsh-cortex-memory@0.4.17`
|
|
13
|
+
- Optional extractor: `dsh-cortex-extractors@0.3.5`
|
|
14
14
|
- DSH: `>=0.2.1-rc.2 <0.4.0`
|
|
15
15
|
- Node: `>=24`
|
|
16
|
-
- Tests:
|
|
16
|
+
- Tests: 437/437 (main)
|
|
17
17
|
- CI: GitHub Actions on Windows, Node 24
|
|
18
18
|
|
|
19
|
+
### What 0.4.17 changes
|
|
20
|
+
|
|
21
|
+
- **Loader id is now `dsh-cortex-memory`** (the package patch and profile row). The `cortex` service key remains as a compatibility alias for code that calls `ctx.get('cortex')`.
|
|
22
|
+
- Existing profiles must migrate the `cordis.patch.yml` row from `cortex` to `dsh-cortex-memory`; the migration script backs up the profile and verifies exactly one target row.
|
|
23
|
+
- Data root is already `~/.dsh/cortex-memory`; legacy `~/.dsh/cortex` is copied, never moved.
|
|
24
|
+
|
|
25
|
+
### What 0.4.16 changes
|
|
26
|
+
|
|
27
|
+
- **Public data path is now `~/.dsh/cortex-memory`**. The old `~/.dsh/cortex` directory is never moved or deleted; the oneclick/upgrade script copies it, verifies it, and keeps a backup.
|
|
28
|
+
- **No loader-id change in 0.4.16**: the bundle row remains `cortex` for compatibility. Renaming it to `cortex-memory` is reserved for a migration-scripted release.
|
|
29
|
+
- README extractor version corrected to 0.3.5 and corrupted characters repaired.
|
|
30
|
+
|
|
19
31
|
### What 0.4.15 changes
|
|
20
32
|
|
|
21
33
|
- **Evolution guard is configurable**: `autoActivate`, `maxPerDay`,
|
|
@@ -58,7 +70,7 @@ core engine.
|
|
|
58
70
|
- Life/date fixes: serialized LLM calls, timeouts, `Asia/Shanghai` diary time,
|
|
59
71
|
and date-header stripping.
|
|
60
72
|
- Graph candidate labels (`fromName` / `toName` / `relLabel`) and cleanup.
|
|
61
|
-
- Neutral public package surface: default `selfName:
|
|
73
|
+
- Neutral public package surface: default `selfName: 助手`, `userAddress: 用户`.
|
|
62
74
|
- Recent timeline endpoint and incremental summon rebuild.
|
|
63
75
|
|
|
64
76
|
### What 0.3.0 changes
|
|
@@ -75,18 +87,31 @@ core engine.
|
|
|
75
87
|
The npm package is named `dsh-cortex-memory` because `dsh-cortex` was already
|
|
76
88
|
taken; the installed bundle is still the Cortex memory engine.
|
|
77
89
|
|
|
90
|
+
## Data path migration
|
|
91
|
+
|
|
92
|
+
0.4.16 defaults to `DSH_HOME/cortex-memory` (or `DSH_HOME/cortex-memory/profiles/<profile>`).
|
|
93
|
+
The old `DSH_HOME/cortex` directory is never moved or deleted.
|
|
94
|
+
|
|
95
|
+
Before starting 0.4.16 with existing memories, close DSH and run:
|
|
96
|
+
|
|
97
|
+
```powershell
|
|
98
|
+
powershell -ExecutionPolicy Bypass -File .\tools\migrate-cortex-path.ps1
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The script copies the old root, verifies the copied `cortex.sqlite` size, and leaves the old root as rollback.
|
|
102
|
+
|
|
78
103
|
## Install
|
|
79
104
|
|
|
80
105
|
```powershell
|
|
81
|
-
npm i dsh-cortex-memory@0.4.
|
|
82
|
-
npm i dsh-cortex-extractors@0.3.
|
|
106
|
+
npm i dsh-cortex-memory@0.4.17
|
|
107
|
+
npm i dsh-cortex-extractors@0.3.5 # optional OCR/ASR
|
|
83
108
|
```
|
|
84
109
|
|
|
85
110
|
Or let DSH add the bundles:
|
|
86
111
|
|
|
87
112
|
```powershell
|
|
88
|
-
dsh plugin --profile desktop add dsh-cortex-memory@0.4.
|
|
89
|
-
dsh plugin --profile desktop add dsh-cortex-extractors@0.3.
|
|
113
|
+
dsh plugin --profile desktop add dsh-cortex-memory@0.4.17
|
|
114
|
+
dsh plugin --profile desktop add dsh-cortex-extractors@0.3.5
|
|
90
115
|
```
|
|
91
116
|
|
|
92
117
|
Or use the Windows one-click zip from the GitHub Release. The installer
|
|
@@ -117,20 +142,20 @@ left sidebar by default.
|
|
|
117
142
|
|
|
118
143
|
```text
|
|
119
144
|
conversation / event
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
145
|
+
→ L1 trace (source of truth)
|
|
146
|
+
→ appraisal + emotion + drives
|
|
147
|
+
→ L2 summon card (atomic, triggerable)
|
|
148
|
+
→ L3 summon volume (index + representatives)
|
|
149
|
+
→ explicit use / feedback → DSR update
|
|
125
150
|
```
|
|
126
151
|
|
|
127
152
|
The per-turn order is:
|
|
128
153
|
|
|
129
154
|
```text
|
|
130
155
|
L0 identity and boundaries
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
156
|
+
→ working memory
|
|
157
|
+
→ recalled traces and summon cards
|
|
158
|
+
→ user message
|
|
134
159
|
```
|
|
135
160
|
|
|
136
161
|
Summon cards are injected as **untrusted historical references**, never as instructions. Identity and boundaries always outrank them.
|
package/cordis.patch.yml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# dsh-cortex bundle patch.
|
|
2
|
-
# Host row + client panel. The engine owns its own data root (~/.dsh/cortex),
|
|
2
|
+
# Host row + client panel. The engine owns its own data root (~/.dsh/cortex-memory),
|
|
3
3
|
# never shiori's data.
|
|
4
4
|
- insert:
|
|
5
|
-
- id: cortex
|
|
6
|
-
name: 'dsh-cortex'
|
|
5
|
+
- id: dsh-cortex-memory
|
|
6
|
+
name: 'dsh-cortex-memory'
|
|
7
7
|
config: {}
|
package/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { createScheduler } from './src/host/scheduler.js';
|
|
|
8
8
|
import { effectiveFeatures } from './src/core/feature-overrides.js';
|
|
9
9
|
import { createWebSearch } from './src/web/search.js';
|
|
10
10
|
|
|
11
|
-
export const name = 'cortex';
|
|
11
|
+
export const name = 'dsh-cortex-memory';
|
|
12
12
|
export const inject = ['tools', 'systemPrompt'];
|
|
13
13
|
|
|
14
14
|
let Schema = null;
|
|
@@ -20,7 +20,7 @@ try {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export const Config = Schema ? Schema.object({
|
|
23
|
-
dataRoot: Schema.string().description('Cortex 数据目录(默认 DSH_HOME/cortex
|
|
23
|
+
dataRoot: Schema.string().description('Cortex 数据目录(默认 DSH_HOME/cortex-memory;旧库由迁移脚本复制)'),
|
|
24
24
|
dbFile: Schema.string().description('SQLite 文件;默认 dataRoot/cortex.sqlite'),
|
|
25
25
|
scope: Schema.string().default('global').description('默认 scope'),
|
|
26
26
|
persona: Schema.object({
|
package/package.json
CHANGED
package/src/core/config.js
CHANGED
|
@@ -4,7 +4,7 @@ import { clamp } from './time.js';
|
|
|
4
4
|
import { profileDataRoot } from './profile.js';
|
|
5
5
|
|
|
6
6
|
const DSH_HOME = process.env.DSH_HOME || path.join(os.homedir(), '.dsh');
|
|
7
|
-
const DEFAULT_ROOT = process.env.CORTEX_HOME || path.join(DSH_HOME, 'cortex');
|
|
7
|
+
const DEFAULT_ROOT = process.env.CORTEX_HOME || path.join(DSH_HOME, 'cortex-memory');
|
|
8
8
|
|
|
9
9
|
export const DEFAULT_CONFIG = Object.freeze({
|
|
10
10
|
dataRoot: DEFAULT_ROOT,
|
|
@@ -25,7 +25,7 @@ export function readOverrides(dataRoot) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export function loadFeatureOverrides(config = {}) {
|
|
28
|
-
const dataRoot = config.dataRoot ?? path.join(process.env.DSH_HOME || path.join(process.env.USERPROFILE || process.env.HOME || '.', '.dsh'), 'cortex');
|
|
28
|
+
const dataRoot = config.dataRoot ?? path.join(process.env.DSH_HOME || path.join(process.env.USERPROFILE || process.env.HOME || '.', '.dsh'), 'cortex-memory');
|
|
29
29
|
return readOverrides(dataRoot).current;
|
|
30
30
|
}
|
|
31
31
|
|
package/src/core/profile.js
CHANGED
|
@@ -26,7 +26,14 @@ export function detectProfileName({ argv = process.argv, env = process.env } = {
|
|
|
26
26
|
export function profileDataRoot({ argv = process.argv, env = process.env } = {}) {
|
|
27
27
|
const profile = detectProfileName({ argv, env });
|
|
28
28
|
const home = homeFromEnv(env);
|
|
29
|
-
//
|
|
29
|
+
// Keep the public bundle identity separate from legacy `cortex` data.
|
|
30
|
+
if (!profile || profile === 'desktop') return path.join(home, 'cortex-memory');
|
|
31
|
+
return path.join(home, 'cortex-memory', 'profiles', profile);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function legacyProfileDataRoot({ argv = process.argv, env = process.env } = {}) {
|
|
35
|
+
const profile = detectProfileName({ argv, env });
|
|
36
|
+
const home = homeFromEnv(env);
|
|
30
37
|
if (!profile || profile === 'desktop') return path.join(home, 'cortex');
|
|
31
38
|
return path.join(home, 'cortex', 'profiles', profile);
|
|
32
39
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { profileDataRoot, legacyProfileDataRoot } from '../../src/core/profile.js';
|
|
5
|
+
|
|
6
|
+
const home = 'C:/tmp/cortex-profile-test';
|
|
7
|
+
|
|
8
|
+
test('desktop data root is cortex-memory', () => {
|
|
9
|
+
const root = profileDataRoot({ argv: [], env: { DSH_HOME: home, DSH_PROFILE: 'desktop' } });
|
|
10
|
+
assert.equal(root, path.join(home, 'cortex-memory'));
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test('other profiles are isolated under cortex-memory/profiles', () => {
|
|
14
|
+
const root = profileDataRoot({ argv: [], env: { DSH_HOME: home, DSH_PROFILE: 'work' } });
|
|
15
|
+
assert.equal(root, path.join(home, 'cortex-memory', 'profiles', 'work'));
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('legacy data root remains readable for migration', () => {
|
|
19
|
+
const root = legacyProfileDataRoot({ argv: [], env: { DSH_HOME: home, DSH_PROFILE: 'desktop' } });
|
|
20
|
+
assert.equal(root, path.join(home, 'cortex'));
|
|
21
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import test from 'node:test';
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import { detectProfileName, profileDataRoot } from '../../src/core/profile.js';
|
|
4
|
+
import { detectProfileName, profileDataRoot, legacyProfileDataRoot } from '../../src/core/profile.js';
|
|
5
5
|
|
|
6
6
|
test('detectProfileName reads --profile, --profile= and profile paths', () => {
|
|
7
7
|
assert.equal(detectProfileName({ argv: ['node', 'dsh', '--profile', 'cortex-clean'], env: {} }), 'cortex-clean');
|
|
@@ -12,9 +12,15 @@ test('detectProfileName reads --profile, --profile= and profile paths', () => {
|
|
|
12
12
|
assert.equal(detectProfileName({ argv: [], env: {} }), null);
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
test('profileDataRoot isolates non-desktop profiles
|
|
15
|
+
test('profileDataRoot isolates non-desktop profiles under the new cortex-memory root', () => {
|
|
16
16
|
const env = { DSH_HOME: 'C:\\dsh-home' };
|
|
17
|
-
assert.equal(profileDataRoot({ argv: ['dsh', '--profile', 'agent-a'], env }), path.join('C:\\dsh-home', 'cortex', 'profiles', 'agent-a'));
|
|
18
|
-
assert.equal(profileDataRoot({ argv: ['dsh', '--profile', 'desktop'], env }), path.join('C:\\dsh-home', 'cortex'));
|
|
19
|
-
assert.equal(profileDataRoot({ argv: [], env }), path.join('C:\\dsh-home', 'cortex'));
|
|
17
|
+
assert.equal(profileDataRoot({ argv: ['dsh', '--profile', 'agent-a'], env }), path.join('C:\\dsh-home', 'cortex-memory', 'profiles', 'agent-a'));
|
|
18
|
+
assert.equal(profileDataRoot({ argv: ['dsh', '--profile', 'desktop'], env }), path.join('C:\\dsh-home', 'cortex-memory'));
|
|
19
|
+
assert.equal(profileDataRoot({ argv: [], env }), path.join('C:\\dsh-home', 'cortex-memory'));
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('legacyProfileDataRoot keeps the old cortex path for migration', () => {
|
|
23
|
+
const env = { DSH_HOME: 'C:\\dsh-home' };
|
|
24
|
+
assert.equal(legacyProfileDataRoot({ argv: ['dsh', '--profile', 'agent-a'], env }), path.join('C:\\dsh-home', 'cortex', 'profiles', 'agent-a'));
|
|
25
|
+
assert.equal(legacyProfileDataRoot({ argv: ['dsh', '--profile', 'desktop'], env }), path.join('C:\\dsh-home', 'cortex'));
|
|
20
26
|
});
|