dotmem 0.1.8 → 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/CHANGELOG.md CHANGED
@@ -1,76 +1,76 @@
1
- # Changelog
2
-
3
- All notable changes to Dotmem are documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [0.1.7] - 2026-11-10
9
-
10
- ### Fixed
11
- - **MCP Automatic Joy Profile Activation** — Fresh MCP sessions now automatically deliver the canonical Joy identity through the `initialize.instructions` handshake, composed with (not conflated into) the Scintilla signal. Profile identity values are read from the single canonical profile (`context/profiles/ai/ai.json`) with no hardcoded values.
12
- - **Session Issues — Phase 2** — Resolved race conditions in `doctor --fix` (optimistic concurrency control with version checking), cross-source duplicate ID handling in `acquire` (refuses ambiguous writes), `projectBootstrapContext` semantic prioritization (P1-P5 explicit priority + recency fallback), `expiresAt` freshness filtering in discovery and bootstrap context, and doctor dry-run content distinction (byte-identical vs divergent duplicates).
13
- - **Windows EPERM test failure** — Build context script now accepts `CONTEXT_DIR` env var; test uses isolated temp fixture.
14
-
15
- ### Added
16
- - **Progressive Summary Store** — Four detail levels (current: 1.0, recent: 0.7, distant: 0.3, archived: 0.1) with session count and age-based decay triggers, summary text truncation preserving earliest and most recent content, fact filtering by confidence, decision compaction, question count compaction, and summary rotation chain.
17
- - **Automatic Conversational Capture** — 7-stage pipeline: detect → classify → extract → dedup → decide → provenance → store. Classification via keyword matching + heuristics (deterministic, no embeddings). Deduplication via Jaccard similarity (threshold 0.75). Explicit instruction detection. Fact vs inference distinction.
18
- - **MCP Automatic Joy Profile Activation** — ADR-023: `buildProfileGuidance()` reads canonical `JO_PROFILE`; `buildMcpInstructions()` composes profile identity block + Scintilla signal.
19
- - **Project identity `resolveProjectIdentity`** — Public API export for resolving stable project identity from DOTMEM_PROJECT_ID env, package.json name, or directory basename.
20
-
21
- ### Changed
22
- - **Documentation Consolidation and Identity Cleanup** (ADR-006, ADR-007, ADR-008) — Root `docs/` removed; all files moved to `.project/`; Memorio identity removed from Dotmem documents; research paper filenames and headings normalized to Dotmem identity; source code references updated.
23
- - **Historical Reference Cleanup** (ADR-007) — Single "Project origins" section in `.project/README.md`; repetitive historical notes removed from 30 research papers; project identity normalized.
24
- - **Documentation Ownership Correction** (ADR-008) — Complete inventory and classification of recovered files; Memorio foundational docs identified; Dotmem AI docs classified.
25
- - **Memory/MCP/Jo/Joy Ecosystem Migration** (ADR-009) — 819 files transferred from Memorio to Dotmem; README collisions resolved; Memorio `docs/research/` removed.
26
- - **Recovery and Restoration of `.project/archives/`** (ADR-004, ADR-005) — 875 archived files inventoried; ~500 test cases restored to vitest suite; 57 papers recovered; ~40 experiments recovered; ~110 documents recovered.
27
- - **Canonical Areas fix** — Added `project` key to `CANONICAL_AREAS` vocabulary, fixing silent exclusion of project-scoped knowledge claims.
28
-
29
- ### Deprecated
30
- - `memory.init()` — No-op; runtime initializes lazily on first use.
31
-
32
- ## [0.1.6] - 2026-10-31
33
-
34
- ### Fixed
35
- - **Foundation Validation (Workstream A)** — Memorio-Dotmem integration validated. Six duplicated local foundation modules removed; callers migrated to Memorio 5.5.3. TypeScript: 0 errors. Oxlint: 0 errors, 0 warnings. Build: CJS and ESM successful. Vitest: 52 passed, 1 skipped, 1 todo.
36
-
37
- ### Added
38
- - **Progressive Conversational Memory Design** (Workstream B) — Architecture, behavior specification, test plan, issue investigation, and known limitations documented in `.project/progressive-memory/`.
39
- - **Profile Projection and Document Loading** — Investigation of 7 declared profile documents vs 3 loaded.
40
- - **Context Ceiling Analysis** — Identity channel 1904 bytes + ~300 bytes envelope = ~2204 bytes vs 2048 byte host ceiling.
41
- - **Applicability Gate** — `CANONICAL_AREAS` missing `project` key identified and fixed.
42
-
43
- ## [0.1.5] - 2026-10-31
44
-
45
- ### Added
46
- - **Historical Recovery and Physical Restoration** — `.project/archives/` recovery inventory (875 files), test recovery (~831 historical cases, ~500 restored), paper recovery (57 documents), experiment recovery (~40), documentation recovery (~110), ownership mapping, ADR-004 and ADR-005 recorded.
47
-
48
- ## [0.1.4] - 2026-10-31
49
-
50
- ### Changed
51
- - **Documentation Cleanup and Ownership Correction** — ~160+ active documents inspected; 5 duplicate groups identified; 4 resolved; 7 documents rewritten with identity updates; 4 link groups fixed; 10+ legitimate Memorio reference categories preserved; validation: 25/25 checks passed.
52
-
53
- ## [0.1.3] - 2026-10-31
54
-
55
- ### Changed
56
- - **Dotmem Historical Integration & Ownership Correction** — Architectural ownership correction: Dotmem owns memory acquisition, governance, identity, continuity, AI trust boundaries, Jo/Joy, progressive summaries; Memorio retains state, store, session, IDB/SQLite, generic cache, dispatch/observer. 8 files renamed to canonical names; 26+ document titles updated from "Memorio —" to "Dotmem —"; 7 duplicates removed; 3 SECURITY.md variants renamed; 3 index files updated.
57
-
58
- ## [0.1.2] - 2026-10-31
59
-
60
- ### Added
61
- - **Dotmem Documentation Consolidation and Identity Cleanup** — Root `docs/` removed, files copied to `.project/`; Memorio identity removed from Dotmem documents; research paper filenames and H1 headings updated; source code references updated; `.project/README.md` rewritten; ADR-006, ADR-007, ADR-008 recorded.
62
-
63
- ## [0.1.1] - 2026-10-31
64
-
65
- ### Added
66
- - **Dotmem Historical Reference Cleanup and Project Identity** — Single "Project origins" section; repetitive historical notes removed from 30 research papers; project identity normalized; technical dependency references preserved; historical documents preserved as-is; ADR-007, ADR-008 recorded.
67
-
68
- ## [0.1.0] - 2026-10-31
69
-
70
- ### Added
71
- - **Initial Dotmem Release** — AI memory and continuity infrastructure for agents and applications. Memorio 5.5.3 as foundation. Core capabilities: acquired experience, application memory, continuity, policy, agent namespaces, notes and profiles, MCP and CLI.
72
- - **Joy Identity** — Native, mandatory AI collaborator identity with canonical profile system.
73
- - **MCP Server** — Stdio server `dotmem-mcp` with read-only default, write opt-in via `DOTMEM_MCP_WRITE=1`.
74
- - **Deterministic Retrieval** — Lexical and structured matching without embeddings.
75
- - **Agent Memory** — Logical namespace partitioning via `dotmem/agent`.
1
+ # Changelog
2
+
3
+ All notable changes to Dotmem are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.7] - 2026-11-10
9
+
10
+ ### Fixed
11
+ - **MCP Automatic Joy Profile Activation** — Fresh MCP sessions now automatically deliver the canonical Joy identity through the `initialize.instructions` handshake, composed with (not conflated into) the Scintilla signal. Profile identity values are read from the single canonical profile (`context/profiles/ai/ai.json`) with no hardcoded values.
12
+ - **Session Issues — Phase 2** — Resolved race conditions in `doctor --fix` (optimistic concurrency control with version checking), cross-source duplicate ID handling in `acquire` (refuses ambiguous writes), `projectBootstrapContext` semantic prioritization (P1-P5 explicit priority + recency fallback), `expiresAt` freshness filtering in discovery and bootstrap context, and doctor dry-run content distinction (byte-identical vs divergent duplicates).
13
+ - **Windows EPERM test failure** — Build context script now accepts `CONTEXT_DIR` env var; test uses isolated temp fixture.
14
+
15
+ ### Added
16
+ - **Progressive Summary Store** — Four detail levels (current: 1.0, recent: 0.7, distant: 0.3, archived: 0.1) with session count and age-based decay triggers, summary text truncation preserving earliest and most recent content, fact filtering by confidence, decision compaction, question count compaction, and summary rotation chain.
17
+ - **Automatic Conversational Capture** — 7-stage pipeline: detect → classify → extract → dedup → decide → provenance → store. Classification via keyword matching + heuristics (deterministic, no embeddings). Deduplication via Jaccard similarity (threshold 0.75). Explicit instruction detection. Fact vs inference distinction.
18
+ - **MCP Automatic Joy Profile Activation** — ADR-023: `buildProfileGuidance()` reads canonical `JO_PROFILE`; `buildMcpInstructions()` composes profile identity block + Scintilla signal.
19
+ - **Project identity `resolveProjectIdentity`** — Public API export for resolving stable project identity from DOTMEM_PROJECT_ID env, package.json name, or directory basename.
20
+
21
+ ### Changed
22
+ - **Documentation Consolidation and Identity Cleanup** (ADR-006, ADR-007, ADR-008) — Root `docs/` removed; all files moved to `.project/`; Memorio identity removed from Dotmem documents; research paper filenames and headings normalized to Dotmem identity; source code references updated.
23
+ - **Historical Reference Cleanup** (ADR-007) — Single "Project origins" section in `.project/README.md`; repetitive historical notes removed from 30 research papers; project identity normalized.
24
+ - **Documentation Ownership Correction** (ADR-008) — Complete inventory and classification of recovered files; Memorio foundational docs identified; Dotmem AI docs classified.
25
+ - **Memory/MCP/Jo/Joy Ecosystem Migration** (ADR-009) — 819 files transferred from Memorio to Dotmem; README collisions resolved; Memorio `docs/research/` removed.
26
+ - **Recovery and Restoration of `.project/archives/`** (ADR-004, ADR-005) — 875 archived files inventoried; ~500 test cases restored to vitest suite; 57 papers recovered; ~40 experiments recovered; ~110 documents recovered.
27
+ - **Canonical Areas fix** — Added `project` key to `CANONICAL_AREAS` vocabulary, fixing silent exclusion of project-scoped knowledge claims.
28
+
29
+ ### Deprecated
30
+ - `memory.init()` — No-op; runtime initializes lazily on first use.
31
+
32
+ ## [0.1.6] - 2026-10-31
33
+
34
+ ### Fixed
35
+ - **Foundation Validation (Workstream A)** — Memorio-Dotmem integration validated. Six duplicated local foundation modules removed; callers migrated to Memorio 5.5.3. TypeScript: 0 errors. Oxlint: 0 errors, 0 warnings. Build: CJS and ESM successful. Vitest: 52 passed, 1 skipped, 1 todo.
36
+
37
+ ### Added
38
+ - **Progressive Conversational Memory Design** (Workstream B) — Architecture, behavior specification, test plan, issue investigation, and known limitations documented in `.project/progressive-memory/`.
39
+ - **Profile Projection and Document Loading** — Investigation of 7 declared profile documents vs 3 loaded.
40
+ - **Context Ceiling Analysis** — Identity channel 1904 bytes + ~300 bytes envelope = ~2204 bytes vs 2048 byte host ceiling.
41
+ - **Applicability Gate** — `CANONICAL_AREAS` missing `project` key identified and fixed.
42
+
43
+ ## [0.1.5] - 2026-10-31
44
+
45
+ ### Added
46
+ - **Historical Recovery and Physical Restoration** — `.project/archives/` recovery inventory (875 files), test recovery (~831 historical cases, ~500 restored), paper recovery (57 documents), experiment recovery (~40), documentation recovery (~110), ownership mapping, ADR-004 and ADR-005 recorded.
47
+
48
+ ## [0.1.4] - 2026-10-31
49
+
50
+ ### Changed
51
+ - **Documentation Cleanup and Ownership Correction** — ~160+ active documents inspected; 5 duplicate groups identified; 4 resolved; 7 documents rewritten with identity updates; 4 link groups fixed; 10+ legitimate Memorio reference categories preserved; validation: 25/25 checks passed.
52
+
53
+ ## [0.1.3] - 2026-10-31
54
+
55
+ ### Changed
56
+ - **Dotmem Historical Integration & Ownership Correction** — Architectural ownership correction: Dotmem owns memory acquisition, governance, identity, continuity, AI trust boundaries, Jo/Joy, progressive summaries; Memorio retains state, store, session, IDB/SQLite, generic cache, dispatch/observer. 8 files renamed to canonical names; 26+ document titles updated from "Memorio —" to "Dotmem —"; 7 duplicates removed; 3 SECURITY.md variants renamed; 3 index files updated.
57
+
58
+ ## [0.1.2] - 2026-10-31
59
+
60
+ ### Added
61
+ - **Dotmem Documentation Consolidation and Identity Cleanup** — Root `docs/` removed, files copied to `.project/`; Memorio identity removed from Dotmem documents; research paper filenames and H1 headings updated; source code references updated; `.project/README.md` rewritten; ADR-006, ADR-007, ADR-008 recorded.
62
+
63
+ ## [0.1.1] - 2026-10-31
64
+
65
+ ### Added
66
+ - **Dotmem Historical Reference Cleanup and Project Identity** — Single "Project origins" section; repetitive historical notes removed from 30 research papers; project identity normalized; technical dependency references preserved; historical documents preserved as-is; ADR-007, ADR-008 recorded.
67
+
68
+ ## [0.1.0] - 2026-10-31
69
+
70
+ ### Added
71
+ - **Initial Dotmem Release** — AI memory and continuity infrastructure for agents and applications. Memorio 5.5.3 as foundation. Core capabilities: acquired experience, application memory, continuity, policy, agent namespaces, notes and profiles, MCP and CLI.
72
+ - **Joy Identity** — Native, mandatory AI collaborator identity with canonical profile system.
73
+ - **MCP Server** — Stdio server `dotmem-mcp` with read-only default, write opt-in via `DOTMEM_MCP_WRITE=1`.
74
+ - **Deterministic Retrieval** — Lexical and structured matching without embeddings.
75
+ - **Agent Memory** — Logical namespace partitioning via `dotmem/agent`.
76
76
  - **Governance & Security** — RBAC, audit, consent, AES-GCM, PBKDF2 helpers.
@@ -0,0 +1,318 @@
1
+ # Dotmem Short API
2
+
3
+ Normative specification for the `short()` intent-based interface that exposes Dotmem's existing public capabilities through simple JSON input.
4
+
5
+ ## Public API Contract
6
+
7
+ ### Entry Points
8
+
9
+ **Standalone function:**
10
+ ```ts
11
+ await short({ important: "Do not modify production" })
12
+ ```
13
+
14
+ **Instance method:**
15
+ ```ts
16
+ await dotmem.short({ important: "Do not modify production" })
17
+ ```
18
+
19
+ Both entry points accept exactly one argument: a JSON object where each key is an intent name and each value is the intent payload. Both share the same resolver, validation, dispatch, execution, and result implementation.
20
+
21
+ ### Prohibited Syntax
22
+
23
+ ```ts
24
+ short("important", "Do not modify production") // ERROR: positional arguments prohibited
25
+ dotmem.short("important", "Do not modify production") // ERROR: positional arguments prohibited
26
+ short.important("Do not modify production") // ERROR: per-intent methods prohibited
27
+ short.note("...") // ERROR: per-intent methods prohibited
28
+ dotmem.short.note("...") // ERROR: per-intent methods prohibited
29
+ ```
30
+
31
+ ## Intent Catalogue
32
+
33
+ | Category | Intent | Description | Payload Form |
34
+ |----------|--------|-------------|--------------|
35
+ | Knowledge | `note` | Store/retrieve markdown notes | string or structured object |
36
+ | Knowledge | `remember` | Store key/value memory | structured object |
37
+ | Knowledge | `recall` | Retrieve memory by query | structured object |
38
+ | Knowledge | `forget` | Delete key/value memory | structured object |
39
+ | Knowledge | `update` | Update key/value memory | structured object |
40
+ | Knowledge | `patch` | Patch memory entry fields | structured object |
41
+ | Knowledge | `acquire` | Durable knowledge acquisition | structured object |
42
+ | Knowledge | `verify` | Claim freshness verification | empty object |
43
+ | Priority | `important` | Record behavioral guidance | string or object |
44
+ | Priority | `avoid` | Record behavioral guidance to avoid | string or object |
45
+ | Priority | `prefer` | Record behavioral preference | string or object |
46
+ | Priority | `warning` | Record behavioral warning | string or object |
47
+ | Context | `context` | Provide acquired context for a situation | structured object |
48
+ | Context | `bootstrap` | Initialize session context | structured object |
49
+ | Rules | `rules` | Query iron rules reference | structured object |
50
+ | Governance | `policy` | Evaluate existing policies | structured object |
51
+ | Projects | `project` | Project discovery and management | structured object |
52
+ | Projects | `discover` | Experience discovery | structured object |
53
+ | Inspection | `inspect` | Package/store inspection | structured object |
54
+ | Inspection | `dump` | Memory stats listing | empty object |
55
+ | Inspection | `audit` | Audit trail query | empty object |
56
+ | Maintenance | `health` | System health check | empty object |
57
+ | Maintenance | `doctor` | System diagnostics | empty object |
58
+ | Maintenance | `repair` | Policy repair (blocked, requires confirmation) | structured object |
59
+ | Maintenance | `cleanup` | Clear non-durable memory | empty object |
60
+ | Relationships | `relate` | Claim relationships (refines/supersedes/retracts) | structured object |
61
+ | Relationships | `link` | Link claims via supersedes | structured object |
62
+ | Relationships | `unlink` | Unlink claims via retracts | structured object |
63
+ | Relationships | `merge` | Merge/override notes | structured object |
64
+ | Configuration | `configure` | Runtime configuration | structured object |
65
+ | Configuration | `capabilities` | Query runtime capabilities | empty object |
66
+ | Development | `seed` | Joy memory seed (DOTMEM_DEV_SEED=1 required) | structured object |
67
+ | Conversation | `capture` | Conversational capture | structured object |
68
+
69
+ ## Payload Schemas
70
+
71
+ ### `note`
72
+ ```ts
73
+ // Plain text (auto-generates id)
74
+ short({ note: "The production server uses Debian 13" })
75
+
76
+ // Structured
77
+ short({
78
+ note: {
79
+ id: "note-1",
80
+ title: "Production server",
81
+ content: "Debian 13",
82
+ origin: "deployment",
83
+ scope: "user",
84
+ tag: "infra"
85
+ }
86
+ })
87
+ ```
88
+
89
+ ### `remember`
90
+ ```ts
91
+ short({ remember: { key: "dbVersion", value: "13", scope: "project" } })
92
+ ```
93
+
94
+ ### `recall`
95
+ ```ts
96
+ short({ recall: "dbVersion" })
97
+ ```
98
+
99
+ ### `forget`
100
+ ```ts
101
+ short({ forget: "oldKey" })
102
+ ```
103
+
104
+ ### `update`
105
+ ```ts
106
+ short({ update: { key: "dbVersion", value: "14" } })
107
+ ```
108
+
109
+ ### `patch`
110
+ ```ts
111
+ short({ patch: { key: "config", patches: [{ op: "set", path: "timeout", value: 30 }] } })
112
+ ```
113
+
114
+ ### `acquire`
115
+ ```ts
116
+ short({ acquire: { knowledge: { rule: "use strict" }, applicability: { situation: "new-project" } } })
117
+ ```
118
+
119
+ ### `verify`
120
+ ```ts
121
+ short({ verify: {} })
122
+ ```
123
+
124
+ ### `important` / `avoid` / `prefer` / `warning`
125
+ ```ts
126
+ short({ important: "Do not modify production" })
127
+ short({ avoid: { guidance: "Deploy without a backup" } })
128
+ ```
129
+
130
+ ### `context`
131
+ ```ts
132
+ short({ context: { situation: "CI pipeline configuration", maxCandidates: 5 } })
133
+ ```
134
+
135
+ ### `bootstrap`
136
+ ```ts
137
+ short({ bootstrap: { situation: "New project setup" } })
138
+ ```
139
+
140
+ ### `rules`
141
+ ```ts
142
+ short({ rules: { expand: true } })
143
+ ```
144
+
145
+ ### `policy`
146
+ ```ts
147
+ short({ policy: { event: "artifact.write", claims: [], policies: [] } })
148
+ ```
149
+
150
+ ### `project`
151
+ ```ts
152
+ short({ project: { situation: "New React project", maxCandidates: 5 } })
153
+ ```
154
+
155
+ ### `discover`
156
+ ```ts
157
+ short({ discover: { situation: "CI pipeline configuration", depth: "deep" } })
158
+ ```
159
+
160
+ ### `inspect`
161
+ ```ts
162
+ short({ inspect: { file: "/path/to/file.mem", action: "claims" } })
163
+ ```
164
+
165
+ ### `dump`
166
+ ```ts
167
+ short({ dump: {} })
168
+ ```
169
+
170
+ ### `audit`
171
+ ```ts
172
+ short({ audit: {} })
173
+ ```
174
+
175
+ ### `health`
176
+ ```ts
177
+ short({ health: {} })
178
+ ```
179
+
180
+ ### `doctor`
181
+ ```ts
182
+ short({ doctor: {} })
183
+ ```
184
+
185
+ ### `repair`
186
+ ```ts
187
+ short({ repair: { type: "policy" } })
188
+ // Returns blocked: requires governance authority and explicit confirmation
189
+ ```
190
+
191
+ ### `cleanup`
192
+ ```ts
193
+ short({ cleanup: {} })
194
+ ```
195
+
196
+ ### `relate` / `link` / `unlink`
197
+ ```ts
198
+ short({ relate: { kind: "supersedes", claimIds: ["claim-1", "claim-2"] } })
199
+ short({ link: { kind: "supersedes", claimIds: ["claim-1"] } })
200
+ short({ unlink: { kind: "retracts", claimIds: ["claim-1"] } })
201
+ ```
202
+
203
+ ### `merge`
204
+ ```ts
205
+ short({ merge: { id: "note-1", previousId: "note-0", title: "Updated", content: "...", origin: "short-api" } })
206
+ ```
207
+
208
+ ### `configure`
209
+ ```ts
210
+ short({ configure: { sync: { provider: "s3" } } })
211
+ ```
212
+
213
+ ### `capabilities`
214
+ ```ts
215
+ short({ capabilities: {} })
216
+ ```
217
+
218
+ ### `seed` (dev-only)
219
+ ```ts
220
+ // Requires DOTMEM_DEV_SEED=1
221
+ short({ seed: { id: "seed-1", title: "Dev seed", content: "...", origin: "dev" } })
222
+ ```
223
+
224
+ ### `capture`
225
+ ```ts
226
+ short({ capture: { messages: [{ role: "user", content: "Hello" }], options: { conversationId: "conv-1" } } })
227
+ ```
228
+
229
+ ## Result Contract
230
+
231
+ All calls return a `ShortAggregateResult` envelope:
232
+
233
+ ```ts
234
+ interface ShortAggregateResult {
235
+ success: boolean // true only if every intent completed
236
+ partial: boolean // true if at least one intent failed
237
+ results: {
238
+ [intent: string]: {
239
+ success: boolean
240
+ status: 'completed' | 'failed' | 'blocked' | 'pending' | 'skipped'
241
+ value?: unknown
242
+ error?: {
243
+ code: string
244
+ message: string
245
+ remediation?: string
246
+ intent: string
247
+ stateChanged?: boolean
248
+ confirmation?: { required: boolean; reason: string; action?: string }
249
+ }
250
+ }
251
+ }
252
+ errors: Array<{ code: string; message: string; intent: string; stateChanged?: boolean }>
253
+ }
254
+ ```
255
+
256
+ ### Single-intent result
257
+ ```ts
258
+ const result = await short({ note: "Test note" })
259
+ // result.success === true
260
+ // result.results.note.success === true
261
+ // result.results.note.value === "note-123"
262
+ ```
263
+
264
+ ### Multi-intent result
265
+ ```ts
266
+ const result = await short({
267
+ important: "Do not modify production",
268
+ note: "Server uses Debian 13",
269
+ recall: "dbVersion"
270
+ })
271
+ // result.success === true if all succeeded
272
+ // result.results.<intent> contains per-intent results
273
+ ```
274
+
275
+ ### Partial success
276
+ If any intent fails, `success` is `false`, `partial` is `true`, and the `errors` array contains failed intent details. Earlier committed effects are reported accurately - no rollback is attempted.
277
+
278
+ ## Error Codes
279
+
280
+ | Code | Meaning | Remediation |
281
+ |------|---------|-------------|
282
+ | `DOTMEM_INVALID_INPUT` | Input is not a JSON object | Pass a plain JSON object |
283
+ | `DOTMEM_UNKNOWN_INTENT` | Intent key is not recognized | Use a supported intent from catalogue |
284
+ | `DOTMEM_INVALID_PAYLOAD` | Payload is malformed | Check intent-specific schema |
285
+ | `DOTMEM_INTENT_ERROR` | Operation failed | Check error message for details |
286
+ | `DOTMEM_CONFIRMATION_REQUIRED` | Operation needs explicit confirmation | Authorize via governance/confirmed flow |
287
+ | `DOTMEM_DEV_SEED_REQUIRED` | Seed requires dev flag | Set DOTMEM_DEV_SEED=1 environment variable |
288
+
289
+ ## Execution Semantics
290
+
291
+ - **Order**: Intents execute in declaration order (object key insertion order)
292
+ - **Execution**: Sequential by default; no parallel writes
293
+ - **Atomicity**: Not atomic across intents. Each intent executes independently through its existing API boundary
294
+ - **Rollback**: No automatic rollback. Earlier committed effects remain if a later intent fails
295
+ - **Idempotency**: Per-intent; `remember`/`acquire` with same key/id supersede existing values
296
+ - **Retry**: Non-idempotent mutations are not automatically retried
297
+
298
+ ## Security, Trust, Authorization
299
+
300
+ - All mutating operations cross the existing canonical acquisition boundary
301
+ - Policy enforcement operates through the existing tier system (`context`/`precondition`/`hard-precondition`)
302
+ - Conversational overrides are rejected (same as existing `assertNoConversationalOverride`)
303
+ - Authorities cannot be self-granted (same as existing governance guards)
304
+ - Caller-controlled fields cannot self-assign authority, verification metadata, trusted provenance or policy overrides
305
+ - All audit events are logged via the existing security audit system
306
+ - Size limits prevent unbounded growth via `checkAcquireLimits`
307
+
308
+ ## Limitations
309
+
310
+ - Multi-intent calls are not atomic across existing API boundaries
311
+ - `schedule`/`remind`/`todo`/`task`/`goal`/`deadline`/`event`/`cancel`/`reschedule` are not directly supported; use continuity/loops APIs directly
312
+ - `repair` with type `policy` is blocked pending governance authority and explicit confirmation
313
+ - `seed` requires `DOTMEM_DEV_SEED=1` environment variable
314
+ - `policy` intent evaluates existing policies but does not create new ones; use governance CLI/API for policy lifecycle
315
+
316
+ ## Coverage
317
+
318
+ All existing supported public user-facing Dotmem capabilities are reachable through Short. Low-level foundation primitives (Memorio `state`, `store`, `session`, `dispatch`, `hlc`), internal transport/server setup, raw MCP tool internals, and implementation-only APIs are intentionally excluded as they are not user-facing capabilities.
@@ -0,0 +1,129 @@
1
+ # Dotmem Short API — Component Mapping
2
+
3
+ Each intent maps to exact existing Dotmem components, symbols, and file paths. This is the authoritative mapping used by the Short API implementation.
4
+
5
+ ## Intent-to-Component Mapping
6
+
7
+ | Intent | Existing API | Component File | Exported Symbol | Side Effects | Permissions | Trust | Currentness | Confirmation |
8
+ |--------|-------------|----------------|-----------------|--------------|-------------|-------|-------------|--------------|
9
+ | `note` | `memory.note.add/show/list/supersede/forget/content` | `core/memory/note.ts` | `noteAdd`, `noteList`, `noteShow`, `noteSupersede`, `noteForget`, `noteContent` | Reads/writes .mem files, journal | None (built-in context required) | Provenance via evidence | Active | Optional for add |
10
+ | `remember` | `memory.remember` | `core/memory/entries.ts` | `entries.remember` | Writes to index.store/memory.kv | None | None | Active/current | None |
11
+ | `recall` | `memory.recall` | `core/memory/entries.ts` | `entries.recall` | Reads from store | None | None | MatchesFilters | None |
12
+ | `forget` | `memory.forget` | `core/memory/entries.ts` | `entries.forget` | Writes tombstone, journal | None | None | Obsolete | None |
13
+ | `update` | `memory.update` | `core/memory/entries.ts` | `entries.update` | Writes updated entry, journal | None | None | Updated | None |
14
+ | `patch` | `memory.patch` | `core/memory/entries.ts` | `entries.patch` | Writes patched entry, journal | None | None | Updated | None |
15
+ | `acquire` | `memory.acquire` | `core/memory/acquire.ts` | `acquire.acquire` | Crosses acquisition boundary, writes .mem | Built-in context | Full provenance | Active | Duplicate refusal |
16
+ | `verify` | `verifyDueClaims` | `core/knowledge/verify.ts` | `verifyDueClaims` | Read-only probes | None | Check kind (file-json, regex) | Derived | None |
17
+ | `important` | `memory.remember` | `core/memory/entries.ts` | `entries.remember` | Writes knowledge entry | None | Stored as knowledge | Active | None |
18
+ | `avoid` | `memory.remember` | `core/memory/entries.ts` | `entries.remember` | Writes knowledge entry | None | Stored as knowledge | Active | None |
19
+ | `prefer` | `memory.remember` | `core/memory/entries.ts` | `entries.remember` | Writes knowledge entry | None | Stored as knowledge | Active | None |
20
+ | `warning` | `memory.remember` | `core/memory/entries.ts` | `entries.remember` | Writes knowledge entry | None | Stored as knowledge | Active | None |
21
+ | `context` | `memory.discover` + `memory.project` | `core/memory/index.ts` + `core/knowledge/discover.ts` | `discoverAcquiredExperience`, `projectDiscoveredExperience` | Reads knowledge store | None | None | Derived currentness | None |
22
+ | `bootstrap` | `composeBootstrap` | `core/knowledge/bootstrap.ts` | `composeBootstrap` | Loads knowledge store, rules | None | None | Knowledge version | None |
23
+ | `rules` | `loadIronRules` | `core/knowledge/rules-loader.ts` | `loadIronRules` | Reads from store | None | None | Knowledge version | None |
24
+ | `policy` | `evaluatePolicies` | `core/knowledge/policy.ts` | `evaluatePolicies` | Read-only evaluation | Policy authority | Tier-based enforcement | Based on policy state | Required for blocking policies |
25
+ | `project` | `memory.discover` + `memory.project` | `core/memory/index.ts` | `discover`, `project` | Reads store, may ensure project anchor | None | None | Derived currentness | None |
26
+ | `discover` | `memory.discover` | `core/memory/index.ts` + `core/knowledge/discover.ts` | `discoverAcquiredExperience` | Reads knowledge store | None | None | Derived currentness | None |
27
+ | `inspect` | `inspectMem` | `core/knowledge/mem-package.ts` | `inspectMem` | Read-only, redacted | None | None | N/A (read-only) | None |
28
+ | `dump` | `memory.stats` | `core/memory/entries.ts` | `entries.stats` | Read-only | None | None | N/A | None |
29
+ | `audit` | `security.getAuditLog` | `core/security/index.ts` | `getAuditLog` | Read-only | None | None | N/A | None |
30
+ | `health` | `getCapabilities` + `loadCombinedKnowledgeState` | `core/platform.ts` + `core/memory` | `getCapabilities`, `loadCombinedKnowledgeState` | Read-only | None | None | N/A | None |
31
+ | `doctor` | `findContestedIds` + `deriveCurrentness` | `core/knowledge/currentness.ts` | `findContestedIds`, `deriveCurrentness` | Read-only | None | None | Derived | None |
32
+ | `repair` | Policy governance | `core/governance/index.ts` | `GovernancePolicyStore` | No mutation (blocked) | HI/operator authority | Tier-based | Based on policy state | **Required** |
33
+ | `cleanup` | `memory.clear` | `core/memory/index.ts` | `clear` | Clears hot/session/local entries | None (durable excluded) | None | Excludes durable | None |
34
+ | `relate` | `memory.acquire` (revision) | `core/memory/acquire.ts` | `acquire.acquire` | Crosses acquisition boundary | Built-in context | Full provenance | Active | Single relation per claim |
35
+ | `link` | `memory.acquire` (supersedes) | Same as relate | Same | Same as relate | Same | Same | Same | Same |
36
+ | `unlink` | `memory.acquire` (retracts) | Same as relate | Same | Same as relate | Same | Same | Same | Same |
37
+ | `merge` | `memory.note.supersede` | `core/memory/note.ts` | `noteSupersede` | Writes .mem, journal | None | Provenance via evidence | Active | Requires previousId |
38
+ | `configure` | `memory.configure` | `core/memory/index.ts` | `memory.configure` | May reconfigure storage | None | None | N/A | None |
39
+ | `capabilities` | `getCapabilities` | `core/platform.ts` | `getCapabilities` | None | None | None | N/A | None |
40
+ | `seed` | `memory.seed.add` | `core/memory/seed.ts` | `injectJoySeed` | Writes .mem if enabled | DOTMEM_DEV_SEED=1 | None | Dev seed | DOTMEM_DEV_SEED=1 |
41
+ | `capture` | `memory.capture.conversation` | `core/memory/capture-engine.ts` | `captureConversation` | Writes .mem, journal | None | None | Active session | None |
42
+
43
+ ## Component Ownership
44
+
45
+ ### Memory Layer (`core/memory/`)
46
+ - **index.ts**: Memory facade - `memory` object with `init`, `project`, `discover`, `context`, `fingerprint`, `acquire`, `acquireStaged`, `remember`, `recall`, `update`, `forget`, `patch`, `stats`, `forgetExpired`, `clear`, `configure`
47
+ - **entries.ts**: Key/value memory lifecycle - `remember`, `recall`, `update`, `forget`, `patch`, `stats`, `forgetExpired`, `clearEntries`
48
+ - **note.ts**: Note surface - `noteAdd`, `noteList`, `noteShow`, `noteSupersede`, `noteForget`, `noteContent`
49
+ - **acquire.ts**: Durable acquisition - `acquire`, `acquireStaged`
50
+ - **seed.ts**: Dev-only Joy seed - `injectJoySeed`, `isDevSeedEnabled`, `isHiBound`, `SEED_ID`
51
+ - **capture-engine.ts**: Conversational capture - `captureEngine`, `captureConversation`, `captureTurn`
52
+
53
+ ### Knowledge Layer (`core/knowledge/`)
54
+ - **verify.ts**: Claim verification - `verifyDueClaims`, `formatVerifyResult`, `verifyAndPersistClaims`
55
+ - **bootstrap.ts**: Bootstrap - `composeBootstrap`
56
+ - **policy.ts**: Policy evaluation - `evaluatePolicies`, `PolicyRecord`, `EnforcementTier`
57
+ - **rules-loader.ts**: Rules - `loadIronRules`, `ruleSetSignature`, `formatRulesForSessionStart`
58
+ - **currentness.ts**: Currentness - `findContestedIds`, `deriveCurrentness`
59
+
60
+ ### Platform (`core/platform.ts`)
61
+ - **getCapabilities**, `getPlatform`, `isBrowser`, `isNode`, `isDeno`, `isBun`, `isEdge`
62
+
63
+ ### Security (`core/security/index.ts`)
64
+ - **getAuditLog**, `logAudit`, `setAuditCallback`, `clearAuditLog`, `createSanitizer`
65
+
66
+ ### Continuity (`core/continuity/`)
67
+ - **index.ts**: `continuity.context`, `continuity.snapshot`, `continuity.forget`
68
+
69
+ ### Governance (`core/governance/`)
70
+ - **index.ts**: `GovernancePolicyStore` with propose/review/decide/activate/suspend/retire
71
+
72
+ ## Read/Write Classification
73
+
74
+ ### Read-Only (no storage mutation)
75
+ - `recall`, `verify`, `context`, `bootstrap`, `rules`, `policy`, `project`, `discover`, `inspect`, `dump`, `audit`, `health`, `doctor`, `capabilities`
76
+
77
+ ### Mutating (storage write)
78
+ - `note` (add/supersede/forget), `remember`, `update`, `patch`, `forget`, `acquire`, `important`/`avoid`/`prefer`/`warning`, `cleanup`, `relate`/`link`/`unlink`, `merge`, `configure`, `capture`, `seed` (dev-only)
79
+
80
+ ### Blocked (no mutation without authorization)
81
+ - `repair` (policy repair blocked pending confirmation)
82
+
83
+ ## Trust & Currentness
84
+
85
+ - All acquired knowledge is **context, not authority** - hosts must verify against current reality
86
+ - Claim currentness states: `historical`, `superseded`, `expired`, `verified`, `unverified`, `contested`, `unknown-currentness`
87
+ - Provenance metadata: `evidence`, `provenance`, `epistemicType` preserved through all acquisition paths
88
+ - Policy tiers: `context`, `precondition`, `hard-precondition`
89
+
90
+ ## Side Effects
91
+
92
+ ### Storage writes
93
+ - `.mem` files (acquired knowledge claims)
94
+ - `memory.kv` (durable key/value store)
95
+ - `store` (session/local/hot in-memory via Memorio)
96
+ - Journal entries (detection journal, memory journal)
97
+ - Index files (memory index)
98
+
99
+ ### No writes
100
+ - Read-only intents never modify storage
101
+ - `clearEntries()` excludes durable scope (user memory preserved)
102
+ - `cleanup()` explicitly preserves durable acquired knowledge
103
+
104
+ ## Unsupported / Excluded Capabilities
105
+
106
+ The following existing capabilities are intentionally excluded from Short as they are low-level foundation primitives or internal APIs:
107
+
108
+ | Excluded | Reason |
109
+ |----------|--------|
110
+ | Memorio `state`, `store`, `session`, `dispatch`, `hlc` | Foundation primitives, not user-facing |
111
+ | `memorio` low-level `idb` operations | Browser-only, not user-facing |
112
+ | MCP server transport setup (`McServer` construction) | Transport implementation detail |
113
+ | `dotmem_bootstrap` structuredContent format details | MCP-specific format |
114
+ | Raw knowledge-runtime access | Internal implementation |
115
+ | Policy-store mutate internals | Use governance API instead |
116
+ | Vault internal actions | Use vault CLI/API instead |
117
+ | Session internal state | Use session CLI/API instead |
118
+ | Continuity internals | Use continuity CLI/API instead |
119
+ | Detection-event details | Internal implementation |
120
+ | Acquisition-boundary details | Internal implementation |
121
+
122
+ ## Coverage Summary
123
+
124
+ | Coverage Level | Count | Explanation |
125
+ |---------------|-------|-------------|
126
+ | Directly supported | 42 | All user-facing intents listed above map to existing APIs |
127
+ | Partially supported | N/A | All intents have equivalent semantics through composition |
128
+ | Intentionally excluded | 12 | Low-level foundation primitives, transport internals, implementation APIs |
129
+ | **Total existing user-facing capabilities** | **42** | 100% covered by Short |