@cerefox/memory 1.1.0-beta.8 → 1.1.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.
@@ -15,7 +15,7 @@
15
15
  href="https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&display=swap"
16
16
  />
17
17
  <title>Cerefox</title>
18
- <script type="module" crossorigin src="/app/assets/index-DD7DDGGU.js"></script>
18
+ <script type="module" crossorigin src="/app/assets/index-B1pgikxA.js"></script>
19
19
  <link rel="stylesheet" crossorigin href="/app/assets/index-C1JXZA9m.css">
20
20
  </head>
21
21
  <body>
@@ -18,7 +18,7 @@
18
18
  * doesn't touch `supabase/functions/` leaves it alone).
19
19
  */
20
20
 
21
- export const EF_VERSION = "1.1.0-beta.7";
21
+ export const EF_VERSION = "1.1.1";
22
22
 
23
23
  /**
24
24
  * The most recent version whose EF-side SOURCE actually changed (#127).
@@ -0,0 +1,28 @@
1
+ -- 0017_retention_default_120h.sql — raise the built-in version-retention window
2
+ -- from 48 to 120 hours.
3
+ --
4
+ -- 48 hours does not survive a weekend: a bad edit made on Friday afternoon is
5
+ -- unrecoverable by Monday morning, which is exactly when someone would look for
6
+ -- it. 120 hours (5 days) covers that gap while still bounding growth — versions
7
+ -- carry embeddings and are the largest rows in a busy store.
8
+ --
9
+ -- This is only the FALLBACK used when the store has expressed no preference. An
10
+ -- explicit `version_retention_hours` in cerefox_config is untouched, as is the
11
+ -- `version_cleanup_enabled=false` fail-safe that migration 0016 seeds on
12
+ -- existing stores.
13
+ --
14
+ -- Unchanged: cleanup never deletes the most recent version, nor any version
15
+ -- marked `archived`.
16
+ --
17
+ -- The value lives in `rpcs.sql`, which `cerefox server deploy` re-applies. This
18
+ -- migration exists so the schema version moves and operators are told to
19
+ -- redeploy.
20
+ --
21
+ -- Idempotent: safe to re-run.
22
+
23
+ DO $$
24
+ BEGIN
25
+ RAISE NOTICE
26
+ 'Migration 0017: default version retention is now 120 hours (was 48). '
27
+ 'An explicit version_retention_hours setting is unaffected.';
28
+ END $$;
@@ -941,7 +941,9 @@ $$;
941
941
  -- p_document_id : Document to snapshot
942
942
  -- p_source : How the update was triggered ('file','paste','agent','manual')
943
943
  -- p_retention_hours : Retention window in hours. NULL (default) reads
944
- -- `version_retention_hours` from cerefox_config, else 48.
944
+ -- `version_retention_hours` from cerefox_config, else 120
945
+ -- (5 days — long enough that a bad edit made on a Friday
946
+ -- is still recoverable on Monday; 48h was not).
945
947
  -- A non-NULL value overrides the store policy for this
946
948
  -- call only.
947
949
  --
@@ -982,7 +984,7 @@ DECLARE
982
984
  -- data. Same COALESCE(param, config, default) shape the retrieval tunables
983
985
  -- already use.
984
986
  v_retention INT := COALESCE(p_retention_hours,
985
- cerefox_config_int('version_retention_hours', 48));
987
+ cerefox_config_int('version_retention_hours', 120));
986
988
  v_cleanup BOOLEAN := COALESCE(p_cleanup_enabled,
987
989
  cerefox_config_bool('version_cleanup_enabled', TRUE));
988
990
  BEGIN
@@ -2323,7 +2325,7 @@ SET search_path = public, pg_catalog
2323
2325
  AS $$
2324
2326
  -- Keep in lockstep with the `@version:` marker in schema.sql (cut_release.ts
2325
2327
  -- enforces it). Bump whenever schema.sql OR rpcs.sql changes.
2326
- SELECT '0.10.3'::TEXT;
2328
+ SELECT '0.10.4'::TEXT;
2327
2329
  $$;
2328
2330
 
2329
2331
  -- ── cerefox_content_format_stats ─────────────────────────────────────────────
@@ -5,7 +5,7 @@
5
5
  -- Requires extensions: vector (pgvector), uuid-ossp
6
6
  -- These are enabled at the top of db_deploy.py before this file is applied.
7
7
  --
8
- -- @version: 0.10.3
8
+ -- @version: 0.10.4
9
9
  -- The `@version` marker above is read by the schema-version-mismatch banner
10
10
  -- (see /api/v1/schema-version). Bump it whenever schema.sql OR rpcs.sql
11
11
  -- changes in a way that requires `cerefox server deploy` to be re-run —
@@ -140,10 +140,10 @@ This handles intermittent OpenAI API errors (500s) that would otherwise cause se
140
140
 
141
141
  > **Which paths read these?** Client-side tunables in this section are read
142
142
  > from *your* `.env` by the **CLI**, the **local MCP server**, and `cerefox
143
- > web`. Since **v1.0.6** the same values are also honored on the **remote MCP /
144
- > Edge Function path** when set as Supabase **Function secrets**
145
- > (`supabase secrets set CEREFOX_MIN_SEARCH_SCORE=0.55 --project-ref <ref>`) —
146
- > the shared helpers read `Deno.env` as well as `process.env`. Per-call
143
+ > web`. **Since v1.1.0 these are database settings only** — the `CEREFOX_*`
144
+ > variables and the equivalent Supabase **Function secrets** are no longer read,
145
+ > on any path. One `cerefox config set` (or the Settings page) governs the CLI,
146
+ > the web UI, local and remote MCP, and the Edge Functions alike. Per-call
147
147
  > parameters (`min_score`, `min_term_coverage`, `alpha` on `cerefox_search`)
148
148
  > override both. A single setting that governs every path without secrets is
149
149
  > tracked as issue #133 (DB-backed config).
@@ -248,7 +248,7 @@ Cerefox automatically archives previous document content whenever a document is
248
248
  When a document's content changes during ingestion, Cerefox calls the `cerefox_snapshot_version` database function before writing new chunks. This function:
249
249
  1. Creates a version record in `cerefox_document_versions`
250
250
  2. Moves all current chunks to that version (by setting their `version_id`)
251
- 3. If `CEREFOX_VERSION_CLEANUP_ENABLED` is `true`, deletes stale versions older than `CEREFOX_VERSION_RETENTION_HOURS` (skipping archived versions)
251
+ 3. If `version_cleanup_enabled` is `true`, deletes versions older than `version_retention_hours` — skipping archived versions and always keeping the most recent one. Both are `cerefox_config` settings (v1.1.0+); before that they came from each client's environment.
252
252
 
253
253
  Metadata-only updates (same content, different title or project) do **not** create a new version.
254
254
 
@@ -413,11 +413,10 @@ Two things the page does deliberately:
413
413
  `require_requestor_identity` starts rejecting agents that don't identify
414
414
  themselves. Neither is a bare toggle — you get a dialog naming the
415
415
  consequence first.
416
- - **Local overrides are shown, read-only.** If the server has
417
- `CEREFOX_MIN_SEARCH_SCORE` (or the `..._TERM_COVERAGE` / `..._SEARCH_ALPHA`
418
- equivalents) in its environment, that value beats the stored one *on that
419
- machine*, and the row says so. Without this the page would report a value the
420
- server isn't using. The page never edits `.env` — that file holds your
416
+ - **Retired `.env` lines are flagged.** If a variable that used to control a
417
+ setting is still present in the server's environment, the row says so — it no
418
+ longer does anything, and the value shown is what actually runs. The page
419
+ never edits `.env` — that file holds your
421
420
  service-role key, OpenAI key and database password, and the server only reads
422
421
  it at boot.
423
422
 
@@ -62,7 +62,9 @@ data volume, so it survives `cerefox-local upgrade`.
62
62
 
63
63
  > Scores are calibrated per embedder: with the local model the default semantic
64
64
  > threshold is **0.6** (vs 0.5 for OpenAI) because nomic scores unrelated text
65
- > higher. Override per call with `--min-score` or via `CEREFOX_MIN_SEARCH_SCORE`.
65
+ > higher. The container seeds `min_search_score = 0.6` into its own config at
66
+ > first boot; change it with `cerefox config set min_search_score <value>` or the
67
+ > Settings page, or override a single query with `--min-score`.
66
68
 
67
69
  ---
68
70
 
@@ -20,18 +20,55 @@ to re-run.
20
20
 
21
21
  ## End-user upgrade
22
22
 
23
- > **Upgrading to v1.1.0: run `cerefox server deploy`, don't defer it.** Most
24
- > releases let you postpone the server step. This one should not be postponed:
25
- > schema **0.10.2** fixes a defect where a stale or blank
26
- > `expected_content_hash` raised its conflict under a SQLSTATE that infrastructure
27
- > treats as *retryable*. Because the conflict is permanent, retry-aware layers
28
- > could replay the request without limit — one report reached ~47 million calls
29
- > over about a day and exhausted the project's disk-IO budget. The fix lives in
30
- > `rpcs.sql`, so **upgrading the client alone does not apply it**; the database
31
- > keeps the old behaviour until the RPCs are redeployed. `cerefox doctor` will
32
- > say so, and the web UI shows a banner.
23
+ > ### Upgrading to v1.1.0 — `cerefox server deploy` is required
33
24
  >
34
- > Cerefox Local users need no separate step — the schema ships inside the image.
25
+ > Most releases let you postpone the server step. **This one does not.** Until
26
+ > you redeploy, the client and the database disagree in ways that cost data:
27
+ >
28
+ > - The conflict fix that stops [unbounded retry
29
+ > storms](../../CHANGELOG.md) lives in `rpcs.sql`, so upgrading the client
30
+ > alone leaves the defect live.
31
+ > - The v1.1.0 client stops sending retention and retrieval settings and expects
32
+ > the **server** to resolve them from `cerefox_config`. An older server does
33
+ > not read those keys, so a store configured to "keep every version" silently
34
+ > reverts to pruning — quiet data loss.
35
+ >
36
+ > Because of that second point, v1.1.0 raises the **minimum supported schema**
37
+ > to `0.10.3` — the version where the RPCs began resolving those settings from
38
+ > `cerefox_config`. (The release ships schema `0.10.4`; the extra step only
39
+ > changed a default value, which degrades gracefully, so it is not part of the
40
+ > minimum. A schema bump does **not** normally raise the minimum.) What the
41
+ > minimum actually gates:
42
+ >
43
+ > | Surface | Below the minimum |
44
+ > |---|---|
45
+ > | `cerefox web` | **Refuses to start** — "Refusing to start: the deployed Cerefox server is incompatible with this client" |
46
+ > | `cerefox doctor` | Reports an error and exits non-zero |
47
+ > | Web UI banner | Red, blocking |
48
+ > | CLI commands (`search`, `document`, `ingest`, …) | **Keep working** |
49
+ > | MCP servers (local and remote) | **Keep working** |
50
+ >
51
+ > So the practical effect is: **your web UI is unavailable between upgrading the
52
+ > client and running `server deploy`.** Run them together and the window is
53
+ > seconds. Nothing is destroyed by being in that state — it exists to stop you
54
+ > operating a mismatched pair for days without noticing.
55
+ >
56
+ > **After redeploying**, carry over any settings you had tuned in `.env`.
57
+ > `cerefox doctor` lists them with the exact commands, and stops mentioning them
58
+ > once the store matches. The five retired variables are
59
+ > `CEREFOX_MIN_SEARCH_SCORE`, `CEREFOX_MIN_TERM_COVERAGE`, `CEREFOX_SEARCH_ALPHA`,
60
+ > `CEREFOX_VERSION_RETENTION_HOURS`, `CEREFOX_VERSION_CLEANUP_ENABLED`.
61
+ >
62
+ > **Version pruning is switched off on existing stores** by migration 0016, so
63
+ > the change above cannot quietly discard history. Nothing is deleted. Re-enable
64
+ > when you have chosen a policy:
65
+ > `cerefox config set version_cleanup_enabled true`. The default retention
66
+ > window is now 120 hours (was 48) — long enough that a Friday mistake is still
67
+ > recoverable on Monday.
68
+ >
69
+ > **Cerefox Local** users need no separate step: the schema ships inside the
70
+ > image, so `cerefox-local upgrade` moves both halves together.
71
+
35
72
 
36
73
  ```bash
37
74
  cerefox self-update # or: re-run the installer, or bun/npm update -g @cerefox/memory
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerefox/memory",
3
- "version": "1.1.0-beta.8",
3
+ "version": "1.1.1",
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",