@cerefox/memory 1.7.1 → 1.9.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.
@@ -638,7 +638,7 @@ In the action editor, paste this schema (replace `<your-project-ref>`):
638
638
  openapi: 3.1.0
639
639
  info:
640
640
  title: Cerefox Knowledge Base
641
- version: 3.2.0
641
+ version: 3.3.0
642
642
  servers:
643
643
  - url: https://<your-project-ref>.supabase.co/functions/v1
644
644
  paths:
@@ -934,7 +934,9 @@ paths:
934
934
  type: string
935
935
  description: >
936
936
  Filter by operation type: create, update-content, update-metadata,
937
- delete, status-change, archive, unarchive (optional)
937
+ insert, replace-section, delete-section, rename-section, delete,
938
+ restore, status-change, archive, unarchive, config-change,
939
+ project-create, project-edit, project-delete (optional)
938
940
  since:
939
941
  type: string
940
942
  description: ISO timestamp lower bound for temporal queries (optional)
@@ -1490,23 +1492,6 @@ neighbours** (±`p_window_size` chunks within the same document).
1490
1492
  Returns: `chunk_id`, `document_id`, `chunk_index`, `title`, `content`, `heading_path`,
1491
1493
  `heading_level`, `doc_title`, `is_seed` (TRUE for the original seed chunks)
1492
1494
 
1493
- #### `cerefox_save_note`
1494
-
1495
- Create a document record directly. The note is stored but **not embedded** — use `cerefox-ingest`
1496
- Edge Function instead for notes that need to be immediately searchable.
1497
-
1498
- | Parameter | Type | Default | Description |
1499
- |-----------|------|---------|-------------|
1500
- | `p_title` | TEXT | required | Note title |
1501
- | `p_content` | TEXT | required | Markdown content |
1502
- | `p_source` | TEXT | `'agent'` | Origin label |
1503
- | `p_project_id` | UUID | null | Project to assign |
1504
- | `p_metadata` | JSONB | `{}` | Metadata (agent name, tags, etc.) |
1505
-
1506
- Returns: `id`, `title`, `created_at`
1507
-
1508
- ---
1509
-
1510
1495
  ### Metadata RPCs
1511
1496
 
1512
1497
  #### `cerefox_list_metadata_keys`
@@ -80,9 +80,9 @@ bun scripts/db_status.ts # human-readable report
80
80
  bun scripts/db_status.ts --json # structured JSON output
81
81
  ```
82
82
 
83
- Reports:
84
- - Tables: `cerefox_documents`, `cerefox_chunks`, `cerefox_document_versions`, `cerefox_projects`, `cerefox_document_projects`, `cerefox_audit_log`, `cerefox_migrations`
85
- - RPC functions: hybrid_search, fts_search, semantic_search, reconstruct_doc, save_note, search_docs, context_expand, snapshot_version, get_document, list_document_versions, ingest_document, delete_document, create_audit_entry, list_audit_entries, list_metadata_keys, update_chunk_fts, **`cerefox_schema_version`** (new in v0.3.0), **`cerefox_pg_function_exists`** (new in v0.3.0)
83
+ Reports (the expected lists live in `_shared/db-status/index.ts` — the single source of truth):
84
+ - Tables: `cerefox_projects`, `cerefox_documents`, `cerefox_document_versions`, `cerefox_audit_log`, `cerefox_document_projects`, `cerefox_chunks`, `cerefox_migrations`, `cerefox_usage_log`, `cerefox_config`, `cerefox_document_relations`
85
+ - RPC functions: set_updated_at, hybrid_search, fts_search, semantic_search, reconstruct_doc, list_projects, log_usage, list_metadata_keys, snapshot_version, get_document, list_document_versions, create_audit_entry, list_audit_entries, ingest_document, delete_document, restore_document, purge_document, set_config, create_project, update_project, delete_project, set_document_metadata, find_dead_links, metadata_health, metadata_search, update_chunk_fts, `cerefox_schema_version`, `cerefox_pg_function_exists`
86
86
  - Row counts per table
87
87
  - **Schema-version mismatch**: compares the `@version` marker in the bundled `schema.sql` against the deployed `cerefox_schema_version()` RPC. Non-zero exit if they differ (the same check powers the web UI's schema-mismatch banner).
88
88
 
@@ -114,7 +114,7 @@ bun scripts/db_migrate.ts [OPTIONS]
114
114
 
115
115
  On a freshly deployed database, `db_migrate.ts` is always a no-op — `db_deploy.ts` has already stamped all existing migrations.
116
116
 
117
- Migration files live in `src/cerefox/db/migrations/` and are applied in filename order (`0001_...`, `0002_...`). Each file is applied exactly once; applied filenames are recorded in the `cerefox_migrations` table.
117
+ Migration files live in `src/cerefox/db/migrations/` and are applied in filename order (`0001_...`, `0002_...`). Each file is applied exactly once; applied filenames are recorded in the `cerefox_migrations` table. Recent migrations (0023–0027) include data migrations that print what they did (0027 reports reclaimed space); see [`docs/guides/upgrading.md`](upgrading.md).
118
118
 
119
119
  Always run a backup before migrating:
120
120
 
@@ -136,7 +136,7 @@ a linked Supabase project.
136
136
 
137
137
  ## Notable cross-version transitions
138
138
 
139
- Most upgrades need nothing beyond the steps above. Two transitions are worth
139
+ Most upgrades need nothing beyond the steps above. A few transitions are worth
140
140
  knowing about:
141
141
 
142
142
  - **v0.9 — CLI verbs moved to a resource-verb shape** (`cerefox document get`,
@@ -149,6 +149,19 @@ knowing about:
149
149
  `@cerefox/memory` npm package (CLI, MCP server, web server, ingestion). If
150
150
  you're coming from a pre-installer 0.1.x clone, see the "old pre-installer
151
151
  clone" note above: install the package and run `cerefox init`.
152
+ - **v1.5.0 — heading-duplication refusal.** Documents with duplicate headings
153
+ that ingested fine before now need deduplication, or are refused on edit.
154
+ - **v1.7.0 — trashed documents refuse content updates.** A soft-deleted
155
+ document must be restored before its content can be updated.
156
+
157
+ ## Notable: v1.8.0 storage reclaim (migration 0027)
158
+
159
+ Upgrading to v1.8.0 strips never-read search artifacts from archived version
160
+ chunks (rationale: #216 / the migration's own header) and the migration
161
+ prints what it freed. Postgres releases the bytes for **reuse** via
162
+ autovacuum rather than shrinking files immediately, so expect growth to stop
163
+ rather than the reported database size to drop the same day. Archived
164
+ version *content* is untouched.
152
165
 
153
166
  ## After upgrading: AI agents
154
167
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerefox/memory",
3
- "version": "1.7.1",
3
+ "version": "1.9.0",
4
4
  "description": "Cerefox — user-owned shared memory for AI agents. CLI + stdio MCP server + web UI + ingestion for a knowledge base on your own Supabase project (or fully self-hosted with Cerefox Local).",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/fstamatelopoulos/cerefox",
@@ -65,7 +65,7 @@
65
65
  "typescript": "^6.0.3"
66
66
  },
67
67
  "scripts": {
68
- "build": "bun build src/bin/cerefox.ts --outdir dist/bin --target node --format esm --external @huggingface/transformers --external onnxruntime-node",
68
+ "build": "bun run bundle-server-assets && bun build src/bin/cerefox.ts --outdir dist/bin --target node --format esm --external @huggingface/transformers --external onnxruntime-node",
69
69
  "clean": "rm -rf dist docs AGENT_GUIDE.md AGENT_QUICK_REFERENCE.md",
70
70
  "bundle-docs": "bun run ../../scripts/bundle_package_docs.ts",
71
71
  "bundle-server-assets": "bun run ../../scripts/bundle_server_assets.ts",