@cerefox/memory 1.12.0 → 1.13.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.
@@ -378,9 +378,13 @@ enable it.
378
378
  ### How it works
379
379
 
380
380
  A `cerefox_config` table in Postgres stores runtime configuration as key-value
381
- pairs. The allow-list lives in the `cerefox_set_config` RPC; run `cerefox config
382
- list` (or open **Settings** in the web UI) for the current set — today that is
383
- usage tracking, the two requestor-identity keys, three retrieval tunables, and
381
+ pairs. Every key is declared once in the shared catalog
382
+ (`_shared/config-catalog/index.ts`: kind, default, group, description); the
383
+ `cerefox_set_config` RPC's allow-list stays authoritative for writes and a unit
384
+ test pins the two together. Run `cerefox config list` (or open **Settings** in
385
+ the web UI) for the current set — today that is usage tracking, the two
386
+ requestor-identity keys, three retrieval tunables, two version-retention keys,
387
+ the document-size warning threshold, `review_workflow_enabled` and
384
388
  `relations_enabled`. Usage logging is the illustrative case below: every logging
385
389
  call goes through the
386
390
  `cerefox_log_usage` RPC, which checks this config value first:
@@ -414,15 +418,17 @@ cerefox config get usage_tracking_enabled
414
418
 
415
419
  **Via the web UI:** `cerefox web` → **Settings**. Every runtime key is listed
416
420
  with its description, current value and default, grouped into Retrieval,
417
- Governance and Features.
421
+ Retention, Governance and Features.
418
422
 
419
423
  Two things the page does deliberately:
420
424
 
421
425
  - **Keys that change what agents see require confirmation.** Turning on
422
- `relations_enabled` adds four tools to every connected agent's tool list, and
426
+ `relations_enabled` adds four tools to every connected agent's tool list,
423
427
  `require_requestor_identity` starts rejecting agents that don't identify
424
- themselves. Neither is a bare toggle you get a dialog naming the
425
- consequence first.
428
+ themselves, `review_workflow_enabled` hides or reveals the review status on
429
+ every surface, and `version_cleanup_enabled` decides whether old versions are
430
+ pruned. None is a bare toggle — you get a dialog naming the consequence
431
+ first.
426
432
  - **Retired `.env` lines are flagged.** If a variable that used to control a
427
433
  setting is still present in the server's environment, the row says so — it no
428
434
  longer does anything, and the value shown is what actually runs. The page
@@ -539,9 +545,51 @@ This is the default state -- no configuration needed for backward compatibility.
539
545
 
540
546
  ---
541
547
 
548
+ ## Review Workflow
549
+
550
+ Cerefox can queue agent-authored writes for a person to approve: with the
551
+ workflow **on**, a document written with `author_type: agent` lands as
552
+ `pending_review`, a human write lands as `approved`, and every surface shows the
553
+ status (a pill on the document page, badges on the dashboard, a search filter,
554
+ a `status` column in the CLI, the field in API and MCP output). Review status
555
+ never gates retrieval — a pending document is exactly as searchable as an
556
+ approved one — it is a governance signal, nothing more.
557
+
558
+ Since v1.13.0 the workflow is a store-level switch, `review_workflow_enabled`,
559
+ kept in `cerefox_config` like every other store setting so two clients on one
560
+ database cannot disagree about whether it exists:
561
+
562
+ | Situation | Value |
563
+ |---|---|
564
+ | Fresh install (v1.13.0+) | **`false`** — most single-operator stores never review anything |
565
+ | Upgraded from an earlier version | **`true`** — an upgrade never changes what your store does |
566
+
567
+ ```bash
568
+ cerefox config get review_workflow_enabled
569
+ cerefox config set review_workflow_enabled true # or false; also in Settings → Governance
570
+ cerefox doctor # prints "review workflow ON …" / "OFF …"
571
+ ```
572
+
573
+ **With the workflow off, the feature is absent, not dimmed.** Every write lands
574
+ `approved` whoever wrote it — the decision is made once, inside the
575
+ `cerefox_ingest_document` RPC, so every access path (CLI, local and remote MCP,
576
+ Edge Functions, web) obeys the same setting, including older clients. No surface
577
+ shows a `review_status`: the web pill, badges and search chip do not render;
578
+ the CLI drops its `status` column; API, MCP and Edge Function rows carry no
579
+ `review_status` key; `GET /api/v1/search?review_status=…` is a `400`; and
580
+ `POST /api/v1/documents/{id}/review-status` is a `404`.
581
+
582
+ **Toggling never touches stored data.** Flipping the flag off does not approve
583
+ anything and flipping it on does not queue anything; documents that were
584
+ `pending_review` are still pending, and are shown as such the moment the flag
585
+ is on again. Attribution and the audit log are unaffected in both states — who
586
+ wrote what is always recorded. Config changes are audited too.
587
+
588
+ Design: [`docs/specs/review-workflow-toggle.md`](../specs/review-workflow-toggle.md).
589
+
542
590
  ## Checking Your Configuration
543
591
 
544
- Run the doctor to verify everything is connected (credentials, DB reachability, schema version):
592
+ Run the doctor to verify everything is connected (credentials, DB reachability, schema version, review workflow on/off):
545
593
 
546
594
  ```bash
547
595
  cerefox doctor # or: cerefox status
@@ -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.3.0
641
+ version: 3.4.0
642
642
  servers:
643
643
  - url: https://<your-project-ref>.supabase.co/functions/v1
644
644
  paths:
@@ -798,8 +798,10 @@ paths:
798
798
  default: agent
799
799
  description: >
800
800
  Whether this write is from a human user or an AI agent.
801
- Controls review_status auto-transition: agent writes set
802
- the document to pending_review, user writes set it to approved.
801
+ Always recorded for attribution. While the store's review
802
+ workflow is on (review_workflow_enabled), agent writes land
803
+ pending_review and user writes approved; with it off every
804
+ write lands approved.
803
805
  responses:
804
806
  '200':
805
807
  description: >
@@ -1033,9 +1035,11 @@ paths:
1033
1035
  '200':
1034
1036
  description: >
1035
1037
  Array of matching documents:
1036
- [{ document_id, title, doc_metadata, review_status, source, created_at,
1038
+ [{ document_id, title, doc_metadata, source, created_at,
1037
1039
  updated_at, total_chars, chunk_count, project_ids, project_names,
1038
- version_count, content_hash, content }].
1040
+ version_count, content_hash, content }], plus review_status
1041
+ only while the store's review workflow is on (the key is absent
1042
+ when it is off).
1039
1043
  content_hash is the concurrency token — pass it back as
1040
1044
  expected_content_hash when updating via ingestNote.
1041
1045
  ```
@@ -11,7 +11,7 @@ cerefox guides ingest # 3. the bundled guides, into your KB
11
11
  ```
12
12
 
13
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
14
+ say so — v1.9.x and v1.13.0 are two), and until `server deploy` runs, the freshly updated
15
15
  client is talking to the previous release's server. That is why
16
16
  `self-update` no longer runs the guides sync automatically — it used to fire
17
17
  at the one moment in the upgrade where it cannot succeed against a
@@ -60,6 +60,24 @@ schema-requiring release.
60
60
 
61
61
  ## End-user upgrade
62
62
 
63
+ > ### Upgrading to v1.13.0 — `cerefox server deploy` is required
64
+ >
65
+ > v1.13.0 makes the review workflow optional and moves the "agent writes land
66
+ > `pending_review`" decision out of the clients and into the
67
+ > `cerefox_ingest_document` RPC (#241). A v1.13.0 client no longer decides
68
+ > the status itself, so against an older server every agent write would
69
+ > silently land `approved` — a behaviour change, not a missing feature — and
70
+ > the new review-status search filter would fail outright. The **minimum
71
+ > supported schema is therefore `0.16.0`**: until you run `cerefox server
72
+ > deploy`, `cerefox web` refuses to start and `doctor` says exactly why.
73
+ >
74
+ > Migration 0031 seeds `review_workflow_enabled = true` on every existing
75
+ > store, so **your store keeps behaving exactly as before**. The flag now
76
+ > exists and `cerefox doctor` prints its state; flip it with
77
+ > `cerefox config set review_workflow_enabled false` (or Settings → Governance)
78
+ > if nobody reviews the queue. See
79
+ > [configuration.md → Review Workflow](configuration.md#review-workflow).
80
+
63
81
  > ### Upgrading to v1.1.0 — `cerefox server deploy` is required
64
82
  >
65
83
  > Most releases let you postpone the server step. **This one does not.** Until
@@ -166,6 +184,8 @@ knowing about:
166
184
  that ingested fine before now need deduplication, or are refused on edit.
167
185
  - **v1.7.0 — trashed documents refuse content updates.** A soft-deleted
168
186
  document must be restored before its content can be updated.
187
+ - **v1.13.0 — the review workflow is a store setting.** Upgraded stores keep
188
+ it on; fresh installs start with it off. See the callout above.
169
189
 
170
190
  ## Notable: v1.8.0 storage reclaim (migration 0027)
171
191
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerefox/memory",
3
- "version": "1.12.0",
3
+ "version": "1.13.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",