@maadb/core 0.18.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,7 +15,8 @@ MAADb stores records as markdown files with YAML frontmatter for structured fiel
15
15
 
16
16
  - **Markdown is canonical.** Open any record in any text editor — your data is exactly what's on screen, no translation layer.
17
17
  - **History policy is explicit.** Choose per-write audit commits, a Git-free feed, zero-write reads, batched commits, or annotated snapshots per project. `maad_history` shows available Git history.
18
- - **LLM-native.** Ships with 46 MCP tools for discovery, read, write, maintenance, and auth. Designed for agent workflows from the start.
18
+ - **LLM-native.** Ships with 49 MCP tools for discovery, read, write, maintenance, and auth. Designed for agent workflows from the start.
19
+ - **Host-verifiable writes.** Freeze a schema contract, create only when those expectations still hold, and read an exact document receipt. Ordinary `maad_create` remains.
19
20
  - **Optional schemas.** Add YAML schemas when you want structure, skip them when you don't. Validation runs on writes, never on old records.
20
21
  - **The index is a speed layer.** SQLite stores pointers into your markdown files. Delete it and `maad reindex` rebuilds it from the markdown — your data never depends on the index surviving.
21
22
  - **Safe under concurrent writes.** Clean shutdown, lock recovery, rate limiting, retry-safe operations all built in.
@@ -25,8 +26,6 @@ MAADb stores records as markdown files with YAML frontmatter for structured fiel
25
26
 
26
27
  MAADb works as a context engine for AI agents — a place to hold the information they need to keep working, when that context still needs structure. Records are typed, relationships are queryable through MCP, and the data stays as readable markdown on disk. Common shapes: agent memory, project state, ongoing case files. For high-throughput transactional data or pure semantic retrieval at scale, purpose-built tools serve better.
27
28
 
28
- Guarded-write consumers can use [compact complete contracts and receipt pages](docs/complete-delivery.md), with separate query and contract response budgets.
29
-
30
29
  ## Quick example
31
30
 
32
31
  A record lives as markdown with a schema-validated YAML header:
@@ -86,7 +85,7 @@ Runtime layout, client to storage:
86
85
  │ MCP server (one process per instance) │
87
86
  │ • SessionRegistry — bind state, effective roles │
88
87
  │ • EnginePool — one engine per bound project │
89
- │ • TokenStore — HTTP transport only (0.7.0+) │
88
+ │ • TokenStore — HTTP transport only │
90
89
  └────────────────────────┬────────────────────────────────┘
91
90
  │
92
91
  ┌────────────────────────▼────────────────────────────────┐
@@ -166,7 +165,7 @@ Wire up MCP in your agent (`.mcp.json` in the project directory):
166
165
 
167
166
  (Or use `node /absolute/path/to/maadb/dist/cli.js ...` if running from a checkout.)
168
167
 
169
- Same shape for Claude Desktop (`claude_desktop_config.json`) and OpenClaw. Any MCP-compatible agent works — stdio is the default, HTTP/SSE is available since 0.5.0.
168
+ Same shape for Claude Desktop (`claude_desktop_config.json`) and OpenClaw. Any MCP-compatible agent works — stdio is the default; HTTP/SSE is available for hosted deployments.
170
169
 
171
170
  Restart your agent. The agent detects an empty project and enters **Architect mode** to design the schema based on your goal:
172
171
 
@@ -322,7 +321,7 @@ rotating a token, discard the old session and initialize a fresh one with the ne
322
321
  bearer. A client that previously reused one session across several tokens must now
323
322
  open one session per token.
324
323
 
325
- > **Known gap (still present in v0.14.0):** `maad_instance_reload` does not reload `tokens.yaml`.
324
+ > **Known gap (still present in v0.18.0):** `maad_instance_reload` does not reload `tokens.yaml`.
326
325
  > On a deployment where SIGHUP is unavailable, a revocation written to
327
326
  > `tokens.yaml` by another process is not observed by the running server until it
328
327
  > restarts, and sessions bound to the revoked token stay live until then. Prefer
@@ -348,14 +347,21 @@ Deployment guides:
348
347
  - [Change feed — polling patterns + cadence](docs/change-feed.md)
349
348
  - [History modes — Git policy, flush, recovery, and migration](docs/history-modes.md)
350
349
 
350
+ Host contracts:
351
+
352
+ - [Guarded create](docs/guarded-create.md)
353
+ - [Exact document receipt](docs/document-receipt.md)
354
+ - [Complete contract and receipt delivery](docs/complete-delivery.md)
355
+ - [Retrieval scope](docs/retrieval-scope.md)
356
+
351
357
  ## Access roles
352
358
 
353
359
  MCP roles control what tools an agent can use. Ceiling set per project in `instance.yaml`; assignment mechanics and three-cap composition detailed in [How roles are assigned](#how-roles-are-assigned).
354
360
 
355
361
  | Role | Tools | Use case |
356
362
  |------|-------|----------|
357
- | `reader` (default) | scan, summary, describe, get, query, search, related, relationship_paths, schema, aggregate, join, verify, find_orphans, changes_since, semantic_search, history, audit, subscribe, unsubscribe, instructions (check) | Read-only agents, reporting, analysis |
358
- | `writer` | reader + create, update, validate, bulk_create, bulk_update | Standard agents that read and write records |
363
+ | `reader` (default) | scan, summary, describe, get, query, search, related, relationship_paths, schema, aggregate, join, verify, find_orphans, changes_since, semantic_search, document_receipt, create_contract, history, audit, subscribe, unsubscribe, instructions (check) | Read-only agents, reporting, analysis |
364
+ | `writer` | reader + create, create_guarded, update, validate, bulk_create, bulk_update | Standard agents that read and write records |
359
365
  | `admin` | writer + delete, reindex, reload, health, flush, instructions (refresh), backup, bulk_delete, delete_where, purge_soft_deleted, repair_where, instance_reload, subscriptions, issue_token, revoke_token, rotate_token, list_tokens, show_token | Project setup, schema changes, maintenance, cleanup, auth |
360
366
 
361
367
  ## Project layout
@@ -389,14 +395,14 @@ my-project/
389
395
  All tools return `{ ok: true, data: {...} }` or `{ ok: false, errors: [...] }`. Call `maad_schema <type>` for full field definitions before writing.
390
396
 
391
397
  **Discover:** `maad_scan`, `maad_summary`, `maad_describe`, `maad_schema`
392
- **Read:** `maad_get`, `maad_query`, `maad_search`, `maad_related`, `maad_relationship_paths`, `maad_aggregate`, `maad_join`, `maad_verify`, `maad_find_orphans`, `maad_changes_since`, `maad_semantic_search`
393
- **Write:** `maad_create`, `maad_update`, `maad_bulk_create`, `maad_bulk_update`, `maad_validate`
398
+ **Read:** `maad_get`, `maad_query`, `maad_search`, `maad_related`, `maad_relationship_paths`, `maad_aggregate`, `maad_join`, `maad_verify`, `maad_find_orphans`, `maad_changes_since`, `maad_semantic_search`, `maad_document_receipt`, `maad_create_contract`
399
+ **Write:** `maad_create`, `maad_create_guarded`, `maad_update`, `maad_bulk_create`, `maad_bulk_update`, `maad_validate`
394
400
  **Maintain:** `maad_delete`, `maad_reindex`, `maad_reload`, `maad_health`, `maad_flush`, `maad_history`, `maad_audit`, `maad_instructions`
395
- **Recovery anchors (0.7.10+):** `maad_backup` — annotated git tags as snapshot points.
396
- **Cleanup (0.7.10+ admin, confirm-contract governed):** `maad_bulk_delete`, `maad_delete_where`, `maad_repair_where`, `maad_purge_soft_deleted` — destructive ops are dry-run by default; pass `confirm: true` to mutate. `maxRecords` cap default 100 / ceiling 1000.
397
- **Live updates (0.6.11+):** `maad_subscribe`, `maad_unsubscribe` — push notifications on durable writes.
401
+ **Backup:** `maad_backup` — annotated git tags as snapshot points.
402
+ **Cleanup (admin, confirm-contract governed):** `maad_bulk_delete`, `maad_delete_where`, `maad_repair_where`, `maad_purge_soft_deleted` — destructive ops are dry-run by default; pass `confirm: true` to mutate. `maxRecords` cap default 100 / ceiling 1000.
403
+ **Live updates:** `maad_subscribe`, `maad_unsubscribe` — push notifications on durable writes.
398
404
  **Instance admin:** `maad_instance_reload`, `maad_subscriptions`.
399
- **Auth admin (0.7.0+):** `maad_issue_token`, `maad_revoke_token`, `maad_rotate_token`, `maad_list_tokens`, `maad_show_token`.
405
+ **Auth admin:** `maad_issue_token`, `maad_revoke_token`, `maad_rotate_token`, `maad_list_tokens`, `maad_show_token`.
400
406
 
401
407
  ### Relationship retrieval
402
408
 
@@ -408,7 +414,17 @@ The versioned response contract and limits are documented in [Evidence-backed re
408
414
 
409
415
  In multi-project mode, session tools are always available pre-bind: `maad_projects`, `maad_use_project`, `maad_use_projects`, `maad_current_session`.
410
416
 
411
- ### Semantic retrieval (0.8.0, opt-in)
417
+ ### Contracts, receipts, and guarded writes
418
+
419
+ Hosts that need to freeze write expectations — rather than relying on ordinary `maad_create` — use three tools:
420
+
421
+ - **`maad_create_contract`** (reader) — observe the complete schema contract, digest, and effective history mode for a type. Save the approved `schemaDigest`; do not silently adopt a new one.
422
+ - **`maad_create_guarded`** (writer) — admit a document only when the frozen schema digest, history mode, authorization, and expected content still match.
423
+ - **`maad_document_receipt`** (reader) — read one document's exact committed content, canonical digest, and current authorization. Receipts report local Git evidence; consumers must verify intended content.
424
+
425
+ Large contracts and receipts can be delivered as compact complete pages with a separate response budget. Details: [guarded create](docs/guarded-create.md), [document receipt](docs/document-receipt.md), [complete delivery](docs/complete-delivery.md).
426
+
427
+ ### Semantic retrieval (opt-in)
412
428
 
413
429
  `maad_semantic_search` adds meaning-based retrieval over record bodies, indexed per block, with a 3-mode dial:
414
430
 
@@ -420,45 +436,36 @@ The agent selects the mode, and that choice lands in the audit trail — the eng
420
436
 
421
437
  Off by default — set `MAAD_SEMANTIC_ENABLE=1`. Embeddings are derived and rebuildable (canonical source stays markdown), generated async-on-write so the deterministic write/commit path is unchanged. The embedding provider is pluggable: inject one from the host, or env-construct (`MAAD_EMBED_PROVIDER=openai`, `MAAD_EMBED_MODEL`, `MAAD_OPENAI_API_KEY`). With no provider, `semantic`/`hybrid` degrade to the lexical leg (flagged in `_meta.degraded`); `exact` always works. After enabling on an existing project, run `maad reindex --embeddings` to build the index. `maad_health.embeddings` reports provider/model/dim, queue depth, embedded vs indexed blocks, and failures.
422
438
 
423
- The vector store is `sqlite-vec` (in the same SQLite file); the lexical leg is FTS5. `exact` needs neither a model nor a key.
439
+ The vector store is `sqlite-vec` (in the same SQLite file); the lexical leg is FTS5. `exact` needs neither a model nor a key. Scoped lexical requests apply live-document and field filters in SQL before the candidate limit, so older in-scope documents stay eligible. Scoped vector retrieval first takes a bounded global candidate pool, then applies those filters — documents outside that pool can still be missed. See [Retrieval scope](docs/retrieval-scope.md) for candidate budgets, `limitations`, and custom-backend capabilities.
424
440
 
425
441
  ## Agent boot flow
426
442
 
427
443
  1. Agent reads `MAAD.md` → stable operating instructions
428
444
  2. Agent runs `maad_summary` → live project snapshot
429
445
  3. If empty project → reads `_skills/architect-core.md`, enters Architect mode
430
- 4. If live project → uses MCP tools for normal operations
446
+ 4. If live but unfamiliar → reads `_skills/corpus-explorer.md` to map the corpus
447
+ 5. Typed-graph work → `_skills/graph-ontology.md` composes `maad_related`, `maad_relationship_paths`, and `maad_join`
448
+ 6. Otherwise → MCP tools for normal operations
431
449
 
432
450
  ## Current state
433
451
 
434
- **Current:** v0.15.0 — managed graph-ontology and corpus-explorer skills teach agents typed-graph densification and unfamiliar-project mapping using existing MCP primitives (`maad_related`, `maad_relationship_paths`, `maad_join`, …).
435
-
436
- See the [v0.15.0 release notes](docs/releases/v0.15.0.md) for highlights, verification, and migration notes.
452
+ **Current:** v0.18.0 — compact complete contracts and receipts, with independent response budgets. Hosts freeze a schema digest, create only when those expectations still hold (`maad_create_guarded`), and verify persisted content with `maad_document_receipt`.
437
453
 
438
454
  Recent shipped scope:
439
- - **0.15.0** — Managed `_skills/graph-ontology.md` and `_skills/corpus-explorer.md` (MANAGED_ARTIFACTS 4 → 6)
440
- - **0.14.0** — Per-project `audit`, `feed`, `read`, `batch`, and `snapshot` history modes; explicit flush; crash recovery; history health telemetry
441
- - **0.13.0** — Evidence-backed relationship paths with deterministic bounded traversal and canonical edge evidence
442
- - **0.12.4** — HTTP sessions bound to the authenticated principal that opened them; revoke, rotate, reload, and expiry tear down affected sessions
443
- - **0.12.3** — Token-store `reload` serialized against in-flight mutations, so a SIGHUP during issue/revoke/rotate cannot drop a just-written token from the in-memory index
444
- - **0.12.2** — Canonical path containment for `maad_scan`; serialized token-store issue/revoke/rotate
445
- - **0.12.1** — Escape newlines and carriage returns in double-quoted YAML frontmatter scalars
446
- - **0.12.0** — Managed-instruction lifecycle (`maad instructions` / `maad_instructions`), schema string constraints (`max_length` / `soft_max_length` / `multiline`), HTTP `/mcp` Origin allowlist
447
- - **0.11.2** — Bounded HTTP session retention (`MAAD_SESSION_MAX`, default 128)
448
- - **0.11.1** — Pool-mode recovery for false-empty indexes: `maad_reindex` is the one MCP tool allowed to initialize a guarded project
449
- - **0.11.0** — Transactional engine lifecycle and literal zero-write read-only mode
450
- - **0.10.0** — Data-correctness wave: type-faithful YAML lists, soft-delete tombstone isolation, exclusive creation
451
- - **0.9.0** — Write-identity + filesystem-boundary enforcement
452
- - **0.8.x** — Semantic retrieval (`maad_semantic_search`), false-empty index guard, index-integrity pass
453
- - **0.7.x** — Scoped auth & identity, integrity/cleanup primitives, transport and write-path hardening
454
-
455
- See [Version.md](Version.md) for the full release history and forward plan.
455
+ - **0.18.0** — Compact complete delivery pages for contracts and receipts
456
+ - **0.17.0** — Versioned guarded document creation (`maad_create_guarded`)
457
+ - **0.16.0** — Exact document receipts (`maad_document_receipt`)
458
+ - **0.15.2** — Scoped search keeps older in-scope evidence; retrieval limitations reported
459
+ - **0.15.0** — Managed `_skills/graph-ontology.md` and `_skills/corpus-explorer.md`
460
+ - **0.14.0** — Per-project `audit`, `feed`, `read`, `batch`, and `snapshot` history modes
461
+
462
+ See [Version.md](Version.md) for the full release history. Feature notes for 0.14.0 and 0.15.0 remain in [docs/releases/](docs/releases/).
456
463
 
457
464
  ## Stack
458
465
 
459
466
  - TypeScript strict, Node.js 24+ (current Active LTS)
460
467
  - 6 production dependencies: `better-sqlite3`, `gray-matter`, `js-yaml`, `simple-git`, `@modelcontextprotocol/sdk`, `pino`. Plus one **optional** dependency `sqlite-vec` (semantic retrieval) — lazily loaded only when `MAAD_SEMANTIC_ENABLE` is on; absent or failed to load ⇒ semantic disabled, engine unaffected
461
- - 1,274 tests at v0.15.0, Vitest — run on every push/PR across Ubuntu and Windows
468
+ - Vitest suite on every push/PR across Ubuntu and Windows
462
469
  - MIT license, pre-1.0, actively developed
463
470
 
464
471
  ## License
@@ -127,6 +127,11 @@ function serializeArrayItem(value) {
127
127
  if (Array.isArray(value))
128
128
  return `[${value.map(serializeArrayItem).join(', ')}]`;
129
129
  if (typeof value === 'string') {
130
+ // Flow delimiters are unsafe anywhere in a plain sequence item, even
131
+ // when the same string is safe as a standalone block scalar.
132
+ if (/[\[\]{},]/.test(value)) {
133
+ return `"${escapeDoubleQuotedScalar(value)}"`;
134
+ }
130
135
  return serializeField('_', value).slice(3);
131
136
  }
132
137
  // Schema-governed lists reject object items, but extras still need valid
@@ -1 +1 @@
1
- {"version":3,"file":"serializer.js","sourceRo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SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IAClF,IAAI,KAAK,YAAY,IAAI;QAAE,OAAO,IAAI,KAAK,CAAC,WAAW,EAAE,GAAG,CAAC;IAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IAEjF,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,qEAAqE;QACrE,6DAA6D;QAC7D,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,IAAI,wBAAwB,CAAC,KAAK,CAAC,GAAG,CAAC;QAChD,CAAC;QACD,OAAO,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;IAED,yEAAyE;IACzE,mEAAmE;IACnE,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;QACtB,MAAM,EAAE,IAAI,CAAC,WAAW;QACxB,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC,CAAC;QACb,MAAM,EAAE,IAAI;KACb,CAAC,CAAC,IAAI,EAAE,CAAC;AACZ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maadb/core",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "Markdown As A Database — treats markdown as the canonical data store, builds a queryable index, and gives LLMs deterministic read/write access.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -51,7 +51,7 @@
51
51
  "@modelcontextprotocol/sdk": "1.30.0",
52
52
  "better-sqlite3": "12.11.1",
53
53
  "gray-matter": "~4.0.3",
54
- "js-yaml": "~4.3.1",
54
+ "js-yaml": "~4.3.2",
55
55
  "pino": "10.3.1",
56
56
  "simple-git": "3.36.0"
57
57
  },