dsh-cortex-memory 0.2.0-rc.13 → 0.2.0

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/README.md CHANGED
@@ -91,3 +91,9 @@ auto-linked into them.
91
91
  MIT. External ideas are cited in the research notes; no third-party source
92
92
  code is copied into this package.
93
93
 
94
+
95
+ ## Security and privacy
96
+
97
+ - [Permissions and scopes](./docs/permissions.md)
98
+ - [Privacy notes](./docs/privacy.md)
99
+
package/client.js CHANGED
@@ -181,7 +181,7 @@ window.__ModuleLoader__.load({
181
181
  graphReject: '拒绝',
182
182
  graphCandidateConfidence: '置信',
183
183
  settingsTitle: '运行设置',
184
- settingsHint: '设置与指标均为只读快照。',
184
+ settingsHint: '功能开关与指标为只读快照;权限修改会写入本机配置,重启后生效。',
185
185
  runtime: '运行时',
186
186
  features: '功能开关',
187
187
  permissions: '权限 / 网络',
@@ -243,7 +243,7 @@ window.__ModuleLoader__.load({
243
243
  p95: 'p95',
244
244
  max: 'max',
245
245
  metricsEmpty: '还没有指标样本。',
246
- readOnlyNote: '只读:此页不会写入设置或记忆。',
246
+ readOnlyNote: '快照只读;权限按钮可写,需确认并重启。',
247
247
  refreshAll: '全部刷新',
248
248
  metricAt: '采样时间',
249
249
  notAvailable: '不可用',
@@ -444,7 +444,7 @@ window.__ModuleLoader__.load({
444
444
  graphReject: 'Reject',
445
445
  graphCandidateConfidence: 'Confidence',
446
446
  settingsTitle: 'Runtime settings',
447
- settingsHint: 'Settings and metrics are read-only snapshots.',
447
+ settingsHint: 'Feature flags and metrics are read-only snapshots; permission changes write local config and apply after restart.',
448
448
  runtime: 'Runtime',
449
449
  features: 'Feature flags',
450
450
  permissions: 'Permissions / network',
@@ -506,7 +506,7 @@ window.__ModuleLoader__.load({
506
506
  p95: 'p95',
507
507
  max: 'max',
508
508
  metricsEmpty: 'No metric samples yet.',
509
- readOnlyNote: 'Read-only: this page never writes settings or memories.',
509
+ readOnlyNote: 'Snapshots are read-only; permission buttons write config after confirmation and need a restart.',
510
510
  refreshAll: 'Refresh all',
511
511
  metricAt: 'Sampled at',
512
512
  notAvailable: 'Not available',
@@ -0,0 +1,49 @@
1
+ # Permissions and scopes
2
+
3
+ Cortex is local-first. The defaults are intentionally conservative.
4
+
5
+ ## Local API
6
+
7
+ - The API is loopback-only by default.
8
+ - Requests carry a local token; cross-origin and unsafe POSTs are rejected.
9
+ - `POST /permissions` requires `confirm: true`; a permission change writes a local override and takes effect after a DSH restart.
10
+ - `POST /permissions/rollback` removes the override and also takes effect after restart.
11
+
12
+ ## Scopes
13
+
14
+ - Every trace, fact, relation, goal and working item has a scope.
15
+ - The global scope is writable by default; shared scopes may be read-only.
16
+ - Scope resolution order is header, then query, then body, then the server default.
17
+ - A write to a read-only scope is refused; it is not silently redirected.
18
+
19
+ ## Shared write grants
20
+
21
+ - Shared write grants are for API clients that send `x-cortex-agent`.
22
+ - A grant is a `scope:agent` pair, with an optional expiry.
23
+ - Revoke takes effect immediately; the tool path does not send an agent header.
24
+ - The grant list is visible in the Settings tab.
25
+
26
+ ## Network permissions
27
+
28
+ - `llm`: allow the configured model service for QA, consolidation or extraction facts.
29
+ - `embed`: allow remote embedding; local embeddings remain available.
30
+ - `rerank`: allow remote reranking.
31
+ - `vector`: enable vector indexing/search.
32
+ - If a provider fails or a permission is off, Cortex falls back to non-vector or evidence-only paths instead of inventing data.
33
+
34
+ ## Feature flags
35
+
36
+ Feature flags and metrics on the Settings page are a read-only snapshot. Permission buttons are the writable part; they always show a confirmation and a restart notice.
37
+
38
+ ## Audit and rollback
39
+
40
+ - Writes, merges, forgets, permission changes and guardian operations append to the audit ledger.
41
+ - `cortex_guard` can back up, validate, export and restore.
42
+ - Delete is a privacy cascade; the event ledger keeps only a content hash.
43
+ - A bad permission override can be removed with the rollback button.
44
+
45
+ ## What Cortex does not do
46
+
47
+ - It does not read arbitrary files just because they are on disk.
48
+ - It does not send memories to a model unless the corresponding permission and provider are configured.
49
+ - It does not store API keys or passwords in memory.
@@ -0,0 +1,48 @@
1
+ # Privacy notes
2
+
3
+ ## Where data lives
4
+
5
+ Default data root:
6
+
7
+ ```text
8
+ ~/.dsh/cortex/
9
+ cortex.sqlite
10
+ backups/
11
+ vector/
12
+ ```
13
+
14
+ The exact paths are shown in the Settings tab. This data stays on the machine unless the user configures a remote provider or moves it.
15
+
16
+ ## What is stored
17
+
18
+ - traces (episodic, semantic, reflective, derived)
19
+ - facts and graph edges
20
+ - working memory, goals, playbook rules
21
+ - audit events
22
+ - emotional appraisals and relationship state
23
+ - optional derived text from local OCR/ASR, with source URI and engine metadata
24
+
25
+ ## What is not stored
26
+
27
+ - API keys, tokens or passwords
28
+ - raw model files
29
+ - the contents of arbitrary local files that were not explicitly passed to an extraction tool
30
+ - a copy of a deleted trace's body (delete cascades; the ledger keeps a content hash)
31
+
32
+ ## Deletion and export
33
+
34
+ - `cortex_forget` archive keeps a trace recoverable; delete removes it and its derived data.
35
+ - `cortex_guard export` writes a Markdown mirror for inspection.
36
+ - `cortex_guard backup` creates a SQLite backup; validate a backup before restoring.
37
+ - Attachments are metadata references; the default attachment reader is disabled.
38
+
39
+ ## OCR / ASR
40
+
41
+ - Extraction is explicit: a `file://` URI and a configured local engine.
42
+ - The extractor never downloads a model automatically.
43
+ - Extracted text is written as a **derived trace**; the target trace is unchanged.
44
+ - PaddleOCR/Tesseract/Whisper models are local files owned by the user.
45
+
46
+ ## Cloud / network
47
+
48
+ Remote LLM, embedding and rerank calls are off unless explicitly enabled and configured. The local API is loopback-only by default. There is no automatic telemetry from Cortex itself.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cortex-memory",
3
- "version": "0.2.0-rc.13",
3
+ "version": "0.2.0",
4
4
  "description": "A layered, temporal, self-developing memory engine for DeepSeek Harness: working, episodic, semantic, procedural and reflective memory with hybrid retrieval, DSR forgetting, reflection, consolidation, gated self-evolution and guardian.",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -31,7 +31,9 @@
31
31
  "docs/scopes.md",
32
32
  "docs/multimodal.md",
33
33
  "examples",
34
- "LICENSE"
34
+ "LICENSE",
35
+ "docs/permissions.md",
36
+ "docs/privacy.md"
35
37
  ],
36
38
  "scripts": {
37
39
  "test": "node --test test/unit/ test/integration/",