@cerefox/memory 1.9.0 → 1.9.2
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/dist/bin/cerefox.js +7 -10
- package/dist/server-assets/_shared/ef-meta/index.ts +2 -2
- package/dist/server-assets/db/migrations/0029_fix_project_edit_description_audit.sql +105 -0
- package/dist/server-assets/db/rpcs.sql +8 -3
- package/dist/server-assets/db/schema.sql +1 -1
- package/docs/guides/upgrading.md +16 -3
- package/package.json +1 -1
package/dist/bin/cerefox.js
CHANGED
|
@@ -7438,7 +7438,7 @@ var exports_meta = {};
|
|
|
7438
7438
|
__export(exports_meta, {
|
|
7439
7439
|
PKG_VERSION: () => PKG_VERSION
|
|
7440
7440
|
});
|
|
7441
|
-
var PKG_VERSION = "1.9.
|
|
7441
|
+
var PKG_VERSION = "1.9.2";
|
|
7442
7442
|
var init_meta = () => {};
|
|
7443
7443
|
|
|
7444
7444
|
// ../../_shared/config/paths.ts
|
|
@@ -25802,7 +25802,7 @@ var init_bundled_docs = __esm(() => {
|
|
|
25802
25802
|
});
|
|
25803
25803
|
|
|
25804
25804
|
// ../../_shared/ef-meta/index.ts
|
|
25805
|
-
var EF_VERSION = "1.9.
|
|
25805
|
+
var EF_VERSION = "1.9.2", CEREFOX_VERSION = "1.9.2", EF_LAST_CHANGED = "1.9.0";
|
|
25806
25806
|
var init_ef_meta = () => {};
|
|
25807
25807
|
|
|
25808
25808
|
// ../../_shared/compatibility/index.ts
|
|
@@ -73413,6 +73413,7 @@ Proceed with deployment to Supabase?`, true);
|
|
|
73413
73413
|
println(c.green(`
|
|
73414
73414
|
✓ Server deploy complete.`));
|
|
73415
73415
|
println(c.dim("Verify with: cerefox doctor"));
|
|
73416
|
+
println(c.dim("Refresh the bundled guides: cerefox guides ingest"));
|
|
73416
73417
|
}
|
|
73417
73418
|
function registerDeployServer(program2) {
|
|
73418
73419
|
program2.command("deploy-server").description("Deploy/update the Cerefox server side (schema + RPCs + Edge Functions) on Supabase.").option("--dry-run", "Print the plan + pre-flight without deploying.").option("--schema-only", "Deploy/update only the schema + RPCs (skip Edge Functions).").option("--functions-only", "Deploy only the Edge Functions (skip the schema/RPCs).").option("--project-ref <ref>", "Supabase project ref for Edge Function deploys (default: derived from CEREFOX_SUPABASE_URL).").option("--yes", "Non-interactive (skip the deployment confirmation).").action(action10);
|
|
@@ -80660,14 +80661,10 @@ async function action33(options) {
|
|
|
80660
80661
|
println("");
|
|
80661
80662
|
println(c.green(`✓ Upgraded to ${target}.`));
|
|
80662
80663
|
println("");
|
|
80663
|
-
println(
|
|
80664
|
-
|
|
80665
|
-
|
|
80666
|
-
|
|
80667
|
-
if (sync.status !== 0) {
|
|
80668
|
-
println(cErr.yellow("⚠ ") + "Could not refresh self-docs (see output above).");
|
|
80669
|
-
println(c.dim(" Run `cerefox guides ingest` manually after a successful `cerefox init`."));
|
|
80670
|
-
}
|
|
80664
|
+
println("Next steps:");
|
|
80665
|
+
println(" 1. " + c.bold("cerefox server deploy") + " apply this release's schema/RPC/EF updates");
|
|
80666
|
+
println(" 2. " + c.bold("cerefox guides ingest") + " re-sync the bundled guides into your KB");
|
|
80667
|
+
println(c.dim(" (order matters: the new client may require the new schema — run the deploy first)"));
|
|
80671
80668
|
}
|
|
80672
80669
|
function registerSelfUpdate(program2) {
|
|
80673
80670
|
const desc = "Upgrade Cerefox in place. Alias: `cerefox upgrade`.";
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* doesn't touch `supabase/functions/` leaves it alone).
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
export const EF_VERSION = "1.9.
|
|
21
|
+
export const EF_VERSION = "1.9.2";
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* The Cerefox RELEASE version — what `cerefox --version` reports and what npm
|
|
@@ -36,7 +36,7 @@ export const EF_VERSION = "1.9.0";
|
|
|
36
36
|
* is imported by the Deno Edge Functions, which cannot reach into the npm
|
|
37
37
|
* package.
|
|
38
38
|
*/
|
|
39
|
-
export const CEREFOX_VERSION = "1.9.
|
|
39
|
+
export const CEREFOX_VERSION = "1.9.2";
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* The most recent version whose EF-side SOURCE actually changed (#127).
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
-- Migration 0029 — fix cerefox_update_project's description-change audit
|
|
2
|
+
-- (schema 0.14.1)
|
|
3
|
+
--
|
|
4
|
+
-- v1.9.0's cerefox_update_project appended the audit-diff fragment with
|
|
5
|
+
-- `v_changes || 'description changed'`; Postgres resolves the untyped
|
|
6
|
+
-- literal via the array||array overload and raises `malformed array
|
|
7
|
+
-- literal`, rolling back EVERY project edit that changes a description
|
|
8
|
+
-- (rename-only edits worked — their concatenation is typed TEXT). Found
|
|
9
|
+
-- live in the v1.9.0 staging dress rehearsal before any production
|
|
10
|
+
-- deployment. The fix is array_append on both branches.
|
|
11
|
+
--
|
|
12
|
+
-- The full corrected body ships inside this migration (repair-path closure,
|
|
13
|
+
-- as 0027/0028), plus the same ACL lockdown 0028 gave the original.
|
|
14
|
+
-- Re-runnable.
|
|
15
|
+
|
|
16
|
+
DROP FUNCTION IF EXISTS cerefox_update_project(UUID, TEXT, TEXT, TEXT, TEXT);
|
|
17
|
+
|
|
18
|
+
CREATE FUNCTION cerefox_update_project(
|
|
19
|
+
p_project_id UUID,
|
|
20
|
+
-- NULL = keep the current value (the #191/#204 "NULL means not provided"
|
|
21
|
+
-- convention). An explicit empty name is rejected.
|
|
22
|
+
p_name TEXT DEFAULT NULL,
|
|
23
|
+
p_description TEXT DEFAULT NULL,
|
|
24
|
+
p_author TEXT DEFAULT 'unknown',
|
|
25
|
+
p_author_type TEXT DEFAULT 'user'
|
|
26
|
+
)
|
|
27
|
+
RETURNS TABLE (
|
|
28
|
+
project_id UUID,
|
|
29
|
+
project_name TEXT,
|
|
30
|
+
project_description TEXT,
|
|
31
|
+
created_at TIMESTAMPTZ,
|
|
32
|
+
updated_at TIMESTAMPTZ
|
|
33
|
+
)
|
|
34
|
+
LANGUAGE plpgsql
|
|
35
|
+
SECURITY DEFINER
|
|
36
|
+
SET search_path = public, pg_catalog
|
|
37
|
+
AS $$
|
|
38
|
+
DECLARE
|
|
39
|
+
v_old cerefox_projects%ROWTYPE;
|
|
40
|
+
v_new cerefox_projects%ROWTYPE;
|
|
41
|
+
v_changes TEXT[] := '{}';
|
|
42
|
+
BEGIN
|
|
43
|
+
IF p_name IS NULL AND p_description IS NULL THEN
|
|
44
|
+
RAISE EXCEPTION 'Nothing to update: pass p_name and/or p_description' USING ERRCODE = '22023';
|
|
45
|
+
END IF;
|
|
46
|
+
IF p_name IS NOT NULL AND NULLIF(BTRIM(p_name), '') IS NULL THEN
|
|
47
|
+
RAISE EXCEPTION 'Project name cannot be empty' USING ERRCODE = '22023';
|
|
48
|
+
END IF;
|
|
49
|
+
|
|
50
|
+
SELECT p.* INTO v_old FROM cerefox_projects p WHERE p.id = p_project_id FOR UPDATE;
|
|
51
|
+
IF NOT FOUND THEN
|
|
52
|
+
RAISE EXCEPTION 'Project not found: %', p_project_id USING ERRCODE = '22023';
|
|
53
|
+
END IF;
|
|
54
|
+
|
|
55
|
+
UPDATE cerefox_projects SET
|
|
56
|
+
name = COALESCE(BTRIM(p_name), name),
|
|
57
|
+
description = COALESCE(p_description, description),
|
|
58
|
+
updated_at = NOW()
|
|
59
|
+
WHERE id = p_project_id
|
|
60
|
+
RETURNING * INTO v_new;
|
|
61
|
+
|
|
62
|
+
-- The trail records what actually changed, not which arguments arrived.
|
|
63
|
+
-- array_append, NOT `||`: with an untyped string literal on the right,
|
|
64
|
+
-- `TEXT[] || 'literal'` resolves to the array||array overload and dies
|
|
65
|
+
-- with `malformed array literal` — found LIVE on staging (v1.9.0; every
|
|
66
|
+
-- description-only edit failed; the rename branch only survived because
|
|
67
|
+
-- its parenthesized concatenation is typed TEXT).
|
|
68
|
+
IF v_new.name <> v_old.name THEN
|
|
69
|
+
v_changes := array_append(v_changes, 'renamed ''' || v_old.name || ''' → ''' || v_new.name || '''');
|
|
70
|
+
END IF;
|
|
71
|
+
IF COALESCE(v_new.description, '') <> COALESCE(v_old.description, '') THEN
|
|
72
|
+
v_changes := array_append(v_changes, 'description changed');
|
|
73
|
+
END IF;
|
|
74
|
+
|
|
75
|
+
PERFORM cerefox_create_audit_entry(
|
|
76
|
+
p_operation := 'project-edit',
|
|
77
|
+
p_author := p_author,
|
|
78
|
+
p_author_type := p_author_type,
|
|
79
|
+
p_description := 'Project ''' || v_new.name || ''' edited ('
|
|
80
|
+
|| COALESCE(NULLIF(array_to_string(v_changes, '; '), ''), 'no-op') || ')'
|
|
81
|
+
);
|
|
82
|
+
RETURN QUERY SELECT v_new.id, v_new.name, v_new.description,
|
|
83
|
+
v_new.created_at, v_new.updated_at;
|
|
84
|
+
END;
|
|
85
|
+
$$;
|
|
86
|
+
|
|
87
|
+
DO $$
|
|
88
|
+
DECLARE
|
|
89
|
+
r TEXT;
|
|
90
|
+
BEGIN
|
|
91
|
+
REVOKE EXECUTE ON FUNCTION cerefox_update_project(UUID, TEXT, TEXT, TEXT, TEXT) FROM PUBLIC;
|
|
92
|
+
FOREACH r IN ARRAY ARRAY['anon', 'authenticated'] LOOP
|
|
93
|
+
IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = r) THEN
|
|
94
|
+
EXECUTE format('REVOKE EXECUTE ON FUNCTION cerefox_update_project(UUID, TEXT, TEXT, TEXT, TEXT) FROM %I', r);
|
|
95
|
+
END IF;
|
|
96
|
+
END LOOP;
|
|
97
|
+
IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'service_role') THEN
|
|
98
|
+
GRANT EXECUTE ON FUNCTION cerefox_update_project(UUID, TEXT, TEXT, TEXT, TEXT) TO service_role;
|
|
99
|
+
END IF;
|
|
100
|
+
END $$;
|
|
101
|
+
|
|
102
|
+
DO $$
|
|
103
|
+
BEGIN
|
|
104
|
+
RAISE NOTICE 'Migration 0029: fixed the project-edit description audit (array_append; description-only edits no longer fail).';
|
|
105
|
+
END $$;
|
|
@@ -2118,11 +2118,16 @@ BEGIN
|
|
|
2118
2118
|
RETURNING * INTO v_new;
|
|
2119
2119
|
|
|
2120
2120
|
-- The trail records what actually changed, not which arguments arrived.
|
|
2121
|
+
-- array_append, NOT `||`: with an untyped string literal on the right,
|
|
2122
|
+
-- `TEXT[] || 'literal'` resolves to the array||array overload and dies
|
|
2123
|
+
-- with `malformed array literal` — found LIVE on staging (v1.9.0; every
|
|
2124
|
+
-- description-only edit failed; the rename branch only survived because
|
|
2125
|
+
-- its parenthesized concatenation is typed TEXT).
|
|
2121
2126
|
IF v_new.name <> v_old.name THEN
|
|
2122
|
-
v_changes := v_changes
|
|
2127
|
+
v_changes := array_append(v_changes, 'renamed ''' || v_old.name || ''' → ''' || v_new.name || '''');
|
|
2123
2128
|
END IF;
|
|
2124
2129
|
IF COALESCE(v_new.description, '') <> COALESCE(v_old.description, '') THEN
|
|
2125
|
-
v_changes := v_changes
|
|
2130
|
+
v_changes := array_append(v_changes, 'description changed');
|
|
2126
2131
|
END IF;
|
|
2127
2132
|
|
|
2128
2133
|
PERFORM cerefox_create_audit_entry(
|
|
@@ -3012,7 +3017,7 @@ AS $$
|
|
|
3012
3017
|
-- 0.11.0 supersedes 0.10.6 (v1.2.1, #191): this branch carries that fix plus
|
|
3013
3018
|
-- the partial-edit surface, and both migrations (0019, 0020) are in the
|
|
3014
3019
|
-- sequence, so a store deploying this gets everything from both lines.
|
|
3015
|
-
SELECT '0.14.
|
|
3020
|
+
SELECT '0.14.1'::TEXT;
|
|
3016
3021
|
$$;
|
|
3017
3022
|
|
|
3018
3023
|
-- ── cerefox_find_dead_links ──────────────────────────────────────────────────
|
|
@@ -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.14.
|
|
8
|
+
-- @version: 0.14.1
|
|
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 —
|
package/docs/guides/upgrading.md
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
# Upgrading Cerefox
|
|
2
2
|
|
|
3
|
-
Upgrading is almost always
|
|
4
|
-
server side if the release changed it
|
|
5
|
-
to re-run.
|
|
3
|
+
Upgrading is almost always three steps, **in this order**: update the CLI,
|
|
4
|
+
re-deploy the server side if the release changed it, then re-sync the bundled
|
|
5
|
+
guides. Everything here is idempotent and safe to re-run.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
cerefox self-update # 1. the client
|
|
9
|
+
cerefox server deploy # 2. schema + RPCs + Edge Functions (if the release changed them)
|
|
10
|
+
cerefox guides ingest # 3. the bundled guides, into your KB
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The order matters: a release may require its own schema (the version notes
|
|
14
|
+
say so — v1.9.x is one), and until `server deploy` runs, the freshly updated
|
|
15
|
+
client is talking to the previous release's server. That is why
|
|
16
|
+
`self-update` no longer runs the guides sync automatically — it used to fire
|
|
17
|
+
at the one moment in the upgrade where it cannot succeed against a
|
|
18
|
+
schema-requiring release.
|
|
6
19
|
|
|
7
20
|
## Pick your path
|
|
8
21
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cerefox/memory",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.2",
|
|
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",
|