@modusensus/dsh-mneme 0.7.10 → 0.7.11

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/README.en.md +368 -0
  2. package/README.md +298 -169
  3. package/{dsh-mneme/cordis.patch.yml → cordis.patch.yml} +1 -0
  4. package/{dsh-mneme/lib → lib}/api.js +50 -295
  5. package/{dsh-mneme/lib → lib}/client.js +780 -936
  6. package/{dsh-mneme/src → lib}/config.js +6 -100
  7. package/{dsh-mneme/lib → lib}/dream/decisions.js +94 -143
  8. package/{dsh-mneme/lib → lib}/dream/sleep.js +12 -152
  9. package/{dsh-mneme/lib → lib}/dream.js +22 -168
  10. package/{dsh-mneme/src → lib}/hot-memory.js +0 -7
  11. package/{dsh-mneme/lib → lib}/index.js +6 -34
  12. package/{dsh-mneme/lib → lib}/inject.js +11 -53
  13. package/{dsh-mneme/src → lib}/mirror.js +1 -12
  14. package/{dsh-mneme/lib → lib}/quality-filter.js +1 -3
  15. package/{dsh-mneme/lib → lib}/reranker.js +1 -4
  16. package/{dsh-mneme/lib → lib}/service.js +20 -410
  17. package/{dsh-mneme/lib → lib}/settings.js +0 -70
  18. package/{dsh-mneme/lib → lib}/store.js +35 -450
  19. package/{dsh-mneme/lib → lib}/summarize.js +10 -10
  20. package/lib/tools.js +274 -0
  21. package/package.json +41 -19
  22. package/{dsh-mneme/scripts → scripts}/e2e-dsh.js +3 -4
  23. package/{dsh-mneme/scripts → scripts}/sync-lib.js +5 -10
  24. package/{dsh-mneme/src → src}/api.js +50 -295
  25. package/{dsh-mneme/lib → src}/config.js +6 -100
  26. package/{dsh-mneme/src → src}/dream/decisions.js +94 -143
  27. package/{dsh-mneme/src → src}/dream/sleep.js +12 -152
  28. package/{dsh-mneme/src → src}/dream.js +22 -168
  29. package/{dsh-mneme/lib → src}/hot-memory.js +0 -7
  30. package/{dsh-mneme/src → src}/index.js +6 -34
  31. package/{dsh-mneme/src → src}/inject.js +11 -53
  32. package/{dsh-mneme/lib → src}/mirror.js +1 -12
  33. package/{dsh-mneme/src → src}/quality-filter.js +1 -3
  34. package/{dsh-mneme/src → src}/reranker.js +1 -4
  35. package/{dsh-mneme/src → src}/service.js +20 -410
  36. package/{dsh-mneme/src → src}/settings.js +0 -70
  37. package/{dsh-mneme/src → src}/store.js +35 -450
  38. package/{dsh-mneme/src → src}/summarize.js +10 -10
  39. package/src/tools.js +274 -0
  40. package/{dsh-mneme/test → test}/api.test.js +1 -156
  41. package/{dsh-mneme/test → test}/client.test.js +10 -206
  42. package/{dsh-mneme/test → test}/config.test.js +0 -21
  43. package/{dsh-mneme/test → test}/dream.test.js +1 -160
  44. package/{dsh-mneme/test → test}/graph-api.test.js +0 -34
  45. package/{dsh-mneme/test → test}/hot-memory.test.js +0 -29
  46. package/test/inject.test.js +120 -0
  47. package/{dsh-mneme/test → test}/llm-audit.test.js +4 -4
  48. package/{dsh-mneme/test → test}/reasoning-effort.test.js +0 -27
  49. package/{dsh-mneme/test → test}/recall-layer.test.js +5 -26
  50. package/{dsh-mneme/test → test}/reranker.test.js +0 -43
  51. package/{dsh-mneme/test → test}/service-search.test.js +0 -25
  52. package/{dsh-mneme/test → test}/service.test.js +0 -106
  53. package/{dsh-mneme/test → test}/settings.test.js +0 -43
  54. package/{dsh-mneme/test → test}/sleep.test.js +4 -171
  55. package/{dsh-mneme/test → test}/store.test.js +0 -76
  56. package/{dsh-mneme/test → test}/summarize.test.js +16 -15
  57. package/test/tools.test.js +265 -0
  58. package/.github/workflows/publish.yml +0 -58
  59. package/.github/workflows/test.yml +0 -32
  60. package/CHANGELOG.md +0 -91
  61. package/CONTRIBUTING.md +0 -293
  62. package/SECURITY.md +0 -718
  63. package/docs/devlog/2026-08-14-dsh-mneme-dev-log.md +0 -247
  64. package/docs/devlog/2026-08-15-dsh-mneme-audit-stress-dev-log.md +0 -145
  65. package/docs/devlog/2026-08-15-dsh-mneme-pipeline-dev-log.md +0 -56
  66. package/docs/devlog/2026-08-15-dsh-mneme-reflection-dev-log.md +0 -77
  67. package/docs/devlog/2026-08-15-dsh-mneme-review-fixes-dev-log.md +0 -64
  68. package/docs/devlog/2026-08-15-dsh-mneme-semantic-dev-log.md +0 -90
  69. package/dsh-mneme/CHANGELOG.md +0 -419
  70. package/dsh-mneme/LICENSE +0 -21
  71. package/dsh-mneme/README.md +0 -501
  72. package/dsh-mneme/docs/AGENT_MEMORY_RESEARCH.md +0 -183
  73. package/dsh-mneme/docs/ENTITIES.md +0 -245
  74. package/dsh-mneme/docs/LOCAL_MODEL.md +0 -141
  75. package/dsh-mneme/docs/MIGRATION.md +0 -127
  76. package/dsh-mneme/docs/SEMANTIC.md +0 -256
  77. package/dsh-mneme/docs/SLEEP.md +0 -163
  78. package/dsh-mneme/lib/dream/tag-extractor.js +0 -156
  79. package/dsh-mneme/lib/heat.js +0 -136
  80. package/dsh-mneme/lib/parser/tag.js +0 -59
  81. package/dsh-mneme/lib/parser/wiki-link.js +0 -38
  82. package/dsh-mneme/lib/search/tag-boost.js +0 -61
  83. package/dsh-mneme/lib/tools.js +0 -458
  84. package/dsh-mneme/package-lock.json +0 -1936
  85. package/dsh-mneme/package.json +0 -83
  86. package/dsh-mneme/scripts/check-sync.js +0 -42
  87. package/dsh-mneme/src/client.js +0 -2242
  88. package/dsh-mneme/src/dream/tag-extractor.js +0 -156
  89. package/dsh-mneme/src/heat.js +0 -136
  90. package/dsh-mneme/src/parser/tag.js +0 -59
  91. package/dsh-mneme/src/parser/wiki-link.js +0 -38
  92. package/dsh-mneme/src/search/tag-boost.js +0 -61
  93. package/dsh-mneme/src/tools.js +0 -458
  94. package/dsh-mneme/test/boundary-v0625.test.js +0 -82
  95. package/dsh-mneme/test/directory.test.js +0 -134
  96. package/dsh-mneme/test/heat.test.js +0 -148
  97. package/dsh-mneme/test/inject.test.js +0 -206
  98. package/dsh-mneme/test/layered-types-stats.test.js +0 -144
  99. package/dsh-mneme/test/lib-smoke.test.js +0 -109
  100. package/dsh-mneme/test/normalize-decisions.test.js +0 -120
  101. package/dsh-mneme/test/provenance.test.js +0 -103
  102. package/dsh-mneme/test/recall-runs.test.js +0 -93
  103. package/dsh-mneme/test/sleep-heat.test.js +0 -112
  104. package/dsh-mneme/test/tag-boost.test.js +0 -125
  105. package/dsh-mneme/test/tag.test.js +0 -426
  106. package/dsh-mneme/test/tools.test.js +0 -674
  107. package/dsh-mneme/test/updated-at-semantics.test.js +0 -113
  108. package/dsh-mneme/test/wiki-link.test.js +0 -332
  109. package//346/250/252/345/271/205.png +0 -0
  110. /package/{dsh-mneme/lib → lib}/commands.js +0 -0
  111. /package/{dsh-mneme/lib → lib}/dream/clustering.js +0 -0
  112. /package/{dsh-mneme/lib → lib}/embedding.js +0 -0
  113. /package/{dsh-mneme/lib → lib}/entities/extractor.js +0 -0
  114. /package/{dsh-mneme/lib → lib}/local-embedder.js +0 -0
  115. /package/{dsh-mneme/lib → lib}/search/adaptive.js +0 -0
  116. /package/{dsh-mneme/lib → lib}/search/bm25.js +0 -0
  117. /package/{dsh-mneme/lib → lib}/vector-index.js +0 -0
  118. /package/{dsh-mneme/scripts → scripts}/benchmark-embed.js +0 -0
  119. /package/{dsh-mneme/scripts → scripts}/benchmark-recall.js +0 -0
  120. /package/{dsh-mneme/scripts → scripts}/benchmark-rerank.js +0 -0
  121. /package/{dsh-mneme/scripts → scripts}/stress-dsh.js +0 -0
  122. /package/{dsh-mneme/src → src}/commands.js +0 -0
  123. /package/{dsh-mneme/src → src}/dream/clustering.js +0 -0
  124. /package/{dsh-mneme/src → src}/embedding.js +0 -0
  125. /package/{dsh-mneme/src → src}/entities/extractor.js +0 -0
  126. /package/{dsh-mneme/src → src}/local-embedder.js +0 -0
  127. /package/{dsh-mneme/src → src}/search/adaptive.js +0 -0
  128. /package/{dsh-mneme/src → src}/search/bm25.js +0 -0
  129. /package/{dsh-mneme/src → src}/vector-index.js +0 -0
  130. /package/{dsh-mneme/test → test}/audit.test.js +0 -0
  131. /package/{dsh-mneme/test → test}/benchmark.test.js +0 -0
  132. /package/{dsh-mneme/test → test}/clustering.test.js +0 -0
  133. /package/{dsh-mneme/test → test}/commands.test.js +0 -0
  134. /package/{dsh-mneme/test → test}/conflict-freeze.test.js +0 -0
  135. /package/{dsh-mneme/test → test}/entities.test.js +0 -0
  136. /package/{dsh-mneme/test → test}/epistemic.test.js +0 -0
  137. /package/{dsh-mneme/test → test}/fnew-0112.test.js +0 -0
  138. /package/{dsh-mneme/test → test}/fnew-03.test.js +0 -0
  139. /package/{dsh-mneme/test → test}/helpers/dream-mock.js +0 -0
  140. /package/{dsh-mneme/test → test}/local-embedder.test.js +0 -0
  141. /package/{dsh-mneme/test → test}/mirror-dirty.test.js +0 -0
  142. /package/{dsh-mneme/test → test}/mirror-edit-digest.test.js +0 -0
  143. /package/{dsh-mneme/test → test}/mirror-generation.test.js +0 -0
  144. /package/{dsh-mneme/test → test}/mirror.test.js +0 -0
  145. /package/{dsh-mneme/test → test}/peer-blockers.test.js +0 -0
  146. /package/{dsh-mneme/test → test}/policy-epoch.test.js +0 -0
  147. /package/{dsh-mneme/test → test}/quality-filter.test.js +0 -0
  148. /package/{dsh-mneme/test → test}/recall-evals.test.js +0 -0
  149. /package/{dsh-mneme/test → test}/receipt-chain.test.js +0 -0
  150. /package/{dsh-mneme/test → test}/reflection.test.js +0 -0
  151. /package/{dsh-mneme/test → test}/search-fusion.test.js +0 -0
  152. /package/{dsh-mneme/test → test}/semantic.test.js +0 -0
  153. /package/{dsh-mneme/test → test}/stress.test.js +0 -0
  154. /package/{dsh-mneme/test → test}/vector-index.test.js +0 -0
package/SECURITY.md DELETED
@@ -1,718 +0,0 @@
1
- # Security Policy
2
-
3
- > **English** | [中文](#安全策略)
4
-
5
- ---
6
-
7
- ## Supported Versions
8
-
9
- We actively maintain the latest minor version. Security fixes are backported to the latest patch release, and critical fixes may be backported to the previous minor version.
10
-
11
- | Version | Supported | Status |
12
- |---|---|---|
13
- | 0.7.x | ✅ Yes | Active development |
14
- | 0.6.x | ⚠️ Best-effort | Critical fixes only |
15
- | < 0.6.0 | ❌ No | Please upgrade to 0.7.x |
16
-
17
- **End-of-life notice**: 0.6.x is in best-effort maintenance (critical fixes only). Its end-of-life date will be announced in advance; after that date no security fixes will be provided for 0.6.x.
18
-
19
- ---
20
-
21
- ## Known Security Features
22
-
23
- The following security features are implemented and maintained in the project:
24
-
25
- | Feature | Description | Status |
26
- |---|---|---|
27
- | `apiToken` Authentication | All remote endpoints require `Authorization: Bearer <apiToken>` when a token is configured; comparison uses `crypto.timingSafeEqual` | ✅ Implemented |
28
- | `policyEpoch` Memory Governance | Bumping `policyEpoch` downgrades all prior `dream_runs` to historical evidence; their receipts no longer drive real-time memory decisions | ✅ Implemented |
29
- | `conflictFreezeEnabled` Conflict Freeze | Conflicting memories are not auto-merged; they are flagged as pending human review, preserving data integrity | ✅ Implemented |
30
- | CAS (Compare-and-Swap) Guard | Prevents concurrent write conflicts; ensures atomic write operations | ✅ Implemented |
31
- | Digest Baseline Audit | Memory updates are compared against digest baselines to detect unauthorized changes | ✅ Implemented |
32
- | `failure_memories` Audit Trail | Every failed write operation is logged for forensic analysis | ✅ Implemented |
33
- | `recall_run` Search Audit | Every search operation is recorded with timestamp and query metadata | ✅ Implemented |
34
- | Local-First Data Processing | All embeddings, reranking, and memory consolidation run locally; no data leaves the device | ✅ Implemented |
35
- | No Telemetry | No analytics, no remote logging, no network requests by design | ✅ Implemented |
36
- | Query Sanitization | LIKE-query escaping, bounded paging, and Markdown mirror escaping prevent injection and malformed input | ✅ Implemented |
37
- | `entityExtractionEnabled` Opt-In Entity Extraction | Entity extraction is opt-in via configuration (default: off), minimizing data processing by default | ✅ Implemented |
38
- | Graceful Degradation | System falls back to keyword search on component failure; no crash | ✅ Implemented |
39
- | Human-Editable Mirrors | All memories mirrored to Markdown files; users can verify and reconstruct data | ✅ Implemented |
40
- | Mirror Generation CAS/Fence | Mirror sync is bound to a monotonic `generation` counter with CAS/fence semantics; stale or concurrent mirror writes are rejected | ✅ Implemented |
41
- | Crash-Recovery Debt Model | Business writes atomically bump `desired generation` in the same transaction; after a crash, `recoverMirror` replays the debt instead of silently skipping repairs | ✅ Implemented |
42
- | `/health` Auth-Gated Endpoint | Health endpoint requires `apiToken`; error codes are sanitized (no-space / permission / sync-failed) and read failures fail closed as `unknown` | ✅ Implemented |
43
- | Fail-Closed Input Validation | Generation counters and hot-memory parameters are validated (`Number.isInteger`, finite, non-negative) with SQL `CHECK` constraints; invalid input falls back to safe defaults or is rejected | ✅ Implemented |
44
- | Hybrid Score Clamping | Hybrid fusion scores are clamped to [0, 1] to prevent vector + BM25 stacking from breaking normalization bounds | ✅ Implemented |
45
- | Tag Sanitization | Tag normalization reuses the sanitizer; `autoTag` skips forgotten memories; `setMemoryTags` runs inside a SAVEPOINT for atomic rollback | ✅ Implemented |
46
-
47
- ---
48
-
49
- ## Reporting a Vulnerability
50
-
51
- ### Please DO NOT
52
-
53
- - Open a public issue for security vulnerabilities
54
- - Post exploit details in discussions or comments
55
- - Submit PRs that expose security flaws without prior coordination
56
-
57
- ### Please DO
58
-
59
- 1. **Email** `work@modusensus.space` (or open a **private security advisory** via [GitHub Security Advisories](https://github.com/modusensus/dsh-mneme/security/advisories))
60
- 2. Include:
61
- - A clear description of the vulnerability
62
- - Steps to reproduce (minimal test case preferred)
63
- - Impact assessment (data exposure? local-only? remote?)
64
- - Affected versions
65
- - Your proposed fix (if any)
66
- - Whether you are requesting credit / disclosure preferences
67
-
68
- ### Scope and Out of Scope
69
-
70
- **In scope** — issues this policy covers:
71
- - Remote API authentication or authorization bypass (`apiToken`-protected surfaces)
72
- - Memory integrity violations (CAS/fence bypass, unauthorized overwrite, replay paths)
73
- - Mirror consistency and recovery logic that can cause silent data corruption
74
- - Exploitable vulnerabilities in shipped runtime dependencies (supported versions only)
75
-
76
- **Out of scope** — we will not act on:
77
- - Social engineering or phishing against maintainers or users
78
- - DoS claims that require unrealistic local resource exhaustion with no product defect
79
- - Vulnerabilities present only in unsupported versions (`< 0.6.0`)
80
- - Best-practice hardening suggestions with no demonstrable security impact
81
-
82
- Not sure whether your finding is in scope? Report it anyway via the private channel — we will triage and respond.
83
-
84
- ### Response Timeline
85
-
86
- | Phase | Time | Action |
87
- |---|---|---|
88
- | Acknowledgment | Within 48 hours | We confirm receipt and assign a tracking ID |
89
- | Initial Assessment | Within 7 days | We validate severity and scope; we may request additional information |
90
- | Fix Development | Severity-dependent | Critical: ≤ 14 days; High: ≤ 30 days; Medium/Low: next release |
91
- | Validation & Testing | 1–3 days after fix | We run regression and security tests on the patch |
92
- | Coordinated Disclosure | At fix release | We publish a security advisory and release patch simultaneously |
93
-
94
- **Note**: For Critical vulnerabilities, if a full fix cannot be developed within 14 days, we will provide a temporary mitigation or workaround within that timeframe.
95
-
96
- ### Escalation (If You Do Not Hear Back)
97
-
98
- - If you do not receive an acknowledgment within **48 hours**, re-send to `work@modusensus.space` with subject prefix: `[SECURITY][FOLLOW-UP]`.
99
- - If there is still no response after another **48 hours**, open a **private security advisory** via [GitHub Security Advisories](https://github.com/modusensus/dsh-mneme/security/advisories) and reference your original report timestamp.
100
- - Do not disclose details publicly while escalation is in progress.
101
-
102
- ### Severity Classification
103
-
104
- We follow the [CVSS v3.1](https://www.first.org/cvss/v3.1/specification-document) standard:
105
-
106
- - **Critical** (9.0–10.0): Remote code execution, unauthorized data exfiltration, bypass of core security controls
107
- - **High** (7.0–8.9): Local privilege escalation, significant data integrity compromise, DoS with high impact
108
- - **Medium** (4.0–6.9): Information disclosure under specific conditions, partial bypass of controls
109
- - **Low** (0.1–3.9): Minor information leakage, defense-in-depth improvements
110
-
111
- ---
112
-
113
- ## Security Design Principles
114
-
115
- ### 1. Local-First, Zero-Network
116
-
117
- - All embeddings, reranking, and memory consolidation run locally
118
- - Memory text **never** leaves the device
119
- - No telemetry, no analytics, no remote logging
120
-
121
- ### 2. Fail-Safe by Default
122
-
123
- - Any component failure (LLM, embedder, reranker) degrades gracefully to keyword search
124
- - Malformed input never crashes the plugin or corrupts the database
125
- - Concurrent write conflicts are resolved via CAS (compare-and-swap) guards
126
-
127
- ### 3. Audit Everything
128
-
129
- - Every `autoDream` run generates a cryptographically verifiable receipt
130
- - Every memory update creates a `failure_memories` audit trail
131
- - Every search records a `recall_run` for later inspection
132
-
133
- ### 4. Human Sovereignty
134
-
135
- - All memories are mirrored to human-editable Markdown files
136
- - Machine writes vs. human edits are distinguished via digest baselines
137
- - Users can fully reconstruct the database from Markdown mirrors alone
138
-
139
- ### 5. Minimal Remote Surface
140
-
141
- - Remote API endpoints are opt-in: they require a configured `apiToken`
142
- - When a token is set, every remote request is checked with a timing-safe comparison
143
- - When no token is set, remote endpoints are effectively disabled; all processing stays local
144
-
145
- ---
146
-
147
- ## Dependency Vulnerability Handling
148
-
149
- ### Process
150
-
151
- We follow a 5-step process for handling third-party dependency vulnerabilities:
152
-
153
- | Step | Action | Timeframe | Tooling |
154
- |---|---|---|---|
155
- | 1. Scan | Continuous automated scanning of all runtime and development dependencies | Automated (daily) | OrbisAI Security, npm audit |
156
- | 2. Assess | For each detected vulnerability, assess severity, exploitability, and impact on dsh-mneme | Within 48 hours of detection | CVSS v3.1, manual code analysis |
157
- | 3. Report | Document findings in the security tracker; report to maintainers | Immediately after assessment | Security tracker, maintainer channel |
158
- | 4. Fix | Upgrade dependency to a patched version or apply mitigation | Critical: ≤ 14 days; High: ≤ 30 days; Medium/Low: next release | npm/pnpm update, manual patching |
159
- | 5. Disclose | Publish security advisory with details and fixed version | At release of fixed version | GitHub Security Advisories + npm release notes |
160
-
161
- ### Third-Party Dependency Policy
162
-
163
- - All new runtime dependencies must pass a security review before inclusion
164
- - Dependencies with known critical vulnerabilities that cannot be fixed within the timeline will be replaced with alternatives
165
- - Dependency lockfiles (`package-lock.json`) are committed and reviewed in PRs
166
-
167
- ### Recent Dependency Fixes
168
-
169
- | CVE | Package | Version (Before) | Version (After) | Severity | Fixed In |
170
- |---|---|---|---|---|---|
171
- | CVE-2026-39244 | `adm-zip` | 0.5.18 | 0.6.0 | High | v0.3.4 |
172
-
173
- ---
174
-
175
- ## Security Audit History
176
-
177
- ### v0.2.10 — Security Hardening
178
-
179
- | ID | Finding | Severity | Status |
180
- |---|---|---|---|
181
- | F-NEW-01 | Concurrent write race on `store.js` | **Critical** | ✅ Fixed (CAS guard + atomic write) |
182
- | F-NEW-02 | Transactional inconsistency during mirror sync | **High** | ✅ Fixed (transactional mirror + rollback) |
183
- | F-NEW-03 | Mirror health state not validated before overwrite | **High** | ✅ Fixed (digest baseline + FSM validation) |
184
-
185
- ### v0.3.4 — Dependency Security
186
-
187
- | CVE | Package | Severity | Status |
188
- |---|---|---|---|
189
- | CVE-2026-39244 | `adm-zip` 0.5.18 | **High** | ✅ Fixed (upgraded to 0.6.0) |
190
-
191
- ### v0.3.6 — Mirror Debt Modeling (audit peer re-verification)
192
-
193
- | Finding | Severity | Status |
194
- |---|---|---|
195
- | Mirror sync not bound to a generation counter (stale overwrite window) | **High** | ✅ Fixed (generation + CAS/fence semantics, per-type status) |
196
- | `/health` endpoint unauthenticated with verbose error codes | **High** | ✅ Fixed (auth-gated, sanitized codes, fail-closed `unknown`) |
197
- | COMMIT-crash window could permanently skip mirror repairs | **High** | ✅ Fixed (recoverMirror triggers on dirty OR generation > applied) |
198
-
199
- ### v0.3.8 — Mirror Sync Reliability (peer 6 blockers)
200
-
201
- | Finding | Severity | Status |
202
- |---|---|---|
203
- | Silent mirror sync failures (no error surfaced to write path) | **High** | ✅ Fixed (`syncMirror` returns `{success, error}`; `afterSync` check on write entry) |
204
- | Non-atomic generation increments under multi-process concurrency | **High** | ✅ Fixed (`UPDATE ... RETURNING` atomic statement + `PRAGMA busy_timeout=5000`) |
205
- | Generation counter overflow / negative values | **Medium** | ✅ Fixed (JS validation + SQL `CHECK(0..MAX_SAFE_INTEGER)`) |
206
-
207
- ### v0.3.9 — Audit A/B/D/F
208
-
209
- | Finding | Severity | Status |
210
- |---|---|---|
211
- | CAS update and generation increment not in the same transaction | **High** | ✅ Fixed (atomic `runAtomically`; miss does not increment) |
212
- | Failed updates could report success | **High** | ✅ Fixed (degraded/pending receipts with mirror attributes) |
213
- | Generation validation not fail-closed | **Medium** | ✅ Fixed (`Number.isInteger` fail-closed + migration detects stale dirty values) |
214
-
215
- ### v0.5.1 — Hot Memory Parameter Defense
216
-
217
- | Finding | Severity | Status |
218
- |---|---|---|
219
- | Negative / non-finite `maxRounds`/`maxTokens` could trigger a synchronous infinite loop via public API | **High** | ✅ Fixed (fallback to safe defaults 5/2000) |
220
- | Hybrid fusion score could exceed 1.0 (vector + BM25 stacking) | **Medium** | ✅ Fixed (clamp to [0, 1]) |
221
-
222
- ### v0.6.5 — Tag System Hardening
223
-
224
- | Finding | Severity | Status |
225
- |---|---|---|
226
- | `autoTag` could tag forgotten memories | **Medium** | ✅ Fixed (filter `forgotten` before tagging) |
227
- | Tag normalization bypassed the sanitizer | **Medium** | ✅ Fixed (reuse `sanitize` in `normalizeTags`) |
228
- | `setMemoryTags` not atomic on failure | **Medium** | ✅ Fixed (SAVEPOINT rollback) |
229
-
230
- ### Ongoing
231
-
232
- - Automated dependency scanning via **OrbisAI Security**
233
- - Community security reviews welcome via private advisory
234
-
235
- ---
236
-
237
- ## Security Advisory Channels
238
-
239
- Security advisories are published through the following channels simultaneously:
240
-
241
- 1. **[GitHub Security Advisories](https://github.com/modusensus/dsh-mneme/security/advisories)** — primary channel with detailed technical information
242
- 2. **[npm Releases](https://www.npmjs.com/package/@modusensus/dsh-mneme)** — release notes include security advisories and fix summaries
243
-
244
- To receive security notifications:
245
- - **GitHub**: Watch the repository and enable "Security alerts" in repository settings
246
- - **npm**: Subscribe to package release notifications for `@modusensus/dsh-mneme`
247
-
248
- ---
249
-
250
- ## Disclosure Policy
251
-
252
- We practice **coordinated disclosure**:
253
-
254
- 1. Reporter submits vulnerability privately
255
- 2. We investigate and acknowledge within 48 hours
256
- 3. We develop fix and prepare advisory (timeline based on severity)
257
- 4. We notify reporter of fix timeline and planned disclosure date
258
- 5. We release patch + publish advisory simultaneously
259
- 6. We credit the reporter (with their consent) in the advisory
260
-
261
- We do **not** pursue legal action against security researchers who:
262
- - Act in good faith
263
- - Do not exploit vulnerabilities beyond proof-of-concept
264
- - Do not access data belonging to others
265
- - Allow reasonable time for us to respond before public disclosure
266
-
267
- **Bug Bounty Policy**: This project does not currently offer monetary rewards. We provide public credit in the advisory (with the reporter's consent).
268
-
269
- ---
270
-
271
- ## Security Logs & Data Retention
272
-
273
- All audit data is stored **locally** in the plugin database and never leaves the device:
274
-
275
- | Data Type | Storage Location | Notes |
276
- |---|---|---|
277
- | `failure_memories` audit logs | Local database | Every failed write is recorded; used for forensic analysis |
278
- | `recall_run` search logs | Local database | Every search is recorded with timestamp and query metadata |
279
- | AutoDream receipts | Local database + Markdown mirror | Cryptographically verifiable; persist until user deletes them |
280
- | Dependency scan reports | OrbisAI Security dashboard | Not stored on device |
281
-
282
- Retention is user-controlled: audit records live only as long as the local database does. There is no remote logging and no telemetry.
283
-
284
- ---
285
-
286
- ## Security-Related Configuration
287
-
288
- ```yaml
289
- # Hardened configuration example (all keys below match src/config.js where applicable)
290
- dsh-mneme:
291
- # Disable autoDream if you want full manual control
292
- autoDream: false
293
-
294
- # Enable conflict freeze for sensitive environments
295
- conflictFreezeEnabled: true
296
-
297
- # Use local-only embedding (no network)
298
- embedProvider: local
299
-
300
- # Require Authorization: Bearer <apiToken> on remote endpoints (timing-safe)
301
- apiToken: "set-a-strong-unique-token"
302
-
303
- # Bump to downgrade all prior dream_runs to historical evidence
304
- policyEpoch: 1
305
-
306
- # Keep entity extraction off by default (data minimization)
307
- entityExtractionEnabled: false
308
-
309
- # Reranking is opt-in (default: off) — no extra model downloads unless enabled
310
- rerankEnabled: false
311
-
312
- # Keep auto-tagging off by default (data minimization)
313
- autoTagEnabled: false
314
-
315
- # Disable session lifecycle if you do not need session-scoped disposal
316
- sessionLifecycleEnabled: false
317
-
318
- # Disable sleep mode maintenance if you want zero background activity
319
- sleepModeEnabled: false
320
-
321
- # Epistemic trust weighting is opt-in (default: off)
322
- trustEpistemicWeighting: false
323
-
324
- # LLM audit log retention (days)
325
- llmAudit:
326
- enabled: true
327
- retentionDays: 90
328
- ```
329
-
330
- ---
331
-
332
- ## Contributor Security Guidelines
333
-
334
- All contributors must comply with the following security requirements:
335
-
336
- 1. **Dependency Audit**: Run `npm audit` before submitting a PR; newly introduced dependencies must pass security review
337
- 2. **Secret Scanning**: Never commit API keys, tokens, or credentials to the repository
338
- 3. **Input Validation**: All user inputs must be validated and sanitized (including LLM-derived content)
339
- 4. **Secure Code Review**: PRs with security-relevant changes require approval from a maintainer with security expertise
340
- 5. **Documentation**: New features must include a security impact analysis in the PR description
341
- 6. **Responsible Disclosure**: Security vulnerabilities found during development must be reported via the appropriate channel, not in public PRs
342
-
343
- ---
344
-
345
- ## Contact
346
-
347
- - **Security Team**: `work@modusensus.space`
348
- - **Private Advisory**: [GitHub Security Advisories](https://github.com/modusensus/dsh-mneme/security/advisories)
349
- - **GPG Key**: Available upon request for encrypted communication
350
-
351
- ---
352
-
353
- ## License
354
-
355
- This project is licensed under the **MIT License**. See [LICENSE](https://github.com/modusensus/dsh-mneme/blob/main/LICENSE) for details.
356
-
357
- ---
358
-
359
- # 安全策略
360
-
361
- > **中文** | [English](#security-policy)
362
-
363
- ---
364
-
365
- ## 支持版本
366
-
367
- 我们积极维护最新的 minor 版本。安全修复会 backport 到最新的 patch 版本,关键修复可能 backport 到前一个 minor 版本。
368
-
369
- | 版本 | 支持状态 | 说明 |
370
- |---|---|---|
371
- | 0.7.x | ✅ 支持 | 活跃开发中 |
372
- | 0.6.x | ⚠️ 尽力维护 | 仅关键修复 |
373
- | < 0.6.0 | ❌ 不支持 | 请升级至 0.7.x |
374
-
375
- **停止维护通知**:0.6.x 处于尽力维护阶段(仅关键修复)。停止维护的具体日期将提前公布;该日期之后将不再提供 0.6.x 的安全修复。
376
-
377
- ---
378
-
379
- ## 已知安全特性
380
-
381
- 项目已实现并维护以下安全特性:
382
-
383
- | 特性 | 描述 | 状态 |
384
- |---|---|---|
385
- | `apiToken` 鉴权 | 配置 token 后,所有远程端点需 `Authorization: Bearer <apiToken>`,比较使用 `crypto.timingSafeEqual` | ✅ 已实现 |
386
- | `policyEpoch` 记忆治理 | 提升 `policyEpoch` 后,所有先前的 `dream_runs` 降级为历史证据,其 receipt 不再驱动实时记忆决策 | ✅ 已实现 |
387
- | `conflictFreezeEnabled` 冲突冻结 | 冲突记忆不自动合并,标记为待人工复核,保护数据完整性 | ✅ 已实现 |
388
- | CAS(比较并交换)守卫 | 防止并发写入冲突,确保原子写操作 | ✅ 已实现 |
389
- | Digest 基线审计 | 记忆更新与 digest 基线比对,检测未授权修改 | ✅ 已实现 |
390
- | `failure_memories` 审计轨迹 | 每次写入失败均记录,供取证分析 | ✅ 已实现 |
391
- | `recall_run` 搜索审计 | 每次搜索操作均记录时间戳和查询元数据 | ✅ 已实现 |
392
- | 本地优先数据处理 | embedding、rerank、记忆整理均在本地完成,数据不离开设备 | ✅ 已实现 |
393
- | 无遥测 | 无分析、无远程日志,设计上无网络请求 | ✅ 已实现 |
394
- | 查询净化 | LIKE 查询转义、分页边界限制、Markdown 镜像转义,防止注入和畸形输入 | ✅ 已实现 |
395
- | `entityExtractionEnabled` 实体抽取 Opt-In | 实体抽取为配置项、默认关闭(数据最小化原则) | ✅ 已实现 |
396
- | 优雅降级 | 组件故障时自动回退至关键词搜索,不崩溃 | ✅ 已实现 |
397
- | 人工可编辑镜像 | 所有记忆镜像至 Markdown 文件,用户可验证和重建数据 | ✅ 已实现 |
398
- | Mirror Generation CAS/Fence | 镜像同步绑定单调递增的 `generation` 计数器并采用 CAS/fence 语义,拒绝过期或并发镜像写入 | ✅ 已实现 |
399
- | 崩溃恢复债务模型 | 业务写入在自身事务内原子递增 `desired generation`;崩溃后 `recoverMirror` 依据债务重放修复,不再静默跳过 | ✅ 已实现 |
400
- | `/health` 鉴权门控 | 健康端点要求 `apiToken`;错误码净化(no-space / permission / sync-failed),读取失败 fail-closed 为 `unknown` | ✅ 已实现 |
401
- | Fail-Closed 输入校验 | generation 计数与热记忆参数均做 `Number.isInteger`、有限性、非负校验并配 SQL `CHECK` 约束;非法输入回退安全默认值或被拒绝 | ✅ 已实现 |
402
- | 混合分数钳制 | 混合检索融合分数钳制在 [0, 1],防止向量 + BM25 叠加突破归一化边界 | ✅ 已实现 |
403
- | Tag 净化 | Tag 规范化复用 sanitizer;`autoTag` 跳过已遗忘记忆;`setMemoryTags` 在 SAVEPOINT 内执行,失败原子回滚 | ✅ 已实现 |
404
-
405
- ---
406
-
407
- ## 报告漏洞
408
-
409
- ### 请不要
410
-
411
- - 在公开 issue 中披露安全漏洞
412
- - 在讨论区或评论中发布漏洞利用细节
413
- - 未经事先协调就提交暴露安全缺陷的 PR
414
-
415
- ### 请这样做
416
-
417
- 1. **发送邮件**至 `work@modusensus.space`(或通过 [GitHub 私有安全公告](https://github.com/modusensus/dsh-mneme/security/advisories) 提交)
418
- 2. 邮件内容请包含:
419
- - 漏洞的清晰描述
420
- - 复现步骤(优先提供最小测试用例)
421
- - 影响评估(数据泄露?仅本地?远程?)
422
- - 受影响的版本
423
- - 你建议的修复方案(如有)
424
- - 是否要求在公告中署名 / 披露偏好
425
-
426
- ### 受理范围与不受理范围
427
-
428
- **受理范围**——本政策覆盖以下问题:
429
- - 远程 API 鉴权 / 授权绕过(`apiToken` 保护面)
430
- - 记忆完整性破坏(CAS/fence 绕过、未授权覆盖、重放路径)
431
- - 可导致静默数据损坏的镜像一致性与恢复逻辑缺陷
432
- - 在受支持版本中可利用的已发布运行时依赖漏洞
433
-
434
- **不受理范围**——以下问题我们不予处理:
435
- - 针对维护者或用户的社工 / 钓鱼类问题
436
- - 仅通过不现实的本地资源耗尽触发、且无产品缺陷支撑的 DoS 声明
437
- - 仅存在于不支持版本(`< 0.6.0`)的问题
438
- - 无可证明安全影响的"最佳实践建议"类问题
439
-
440
- 不确定你的发现是否在受理范围内?仍请通过私有渠道提交——我们会评估并回复。
441
-
442
- ### 响应时间线
443
-
444
- | 阶段 | 时间 | 行动 |
445
- |---|---|---|
446
- | 确认收到 | 48 小时内 | 我们确认收到并分配追踪 ID |
447
- | 初步评估 | 7 天内 | 我们验证严重程度和影响范围;可能需要更多信息 |
448
- | 修复开发 | 按严重程度 | 严重:≤ 14 天;高:≤ 30 天;中/低:下个版本 |
449
- | 验证与测试 | 修复完成后 1–3 天 | 对补丁进行回归测试和安全测试 |
450
- | 协调披露 | 修复发布时 | 同时发布安全公告和补丁版本 |
451
-
452
- **备注**:对于严重漏洞,如果 14 天内无法提供完整修复,我们将在该时间内提供临时缓解措施或替代方案。
453
-
454
- ### 无响应升级路径
455
-
456
- - 若 **48 小时内**未收到确认,请重新发送到 `work@modusensus.space`,邮件标题加前缀:`[SECURITY][FOLLOW-UP]`。
457
- - 若再次等待 **48 小时**仍无回复,请通过 [GitHub 私有安全公告](https://github.com/modusensus/dsh-mneme/security/advisories) 提交,并注明首次报告时间。
458
- - 升级处理中请勿公开披露漏洞细节。
459
-
460
- ### 严重程度分级
461
-
462
- 我们遵循 [CVSS v3.1](https://www.first.org/cvss/v3.1/specification-document) 标准:
463
-
464
- - **严重** (9.0–10.0):远程代码执行、未授权数据外泄、核心安全控制绕过
465
- - **高** (7.0–8.9):本地权限提升、重大数据完整性破坏、高影响 DoS
466
- - **中** (4.0–6.9):特定条件下的信息泄露、部分控制绕过
467
- - **低** (0.1–3.9):轻微信息泄露、纵深防御改进
468
-
469
- ---
470
-
471
- ## 安全设计原则
472
-
473
- ### 1. 本地优先,零网络
474
-
475
- - 所有 embedding、rerank、记忆整理均在本地运行
476
- - 记忆文本**永不**离开设备
477
- - 无遥测、无分析、无远程日志
478
-
479
- ### 2. 默认 Fail-Safe
480
-
481
- - 任何组件故障(LLM、embedder、reranker)均优雅降级到关键词搜索
482
- - 畸形输入不会导致插件崩溃或数据库损坏
483
- - 并发写入冲突通过 CAS(比较并交换)守卫解决
484
-
485
- ### 3. 全面审计
486
-
487
- - 每次 `autoDream` 运行生成密码学可验证的 receipt
488
- - 每次记忆更新创建 `failure_memories` 审计轨迹
489
- - 每次搜索记录 `recall_run` 供后续检查
490
-
491
- ### 4. 人类主权
492
-
493
- - 所有记忆镜像到人类可编辑的 Markdown 文件
494
- - 机器写入 vs 人工编辑通过 digest 基线区分
495
- - 用户可仅凭 Markdown 镜像完整重建数据库
496
-
497
- ### 5. 最小远程暴露面
498
-
499
- - 远程 API 端点为可选:需配置 `apiToken` 才生效
500
- - 配置 token 后,每个远程请求均经过 timing-safe 比较
501
- - 未配置 token 时,远程端点实际处于禁用状态,所有处理均在本地
502
-
503
- ---
504
-
505
- ## 依赖漏洞处理
506
-
507
- ### 处理流程
508
-
509
- 我们采用 5 步流程处理第三方依赖漏洞:
510
-
511
- | 步骤 | 行动 | 时间要求 | 工具 |
512
- |---|---|---|---|
513
- | 1. 扫描 | 对所有运行时和开发依赖进行持续自动扫描 | 自动(每日) | OrbisAI Security、npm audit |
514
- | 2. 评估 | 对每个检测到的漏洞评估严重程度、可利用性和对 dsh-mneme 的影响 | 检测后 48 小时内 | CVSS v3.1、人工代码分析 |
515
- | 3. 上报 | 将发现记录到安全追踪器,并上报给维护者 | 评估后立即 | 安全追踪器、维护者通道 |
516
- | 4. 修复 | 升级依赖至已修复版本或应用缓解措施 | 严重:≤ 14 天;高:≤ 30 天;中/低:下个版本 | npm/pnpm 更新、手动补丁 |
517
- | 5. 披露 | 发布包含详情和已修复版本的安全公告 | 修复版本发布时 | GitHub Security Advisories + npm 发布说明 |
518
-
519
- ### 第三方依赖政策
520
-
521
- - 所有新增运行时依赖需通过安全审查后方可引入
522
- - 存在已知严重漏洞且在期限内无法修复的依赖将被替换为替代方案
523
- - 依赖锁文件(`package-lock.json`)已提交并在 PR 中审查
524
-
525
- ### 近期依赖修复
526
-
527
- | CVE | 包 | 修复前版本 | 修复后版本 | 严重程度 | 修复版本 |
528
- |---|---|---|---|---|---|
529
- | CVE-2026-39244 | `adm-zip` | 0.5.18 | 0.6.0 | 高 | v0.3.4 |
530
-
531
- ---
532
-
533
- ## 安全审计历史
534
-
535
- ### v0.2.10 — 安全加固
536
-
537
- | ID | 发现 | 严重程度 | 状态 |
538
- |---|---|---|---|
539
- | F-NEW-01 | `store.js` 并发写入竞态 | **严重** | ✅ 已修复(CAS 守卫 + 原子写入) |
540
- | F-NEW-02 | 镜像同步期间事务不一致 | **高** | ✅ 已修复(事务化镜像 + 回滚) |
541
- | F-NEW-03 | 覆盖前未验证镜像健康状态 | **高** | ✅ 已修复(digest 基线 + FSM 验证) |
542
-
543
- ### v0.3.4 — 依赖安全
544
-
545
- | CVE | 包 | 严重程度 | 状态 |
546
- |---|---|---|---|
547
- | CVE-2026-39244 | `adm-zip` 0.5.18 | **高** | ✅ 已修复(升级至 0.6.0) |
548
-
549
- ### v0.3.6 — Mirror 债务建模(审计 peer 复核修复)
550
-
551
- | 发现 | 严重程度 | 状态 |
552
- |---|---|---|
553
- | 镜像同步未绑定 generation 计数器(过期覆盖窗口) | **高** | ✅ 已修复(generation + CAS/fence 语义,per-type 状态) |
554
- | `/health` 端点未鉴权且错误码冗长 | **高** | ✅ 已修复(鉴权门控、错误码净化、读取失败 fail-closed `unknown`) |
555
- | COMMIT-崩溃窗口可能永久跳过镜像修复 | **高** | ✅ 已修复(dirty 或 generation > applied 时触发 recoverMirror) |
556
-
557
- ### v0.3.8 — Mirror 同步可靠性(peer 6 blockers)
558
-
559
- | 发现 | 严重程度 | 状态 |
560
- |---|---|---|
561
- | 镜像同步静默失败(错误未上抛至写路径) | **高** | ✅ 已修复(`syncMirror` 返回 `{success, error}`;写入口 `afterSync` 检查) |
562
- | 多进程并发下 generation 非原子递增 | **高** | ✅ 已修复(`UPDATE ... RETURNING` 原子语句 + `PRAGMA busy_timeout=5000`) |
563
- | generation 溢出 / 负值 | **中** | ✅ 已修复(JS 校验 + SQL `CHECK(0..MAX_SAFE_INTEGER)`) |
564
-
565
- ### v0.3.9 — 审计 A/B/D/F
566
-
567
- | 发现 | 严重程度 | 状态 |
568
- |---|---|---|
569
- | CAS 更新与 generation 递增不在同一事务 | **高** | ✅ 已修复(`runAtomically` 原子执行;miss 不递增) |
570
- | 失败更新可能虚报成功 | **高** | ✅ 已修复(degraded/pending 回执,带 mirror 属性) |
571
- | generation 校验未 fail-closed | **中** | ✅ 已修复(`Number.isInteger` fail-closed + 迁移检测旧脏值) |
572
-
573
- ### v0.5.1 — 热记忆负参数防御
574
-
575
- | 发现 | 严重程度 | 状态 |
576
- |---|---|---|
577
- | 负 / 非有限 `maxRounds`/`maxTokens` 可经公开 API 触发同步死循环 | **高** | ✅ 已修复(回退安全默认值 5/2000) |
578
- | 混合融合分数可超过 1.0(向量 + BM25 叠加) | **中** | ✅ 已修复(钳制到 [0, 1]) |
579
-
580
- ### v0.6.5 — Tag 系统加固
581
-
582
- | 发现 | 严重程度 | 状态 |
583
- |---|---|---|
584
- | `autoTag` 可能给已遗忘记忆打标签 | **中** | ✅ 已修复(打标前过滤 `forgotten`) |
585
- | Tag 规范化绕过 sanitizer | **中** | ✅ 已修复(`normalizeTags` 复用 `sanitize`) |
586
- | `setMemoryTags` 失败时非原子 | **中** | ✅ 已修复(SAVEPOINT 回滚) |
587
-
588
- ### 持续进行
589
-
590
- - 通过 **OrbisAI Security** 进行自动化依赖扫描
591
- - 欢迎社区通过私有公告提交安全审查
592
-
593
- ---
594
-
595
- ## 安全公告渠道
596
-
597
- 安全公告通过以下渠道同时发布:
598
-
599
- 1. **[GitHub Security Advisories](https://github.com/modusensus/dsh-mneme/security/advisories)** — 主要渠道,包含详细技术信息
600
- 2. **[npm Releases](https://www.npmjs.com/package/@modusensus/dsh-mneme)** — 发布说明中包含安全公告和修复摘要
601
-
602
- 接收安全通知方式:
603
- - **GitHub**:Watch 仓库并在仓库设置中启用“安全警报”
604
- - **npm**:订阅 `@modusensus/dsh-mneme` 的发布通知
605
-
606
- ---
607
-
608
- ## 披露政策
609
-
610
- 我们实行**协调披露**:
611
-
612
- 1. 报告者私下提交漏洞
613
- 2. 我们在 48 小时内确认收到
614
- 3. 我们开发修复并准备公告(时间取决于严重程度)
615
- 4. 我们通知报告者修复时间线和计划披露日期
616
- 5. 我们同时发布补丁和安全公告
617
- 6. 我们在公告中致谢报告者(经其同意)
618
-
619
- 我们**不会**对以下安全研究人员采取法律行动:
620
- - 出于善意行事
621
- - 不将漏洞利用超出概念验证范围
622
- - 不访问属于他人的数据
623
- - 在公开披露前给予我们合理的响应时间
624
-
625
- **漏洞赏金政策**:本项目目前不提供经济奖励。我们会在公告中公开致谢报告者(经其同意)。
626
-
627
- ---
628
-
629
- ## 安全日志与数据保留
630
-
631
- 所有审计数据**本地**存储于插件数据库,不离开设备:
632
-
633
- | 数据类型 | 存储位置 | 说明 |
634
- |---|---|---|
635
- | `failure_memories` 审计日志 | 本地数据库 | 每次写入失败均记录,供取证分析 |
636
- | `recall_run` 搜索日志 | 本地数据库 | 每次搜索均记录时间戳和查询元数据 |
637
- | AutoDream receipts | 本地数据库 + Markdown 镜像 | 密码学可验证;保留至用户删除 |
638
- | 依赖扫描报告 | OrbisAI Security 控制台 | 不存储于设备 |
639
-
640
- 保留期由用户控制:审计记录仅随本地数据库存续。无远程日志、无遥测。
641
-
642
- ---
643
-
644
- ## 安全相关配置
645
-
646
- ```yaml
647
- # 加固配置示例(键均对应 src/config.js 实际配置,除注明外)
648
- dsh-mneme:
649
- # 如需完全手动控制,可禁用 autoDream
650
- autoDream: false
651
-
652
- # 敏感环境启用冲突冻结
653
- conflictFreezeEnabled: true
654
-
655
- # 仅使用本地 embedding(无网络)
656
- embedProvider: local
657
-
658
- # 远程端点需 Authorization: Bearer <apiToken>(timing-safe)
659
- apiToken: "set-a-strong-unique-token"
660
-
661
- # 提升以将先前的 dream_runs 降级为历史证据
662
- policyEpoch: 1
663
-
664
- # 实体抽取默认关闭(数据最小化)
665
- entityExtractionEnabled: false
666
-
667
- # Rerank 为 opt-in(默认关闭)——未启用时不下载额外模型
668
- rerankEnabled: false
669
-
670
- # 自动打标签默认关闭(数据最小化)
671
- autoTagEnabled: false
672
-
673
- # 不需要会话级清理时可关闭会话生命周期
674
- sessionLifecycleEnabled: false
675
-
676
- # 不需要后台维护时可关闭 Sleep Mode
677
- sleepModeEnabled: false
678
-
679
- # 记忆可信度加权为 opt-in(默认关闭)
680
- trustEpistemicWeighting: false
681
-
682
- # LLM 审计日志保留天数
683
- llmAudit:
684
- enabled: true
685
- retentionDays: 90
686
- ```
687
-
688
- ---
689
-
690
- ## 贡献者安全指南
691
-
692
- 所有贡献者必须遵守以下安全要求:
693
-
694
- 1. **依赖审计**:提交 PR 前运行 `npm audit`;新增依赖必须通过安全审查
695
- 2. **密钥扫描**:禁止向仓库提交 API 密钥、令牌或凭据
696
- 3. **输入验证**:所有用户输入必须验证和净化(包括 LLM 相关内容)
697
- 4. **安全代码审查**:涉及安全相关变更的 PR 需获得具有安全专业知识维护者的批准
698
- 5. **文档记录**:新功能必须在 PR 描述中包含安全影响分析
699
- 6. **负责任的披露**:开发过程中发现的安全漏洞必须通过适当渠道报告,而非在公开 PR 中提交
700
-
701
- ---
702
-
703
- ## 联系方式
704
-
705
- - **安全团队**:`work@modusensus.space`
706
- - **私有公告**:[GitHub Security Advisories](https://github.com/modusensus/dsh-mneme/security/advisories)
707
- - **GPG 密钥**:如需加密通信,可应请求提供
708
-
709
- ---
710
-
711
- ## 许可协议
712
-
713
- 本项目基于 **MIT License** 开源。详见 [LICENSE](https://github.com/modusensus/dsh-mneme/blob/main/LICENSE)。
714
-
715
- ---
716
-
717
- *Last updated: 2026-09-06*
718
- *Policy version: 2.3*