dsh-memento 0.5.8 → 0.5.10
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/ARCHITECTURE.md +1 -1
- package/CHANGELOG.md +39 -21
- package/README.es.md +2 -2
- package/README.hi.md +2 -2
- package/README.md +2 -2
- package/README.pt.md +2 -2
- package/README.zh.md +2 -2
- package/docs/upstream-proposal.md +101 -0
- package/package.json +10 -12
package/ARCHITECTURE.md
CHANGED
|
@@ -51,7 +51,7 @@ memory 工具(add)
|
|
|
51
51
|
→ store.insertEntry + audit 行(outcome 含 policy 来源)
|
|
52
52
|
→ 会话日志(已知事件类型)已有 approval/asked+decided 审计对
|
|
53
53
|
→ 下一会话首个 assemble:渲染冻结快照(带用量头)注入 systemPrompt 段
|
|
54
|
-
└ 同一文本也写入 audit(snapshot) 行 +
|
|
54
|
+
└ 同一文本也写入 audit(snapshot) 行 + system/message(S2 可重建)
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
## 关键设计决策
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.5.10] - 2026-09-09
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Align the `@deepseek-ai/dsh-*` peer ranges to `>=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0` and pin the dev/test dependencies to the published `0.1.5-alpha.1` line: adaptation to DeepSeek Harness `dsh-v0.1.5-alpha.1` (session format V3, `ctx.agent` removal, `Inbox` type-only interface); runtime behavior is unchanged for every supported host line.
|
|
13
|
+
- Record `0.1.5-alpha.1` in `dshWorkshop.compatibility.dshVersions`.
|
|
14
|
+
|
|
15
|
+
### Docs
|
|
16
|
+
|
|
17
|
+
- Refresh the five-language README compatibility baseline to `dsh-v0.1.5-alpha.1` (verified 2026-09-09).
|
|
18
|
+
|
|
19
|
+
## [0.5.9] - 2026-09-08
|
|
20
|
+
|
|
21
|
+
### Docs
|
|
22
|
+
|
|
23
|
+
- Repair GBK mojibake in historical CHANGELOG entries: em dashes, arrows, comparison signs, the multiplication sign, a mangled emoji (U+9983 U+E765), and the mangled Chinese appendix label (U+6D93 U+E15F U+6783) are restored to the clean pre-corruption text; no behavior change.
|
|
24
|
+
|
|
25
|
+
|
|
8
26
|
## [0.5.8] - 2026-09-07
|
|
9
27
|
|
|
10
28
|
### Docs
|
|
@@ -39,8 +57,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
39
57
|
|
|
40
58
|
### Added
|
|
41
59
|
|
|
42
|
-
- **Host settings panel integration**
|
|
43
|
-
- **Hideable floating panel button**
|
|
60
|
+
- **Host settings panel integration** — when the DSH settings service is mounted, the plugin registers the `dsh-memento` settings namespace (every `Config` field except `enabled`, plus a new `panel.enabled`), and its browser half contributes a **top-level `dsh-memento` entry to the DSH settings sidebar** (via the public `settings.section` slot, like the built-in sections). Edits persist to the settings user layer (`settings.yaml`) with staged-draft save/discard/per-field reset semantics. Nearly everything applies live: write policies, language, budgets, limits, proposals, panel; `dbPath` / `auditRetentionDays` apply by reopening the store (old one closed safely); `retrieval.vector` swaps the retriever in place; only `snapshotOrder` needs a DSH reload (changes are recorded as a `settings-startup-fields` audit row). Without the settings service the plugin behaves exactly as composed.
|
|
61
|
+
- **Hideable floating panel button** — new `panel.enabled` config (default `true`); `false` stops the web panel from rendering its 🧠 entry button (addresses upstream issue #7). The panel probes its own `/api/memento/entries` response at startup and falls back to showing the button when the probe fails.
|
|
44
62
|
|
|
45
63
|
### Changed
|
|
46
64
|
|
|
@@ -68,9 +86,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
68
86
|
|
|
69
87
|
### Added
|
|
70
88
|
|
|
71
|
-
- **Embedding Provider seam (`ctx.memoryEmbedding`)**
|
|
72
|
-
- **Retrieval Provider seam (`ctx.memoryRetrieval`)**
|
|
73
|
-
- **stdio MCP server export**
|
|
89
|
+
- **Embedding Provider seam (`ctx.memoryEmbedding`)** — new `lib/embedding.mjs` registry ships a deterministic fake-hash provider by default, so third-party plugins can register real embedding backends behind the same Service Definition.
|
|
90
|
+
- **Retrieval Provider seam (`ctx.memoryRetrieval`)** — new `lib/retrieval.mjs` registry keeps the built-in substring retriever as the zero-dependency main path and adds an optional `VectorRetriever` for semantic recall, enabled when `config.retrieval.vector` is `true` and an embedding provider is detected (graceful fallback to substring otherwise).
|
|
91
|
+
- **stdio MCP server export** — new `bin/mcp-server.mjs` and `lib/mcp.mjs` expose the memory seam as an MCP server through the `dsh-memento-mcp` bin.
|
|
74
92
|
|
|
75
93
|
## [0.4.5] - 2026-08-23
|
|
76
94
|
|
|
@@ -96,7 +114,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
96
114
|
|
|
97
115
|
### Changed
|
|
98
116
|
|
|
99
|
-
- `package.json#dshWorkshop.lifecycle.activation` upgraded from `restart-profile` to `hot-reload`: with the panel routes riding the plugin fiber since 0.4.1, dispose-and-reactivate is fully clean. Proven by a Loader-level hot-reload composition test that drives `Include.refresh()`
|
|
117
|
+
- `package.json#dshWorkshop.lifecycle.activation` upgraded from `restart-profile` to `hot-reload`: with the panel routes riding the plugin fiber since 0.4.1, dispose-and-reactivate is fully clean. Proven by a Loader-level hot-reload composition test that drives `Include.refresh()` — the same transaction the HMR watcher triggers — through a `language` en → zh → en cycle against a duplicate-strict mock `webServer`, asserting the memory seam, the re-applied config, and the routes re-registering without a duplicate route.
|
|
100
118
|
|
|
101
119
|
## [0.4.1] - 2026-08-19
|
|
102
120
|
|
|
@@ -108,33 +126,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
108
126
|
|
|
109
127
|
### Added
|
|
110
128
|
|
|
111
|
-
- **dsh-memory-protocol v1**
|
|
112
|
-
- **Protocol/implementation separation**
|
|
113
|
-
- **Adapter registry `ctx.memoryAdapters`**
|
|
114
|
-
- **Protocol conformance suite**
|
|
115
|
-
- **Upstream proposal material**
|
|
129
|
+
- **dsh-memory-protocol v1** — the community rehearsal of the DSH memory protocol: normative spec in `docs/protocol-v1.md` (+ 中文), machine-readable JSON Schema in `docs/schemas/dsh-memory-protocol-v1.schema.json`, entry spec extended with `tags` (≤16 × ≤32 chars) and a per-entry `version` that increments on every `replace` (store schema v4, forward-migrated).
|
|
130
|
+
- **Protocol/implementation separation** — write semantics moved into `lib/protocol.mjs` (`MemoryProtocolCore`, zero DSH dependencies); `MemoryService` is now a thin subclass that only injects the approval transport and the session-event emission gate. Behavior is unchanged.
|
|
131
|
+
- **Adapter registry `ctx.memoryAdapters`** — reversible `register()`/`list()`/`adapt()`/`export()` plus three built-in reference adapters: `mem0`, `hermes-memory-md`, `claude-code-memory-md` (pure data converters — never model extraction). New command verbs: `/memory adapters`, `export --adapter=<id>` (read-only), `import --adapter=<id> <path|inline>` (rides the approval-gated `seed`, per-entry audit). Onboarding guide in `docs/adapters-guide.md` (+ 中文).
|
|
132
|
+
- **Protocol conformance suite** — `test/protocol-conformance/`: 22 distributable cases (entry model, write semantics, budget model, audit reconstruction, export envelope) with a `--provider` CLI for third parties; CI runs them against dsh-memento's own provider as the golden reference (`npm run test:conformance`).
|
|
133
|
+
- **Upstream proposal material** — `docs/upstream-proposal.md` (+ 中文): why the official `ctx.memory` seam should adopt the protocol, differences from the current seam, and the migration path.
|
|
116
134
|
- `memory` tool accepts optional `tags` on add/replace/consolidate; tool results and `/memory export` documents carry `tags`/`version`.
|
|
117
135
|
|
|
118
136
|
### Changed
|
|
119
137
|
|
|
120
138
|
- Five-language READMEs: protocol section, adapter matrix, conformance suite, new command verbs, and the development gate list (now 133 tests).
|
|
121
|
-
- ARCHITECTURE: decisions 13
|
|
139
|
+
- ARCHITECTURE: decisions 13–15 (protocol separation, schema v4, adapter registry + conformance suite).
|
|
122
140
|
- npm package now ships the protocol docs and the conformance suite (`files` whitelist).
|
|
123
141
|
|
|
124
142
|
## [0.3.1] - 2026-08-15
|
|
125
143
|
|
|
126
144
|
### Fixed
|
|
127
145
|
|
|
128
|
-
- Boot crash on default Windows setups (reported in [issue #1](https://github.com/PerryLink/dsh-memento/issues/1)): `dsh web` does not write the harness's resolved home back to `process.env.DSH_HOME`, so `resolveDbPath` threw `MISSING_DSH_HOME` and failed the whole profile load. It now falls back to `~/.dsh`
|
|
146
|
+
- Boot crash on default Windows setups (reported in [issue #1](https://github.com/PerryLink/dsh-memento/issues/1)): `dsh web` does not write the harness's resolved home back to `process.env.DSH_HOME`, so `resolveDbPath` threw `MISSING_DSH_HOME` and failed the whole profile load. It now falls back to `~/.dsh` — the same documented fallback as the official harness (`resolveDshHome()`), replicated with `os.homedir()` to keep `lib/` zero-DSH-dependency. Relative `dbPath` values resolve against the same fallback home.
|
|
129
147
|
- Removed the now-unreachable `MISSING_DSH_HOME` error code.
|
|
130
148
|
|
|
131
149
|
## [0.3.0] - 2026-08-15
|
|
132
150
|
|
|
133
151
|
### Added
|
|
134
152
|
|
|
135
|
-
- `/memory import` subcommand: restores entries from a `/memory export` document (file path or inline JSON starting with `{`). Validates the `dsh-memento` / `memory-export-v1` markers and entry shapes (unknown schema versions fail loudly), caps one import at 1000 entries, then rides `seed`
|
|
136
|
-
- Approve-what-you-see approval payloads: `replace` carries `from:` (full previous entry) + `to:` (new text), `remove` carries the full text of the entry being deleted (no more bare substrings), and `consolidate` carries each target's resolved text (300-char excerpt cap per target)
|
|
137
|
-
- `*-denied` audit rows: every rejected/cancelled/unavailable write (including the turn-outside `/memory` gate path, which has no approval audit pair) lands a denied row with the real decision source
|
|
153
|
+
- `/memory import` subcommand: restores entries from a `/memory export` document (file path or inline JSON starting with `{`). Validates the `dsh-memento` / `memory-export-v1` markers and entry shapes (unknown schema versions fail loudly), caps one import at 1000 entries, then rides `seed` — single approval, full budget pre-check, one atomic transaction. `source`/`workspaceKey`/`agentKey` survive the round-trip; entries get fresh ids/timestamps and reset recall counts. This completes the backup/migration story.
|
|
154
|
+
- Approve-what-you-see approval payloads: `replace` carries `from:` (full previous entry) + `to:` (new text), `remove` carries the full text of the entry being deleted (no more bare substrings), and `consolidate` carries each target's resolved text (300-char excerpt cap per target) — the approval reason now holds the complete change being authorized.
|
|
155
|
+
- `*-denied` audit rows: every rejected/cancelled/unavailable write (including the turn-outside `/memory` gate path, which has no approval audit pair) lands a denied row with the real decision source — denials now have their own evidence chain.
|
|
138
156
|
- Session-visibility isolation for reads and write targeting: `memory` / `memory_recall` queries filter by the session's `agentPreset` (shared + own agent), and `replace`/`remove`/`consolidate` can only target entries visible to the session (shared + own agent, workspace entries only for the session cwd). Management surfaces (`/memory`, the panel) keep the full cross-agent view and now render non-shared entries' agent keys.
|
|
139
157
|
- `query` accepts an explicit `agentKey` option (`service.query(filter, { agentKey })`); without it, behavior is unchanged (full view, backward compatible).
|
|
140
158
|
|
|
@@ -143,7 +161,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
143
161
|
- `proposalDecide` now resolves and updates inside one transaction: concurrent approve/dismiss races settle first-writer-wins instead of double-deciding.
|
|
144
162
|
- `/memory proposals approve` no longer masks a successful write when the proposal was concurrently decided elsewhere.
|
|
145
163
|
- Release workflow is now idempotent: it skips `npm publish` when the tag's version is already on npm, so re-pushing an old tag cannot fail a run.
|
|
146
|
-
- Cross-platform test fix: the `resolveDbPath` absolute-path sample now matches the platform's `path.isAbsolute` semantics (a Windows drive path is relative on POSIX)
|
|
164
|
+
- Cross-platform test fix: the `resolveDbPath` absolute-path sample now matches the platform's `path.isAbsolute` semantics (a Windows drive path is relative on POSIX) — CI is green on all three platforms instead of red on Linux/macOS.
|
|
147
165
|
|
|
148
166
|
### Changed
|
|
149
167
|
|
|
@@ -160,7 +178,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
160
178
|
- Bilingual `memory_recall` tool description, parameter descriptions, and result renderer.
|
|
161
179
|
- New README section "What we learned from the terminal memories" (Claude Code / Codex / Hermes), mirrored across all five languages.
|
|
162
180
|
- `commandListLimit` (default 50) and `commandAuditLimit` (default 10) config fields for the `/memory` command surface.
|
|
163
|
-
- Coverage gate (`npm run check:coverage`: lib
|
|
181
|
+
- Coverage gate (`npm run check:coverage`: lib ≥90%, index.mjs ≥85%, all files ≥90%) and a weekly `next`-rc compatibility probe workflow.
|
|
164
182
|
- Peer dependency ranges widened to `>=0.1.0-rc.6` so later harness rc releases resolve without a coordinated release.
|
|
165
183
|
- Package metadata (`repository`/`homepage`/`bugs`), `types` conditions on the `exports` map, and this changelog.
|
|
166
184
|
|
|
@@ -170,7 +188,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
170
188
|
- `/memory list` / `query` render at most `commandListLimit` entries and label truncation instead of silently dropping rows.
|
|
171
189
|
- `seed` inserts run in one SQLite transaction: any mid-batch failure rolls back the whole batch (the documented all-or-nothing promise now holds).
|
|
172
190
|
- `replace` re-resolves the target and recomputes the net budget delta after approval, closing the stale-previous race during the approval wait.
|
|
173
|
-
- Audit rows record the real decision source (`via approval, writePolicy
|
|
191
|
+
- Audit rows record the real decision source (`via approval, writePolicy …` vs `via write gate`) instead of always labeling the configured policy.
|
|
174
192
|
- `memory_recall` description now states the true case semantics (case-sensitive for memory entries, case-insensitive for session history).
|
|
175
193
|
- `maxEntriesPerQuery` is documented and enforced as the default result cap; explicit `limit` values are hard-capped at 1000 by the provider.
|
|
176
194
|
|
|
@@ -187,5 +205,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
187
205
|
- `/memory` command (`list` / `query` / `add` / `remove` / `budgets` / `audit`) with an out-of-turn write gate sharing the same waterfall and policy.
|
|
188
206
|
- Read-only web panel (`dsh.client` drawer): browse entries, search, budget bars, audit tail.
|
|
189
207
|
- Session-event vocabulary (`memory/added|updated|removed|recalled|snapshot`) merge-declared in `types.d.ts` with rc.6-adaptive dispatch.
|
|
190
|
-
- Hard per-track/per-layer character budgets with structured `BUDGET_EXCEEDED` errors
|
|
191
|
-
- CI matrix (three platforms
|
|
208
|
+
- Hard per-track/per-layer character budgets with structured `BUDGET_EXCEEDED` errors — never truncate, never auto-compact.
|
|
209
|
+
- CI matrix (three platforms × Node 22.19/24), typecheck gate, and five-language README consistency gate.
|
package/README.es.md
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
| Surface | Status |
|
|
27
27
|
|---|---|
|
|
28
|
-
| Harness | DeepSeek Harness `dsh-v0.1.
|
|
28
|
+
| Harness | DeepSeek Harness `dsh-v0.1.5-alpha.1` (adaptado el 2026-09-09): el sobre de sesión conserva su campo ignorable solo para compatibilidad de lectura de logs almacenados - Session.append aún no puede estamparlo, por lo que el comportamiento de la puerta no cambia. Verificado el 2026-09-09 contra el checkout master dsh-v0.1.5-alpha.1 (cadena completa de puertas + humo de instalación de perfil). |
|
|
29
29
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
30
30
|
| Platforms | Windows / macOS / Linux (solo host; sin código nativo, sin red) |
|
|
31
31
|
| Model | Cualquiera |
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
`dsh-memento` es una costura de capacidad, no otro almacén: un servicio tipado `ctx.memory`, un proveedor SQLite local (`node:sqlite`, WAL, `0600`, en `$DSH_HOME/dsh-memento/memory.db`) y sus consumidores — la herramienta `memory` y una instantánea congelada inyectada en el prompt del sistema.
|
|
36
36
|
|
|
37
37
|
- **La puerta no se puede eludir.** Toda ruta de escritura (`add` / `replace` / `remove` / `seed`) se fuerza a través de la cascada de aprobación dentro del servicio, no en la capa de herramientas. `writePolicy: ask | auto | off` es configuración invisible para el modelo; `replace` / `remove` / `consolidate` llevan el texto completo de las entradas que cambian en el payload de aprobación, y una escritura denegada deja igualmente una fila de auditoría `*-denied`.
|
|
38
|
-
- **Visible para el modelo ⟺ registrado.** La instantánea inyectada llega textualmente a `
|
|
38
|
+
- **Visible para el modelo ⟺ registrado.** La instantánea inyectada llega textualmente a `system/message`; cada escritura es reconstruible a partir de `approval/asked` + `approval/decided` + la propia tabla de auditoría del plugin.
|
|
39
39
|
- **Acotada y honesta.** Presupuestos estrictos de caracteres por pista y por capa (por defecto usuario 2000 / agente 4000). Un almacén lleno falla con un error estructurado (uso + límite): nunca se trunca, nunca se compacta automáticamente.
|
|
40
40
|
|
|
41
41
|
Dos pistas × dos capas × clave por agente: una pista `user` (hechos sobre el usuario) y una pista `agent` (hechos de entorno y convenciones), cada una dividida en capas `user-global` y `workspace`, aisladas por `agentPreset`. La instantánea se congela una vez por sesión en el primer ensamblado del prompt y nunca cambia a mitad de sesión.
|
package/README.hi.md
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
| Surface | Status |
|
|
27
27
|
|---|---|
|
|
28
|
-
| Harness | DeepSeek Harness `dsh-v0.1.
|
|
28
|
+
| Harness | DeepSeek Harness `dsh-v0.1.5-alpha.1` (2026-09-09 को अनुकूलित): सत्र लिफ़ाफ़ा अपना ignorable फ़ील्ड केवल संग्रहीत-लॉग पठन संगतता के लिए रखता है - Session.append अभी भी इसे स्टैम्प नहीं कर सकता, इसलिए गेट व्यवहार अपरिवर्तित है। dsh-v0.1.5-alpha.1 master checkout के विरुद्ध 2026-09-09 को सत्यापित (पूर्ण गेट शृंखला + प्रोफ़ाइल इंस्टॉल स्मोक)। |
|
|
29
29
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
30
30
|
| Platforms | Windows / macOS / Linux (केवल host; कोई नेटिव कोड नहीं, कोई नेटवर्क नहीं) |
|
|
31
31
|
| Model | कोई भी |
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
`dsh-memento` एक क्षमता-सीम है, कोई दूसरा भंडार नहीं: एक टाइप्ड `ctx.memory` सेवा, एक स्थानीय SQLite प्रदाता (`node:sqlite`, WAL, `0600`, `$DSH_HOME/dsh-memento/memory.db` पर) और उसके उपभोक्ता — `memory` टूल और सिस्टम प्रॉम्प्ट में इंजेक्ट किया गया फ़्रोज़न स्नैपशॉट।
|
|
36
36
|
|
|
37
37
|
- **अनुमोदन द्वार को टाला नहीं जा सकता।** हर लेखन पथ (`add` / `replace` / `remove` / `seed`) सेवा के भीतर अनुमोदन वॉटरफ़ॉल से होकर गुज़रता है, टूल परत से नहीं। `writePolicy: ask | auto | off` मॉडल के लिए अदृश्य विन्यास है; `replace` / `remove` / `consolidate` अनुमोदन पेलोड में बदली जाने वाली प्रविष्टियों का पूरा पाठ ले जाते हैं, और अस्वीकृत लेखन भी एक `*-denied` ऑडिट पंक्ति छोड़ता है।
|
|
38
|
-
- **मॉडल-दृश्य ⟺ लॉग किया गया।** इंजेक्ट किया गया स्नैपशॉट `
|
|
38
|
+
- **मॉडल-दृश्य ⟺ लॉग किया गया।** इंजेक्ट किया गया स्नैपशॉट `system/message` में शब्दशः पहुँचता है; हर लेखन `approval/asked` + `approval/decided` + प्लगइन की अपनी ऑडिट तालिका से पुनर्निर्माण-योग्य है।
|
|
39
39
|
- **परिबद्ध और ईमानदार।** प्रति-ट्रैक/प्रति-परत कठोर अक्षर बजट (डिफ़ॉल्ट user 2000 / agent 4000)। भरा हुआ भंडार संरचित त्रुटि से विफल होता है (उपयोग + सीमा) — कभी काटा नहीं, कभी स्वतः संकुचित नहीं।
|
|
40
40
|
|
|
41
41
|
दो ट्रैक × दो परतें × प्रति-एजेंट कुंजी: एक `user` ट्रैक (उपयोगकर्ता के बारे में तथ्य) और एक `agent` ट्रैक (पर्यावरण तथ्य और परंपराएँ), प्रत्येक `user-global` और `workspace` परतों में बँटा, `agentPreset` के अनुसार पृथक। स्नैपशॉट पहले प्रॉम्प्ट संयोजन पर प्रति-सत्र एक बार फ़्रीज़ होता है और सत्र के बीच कभी नहीं बदलता।
|
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
| Surface | Status |
|
|
28
28
|
|---|---|
|
|
29
|
-
| Harness | DeepSeek Harness `dsh-v0.1.
|
|
29
|
+
| Harness | DeepSeek Harness `dsh-v0.1.5-alpha.1` (adapted 2026-09-09): the session envelope keeps its ignorable field for stored-log read compatibility only - Session.append still cannot stamp it, so audit-gate behavior is unchanged. Verified 2026-09-09 against the dsh-v0.1.5-alpha.1 master checkout (full gate chain + profile install smoke). |
|
|
30
30
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
31
31
|
| Platforms | Windows / macOS / Linux (pure host; no native code, no network) |
|
|
32
32
|
| Model | Any |
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
`dsh-memento` is a capability seam, not another memory warehouse: a typed `ctx.memory` service, a local SQLite provider (`node:sqlite`, WAL, `0600`, at `$DSH_HOME/dsh-memento/memory.db`), and its consumers — the `memory` tool and a frozen snapshot injected into the system prompt.
|
|
37
37
|
|
|
38
38
|
- **The approval gate cannot be bypassed.** Every write path (`add` / `replace` / `remove` / `seed`) is forced through the approval waterfall inside the service, not in the tool layer. `writePolicy: ask | auto | off` is model-invisible configuration; `replace` / `remove` / `consolidate` carry the full text of the entries they change in the approval payload, and a denied write still lands a `*-denied` audit row.
|
|
39
|
-
- **Model-visible ⟺ logged.** The injected snapshot lands verbatim in `
|
|
39
|
+
- **Model-visible ⟺ logged.** The injected snapshot lands verbatim in `system/message`; every write is reconstructable from `approval/asked` + `approval/decided` + the plugin's own audit table.
|
|
40
40
|
- **Bounded and honest.** Hard per-track/per-layer character budgets (default user 2000 / agent 4000). A full store fails with a structured error (usage + limit) — never truncated, never auto-compacted.
|
|
41
41
|
|
|
42
42
|
Two tracks × two layers × per-agent key: a `user` track (facts about the user) and an `agent` track (environment facts and conventions), each split into `user-global` and `workspace` layers, isolated per `agentPreset`. The snapshot is frozen once per session at first prompt assembly and never changes mid-session.
|
package/README.pt.md
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
| Surface | Status |
|
|
27
27
|
|---|---|
|
|
28
|
-
| Harness | DeepSeek Harness `dsh-v0.1.
|
|
28
|
+
| Harness | DeepSeek Harness `dsh-v0.1.5-alpha.1` (adaptado em 2026-09-09): o envelope de sessão mantém seu campo ignorable apenas para compatibilidade de leitura de logs armazenados - o Session.append ainda não consegue estampá-lo, então o comportamento da porta não muda. Verificado em 2026-09-09 contra o checkout master dsh-v0.1.5-alpha.1 (cadeia completa de portas + smoke de instalação de perfil). |
|
|
29
29
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
30
30
|
| Platforms | Windows / macOS / Linux (somente host; sem código nativo, sem rede) |
|
|
31
31
|
| Model | Qualquer |
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
O `dsh-memento` é uma costura de capacidade, não outro armazém: um serviço tipado `ctx.memory`, um provedor SQLite local (`node:sqlite`, WAL, `0600`, em `$DSH_HOME/dsh-memento/memory.db`) e seus consumidores — a ferramenta `memory` e um snapshot congelado injetado no prompt do sistema.
|
|
36
36
|
|
|
37
37
|
- **A porta não pode ser contornada.** Todo caminho de escrita (`add` / `replace` / `remove` / `seed`) passa pela cascata de aprovação dentro do serviço, não na camada de ferramentas. `writePolicy: ask | auto | off` é configuração invisível para o modelo; `replace` / `remove` / `consolidate` carregam o texto completo das entradas que alteram no payload de aprovação, e uma escrita negada ainda gera uma linha de auditoria `*-denied`.
|
|
38
|
-
- **Visível para o modelo ⟺ registrado.** O snapshot injetado chega textualmente a `
|
|
38
|
+
- **Visível para o modelo ⟺ registrado.** O snapshot injetado chega textualmente a `system/message`; toda escrita é reconstruível a partir de `approval/asked` + `approval/decided` + a própria tabela de auditoria do plugin.
|
|
39
39
|
- **Limitado e honesto.** Orçamentos rígidos de caracteres por trilha e por camada (padrão usuário 2000 / agente 4000). Um armazém cheio falha com erro estruturado (uso + limite) — nunca trunca, nunca compacta automaticamente.
|
|
40
40
|
|
|
41
41
|
Duas trilhas × duas camadas × chave por agente: uma trilha `user` (fatos sobre o usuário) e uma trilha `agent` (fatos de ambiente e convenções), cada uma dividida em camadas `user-global` e `workspace`, isoladas por `agentPreset`. O snapshot é congelado uma vez por sessão na primeira montagem do prompt e nunca muda no meio da sessão.
|
package/README.zh.md
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
| Surface | Status |
|
|
27
27
|
|---|---|
|
|
28
|
-
| Harness | DeepSeek Harness `dsh-v0.1.
|
|
28
|
+
| Harness | DeepSeek Harness `dsh-v0.1.5-alpha.1`(2026-09-09 已适配):会话信封保留 ignorable 字段但仅用于存量日志读取兼容——Session.append 仍无法盖章,门控行为不变。 2026-09-09 已对照 dsh-v0.1.5-alpha.1 master checkout 核验(全部门禁链 + profile 安装冒烟)。 |
|
|
29
29
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
30
30
|
| Platforms | Windows / macOS / Linux(纯 host;无原生代码、无网络) |
|
|
31
31
|
| Model | 任意 |
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
`dsh-memento` 是能力接缝,不是又一个仓库:一个类型安全的 `ctx.memory` 服务、一个本地 SQLite 提供方(`node:sqlite`,WAL,`0600`,位于 `$DSH_HOME/dsh-memento/memory.db`),以及它的消费方——`memory` 工具与注入系统提示的冻结快照。
|
|
36
36
|
|
|
37
37
|
- **审批门不可绕过。** 每条写路径(`add` / `replace` / `remove` / `seed`)都被强制经过服务内部的审批 waterfall,而非工具层。`writePolicy: ask | auto | off` 是模型看不见的配置;`replace` / `remove` / `consolidate` 的审批载荷携带将被改动条目的全文,被拒的写同样落一条 `*-denied` 审计行。
|
|
38
|
-
- **模型可见 ⟺ 已记录。** 注入的快照逐字进入 `
|
|
38
|
+
- **模型可见 ⟺ 已记录。** 注入的快照逐字进入 `system/message`;每次写都能从 `approval/asked` + `approval/decided` + 插件自有审计表重建。
|
|
39
39
|
- **有界且诚实。** 每轨每层硬字符预算(默认 user 2000 / agent 4000)。写满返回结构化错误(用量 + 上限)——绝不截断、绝不自动压缩。
|
|
40
40
|
|
|
41
41
|
两条轨道 × 两个层级 × 按 agent 隔离:`user` 轨(关于用户的事实)与 `agent` 轨(环境事实与约定),各自再分为 `user-global` 与 `workspace` 层,并按 `agentPreset` 隔离。快照在会话首次组装提示时冻结一次,会话中途不再变化。
|
|
@@ -72,3 +72,104 @@ Backward compatibility: the protocol is a normalization and extension of dsh-mem
|
|
|
72
72
|
0.3.x seam — existing behavior is preserved; `tags`/`version`/adapters are additive. The
|
|
73
73
|
reference implementation stays installable as a community plugin regardless of whether or when
|
|
74
74
|
the harness adopts the protocol.
|
|
75
|
+
|
|
76
|
+
## Alignment with official ctx.storage (0.1.5-alpha.1)
|
|
77
|
+
|
|
78
|
+
> Status check 2026-09-09, read-only against `origin/master` = `5dda764e`
|
|
79
|
+
> (`0.1.5-alpha.1`). The sections above were written when the official
|
|
80
|
+
> harness had no storage subsystem. That has changed, so this proposal is
|
|
81
|
+
> realigned: instead of a new top-level `ctx.memory` seam, memory protocol
|
|
82
|
+
> v1 now mounts on the official storage hub -- its persistence rides
|
|
83
|
+
> `ctx.storage.domain`, and the json/sqlite dual backend already exists.
|
|
84
|
+
> The earlier sections stay as the protocol rationale; the rc.6-era
|
|
85
|
+
> "Differences from the current official seam" table stays as a historical
|
|
86
|
+
> snapshot, superseded by this section.
|
|
87
|
+
|
|
88
|
+
### What the official seam now provides (recorded from source)
|
|
89
|
+
|
|
90
|
+
The `packages/storage` group (host-side only; no model-facing surface)
|
|
91
|
+
ships four packages:
|
|
92
|
+
|
|
93
|
+
- `storage` (`@deepseek-ai/dsh-storage`) -- the hub `ctx.storage`: a named
|
|
94
|
+
backend table (`BackendRegistry`: `register` / `get` / `names`; errors
|
|
95
|
+
`duplicate-backend` / `backend-not-found`) plus a data-form mount table.
|
|
96
|
+
`StorageForms` is an empty declaration-merge interface; `mount(form,
|
|
97
|
+
facility)` returns an unmount disposer (error `duplicate-mount`),
|
|
98
|
+
`form(form)` resolves a mounted form (error `form-not-mounted`), and the
|
|
99
|
+
`domain` getter is the typed accessor for the domain form.
|
|
100
|
+
`storageBackendServiceKey(name)` yields the lifecycle-only key
|
|
101
|
+
`storage.backend.<name>` that domain providers inject so activation
|
|
102
|
+
cannot race backend registration.
|
|
103
|
+
- `storage-json` (`@deepseek-ai/dsh-storage-json`) -- registers backend
|
|
104
|
+
`json` (one human-readable file per unit, or per-record documents).
|
|
105
|
+
- `storage-sqlite` (`@deepseek-ai/dsh-storage-sqlite`) -- registers backend
|
|
106
|
+
`sqlite` (units as JSON documents in one database).
|
|
107
|
+
- `storage-domain` (`@deepseek-ai/dsh-storage-domain`) -- plugin name
|
|
108
|
+
`storage-domain`, `inject: ['storage']`; mounts `DomainFacility` under
|
|
109
|
+
`StorageForms['domain']` and provides `ctx.storageDomain`. `Config` =
|
|
110
|
+
`{ backend: string, routes?: Record<string, string> }` -- the default
|
|
111
|
+
backend plus per-domain overrides. `DomainFacility.open(spec)` opens a
|
|
112
|
+
declared domain over a routed backend (errors: `already-open`,
|
|
113
|
+
`backend-not-found`, `facet-unsupported`, `invalid-record` with an
|
|
114
|
+
optional `backup-and-skip` policy, and backend `version-mismatch` /
|
|
115
|
+
`malformed-medium`); `get(name)` is the untyped lookup; `closeAll()`
|
|
116
|
+
closes everything. `defineDomain` / `domainTable` / `descriptorOf`
|
|
117
|
+
declare specs with zod record schemas; open domains emit
|
|
118
|
+
`domain/changed` events.
|
|
119
|
+
|
|
120
|
+
The domain layer is deliberately generic: schema-validated, change-emitting
|
|
121
|
+
KV with no memory semantics (no budgets, no approval, no audit). The
|
|
122
|
+
workspace subsystem is its first consumer, and
|
|
123
|
+
`session-projection-cache/src/spec.ts` already declares its domain with
|
|
124
|
+
`defineDomain` -- the mounting pattern this proposal now follows.
|
|
125
|
+
|
|
126
|
+
### Realigned adoption framing
|
|
127
|
+
|
|
128
|
+
**From "new ctx.memory seam" to "memory protocol v1 on ctx.storage.domain".**
|
|
129
|
+
|
|
130
|
+
1. **Entry model -> `DomainSpec`.** Declare the memory store once with
|
|
131
|
+
`defineDomain`: tracks become tables, entries become zod-validated
|
|
132
|
+
records keyed by agent key + entry id, `version` carries the protocol
|
|
133
|
+
schema version, and `compatibleVersions` carries the migration list.
|
|
134
|
+
The domain layer's loud `invalid-record` failure (plus the optional
|
|
135
|
+
`backup-and-skip` policy) matches the protocol's "fail loud, never
|
|
136
|
+
silently truncate" stance.
|
|
137
|
+
2. **Medium -> existing backends.** No backend work: open the domain over
|
|
138
|
+
`sqlite` (point updates, WAL) or `json` (portable, human-readable)
|
|
139
|
+
through the domain plugin's `Config.backend` / `Config.routes`. The
|
|
140
|
+
json/sqlite dual backend already exists upstream.
|
|
141
|
+
3. **Service -> thin protocol layer over the domain handle.** The official
|
|
142
|
+
seam contributes the storage spine; the protocol's semantics -- the
|
|
143
|
+
write gate enforced inside the provider, model-invisible
|
|
144
|
+
`writePolicy`, per-track/per-layer budgets, the audit ledger, the
|
|
145
|
+
conformance suite -- stay in the memory layer
|
|
146
|
+
(`MemoryProtocolCore` / `MemoryService`), which owns the `Domain`
|
|
147
|
+
handle returned by `ctx.storage.domain.open(spec)` and keeps the
|
|
148
|
+
approval transport on top of it.
|
|
149
|
+
4. **Naming -> StorageForms / domain vocabulary.** When a service-shaped
|
|
150
|
+
face is wanted, promote the memory facility to a mounted data form via
|
|
151
|
+
declaration merging (`interface StorageForms { memory: MemoryFacility }`,
|
|
152
|
+
the `domain: DomainFacility` precedent), mount it in `apply` with
|
|
153
|
+
`ctx.storage.mount('memory', facility)` (disposal unmounts), and reach
|
|
154
|
+
it as `ctx.storage.memory` -- the `ctx.storage.domain` getter is the
|
|
155
|
+
precedent. Inject `storageBackendServiceKey('sqlite')` so the form
|
|
156
|
+
never activates before its backend (the storage-domain precedent). The
|
|
157
|
+
earlier `ctx.memory` / `ctx.memoryAdapters` vocabulary is superseded
|
|
158
|
+
by `ctx.storage.memory` plus the adapter registry inside the facility.
|
|
159
|
+
|
|
160
|
+
### Realigned migration path
|
|
161
|
+
|
|
162
|
+
1. Declare the memory `DomainSpec` and publish it; existing plugins see no
|
|
163
|
+
behavior change, and the conformance suite remains the acceptance gate.
|
|
164
|
+
2. Route the domain to `sqlite` by default (or `json` for portable stores)
|
|
165
|
+
via the domain plugin `Config` -- no backend code changes.
|
|
166
|
+
3. Land the memory data form (`StorageForms['memory']`) as the official
|
|
167
|
+
provider shape: the protocol core rides the `Domain` handle, keeps the
|
|
168
|
+
approval transport and audit ledger, and mounts/unmounts as an effect.
|
|
169
|
+
4. Register the `memory/*` session event types when the session event
|
|
170
|
+
vocabulary opens up (unchanged from above); conformance suite adoption
|
|
171
|
+
unchanged.
|
|
172
|
+
|
|
173
|
+
Backward compatibility: the earlier "new `ctx.memory` seam" path is a
|
|
174
|
+
subset of this framing -- the protocol still ships and rehearses as a
|
|
175
|
+
community plugin; only the official surface it targets has changed.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-memento",
|
|
3
3
|
"description": "Bounded, layered, approval-gated, auditable cross-session memory for DeepSeek Harness — a capability seam (ctx.memory service + local SQLite provider + memory tool + frozen snapshot injection), not another memory warehouse",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.10",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.mjs",
|
|
7
7
|
"types": "./types.d.ts",
|
|
@@ -90,9 +90,7 @@
|
|
|
90
90
|
"credentials:none"
|
|
91
91
|
],
|
|
92
92
|
"compatibility": {
|
|
93
|
-
"dshVersions": [
|
|
94
|
-
"0.1.2-rc.1"
|
|
95
|
-
]
|
|
93
|
+
"dshVersions": ["0.1.2-rc.1","0.1.5-alpha.1"]
|
|
96
94
|
},
|
|
97
95
|
"capability": {
|
|
98
96
|
"id": "memory",
|
|
@@ -109,19 +107,19 @@
|
|
|
109
107
|
},
|
|
110
108
|
"peerDependencies": {
|
|
111
109
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
112
|
-
"@deepseek-ai/dsh-session": ">=0.1.2-rc.1 <0.2.0",
|
|
113
|
-
"@deepseek-ai/dsh-settings": ">=0.1.2-rc.1 <0.2.0",
|
|
114
|
-
"@deepseek-ai/dsh-tools": ">=0.1.2-rc.1 <0.2.0",
|
|
115
|
-
"@deepseek-ai/schemastery": "
|
|
110
|
+
"@deepseek-ai/dsh-session": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
111
|
+
"@deepseek-ai/dsh-settings": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
112
|
+
"@deepseek-ai/dsh-tools": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
113
|
+
"@deepseek-ai/schemastery": "^3.18.2"
|
|
116
114
|
},
|
|
117
115
|
"devDependencies": {
|
|
118
|
-
"@deepseek-ai/dsh-attachment": "0.1.
|
|
116
|
+
"@deepseek-ai/dsh-attachment": "0.1.5-alpha.1",
|
|
119
117
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
120
118
|
"@deepseek-ai/cordis-plugin-include": "^1.0.7",
|
|
121
119
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
122
|
-
"@deepseek-ai/dsh-session": "0.1.
|
|
123
|
-
"@deepseek-ai/dsh-settings": "0.1.
|
|
124
|
-
"@deepseek-ai/dsh-tools": "0.1.
|
|
120
|
+
"@deepseek-ai/dsh-session": "0.1.5-alpha.1",
|
|
121
|
+
"@deepseek-ai/dsh-settings": "0.1.5-alpha.1",
|
|
122
|
+
"@deepseek-ai/dsh-tools": "0.1.5-alpha.1",
|
|
125
123
|
"@deepseek-ai/schemastery": "^3.18.2",
|
|
126
124
|
"@types/node": "^26.2.0",
|
|
127
125
|
"oxlint": "^0.18.1",
|