@cerefox/memory 1.13.0 → 1.13.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/AGENT_GUIDE.md +33 -33
- package/AGENT_QUICK_REFERENCE.md +19 -19
- package/dist/bin/cerefox.js +124 -133
- package/dist/server-assets/_shared/ef-meta/index.ts +3 -3
- package/dist/server-assets/_shared/mcp-tools/audit-log.ts +10 -8
- package/dist/server-assets/_shared/mcp-tools/delete-document.ts +4 -10
- package/dist/server-assets/_shared/mcp-tools/feature-flags.ts +4 -3
- package/dist/server-assets/_shared/mcp-tools/get-document.ts +3 -6
- package/dist/server-assets/_shared/mcp-tools/get-help-content.ts +4 -4
- package/dist/server-assets/_shared/mcp-tools/get-help.ts +3 -6
- package/dist/server-assets/_shared/mcp-tools/identity.ts +48 -0
- package/dist/server-assets/_shared/mcp-tools/ingest.ts +3 -6
- package/dist/server-assets/_shared/mcp-tools/list-metadata-keys.ts +3 -6
- package/dist/server-assets/_shared/mcp-tools/list-projects.ts +3 -6
- package/dist/server-assets/_shared/mcp-tools/list-versions.ts +3 -6
- package/dist/server-assets/_shared/mcp-tools/metadata-search.ts +3 -6
- package/dist/server-assets/_shared/mcp-tools/partial-edits.ts +5 -10
- package/dist/server-assets/_shared/mcp-tools/relations.ts +11 -12
- package/dist/server-assets/_shared/mcp-tools/restore-document.ts +4 -10
- package/dist/server-assets/_shared/mcp-tools/search.ts +3 -6
- package/dist/server-assets/_shared/mcp-tools/set-document-metadata.ts +4 -10
- package/dist/server-assets/_shared/mcp-tools/set-document-projects.ts +3 -6
- package/dist/server-assets/db/migrations/0031_review_workflow_toggle.sql +4 -2
- package/dist/server-assets/db/rpcs.sql +19 -12
- package/dist/server-assets/db/schema.sql +4 -4
- package/dist/server-assets/supabase/functions/cerefox-get-audit-log/index.ts +7 -5
- package/dist/server-assets/supabase/functions/cerefox-get-document/index.ts +5 -4
- package/dist/server-assets/supabase/functions/cerefox-ingest/index.ts +7 -3
- package/dist/server-assets/supabase/functions/cerefox-list-projects/index.ts +6 -5
- package/dist/server-assets/supabase/functions/cerefox-list-versions/index.ts +5 -4
- package/dist/server-assets/supabase/functions/cerefox-mcp/index.ts +6 -6
- package/dist/server-assets/supabase/functions/cerefox-metadata/index.ts +5 -4
- package/dist/server-assets/supabase/functions/cerefox-metadata-search/index.ts +5 -4
- package/dist/server-assets/supabase/functions/cerefox-search/index.ts +7 -4
- package/docs/guides/cli.md +20 -20
- package/docs/guides/configuration.md +37 -25
- package/docs/guides/connect-agents.md +47 -31
- package/docs/guides/upgrading.md +11 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import "jsr:@supabase/functions-js/edge-runtime.d.ts";
|
|
|
2
2
|
import { createClient } from "jsr:@supabase/supabase-js@2";
|
|
3
3
|
import { isVersionRequest, versionResponse } from "../../../_shared/ef-meta/index.ts";
|
|
4
4
|
import { efAuthGate } from "../../../_shared/ef-auth/index.ts";
|
|
5
|
+
import { callerIdentity } from "../../../_shared/mcp-tools/identity.ts";
|
|
5
6
|
import { reviewWorkflowEnabled } from "../../../_shared/mcp-tools/feature-flags.ts";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -110,9 +111,9 @@ Deno.serve(async (req: Request): Promise<Response> => {
|
|
|
110
111
|
const supabaseKey = Deno.env.get("SUPABASE_SERVICE_ROLE_KEY")!;
|
|
111
112
|
const supabase = createClient(supabaseUrl, supabaseKey);
|
|
112
113
|
|
|
113
|
-
// Configurable requestor
|
|
114
|
-
const identityField = "
|
|
115
|
-
const identityValue = body
|
|
114
|
+
// Configurable caller-identity enforcement: `author`, or `requestor` as the pre-1.13.2 alias (#244)
|
|
115
|
+
const identityField = "author";
|
|
116
|
+
const identityValue = callerIdentity(body as Record<string, unknown>);
|
|
116
117
|
const { data: reqConfig } = await supabase.rpc("cerefox_get_config", { p_key: "require_requestor_identity" });
|
|
117
118
|
if (reqConfig === "true") {
|
|
118
119
|
if (!identityValue || (typeof identityValue === "string" && identityValue.trim() === "")) {
|
|
@@ -157,7 +158,7 @@ Deno.serve(async (req: Request): Promise<Response> => {
|
|
|
157
158
|
Promise.resolve(supabase.rpc("cerefox_log_usage", {
|
|
158
159
|
p_operation: "metadata_search",
|
|
159
160
|
p_access_path: "edge-function",
|
|
160
|
-
p_requestor:
|
|
161
|
+
p_requestor: identityValue ?? null,
|
|
161
162
|
p_query_text: JSON.stringify(metadata_filter),
|
|
162
163
|
p_result_count: (data ?? []).length,
|
|
163
164
|
p_project_id: project_id,
|
|
@@ -2,6 +2,7 @@ import "jsr:@supabase/functions-js/edge-runtime.d.ts";
|
|
|
2
2
|
import { createClient } from "jsr:@supabase/supabase-js@2";
|
|
3
3
|
import { isVersionRequest, versionResponse } from "../../../_shared/ef-meta/index.ts";
|
|
4
4
|
import { efAuthGate } from "../../../_shared/ef-auth/index.ts";
|
|
5
|
+
import { callerIdentity } from "../../../_shared/mcp-tools/identity.ts";
|
|
5
6
|
import { capEmbeddingInput } from "../../../_shared/embeddings/index.ts";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -67,6 +68,8 @@ interface SearchRequest {
|
|
|
67
68
|
min_score?: number;
|
|
68
69
|
metadata_filter?: Record<string, string> | null;
|
|
69
70
|
max_bytes?: number;
|
|
71
|
+
author?: string;
|
|
72
|
+
/** Pre-1.13.2 spelling of `author`; still accepted. */
|
|
70
73
|
requestor?: string;
|
|
71
74
|
}
|
|
72
75
|
|
|
@@ -266,9 +269,9 @@ Deno.serve(async (req: Request) => {
|
|
|
266
269
|
const supabaseKey = Deno.env.get("SUPABASE_SERVICE_ROLE_KEY")!;
|
|
267
270
|
const supabase = createClient(supabaseUrl, supabaseKey);
|
|
268
271
|
|
|
269
|
-
// Configurable requestor
|
|
270
|
-
const identityField = "
|
|
271
|
-
const identityValue = body
|
|
272
|
+
// Configurable caller-identity enforcement: `author`, or `requestor` as the pre-1.13.2 alias (#244)
|
|
273
|
+
const identityField = "author";
|
|
274
|
+
const identityValue = callerIdentity(body as unknown as Record<string, unknown>);
|
|
272
275
|
const { data: reqConfig } = await supabase.rpc("cerefox_get_config", { p_key: "require_requestor_identity" });
|
|
273
276
|
if (reqConfig === "true") {
|
|
274
277
|
if (!identityValue || (typeof identityValue === "string" && identityValue.trim() === "")) {
|
|
@@ -377,7 +380,7 @@ Deno.serve(async (req: Request) => {
|
|
|
377
380
|
Promise.resolve(supabase.rpc("cerefox_log_usage", {
|
|
378
381
|
p_operation: "search",
|
|
379
382
|
p_access_path: "edge-function",
|
|
380
|
-
p_requestor:
|
|
383
|
+
p_requestor: identityValue ?? null,
|
|
381
384
|
p_query_text: query,
|
|
382
385
|
p_result_count: accepted.length,
|
|
383
386
|
p_project_id: projectId,
|
package/docs/guides/cli.md
CHANGED
|
@@ -50,7 +50,7 @@ cerefox document ingest --paste --title "<title>" [OPTIONS] # stdin
|
|
|
50
50
|
| `--last-write-wins` | — | flag | off | Skip the concurrency check and overwrite regardless of concurrent changes. For re-sync flows where an external source of truth makes conflicts meaningless. Recorded in the audit log. |
|
|
51
51
|
| `--source` | — | str | `paste` / `file` | Source label recorded on the document. |
|
|
52
52
|
| `--author` | — | str | `CEREFOX_AUTHOR_NAME` or `unknown` | Audit-log author identity. |
|
|
53
|
-
| `--author-type` | — | `user`\|`agent` | `CEREFOX_AUTHOR_TYPE` or `user` | Caller type. Agent writes
|
|
53
|
+
| `--author-type` | — | `user`\|`agent` | `CEREFOX_AUTHOR_TYPE` or `user` | Caller type. Agent writes are recorded `pending_review`, user writes `approved`; the store's `review_workflow_enabled` flag decides whether that status is shown. |
|
|
54
54
|
|
|
55
55
|
**Examples**:
|
|
56
56
|
```bash
|
|
@@ -149,14 +149,14 @@ cerefox search [OPTIONS] QUERY
|
|
|
149
149
|
| `--metadata-filter <json>` (`-f`) | JSON | _none_ | JSONB metadata containment filter, e.g. `'{"type":"decision"}'`. |
|
|
150
150
|
| `--max-bytes <n>` | int | `200000` | Response size budget in bytes. |
|
|
151
151
|
| `--only-metadata` | flag | off | List matching docs (id, score, chunks, chars) without content — a compact listing. |
|
|
152
|
-
| `--
|
|
152
|
+
| `--author <name>` (`-a`) | str | `CEREFOX_REQUESTOR_NAME`, then `CEREFOX_AUTHOR_NAME`, else `unknown` | Your name (agent or user), recorded in the usage log. `--requestor` (`-r`) still works as a hidden alias (v1.13.2). |
|
|
153
153
|
| `--json` | flag | off | Machine-readable JSON output. |
|
|
154
154
|
|
|
155
155
|
**Examples**:
|
|
156
156
|
```bash
|
|
157
157
|
cerefox search "OAuth design"
|
|
158
158
|
cerefox search "decisions" --metadata-filter '{"type":"decision-log"}' --match-count 5
|
|
159
|
-
cerefox search "what we tried" --mode hybrid --
|
|
159
|
+
cerefox search "what we tried" --mode hybrid --author "claude-code"
|
|
160
160
|
cerefox search "design docs" --only-metadata
|
|
161
161
|
```
|
|
162
162
|
|
|
@@ -182,7 +182,7 @@ cerefox document get [OPTIONS] DOCUMENT_ID
|
|
|
182
182
|
| Flag | Type | Default | Description |
|
|
183
183
|
|---|---|---|---|
|
|
184
184
|
| `--version-id <uuid>` | UUID | _none_ (current) | Archived version UUID — get from `cerefox document version list`. |
|
|
185
|
-
| `--
|
|
185
|
+
| `--author <name>` (`-a`) | str | `CEREFOX_REQUESTOR_NAME`, then `CEREFOX_AUTHOR_NAME`, else `unknown` | Your name (agent or user), recorded in the usage log. `--requestor` (`-r`) still works as a hidden alias (v1.13.2). |
|
|
186
186
|
| `--json` | flag | off | Machine-readable JSON output. |
|
|
187
187
|
|
|
188
188
|
**Examples**:
|
|
@@ -394,7 +394,7 @@ cerefox document version list [OPTIONS] DOCUMENT_ID
|
|
|
394
394
|
|
|
395
395
|
| Flag | Type | Default | Description |
|
|
396
396
|
|---|---|---|---|
|
|
397
|
-
| `--
|
|
397
|
+
| `--author TEXT` (`-a`) | str | `CEREFOX_REQUESTOR_NAME`, then `CEREFOX_AUTHOR_NAME`, else `unknown` | Your name (agent or user), recorded in the usage log. `--requestor` (`-r`) still works as a hidden alias (v1.13.2). |
|
|
398
398
|
|
|
399
399
|
**Output**: table with version number, created timestamp, source, chunk/char counts, and version UUID. Pass the UUID to `cerefox document get --version-id <uuid>` to retrieve the archived content.
|
|
400
400
|
|
|
@@ -429,7 +429,7 @@ cerefox project list [OPTIONS]
|
|
|
429
429
|
|
|
430
430
|
| Flag | Type | Default | Description |
|
|
431
431
|
|---|---|---|---|
|
|
432
|
-
| `--
|
|
432
|
+
| `--author TEXT` (`-a`) | str | `CEREFOX_REQUESTOR_NAME`, then `CEREFOX_AUTHOR_NAME`, else `unknown` | Your name (agent or user), recorded in the usage log. `--requestor` (`-r`) still works as a hidden alias (v1.13.2). |
|
|
433
433
|
|
|
434
434
|
**MCP equivalent**: [`cerefox_list_projects`](../../AGENT_GUIDE.md).
|
|
435
435
|
|
|
@@ -498,7 +498,7 @@ cerefox metadata search --metadata-filter '<json>' [OPTIONS]
|
|
|
498
498
|
| `--created-since TEXT` | ISO-8601 | _none_ | Documents created after this timestamp. |
|
|
499
499
|
| `--limit INTEGER` | int | `10` | Max results. |
|
|
500
500
|
| `--include-content` | flag | off | Include full document content (slower; subject to byte budget). |
|
|
501
|
-
| `--
|
|
501
|
+
| `--author TEXT` (`-a`) | str | `CEREFOX_REQUESTOR_NAME`, then `CEREFOX_AUTHOR_NAME`, else `unknown` | Your name (agent or user), recorded in the usage log. `--requestor` (`-r`) still works as a hidden alias (v1.13.2). |
|
|
502
502
|
|
|
503
503
|
**Examples**:
|
|
504
504
|
```bash
|
|
@@ -526,13 +526,13 @@ cerefox audit list [OPTIONS]
|
|
|
526
526
|
| Flag | Type | Default | Description |
|
|
527
527
|
|---|---|---|---|
|
|
528
528
|
| `--document-id TEXT` | UUID | _none_ | Filter to a single document. |
|
|
529
|
-
| `--author TEXT` | str | _none_ | Filter by author name (exact match). |
|
|
529
|
+
| `--by-author TEXT` | str | _none_ | Filter: only entries written by this author name (exact match). Until v1.13.2 this filter was `--author`; `--author` is now the caller identity here, as on every other command. |
|
|
530
530
|
| `--operation TEXT` | choice | _none_ | Filter by operation type: `create`, `update-content`, `update-metadata`, `insert`, `replace-section`, `delete-section`, `rename-section`, `delete`, `restore`, `status-change`, `archive`, `unarchive`, `config-change`, `project-create`, `project-edit`, `project-delete`. |
|
|
531
531
|
| `--since TEXT` | ISO-8601 | _none_ | Lower bound on `created_at`. |
|
|
532
532
|
| `--until TEXT` | ISO-8601 | _none_ | Upper bound on `created_at`. |
|
|
533
533
|
| `--limit INTEGER` | int | `50` | Max rows. |
|
|
534
534
|
| `--json` | flag | off | Emit one JSON object per line (for piping to `jq` / scripts). |
|
|
535
|
-
| `--
|
|
535
|
+
| `--author TEXT` (`-a`) | str | `CEREFOX_REQUESTOR_NAME`, then `CEREFOX_AUTHOR_NAME`, else `unknown` | Your name (agent or user), recorded in the usage log. `--requestor` (`-r`) still works as a hidden alias (v1.13.2). |
|
|
536
536
|
|
|
537
537
|
**Examples**:
|
|
538
538
|
```bash
|
|
@@ -791,7 +791,7 @@ The CLI reads its own runtime config from environment (or `.env`). See [`configu
|
|
|
791
791
|
|---|---|---|
|
|
792
792
|
| `CEREFOX_AUTHOR_NAME` | `unknown` | Default for `--author` on `ingest` / `ingest-dir`. |
|
|
793
793
|
| `CEREFOX_AUTHOR_TYPE` | `user` | Default for `--author-type`. |
|
|
794
|
-
| `CEREFOX_REQUESTOR_NAME` | `user` | Default for `--
|
|
794
|
+
| `CEREFOX_REQUESTOR_NAME` | `user` | Default for `--author` on read commands (falls back to `CEREFOX_AUTHOR_NAME`). |
|
|
795
795
|
|
|
796
796
|
Precedence: **CLI flag > env var > built-in default**.
|
|
797
797
|
|
|
@@ -811,21 +811,21 @@ Every MCP parameter has an exact-name CLI flag (kebab-cased). Short forms exist
|
|
|
811
811
|
|
|
812
812
|
| MCP tool | CLI command |
|
|
813
813
|
|---|---|
|
|
814
|
-
| `cerefox_search(query, match_count, project_name, metadata_filter,
|
|
814
|
+
| `cerefox_search(query, match_count, project_name, metadata_filter, author)` | `cerefox search "<q>" --match-count N --project-name <name> --metadata-filter '<json>' --author <name>` |
|
|
815
815
|
| `cerefox_ingest(title, content, project_name, metadata, update_if_exists, document_id, expected_content_hash, last_write_wins, source, author, author_type)` (file) | `cerefox document ingest <path> --title <t> --project-name <n> --metadata '<json>' --update-if-exists\|--document-id <uuid> --expected-content-hash <hash>\|--last-write-wins --source <s> --author <a> --author-type <t>` |
|
|
816
816
|
| `cerefox_ingest(...)` (paste) | `printf '...' \| cerefox document ingest --paste --title "<t>"` (same flags) |
|
|
817
|
-
| `cerefox_get_document(document_id, version_id, outline,
|
|
818
|
-
| `cerefox_insert(document_id, text, position, anchor_heading, section_part, expected_content_hash,
|
|
819
|
-
| `cerefox_edit(document_id, operations, expected_content_hash,
|
|
820
|
-
| `cerefox_list_versions(document_id,
|
|
821
|
-
| `cerefox_list_projects(
|
|
817
|
+
| `cerefox_get_document(document_id, version_id, outline, author)` | `cerefox document get <id> --version-id <vid> --outline --author <name>` |
|
|
818
|
+
| `cerefox_insert(document_id, text, position, anchor_heading, section_part, expected_content_hash, author)` | `cerefox document insert <id> -t <text\|-\|@file> -p <position> -a <anchor> --section-part <part> --expected-hash <hash> --author <name>` |
|
|
819
|
+
| `cerefox_edit(document_id, operations, expected_content_hash, author)` | `cerefox document edit-parts <id> -o <json\|-\|@file> --expected-hash <hash> --author <name>` |
|
|
820
|
+
| `cerefox_list_versions(document_id, author)` | `cerefox document version list <id> --author <name>` |
|
|
821
|
+
| `cerefox_list_projects(author)` | `cerefox project list --author <name>` |
|
|
822
822
|
| `cerefox_set_document_projects(document_id, project_names, author)` | `cerefox document set-projects <id> <name...> --author <a> --author-type <t>` (or `--clear` to remove all) |
|
|
823
823
|
| `cerefox_list_metadata_keys()` | `cerefox metadata keys` |
|
|
824
|
-
| `cerefox_metadata_search(metadata_filter, project_name, updated_since, created_since, limit, include_content,
|
|
825
|
-
| `cerefox_get_audit_log(document_id,
|
|
824
|
+
| `cerefox_metadata_search(metadata_filter, project_name, updated_since, created_since, limit, include_content, author)` | `cerefox metadata search --metadata-filter '<json>' --project-name <n> --updated-since <iso> --created-since <iso> --limit N --include-content --author <name>` |
|
|
825
|
+
| `cerefox_get_audit_log(document_id, by_author, operation, since, until, limit, author)` | `cerefox audit list --document-id <id> --by-author <a> --operation <op> --since <iso> --until <iso> --limit N --author <name>` |
|
|
826
826
|
| `cerefox_set_document_metadata(document_id, metadata, replace, author)` | `cerefox document set-metadata <id> --set key=value` (also `--remove key`, `--json '<json>'`, `--replace`) |
|
|
827
|
-
| `cerefox_delete_document(document_id, expected_content_hash, reason, author
|
|
828
|
-
| `cerefox_restore_document(document_id, reason, author
|
|
827
|
+
| `cerefox_delete_document(document_id, expected_content_hash, reason, author)` | `cerefox document delete <id> --reason <text> --author <a> --author-type <t> --yes` (confirms interactively instead of requiring the hash) |
|
|
828
|
+
| `cerefox_restore_document(document_id, reason, author)` | `cerefox document restore <id> --reason <text> --author <a> --author-type <t>` |
|
|
829
829
|
|
|
830
830
|
## CLI ↔ MCP parity matrix
|
|
831
831
|
|
|
@@ -480,14 +480,23 @@ cerefox config get usage_tracking_enabled
|
|
|
480
480
|
|
|
481
481
|
## Requestor Identity Enforcement
|
|
482
482
|
|
|
483
|
-
By default, the `
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
483
|
+
By default, the `author` parameter on the MCP tools is optional. When omitted, it
|
|
484
|
+
defaults to `"mcp-agent"`. This means the usage log shows `"mcp-agent"` for all calls
|
|
485
|
+
that don't explicitly identify themselves, making analytics less useful in
|
|
486
|
+
multi-agent setups.
|
|
487
|
+
|
|
488
|
+
Since v1.13.1 every MCP tool takes the caller's identity as **`author`**, reads and
|
|
489
|
+
writes alike; `requestor` (the pre-1.13.1 name on most tools) is still accepted as
|
|
490
|
+
a silent alias. (On `cerefox_get_audit_log` the entries filter, formerly `author`,
|
|
491
|
+
is now `by_author`.) Since v1.13.2 the CLI (`--author` on every command,
|
|
492
|
+
`--requestor` a hidden alias, `--by-author` the audit-list filter) and the
|
|
493
|
+
primitive Edge Functions used by GPT Actions (`author` in every request body,
|
|
494
|
+
`requestor` an alias, `by_author` on `cerefox-get-audit-log`) follow the same
|
|
495
|
+
rule, so there is one name on every surface.
|
|
496
|
+
|
|
497
|
+
You can optionally enforce caller identification so that tool calls must include
|
|
498
|
+
an identity. Calls without one receive a JSON-RPC `-32602` error with a helpful
|
|
499
|
+
message telling the agent what to provide.
|
|
491
500
|
|
|
492
501
|
### What it actually covers
|
|
493
502
|
|
|
@@ -516,7 +525,7 @@ tenth copy of the same block. Raise an issue rather than assuming it is there.
|
|
|
516
525
|
### Enabling enforcement
|
|
517
526
|
|
|
518
527
|
```bash
|
|
519
|
-
# Require all MCP tool calls to include requestor
|
|
528
|
+
# Require all MCP tool calls to include author (or the requestor alias)
|
|
520
529
|
cerefox config set require_requestor_identity true
|
|
521
530
|
|
|
522
531
|
# Optionally override the default naming format (regex)
|
|
@@ -532,7 +541,7 @@ cerefox config set requestor_identity_format "^[a-z]+:[a-z]+$"
|
|
|
532
541
|
| `^[a-z]+:[a-z]+$` | `conclave:agent` format only | Multi-conclave setups (e.g., `personal:steward`) |
|
|
533
542
|
| (empty string) | Any non-empty string | No format restriction |
|
|
534
543
|
|
|
535
|
-
The format is applied to
|
|
544
|
+
The format is applied to whichever identity field the call carries (`author`, or the `requestor` alias).
|
|
536
545
|
|
|
537
546
|
### Disabling enforcement
|
|
538
547
|
|
|
@@ -540,7 +549,7 @@ The format is applied to both `requestor` (read tools) and `author` (ingest).
|
|
|
540
549
|
cerefox config set require_requestor_identity false
|
|
541
550
|
```
|
|
542
551
|
|
|
543
|
-
When disabled, the
|
|
552
|
+
When disabled, the identity parameter remains optional with the `"mcp-agent"` default.
|
|
544
553
|
This is the default state -- no configuration needed for backward compatibility.
|
|
545
554
|
|
|
546
555
|
---
|
|
@@ -570,20 +579,23 @@ cerefox config set review_workflow_enabled true # or false; also in Settings
|
|
|
570
579
|
cerefox doctor # prints "review workflow ON …" / "OFF …"
|
|
571
580
|
```
|
|
572
581
|
|
|
573
|
-
**With the workflow off, the feature is
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
anything and flipping it on does not
|
|
584
|
-
`pending_review` are still pending, and
|
|
585
|
-
|
|
586
|
-
|
|
582
|
+
**With the workflow off, the feature is hidden, not dimmed.** No surface
|
|
583
|
+
shows or enforces a `review_status`: the web pill, badges and search chip do
|
|
584
|
+
not render; the CLI drops its `status` column; API, MCP and Edge Function rows
|
|
585
|
+
carry no `review_status` key; `GET /api/v1/search?review_status=…` is a `400`;
|
|
586
|
+
and `POST /api/v1/documents/{id}/review-status` is a `404`.
|
|
587
|
+
|
|
588
|
+
**The flag hides; it never rewrites.** Writes are recorded the same way in
|
|
589
|
+
both states — agent writes `pending_review`, user writes `approved`, decided
|
|
590
|
+
once inside the `cerefox_ingest_document` RPC so every access path (CLI, local
|
|
591
|
+
and remote MCP, Edge Functions, web) behaves alike, including older clients.
|
|
592
|
+
Flipping the flag off does not approve anything and flipping it on does not
|
|
593
|
+
queue anything; documents that were `pending_review` are still pending, and a
|
|
594
|
+
document an agent wrote while the workflow was off is pending too, shown as
|
|
595
|
+
such the moment the flag is on again. (v1.13.0 stored `approved` for every
|
|
596
|
+
write while off; v1.13.1 corrected that.) Attribution and the audit log are
|
|
597
|
+
unaffected in both states — who wrote what is always recorded. Config changes
|
|
598
|
+
are audited too.
|
|
587
599
|
|
|
588
600
|
Design: [`docs/specs/review-workflow-toggle.md`](../specs/review-workflow-toggle.md).
|
|
589
601
|
|
|
@@ -221,7 +221,7 @@ You have access to a personal knowledge base via Cerefox MCP tools.
|
|
|
221
221
|
When answering questions, always call cerefox_search first with a relevant query.
|
|
222
222
|
Cite doc_title for every claim drawn from the knowledge base.
|
|
223
223
|
Use cerefox_ingest to save anything the user asks you to remember.
|
|
224
|
-
Always set
|
|
224
|
+
Always set the author parameter to identify yourself.
|
|
225
225
|
For the full tool reference, search Cerefox for "How AI Agents Use Cerefox".
|
|
226
226
|
```
|
|
227
227
|
|
|
@@ -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:
|
|
641
|
+
version: 4.0.0
|
|
642
642
|
servers:
|
|
643
643
|
- url: https://<your-project-ref>.supabase.co/functions/v1
|
|
644
644
|
paths:
|
|
@@ -698,11 +698,12 @@ paths:
|
|
|
698
698
|
Whole results are dropped (never truncated mid-document) until
|
|
699
699
|
the budget is met; the response sets `truncated: true` when this
|
|
700
700
|
happens. Advanced; leave unset for the default.
|
|
701
|
-
|
|
701
|
+
author:
|
|
702
702
|
type: string
|
|
703
703
|
description: >
|
|
704
|
-
|
|
705
|
-
|
|
704
|
+
Your name (agent or user), e.g. "ChatGPT". Recorded in the
|
|
705
|
+
usage log for attribution. Optional. `requestor` is still
|
|
706
|
+
accepted as an alias.
|
|
706
707
|
responses:
|
|
707
708
|
'200':
|
|
708
709
|
description: >
|
|
@@ -798,10 +799,10 @@ paths:
|
|
|
798
799
|
default: agent
|
|
799
800
|
description: >
|
|
800
801
|
Whether this write is from a human user or an AI agent.
|
|
801
|
-
Always recorded for attribution.
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
802
|
+
Always recorded for attribution. Agent writes are recorded
|
|
803
|
+
pending_review and user writes approved; the store's review
|
|
804
|
+
workflow flag (review_workflow_enabled) only decides whether
|
|
805
|
+
that status is shown.
|
|
805
806
|
responses:
|
|
806
807
|
'200':
|
|
807
808
|
description: >
|
|
@@ -847,9 +848,11 @@ paths:
|
|
|
847
848
|
schema:
|
|
848
849
|
type: object
|
|
849
850
|
properties:
|
|
850
|
-
|
|
851
|
+
author:
|
|
851
852
|
type: string
|
|
852
|
-
description:
|
|
853
|
+
description: >
|
|
854
|
+
Your name (agent or user). Recorded in the usage log.
|
|
855
|
+
Optional. `requestor` is still accepted as an alias.
|
|
853
856
|
responses:
|
|
854
857
|
'200':
|
|
855
858
|
description: Array of metadata keys with doc_count and example_values
|
|
@@ -875,9 +878,11 @@ paths:
|
|
|
875
878
|
description: >
|
|
876
879
|
UUID of a specific archived version to retrieve. Omit (or pass null)
|
|
877
880
|
for the current version. Version UUIDs are returned by listVersions.
|
|
878
|
-
|
|
881
|
+
author:
|
|
879
882
|
type: string
|
|
880
|
-
description:
|
|
883
|
+
description: >
|
|
884
|
+
Your name (agent or user). Recorded in the usage log.
|
|
885
|
+
Optional. `requestor` is still accepted as an alias.
|
|
881
886
|
responses:
|
|
882
887
|
'200':
|
|
883
888
|
description: >
|
|
@@ -905,9 +910,11 @@ paths:
|
|
|
905
910
|
document_id:
|
|
906
911
|
type: string
|
|
907
912
|
description: UUID of the document whose version history to list
|
|
908
|
-
|
|
913
|
+
author:
|
|
909
914
|
type: string
|
|
910
|
-
description:
|
|
915
|
+
description: >
|
|
916
|
+
Your name (agent or user). Recorded in the usage log.
|
|
917
|
+
Optional. `requestor` is still accepted as an alias.
|
|
911
918
|
responses:
|
|
912
919
|
'200':
|
|
913
920
|
description: >
|
|
@@ -929,9 +936,12 @@ paths:
|
|
|
929
936
|
document_id:
|
|
930
937
|
type: string
|
|
931
938
|
description: Filter by document UUID (optional)
|
|
932
|
-
|
|
939
|
+
by_author:
|
|
933
940
|
type: string
|
|
934
|
-
description:
|
|
941
|
+
description: >
|
|
942
|
+
Filter: only entries written by this author name (optional).
|
|
943
|
+
Was `author` before v1.13.2; `author` is now the caller's
|
|
944
|
+
identity here, as on every other operation.
|
|
935
945
|
operation:
|
|
936
946
|
type: string
|
|
937
947
|
description: >
|
|
@@ -949,9 +959,11 @@ paths:
|
|
|
949
959
|
type: integer
|
|
950
960
|
default: 50
|
|
951
961
|
description: Max entries to return (max 200)
|
|
952
|
-
|
|
962
|
+
author:
|
|
953
963
|
type: string
|
|
954
|
-
description:
|
|
964
|
+
description: >
|
|
965
|
+
Your name (agent or user). Recorded in the usage log.
|
|
966
|
+
Optional. `requestor` is still accepted as an alias.
|
|
955
967
|
responses:
|
|
956
968
|
'200':
|
|
957
969
|
description: >
|
|
@@ -969,9 +981,11 @@ paths:
|
|
|
969
981
|
schema:
|
|
970
982
|
type: object
|
|
971
983
|
properties:
|
|
972
|
-
|
|
984
|
+
author:
|
|
973
985
|
type: string
|
|
974
|
-
description:
|
|
986
|
+
description: >
|
|
987
|
+
Your name (agent or user). Recorded in the usage log.
|
|
988
|
+
Optional. `requestor` is still accepted as an alias.
|
|
975
989
|
responses:
|
|
976
990
|
'200':
|
|
977
991
|
description: >
|
|
@@ -1028,9 +1042,11 @@ paths:
|
|
|
1028
1042
|
description: >
|
|
1029
1043
|
Response size budget in bytes when include_content is true
|
|
1030
1044
|
(whole results dropped to fit). Advanced; leave unset for the default.
|
|
1031
|
-
|
|
1045
|
+
author:
|
|
1032
1046
|
type: string
|
|
1033
|
-
description:
|
|
1047
|
+
description: >
|
|
1048
|
+
Your name (agent or user). Recorded in the usage log.
|
|
1049
|
+
Optional. `requestor` is still accepted as an alias.
|
|
1034
1050
|
responses:
|
|
1035
1051
|
'200':
|
|
1036
1052
|
description: >
|
|
@@ -1258,7 +1274,7 @@ You have access to a personal Cerefox knowledge base via a local CLI.
|
|
|
1258
1274
|
Identify yourself on every call:
|
|
1259
1275
|
- Writes (document ingest, document ingest-dir): pass --author "<your-name>" --author-type agent
|
|
1260
1276
|
- Reads (search, document get, document version list, project list,
|
|
1261
|
-
metadata search, audit list): pass --
|
|
1277
|
+
metadata search, audit list): pass --author "<your-name>" (the same flag as on writes)
|
|
1262
1278
|
|
|
1263
1279
|
When answering questions, search Cerefox first. When the user asks you to
|
|
1264
1280
|
remember something, ingest it. Cite document titles for every claim drawn
|
|
@@ -1271,17 +1287,17 @@ The agent docs are written around MCP tool names. **CLI flag names match MCP par
|
|
|
1271
1287
|
|
|
1272
1288
|
| MCP tool | CLI command |
|
|
1273
1289
|
|---|---|
|
|
1274
|
-
| `cerefox_search` | `cerefox search "<query>" --match-count N --project-name <n> --metadata-filter '<json>' --
|
|
1290
|
+
| `cerefox_search` | `cerefox search "<query>" --match-count N --project-name <n> --metadata-filter '<json>' --author <name>` (CLI-only: `--mode`, `--alpha`, `--min-score`, `--only-metadata`) |
|
|
1275
1291
|
| `cerefox_ingest` (file) | `cerefox document ingest <path> --title <t> --project-name <n> --metadata '<json>' --update-if-exists\|--document-id <uuid> --source <s> --author <a> --author-type user\|agent` |
|
|
1276
1292
|
| `cerefox_ingest` (paste) | `printf '...' \| cerefox document ingest --paste --title "<title>"` (same flags) |
|
|
1277
|
-
| `cerefox_get_document` | `cerefox document get <document-id> --version-id <vid> --
|
|
1278
|
-
| `cerefox_list_versions` | `cerefox document version list <document-id> --
|
|
1279
|
-
| `cerefox_list_projects` | `cerefox project list --
|
|
1293
|
+
| `cerefox_get_document` | `cerefox document get <document-id> --version-id <vid> --author <name>` |
|
|
1294
|
+
| `cerefox_list_versions` | `cerefox document version list <document-id> --author <name>` |
|
|
1295
|
+
| `cerefox_list_projects` | `cerefox project list --author <name>` |
|
|
1280
1296
|
| `cerefox_set_document_metadata` | `cerefox document set-metadata <document-id> --set key=value` (also `--remove key`, `--json '{...}'`, `--replace`) |
|
|
1281
1297
|
| `cerefox_set_document_projects` | `cerefox document set-projects <document-id> <name...> --author <a> --author-type user\|agent` (or `--clear`) |
|
|
1282
1298
|
| `cerefox_list_metadata_keys` | `cerefox metadata keys` |
|
|
1283
|
-
| `cerefox_metadata_search` | `cerefox metadata search --metadata-filter '<json>' --project-name <n> --
|
|
1284
|
-
| `cerefox_get_audit_log` | `cerefox audit list --document-id <id> --author <a> --operation <op> --since <iso> --until <iso> --limit N --json --
|
|
1299
|
+
| `cerefox_metadata_search` | `cerefox metadata search --metadata-filter '<json>' --project-name <n> --author <name>` |
|
|
1300
|
+
| `cerefox_get_audit_log` | `cerefox audit list --document-id <id> --by-author <a> --operation <op> --since <iso> --until <iso> --limit N --json --author <name>` |
|
|
1285
1301
|
|
|
1286
1302
|
> CLI verbs with no MCP equivalent: `cerefox document edit`, `cerefox project create` / `cerefox project edit`, `cerefox config list`.
|
|
1287
1303
|
|
|
@@ -1301,7 +1317,7 @@ After pointing your agent at the repo, ask it:
|
|
|
1301
1317
|
### Caveats
|
|
1302
1318
|
|
|
1303
1319
|
- **Privilege level**: the CLI uses the **service-role key** (`CEREFOX_SUPABASE_KEY`), which bypasses Row Level Security. An agent with Bash access has the same full read/write power you do. Only enable Path C for agents you trust to act on your behalf — the same trust level you'd grant Cursor/Claude Code for editing your source code.
|
|
1304
|
-
- **Audit attribution**: Path C records `access_path = "cli"` in usage logs, distinct from `"local-mcp"` / `"remote-mcp"`. **Agents must set `--author <name> --author-type agent` on writes and `--
|
|
1320
|
+
- **Audit attribution**: Path C records `access_path = "cli"` in usage logs, distinct from `"local-mcp"` / `"remote-mcp"`. **Agents must set `--author <name> --author-type agent` on writes and `--author <name>` on reads** (or rely on `CEREFOX_AUTHOR_NAME` / `CEREFOX_AUTHOR_TYPE` / `CEREFOX_REQUESTOR_NAME` env vars). Without these flags, writes attribute to `"unknown"` / `"user"`, which under-reports agent activity. See the 2026-05-18 Decision Log Q2 entry for the design rationale (`author_type` is caller-declared on ambiguous channels — CLI and Edge Functions — but `access_path` is always derived from the code layer).
|
|
1305
1321
|
- **Soft-delete and restore are reachable; permanent purge is not** — by design. `cerefox document delete` / `cerefox document restore` on the CLI, `cerefox_delete_document` / `cerefox_restore_document` over MCP (v1.7.0, #208/#210): both audited with author attribution. **Permanent purge** (irreversible) stays web-UI-only with human-in-the-loop confirmation. If an agent deletes or restores content, it should surface that to the user explicitly so they can follow it in the audit trail. See [`access-paths.md` → Destructive operations and the trust model](access-paths.md#destructive-operations-and-the-trust-model) for the full rationale and contributor guidance.
|
|
1306
1322
|
- **Cross-doc links in content you ingest** become clickable when the user views them in the Cerefox web UI. **Always author them as `[Text](uuid)`** — the server validates these on every write (v1.7.0) and rejects links to nonexistent ids, which catches mangled UUIDs at write time. `[Text](docs/path.md)` exists for repo-ingested files; do not write title-based links (fragile, and `AGENT_GUIDE.md` says never in agent-authored content). See [`AGENT_GUIDE.md` → "Writing linkable content"](../../AGENT_GUIDE.md#writing-linkable-content) for the full set of rules.
|
|
1307
1323
|
- **CLI install per machine**: the agent needs the `cerefox` binary installed (`npm install -g @cerefox/memory`) with a resolvable `.env`. If you skip the local install entirely, Path A-Remote or Path B is the only option.
|
package/docs/guides/upgrading.md
CHANGED
|
@@ -77,6 +77,14 @@ schema-requiring release.
|
|
|
77
77
|
> `cerefox config set review_workflow_enabled false` (or Settings → Governance)
|
|
78
78
|
> if nobody reviews the queue. See
|
|
79
79
|
> [configuration.md → Review Workflow](configuration.md#review-workflow).
|
|
80
|
+
>
|
|
81
|
+
> **v1.13.1** (schema 0.16.1) corrects one thing in the above: the flag
|
|
82
|
+
> governs only what is *shown*. v1.13.0 also stored `approved` for every
|
|
83
|
+
> write while the flag was off; v1.13.1 records agent writes as
|
|
84
|
+
> `pending_review` regardless, so turning the workflow back on shows the
|
|
85
|
+
> statuses the store would have had all along. It is an RPC-only change —
|
|
86
|
+
> `cerefox server deploy` (or `--schema-only`) picks it up; nothing refuses
|
|
87
|
+
> to run until you do, but a 0.16.0 server keeps the v1.13.0 write behaviour.
|
|
80
88
|
|
|
81
89
|
> ### Upgrading to v1.1.0 — `cerefox server deploy` is required
|
|
82
90
|
>
|
|
@@ -186,6 +194,9 @@ knowing about:
|
|
|
186
194
|
document must be restored before its content can be updated.
|
|
187
195
|
- **v1.13.0 — the review workflow is a store setting.** Upgraded stores keep
|
|
188
196
|
it on; fresh installs start with it off. See the callout above.
|
|
197
|
+
- **v1.13.1 — the flag hides, it does not rewrite.** Agent writes are
|
|
198
|
+
recorded `pending_review` whether or not the workflow is shown (v1.13.0
|
|
199
|
+
stored `approved` while off). Redeploy to pick it up.
|
|
189
200
|
|
|
190
201
|
## Notable: v1.8.0 storage reclaim (migration 0027)
|
|
191
202
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cerefox/memory",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.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",
|