dsh-memu-memory 1.2.2 → 1.2.4
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/AGENTS.md +4 -1
- package/README.md +12 -16
- package/README.zh.md +13 -17
- package/docs/client-conventions.md +2 -0
- package/docs/contributing.md +7 -6
- package/docs/emotion-model-spec.md +2 -2
- package/docs/env-and-commands.md +63 -1
- package/docs/host-api.md +19 -0
- package/docs/memory-semantics.md +10 -1
- package/docs/troubleshooting.md +77 -3
- package/lib/activity-log.js +1 -1
- package/lib/binding-diagnostics.js +1 -1
- package/lib/client.js +223 -19
- package/lib/cycle.js +9 -1
- package/lib/embedding-catalog.js +416 -138
- package/lib/embedding-download.js +36 -11
- package/lib/freshness.js +97 -0
- package/lib/graph.js +244 -2
- package/lib/inject.js +218 -11
- package/lib/local-embedding-manager.js +3 -2
- package/lib/local-embedding-protocol.js +40 -3
- package/lib/local-embedding-worker.js +36 -6
- package/lib/local-vector-service.js +18 -4
- package/lib/memory.js +83 -17
- package/lib/memu.js +15 -7
- package/lib/private.js +25 -5
- package/lib/rpc.js +17 -3
- package/lib/salient-wake.js +402 -0
- package/lib/state.js +173 -1
- package/package.json +3 -2
- package/scripts/drive-session.mjs +864 -0
- package/scripts/mock-llm.mjs +903 -0
- package/scripts/simulate-injection.mjs +298 -0
- package/tests/client-render.test.mjs +69 -2
- package/tests/consolidation-fork.test.mjs +14 -1
- package/tests/drive-session.test.mjs +152 -0
- package/tests/embedding-catalog.test.mjs +116 -8
- package/tests/embedding-download.test.mjs +97 -2
- package/tests/embedding-runtime.test.mjs +21 -13
- package/tests/entity-merge.test.mjs +261 -0
- package/tests/fixtures/mock-llm/reply.txt +1 -0
- package/tests/freshness.test.mjs +140 -0
- package/tests/help-page.test.mjs +4 -4
- package/tests/injection-chain.test.mjs +176 -0
- package/tests/injection-rollback.test.mjs +230 -0
- package/tests/local-embedding-env.test.mjs +51 -0
- package/tests/local-embedding-manager.test.mjs +18 -0
- package/tests/local-embedding-protocol.test.mjs +28 -2
- package/tests/local-embedding-worker.test.mjs +94 -0
- package/tests/mock-llm.test.mjs +225 -0
- package/tests/open-loop-date.test.mjs +406 -0
- package/tests/salient-wake.test.mjs +362 -0
- package/tests/settings-plumbing.test.mjs +76 -0
- package/tests/sidebar.test.mjs +5 -1
- package/tests/simulate-injection.test.mjs +76 -0
- package/tests/stubs/dsh-schedule.js +105 -0
- package/tests/vector-profile.test.mjs +28 -4
- package/tests/webui-auth.test.mjs +4 -0
|
@@ -139,11 +139,35 @@ test('profile depends on the catalog only: it never touches state', () => {
|
|
|
139
139
|
|
|
140
140
|
// ---------------------------------------------------------------- 拒绝
|
|
141
141
|
|
|
142
|
+
// 三条已核实条目都能建 profile:切换功能的前提是「任意两条之间都能换」,而前缀必须随
|
|
143
|
+
// profile 下发到 worker,否则 e5 的两种读法在建 profile 这一步就丢了。
|
|
144
|
+
test('every verified catalog entry builds a profile that carries its prefixes', () => {
|
|
145
|
+
for (const entry of catalog.getEmbeddingCatalog()) {
|
|
146
|
+
const built = vp.profileFromCatalog(entry.id)
|
|
147
|
+
assert.equal(built.catalogId, entry.id)
|
|
148
|
+
assert.ok(Number.isInteger(built.dimension) && built.dimension > 0, entry.id)
|
|
149
|
+
assert.deepEqual(built.prefixes, entry.prefixes, entry.id)
|
|
150
|
+
assert.equal(built.fingerprint, entry.profileFingerprint, entry.id)
|
|
151
|
+
assert.equal(built.verification.status, 'verified', entry.id)
|
|
152
|
+
}
|
|
153
|
+
})
|
|
154
|
+
|
|
142
155
|
test('a pending model is refused instead of guessed', () => {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
156
|
+
// 目录里三条都已核实,所以「未核实」用注入的候选条目验:挡住的是状态,不是某个 id。
|
|
157
|
+
const pending = clone(entry)
|
|
158
|
+
pending.id = 'pending-candidate'
|
|
159
|
+
pending.availability = 'pending'
|
|
160
|
+
pending.files = []
|
|
161
|
+
pending.verification = { ...pending.verification, status: 'unverified' }
|
|
162
|
+
delete pending.profileFingerprint
|
|
163
|
+
vp.setCatalogEntryResolver(id => (id === 'pending-candidate' ? pending : catalog.getEmbeddingModel(id)))
|
|
164
|
+
try {
|
|
165
|
+
assertCode(() => vp.profileFromCatalog('pending-candidate'), 'VECTOR_PROFILE_PENDING')
|
|
166
|
+
assertCode(() => vp.profileFromCatalog('nope-not-in-catalog'), 'VECTOR_PROFILE_UNKNOWN')
|
|
167
|
+
assertCode(() => vp.profileFromCatalog(null), 'VECTOR_PROFILE_UNKNOWN')
|
|
168
|
+
} finally {
|
|
169
|
+
vp.resetCatalogEntryResolver()
|
|
170
|
+
}
|
|
147
171
|
})
|
|
148
172
|
|
|
149
173
|
test('an unverified manifest is refused', () => {
|
|
@@ -521,6 +521,10 @@ const matrixRows = [
|
|
|
521
521
|
{ endpoint: 'getMemory', operation: 'read', payload: (lib) => ({ libraryId: lib.id, id: 'mem-matrix-scratch' }) },
|
|
522
522
|
{ endpoint: 'browseWall', operation: 'read', payload: (lib) => ({ libraryId: lib.id }) },
|
|
523
523
|
{ endpoint: 'getStats', operation: 'read', payload: (lib) => ({ libraryId: lib.id }) },
|
|
524
|
+
// 工单 F:实体合并的读写面。合并矩阵只验证路由授权:不存在的实体在 200
|
|
525
|
+
// 业务信封里报 unknown entity,403 必须在 dispatch 之前发生。
|
|
526
|
+
{ endpoint: 'suggestEntityMerges', operation: 'read', payload: (lib) => ({ libraryId: lib.id }) },
|
|
527
|
+
{ endpoint: 'mergeEntities', operation: 'write', payload: (lib) => ({ libraryId: lib.id, targetId: 'ent-matrix-target', sourceIds: ['ent-matrix-source'] }) },
|
|
524
528
|
{ endpoint: 'addMemory', operation: 'write', payload: (lib) => ({ libraryId: lib.id, content: 'matrix write body' }) },
|
|
525
529
|
{ endpoint: 'updateMemory', operation: 'write', payload: (lib) => ({ libraryId: lib.id, id: 'mem-matrix-scratch', patch: { title: 'matrix retitled' } }) },
|
|
526
530
|
{ endpoint: 'archiveMemory', operation: 'archive', payload: (lib) => ({ libraryId: lib.id, id: 'mem-matrix-scratch' }) },
|