@cairnkeep/cli 2.23.1 → 2.25.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/docs/README.md +4 -0
  3. package/docs/agents.md +18 -0
  4. package/docs/containers.md +4 -0
  5. package/docs/design/team-mode.md +17 -9
  6. package/docs/harness-compatibility.md +17 -0
  7. package/docs/learning/CURRICULUM-MAP.md +3 -1
  8. package/docs/learning/FEATURE-GUIDE.md +34 -1
  9. package/docs/learning/README.md +5 -3
  10. package/docs/learning/lessons/L00-why-cairnkeep.md +1 -1
  11. package/docs/learning/lessons/L01-safe-trial.md +3 -3
  12. package/docs/learning/lessons/L02-installation.md +2 -2
  13. package/docs/learning/lessons/L03-first-project.md +1 -1
  14. package/docs/learning/lessons/L04-memory-fundamentals.md +12 -0
  15. package/docs/learning/lessons/L19-validated-skill-improvement.md +1 -1
  16. package/docs/learning/lessons/L20-mcp-tool-profiles.md +1 -1
  17. package/docs/learning/lessons/L21-context-packs.md +1 -1
  18. package/docs/learning/lessons/L22-native-windows.md +2 -2
  19. package/docs/learning/lessons/L23-guided-setup.md +1 -1
  20. package/docs/learning/lessons/L24-okf-exchange.md +1 -1
  21. package/docs/learning/lessons/L25-playbooks.md +1 -1
  22. package/docs/learning/lessons/L26-context-intelligence.md +1 -1
  23. package/docs/learning/lessons/L27-ecosystem-evidence.md +1 -1
  24. package/docs/learning/lessons/L28-security-assurance.md +2 -2
  25. package/docs/learning/lessons/L29-team-continuity.md +95 -0
  26. package/docs/learning/tracks/operator.md +2 -0
  27. package/docs/learning/video-scripts/V04-memory-retrieval-supplement.md +13 -0
  28. package/docs/learning/video-scripts/V29-team-continuity.md +66 -0
  29. package/docs/mcp-tool-profiles.md +7 -0
  30. package/docs/memory-retrieval.md +84 -2
  31. package/docs/operating.md +22 -3
  32. package/docs/privacy-and-data-flow.md +37 -9
  33. package/docs/security-assurance.md +28 -0
  34. package/docs/storage.md +18 -0
  35. package/docs/team-pilot.md +132 -0
  36. package/docs/team.md +234 -0
  37. package/examples/eval/bundled-fake.json +1 -1
  38. package/mcp-memory-server/dist/index.js +30 -2
  39. package/mcp-memory-server/dist/mcp-tool-catalog.js +4 -1
  40. package/mcp-memory-server/dist/memory-reranker.js +109 -0
  41. package/mcp-memory-server/dist/team-cli.js +218 -0
  42. package/mcp-memory-server/dist/team-http.js +193 -0
  43. package/mcp-memory-server/dist/team-mcp.js +82 -0
  44. package/mcp-memory-server/dist/team-store.js +663 -0
  45. package/mcp-memory-server/package.json +1 -0
  46. package/package.json +1 -1
  47. package/scripts/cairn-cli.mjs +2 -0
  48. package/scripts/completion.sh +23 -3
  49. package/scripts/doctor.sh +17 -0
  50. package/scripts/lib/team-retention.mjs +29 -0
  51. package/scripts/probe-memory-reranker.mjs +22 -0
  52. package/scripts/test-ci-sharding.sh +4 -0
  53. package/scripts/test-completion.sh +8 -0
  54. package/scripts/test-container-health.mjs +2 -0
  55. package/scripts/test-container.sh +21 -1
  56. package/scripts/test-dependency-security.mjs +11 -1
  57. package/scripts/test-doctor.sh +28 -0
  58. package/scripts/test-package-install.sh +9 -0
  59. package/scripts/test-team-docs.sh +52 -0
  60. package/scripts/test-team-pilot.mjs +59 -0
  61. package/scripts/test-windows-native.mjs +5 -0
  62. package/scripts/uninstall.sh +13 -0
  63. package/scripts/verify-dependency-security.mjs +3 -2
  64. package/scripts/verify-team-retention.mjs +3 -0
  65. package/scripts/windows-platform.mjs +14 -2
@@ -0,0 +1,66 @@
1
+ # V29 - Remember together without sharing everything
2
+
3
+ Status: technical rehearsal brief for the opt-in Cairnkeep 2.25.0 preview.
4
+ Target: 10–12 minutes, experienced-developer audience. Describe a released
5
+ experimental preview, not a generally production-admitted team service.
6
+ Use the [isolated pilot guide](../../team-pilot.md) for a separately authorized
7
+ native-harness trial, not as authorization to record private review or credentials.
8
+
9
+ ## 0:00–1:30 — Continuity is the goal
10
+
11
+ “The useful part is not winning a one-shot puzzle. It is continuing tomorrow,
12
+ in another harness, without explaining the same project decision again.”
13
+ Pause, then introduce the new boundary: your private memory is not a team bucket.
14
+ Show the proposal/review/revision lifecycle, one stage at a time.
15
+
16
+ ## 1:30–3:30 — Deliberately separate identities
17
+
18
+ Use a disposable source checkout and only synthetic fixtures. Show
19
+ `bin/cairn team --help` and the default-off failure. Read the roles in
20
+ `docs/team.md`; highlight that a reviewer token is human-only and is never
21
+ handed to the agent. Briefly show initialization/membership command forms,
22
+ with no token contents on screen. The server is loopback-only.
23
+
24
+ ## 3:30–6:00 — Make the boundary visible
25
+
26
+ Type the six L29 control commands at human speed; use completion where useful.
27
+ Split the terminal: immutable selected proposal on one side, human review and
28
+ approved retrieval on the other. Use the actual fixture results rather than
29
+ fabricating a transcript. Pause on denied workload/self-review and the stale
30
+ digest/base controls. Explain that confirming a hash does not prove human consent.
31
+
32
+ ## 6:00–8:00 — Change clients, not authority
33
+
34
+ Run `smoke-team-mcp.mjs` separately and inspect its maintained fixture: two
35
+ actual stdio clients, different cwd, same approved project decision. Zoom into
36
+ project provenance, then contrast an unrelated project denial and live token
37
+ revocation. Do not claim the test launched every named commercial harness.
38
+ Show `cairn team member remove SUBJECT --project ID --data DIR` as the explicit
39
+ project-offboarding command. Pause on the connected client's denial; explain
40
+ that removing one project membership does not revoke all of that person's tokens.
41
+ An additional MCP entry is opt-in; existing memory servers are not replaced.
42
+
43
+ ## 8:00–10:00 — Recovery with a catch
44
+
45
+ Run `smoke-team-restore.mjs` and `smoke-team-cli.mjs`. Leave a two-second pause
46
+ on “restored credentials revoked”: copying a backup must not silently restore
47
+ access. Show fresh-only restore, no-overwrite and uninstall-retention controls.
48
+ Explain that logical deletion is not secure disk erasure or backup deletion.
49
+
50
+ ## 10:00–11:30 — Honest closing
51
+
52
+ End on the admission checklist in `docs/team.md`, not a production deployment.
53
+ Distinguish completed regression controls, the internal governed review and
54
+ the approved isolated native pilot from independent production review and a
55
+ deployment-specific real-data pilot. Do not imply two independent human testers.
56
+ Explain that personal-memory embeddings/reranking never process team search.
57
+ Distinguish the JSON API/local stdio bridge from OAuth
58
+ remote MCP. Call out OIDC, team packs and multi-organization tenancy as deferred.
59
+
60
+ ## Recording contract
61
+
62
+ Use legible real terminals, short scene changes, natural pauses and emphasis
63
+ around each changed authority boundary. Keep credentials, personal memory,
64
+ source excerpts from private projects and raw snapshot text off screen.
65
+ Do not enroll a real user, deploy, purchase services or mutate live MCP config
66
+ to produce the video. This brief does not imply a video has been recorded.
@@ -41,3 +41,10 @@ The default `full` profile preserves the same tool names, schemas, responses,
41
41
  feature gates, and ordering as an unconfigured server. The annotations help
42
42
  conservative clients distinguish observations from actions; they do not grant
43
43
  permission or replace the client's approval policy.
44
+
45
+ With a valid, explicitly enabled memory reranker, `memory_search` advertises
46
+ `openWorldHint: true` because query and bounded candidate excerpts can reach
47
+ the configured service. It remains `readOnlyHint: true`, so a read-only
48
+ profile still exposes it. Tool restriction is not network consent: omit it
49
+ from a custom profile or disable reranking if that data flow is unwanted.
50
+ With reranking off, existing discovery metadata is unchanged.
@@ -161,8 +161,90 @@ Its sample threshold of 0.75 is an evaluation arm, not a recommended default.
161
161
  An attempted live run during development accepted short probes but failed with
162
162
  HTTP 502 on some fixture inputs. No successful live-model result is claimed.
163
163
  The offline suite never requires a model, API key, paid service or network beyond
164
- its own loopback fixture. An optional learned reranker remains deferred until
165
- provider-specific evidence demonstrates a benefit beyond this simpler policy.
164
+ its own loopback fixture. A separate optional reranker comparison below does
165
+ not replace this older study or retroactively make that failed run successful.
166
+
167
+ ## Optional learned reranking
168
+
169
+ Available since Cairnkeep 2.24.0. This feature improves ordering, not guaranteed
170
+ recall: the small live comparison below retained the same Recall@3 in both arms.
171
+
172
+ The optional reranker is default-off and independent of extraction and
173
+ embeddings. Set `CAIRN_MEMORY_RERANK=1`, `CAIRN_MEMORY_RERANK_URL` (a base URL,
174
+ normally ending in `/v1`) and `CAIRN_MEMORY_RERANK_MODEL` on the memory-server
175
+ process. The client appends `/rerank`. If authentication is needed, set the
176
+ separate `CAIRN_MEMORY_RERANK_API_KEY`; extraction/embedding credentials are
177
+ never reused. `CAIRN_MEMORY_RERANK_TIMEOUT_MS` defaults to 2,000 ms and accepts
178
+ 100–10,000 ms. Restart the server after configuration changes.
179
+
180
+ Only `memory_search` in the `memory` address space is reranked, for either
181
+ legacy or hybrid strategy. Notes, context packs, documents and the separate
182
+ team store are unchanged. Existing scope, current-value, typed and relevance
183
+ filters admit candidates first. The provider receives the original query
184
+ (at most 4 KiB) and at most 50 admitted key/value excerpts (at most 4 KiB each),
185
+ not the whole store. Candidate depth is `min(50, max(32, 4 * top_k))`.
186
+ Exact-key priority in hybrid search (including explicit aliases) and typed legacy exact-hit priority remain
187
+ ahead of model scores. The provider only reorders admitted records; it cannot
188
+ add facts, change authority, write memory or recover a candidate already
189
+ rejected by admission. A small final `top_k` can include a candidate outside
190
+ the original top-k prefix after reranking.
191
+
192
+ The endpoint must return every candidate index exactly once in a `results`
193
+ array with finite `relevance_score` numbers. Negative raw scores are accepted;
194
+ these are ranking values, not calibrated confidence. Returned memory text,
195
+ provenance and existing retrieval scores are unchanged; those scores need not
196
+ be descending after learned reranking. Ties preserve the
197
+ existing order. Timeout, HTTP errors, redirects, oversized responses, invalid
198
+ configuration or malformed/partial indices preserve the original order.
199
+ No retries or alternate provider fallback are made. Unset/disabled configuration
200
+ performs no reranker request and preserves existing discovery and responses.
201
+ When configured, `memory_search` remains read-only but advertises
202
+ `openWorldHint: true` because it can export candidate text.
203
+
204
+ `cairn doctor` uses synthetic text to check configured reranking and fails if
205
+ the configuration or response is invalid. Ordinary searches still fall back
206
+ safely; doctor does not mistake fallback for a healthy provider.
207
+
208
+ ### Bounded provider comparison
209
+
210
+ The frozen `memory-reranker-study-v1.json` fixture contains 20 synthetic
211
+ continuity cases, including 16 positive and four negative cases. Both arms use
212
+ the same embedding vectors, admission rules, aliases and final top three.
213
+ Labels and the fixture digest were frozen before the first live ranking run.
214
+
215
+ | Metric | Hybrid + embeddings | Same candidates + reranker |
216
+ |---|---:|---:|
217
+ | Relevant first result, 16 positive cases | 6/16 | 15/16 |
218
+ | MRR@3 | 0.635417 | 0.968750 |
219
+ | NDCG@3 | 0.728416 | 0.976933 |
220
+ | Recall@3 | 1.0 | 1.0 |
221
+ | Negative queries returning results, 4 cases | 0/4 | 0/4 |
222
+
223
+ Ten cases improved and **one regressed**: `current-not-history` ranked a
224
+ topical interface distractor above the correct current fact. Hidden history
225
+ was still excluded. No scope/history violation or provider failure occurred.
226
+ Observed additional ranking latency was 9 ms median and 46 ms p95 in this
227
+ small local run; this is not a deployment latency guarantee.
228
+
229
+ This is an engineering-labeled synthetic comparison with deliberately
230
+ ambiguous topical distractors, not an independent holdout, a human study or
231
+ proof of general agent-quality gains. It justifies an optional experiment,
232
+ not default enablement. Evaluate your provider and corpus before opting in;
233
+ disable `CAIRN_MEMORY_RERANK` to reverse the change.
234
+
235
+ From a source checkout (these developer study scripts are not installed CLI
236
+ commands):
237
+
238
+ ```sh
239
+ npm --prefix mcp-memory-server run check:memory-reranker
240
+ # Requires explicit existing embedding and reranker configuration:
241
+ node mcp-memory-server/scripts/run-memory-reranker-study.mjs --live --summary
242
+ ```
243
+
244
+ Without `--live`, the study makes no provider calls even when configured.
245
+ Reports include fixture, implementation and model-ID digests, no URLs or keys.
246
+ The frozen fixture SHA-256 is
247
+ `f6a5d2de8d2846dd5a8de764096d92255716592805e8abfdc771181eac23beb1`.
166
248
 
167
249
  ## Research connection
168
250
 
package/docs/operating.md CHANGED
@@ -495,6 +495,11 @@ vendor or host.
495
495
  | `CAIRN_MEMORY_EMBEDDING_URL` | Embeddings endpoint (falls back to `CAIRN_LLM_API_URL`) |
496
496
  | `CAIRN_MEMORY_EMBEDDING_MODEL` | Embedding model name (required for semantic search) |
497
497
  | `CAIRN_MEMORY_EMBEDDING_TIMEOUT_MS` | Embedding request timeout before substring fallback (default `15000`) |
498
+ | `CAIRN_MEMORY_RERANK` | Explicit `1` enables optional learned memory-search reranking; off by default |
499
+ | `CAIRN_MEMORY_RERANK_URL` | Explicit HTTP(S) base URL; client appends `/rerank`; no embedded credentials, query or fragment |
500
+ | `CAIRN_MEMORY_RERANK_MODEL` | Required model identifier when reranking is enabled |
501
+ | `CAIRN_MEMORY_RERANK_API_KEY` | Optional separate reranker credential; no extraction/embedding key fallback |
502
+ | `CAIRN_MEMORY_RERANK_TIMEOUT_MS` | Reranking deadline, default `2000`, allowed `100`–`10000`; failure preserves existing search order |
498
503
  | `CAIRN_AGENTFS_BASE_DIR` | Server-side base dir for named/global memory scopes (default `~/.cairnkeep`); it does not affect `project` scope |
499
504
  | `CAIRN_TRAJECTORY_CAPTURE` | Opt in to local structured session capture (`1`, `true`, `yes`, or `on`; unset/default → no capture work) |
500
505
  | `CAIRN_TRAJECTORY_SESSION_MAX_BYTES` | Maximum serialized bytes per session (default `5242880`, 5 MiB; minimum 1024) |
@@ -957,9 +962,10 @@ cairn playbook record --help
957
962
  ```
958
963
 
959
964
  Inspect receipts with `cairn playbook receipts list|show`; validate state with
960
- `cairn playbook doctor`. Actor and session options are provenance labels only:
961
- v2.15 does not authenticate them and does not provide team ACLs. See
962
- [team mode](design/team-mode.md) for the future admission contract.
965
+ `cairn playbook doctor`. Actor and session options remain unverified provenance
966
+ labels, not team ACLs. The separate [team preview](team.md) authenticates its own
967
+ credentials and project memberships; it never trusts local playbook labels.
968
+ See [team mode](design/team-mode.md) for the broader admission contract.
963
969
 
964
970
  The corresponding process overrides are optional:
965
971
 
@@ -1536,3 +1542,16 @@ cairn proposals apply PROPOSAL_DIGEST --project /path/to/project --json
1536
1542
 
1537
1543
  No background process synchronizes OpenViking, creates proposals, applies
1538
1544
  memory, enables packs, or approves skills.
1545
+
1546
+ ## Team continuity (opt-in 2.25 preview)
1547
+
1548
+ The separate `cairn team` command implements explicitly selected and reviewed
1549
+ project memory. It is default off (`CAIRN_TEAM=1` required); serving also needs
1550
+ `CAIRN_TEAM_HTTP=1`. It does not change ordinary setup or existing MCP entries.
1551
+ Use [the team reference](team.md) for roles, private credentials, additional
1552
+ local stdio registration, human review, backup/restore and incident handling.
1553
+ The internal governed review and approved isolated native pilot are complete;
1554
+ independent production review and a deployment-specific approved real-data pilot
1555
+ are still required before using real organization data.
1556
+ Existing personal HTTP remains a trusted single storage domain; token-first
1557
+ team JSON HTTP is a different service, not OAuth remote MCP HTTP.
@@ -3,7 +3,8 @@
3
3
  Cairnkeep has no telemetry, analytics collector, hosted control plane, or
4
4
  automatic remote-service discovery. A default local stdio installation stores
5
5
  memory in SQLite on the machine running the MCP server and makes no model or RAG
6
- request unless the corresponding endpoint and credential are configured.
6
+ request unless the corresponding feature is explicitly configured as described
7
+ below (some operator-owned endpoints do not require a credential).
7
8
 
8
9
  ## Data flows
9
10
 
@@ -11,6 +12,7 @@ request unless the corresponding endpoint and credential are configured.
11
12
  |---|---|---|
12
13
  | Local substring search | None | Local SQLite only |
13
14
  | Embedding-ranked search | Stored memory values that are not cached, plus the search query | `CAIRN_MEMORY_EMBEDDING_URL` or `CAIRN_LLM_API_URL` |
15
+ | Separately opted-in memory reranking | Query and at most 50 scope/current/filter-admitted key/value excerpts, each at most 4 KiB | Only the explicit `CAIRN_MEMORY_RERANK_URL`; separate optional credential, no retries/redirects/alternate hosts |
14
16
  | `memory_extract` | The transcript supplied to the tool | `CAIRN_LLM_API_URL` |
15
17
  | `domain_knowledge_query` | Workspace slug and query | `ANYTHINGLLM_BASE_URL` |
16
18
  | `domain_knowledge_sync` | Files selected by the sync configuration | `ANYTHINGLLM_BASE_URL` |
@@ -50,6 +52,10 @@ Model endpoints may be local or remote. Cairnkeep cannot determine a provider's
50
52
  retention, training, or logging policy; verify it before sending confidential
51
53
  material. Disabling `CAIRN_LLM_API_KEY`, `ANYTHINGLLM_API_KEY`, remote HTTP
52
54
  registration, and delegated tools keeps the core memory workflow local.
55
+ Also leave `CAIRN_MEMORY_RERANK` unset to disable its independent data flow;
56
+ it does not require or inherit `CAIRN_LLM_API_KEY`. A local provider is still a
57
+ separate process that receives these excerpts. Neither a chat agent nor a
58
+ research assistant is part of reranking or authorization.
53
59
 
54
60
  ## Playbook decision and receipt flow
55
61
 
@@ -65,12 +71,12 @@ timestamp, and the supplied actor/session labels. It excludes prompt content,
65
71
  file content, patches, command output, secrets, endpoint values, and environment
66
72
  snapshots. Changed paths influence a decision but are not copied into receipts.
67
73
 
68
- In v2.15, actor identity is an unauthenticated local assertion even when a
74
+ Local playbook actor identity remains an unauthenticated assertion even when a
69
75
  harness supplies it. Do not use receipts for employee monitoring,
70
- authorization, non-repudiation, or team access decisions. The future
71
- [team-mode contract](design/team-mode.md) requires authenticated subjects,
72
- deny-by-default ACLs, tenant isolation, retention, and append-only auditing
73
- before shared operation can ship.
76
+ authorization, non-repudiation, or team access decisions. The separate
77
+ [team preview](team.md) uses verified credentials and server-side memberships,
78
+ never these labels. The broader [team-mode contract](design/team-mode.md)
79
+ retains independent production-admission, isolation and retention requirements.
74
80
 
75
81
  ## Data at rest
76
82
 
@@ -91,11 +97,14 @@ backups/journals are sensitive local data at rest. Dry-run and commit responses
91
97
  contain scopes/address spaces, digests, keys, actions, and counts—not supplied
92
98
  or displaced values. No model, API key, endpoint, or network is required.
93
99
 
94
- The existing explicitly configured embedding search is the sole related egress:
95
- eligible key/value/type/tag text and the query may be sent to
100
+ Explicitly configured embedding search can send eligible key/value/type/tag
101
+ text and the query to
96
102
  `CAIRN_MEMORY_EMBEDDING_URL` (or its documented fallback). Hard filters run
97
103
  before that request; endpoint failure returns to local substring search. Note
98
- search is always local and never uses embeddings.
104
+ search is always local and never uses embeddings or reranking. Separately
105
+ opting into the [bounded reranker](memory-retrieval.md#optional-learned-reranking)
106
+ can also send admitted memory excerpts and the query. It only changes ordering,
107
+ never scope, history admission, approval, factual authority or durable memory.
99
108
 
100
109
  Canonical note storage includes manifest records, Markdown, indexes, history,
101
110
  import replay state, staged bytes, backups, and journals. Prepared/committing
@@ -692,3 +701,22 @@ skill readable; Cairnkeep never copies it into a harness or executes it.
692
701
 
693
702
  Pack digests and proposal digests protect integrity and stale-state detection;
694
703
  they do not authenticate a publisher or make extracted statements true.
704
+
705
+ ## Team preview flow and isolation
706
+
707
+ The default-off [team preview](team.md) reads no personal memory automatically.
708
+ Only explicitly supplied, inspected text becomes an immutable project proposal;
709
+ only review by a different human credential publishes a shared revision.
710
+ Workload tokens cannot review. The agent's local stdio bridge sends explicit
711
+ organization/project requests and bearer authorization to the separately
712
+ configured JSON API. Search uses substring matching, never an embedding/model
713
+ provider. There is no background ingestion or sync.
714
+
715
+ Membership and credentials, not cwd or local playbook actor labels, select
716
+ authority. Server checks happen on every operation. Profile/capability
717
+ restrictions only narrow MCP tools. Shared values, source digests and identities
718
+ are stored privately; audit includes operation/outcome/digests without text or
719
+ tokens. Backups include shared proposals and memberships and need separate
720
+ encryption and access control. No unapproved personal content is discoverable.
721
+ A hash confirmation does not establish human consent or content truth.
722
+ Review and production admission remain separate operator responsibilities.
@@ -222,3 +222,31 @@ fallback; its response cap is 8 MiB. OpenViking retains its 1 MiB cap, explicit
222
222
  consents and HTTPS-or-loopback rule. Both reject malformed UTF-8 and suppress
223
223
  network/stream diagnostics. Health probes use only `127.0.0.1` with a validated
224
224
  port and the existing private token resolver, and never follow redirects.
225
+
226
+ ## Team preview assurance boundary
227
+
228
+ The [team preview](team.md) adds a separate authenticated organization/project
229
+ boundary; it does not retrofit ACLs onto the existing personal HTTP server.
230
+ Expiring/revocable credentials, independent project roles, workload-review
231
+ denial, self-review denial, policy/base conflicts, immutable proposals and
232
+ transactional publication/audit have maintained synthetic controls.
233
+ The local MCP bridge has no review/admin tools, no scope fallback and a
234
+ restrictive profile/capability intersection. The loopback JSON API rejects
235
+ browser origins and unexpected Host headers, bounds requests/responses and
236
+ rechecks authority after body receipt.
237
+
238
+ `smoke-team*.mjs` additionally covers concurrent/cross-process state changes,
239
+ audit failure rollback, oversized chunked bodies, restore integrity, revoked
240
+ restored credentials, CLI exit and uninstall retention. Built-in SQLite needs
241
+ Node 22.13+ only when opted in. Linux fixture execution is not native Windows
242
+ evidence, and same-account processes remain trusted. Hash-linked local audit
243
+ cannot detect an OS owner rewriting the entire chain; backups are unencrypted.
244
+ Capacity exhaustion fails closed rather than removing audit history.
245
+
246
+ The governed internal separate-context review and approved isolated native
247
+ pilot are complete; this is not an external professional assessment or a study
248
+ with two independent human participants. The released preview remains default
249
+ off. Independent production security review, platform/package/container
250
+ verification and a deployment-specific approved real-data pilot remain
251
+ mandatory production gates. Inline review alone is not independent review.
252
+ The service is token-first JSON HTTP plus local stdio MCP, not OAuth remote MCP.
package/docs/storage.md CHANGED
@@ -602,3 +602,21 @@ store; it does not turn the proposal directory into a second memory authority.
602
602
  Context-usage receipts are strict links in the existing work-evidence store.
603
603
  They inherit work-evidence inspection, retention, and doctor behavior; there is
604
604
  no separate prompt or retrieved-content log.
605
+
606
+ ## Separate team store (opt-in 2.25 preview)
607
+
608
+ [Team continuity](team.md) keeps organization/project records in a separate
609
+ `team.db` under `CAIRN_TEAM_BASE_DIR` (default `~/.cairnkeep/team`). Built-in
610
+ SQLite transactions serialize state and audit across processes; personal
611
+ AgentFS stores and layouts are unchanged. No migration or automatic copying
612
+ of personal memory occurs. The OS owner is trusted; stored text is unencrypted.
613
+
614
+ Use `cairn team backup`, not a live directory copy, for a verified consistent
615
+ snapshot. Restore publishes only a new directory, requires its exact digest,
616
+ and revokes all copied credentials. Doctor verifies references, object hashes,
617
+ audit links and temporary remnants without choosing a recovery state.
618
+ Manual logical key deletion retains audit metadata and does not erase free
619
+ pages, WAL or backup copies. Uninstall retains team data and refuses purge
620
+ targets overlapping its configured directory. Independently selected
621
+ `--data` stores must be outside purge targets or also configured through
622
+ `CAIRN_TEAM_BASE_DIR`. Keep encrypted backups separately protected.
@@ -0,0 +1,132 @@
1
+ # An isolated team-continuity pilot
2
+
3
+ This guide is for the opt-in Cairnkeep 2.25.0 team preview. It is **not production admission**.
4
+ Obtain explicit pilot approval first. Keep automated rehearsal, human review,
5
+ native-harness observations and release authorization as separate evidence.
6
+ Use the exact matching source checkout for the source controls below, not an
7
+ unverified global command or a production overlay. The released CLI includes
8
+ the optional team commands, but installation does not authorize this pilot.
9
+
10
+ The pilot runs beside existing personal memory: a new private store, expiring
11
+ credentials, a separate loopback port and additional isolated client profiles.
12
+ It never imports a personal store or replaces an existing MCP registration.
13
+ Use synthetic project decisions, not employer, personal or customer data.
14
+
15
+ ## 1. Prepare a private lab
16
+
17
+ Build the matching checkout. The following setup uses Bash on Linux/macOS; on
18
+ native Windows use the equivalent explicit CLI commands from [Team continuity](team.md).
19
+ Choose an absolute, **nonexistent** lab directory outside source checkouts,
20
+ personal memory, backup stores and other private stores. Do not reuse an old lab.
21
+
22
+ ```sh
23
+ TEAM_CAIRN=/absolute/path/to/feature-checkout/bin/cairn
24
+ TEAM_PILOT_DIR=/absolute/private/new-team-pilot
25
+ ```
26
+
27
+ Run this setup block in that shell. The operator chooses these two paths; the
28
+ block refuses an existing lab directory. Credential values are never printed.
29
+
30
+ <!-- team-pilot-setup:start -->
31
+ ```sh
32
+ set -e
33
+ : "${TEAM_CAIRN:?Set the absolute feature-checkout command}"
34
+ : "${TEAM_PILOT_DIR:?Set a new absolute private lab directory}"
35
+ case "$TEAM_CAIRN:$TEAM_PILOT_DIR" in /*:/*) ;; *) exit 1 ;; esac
36
+ mkdir -m 0700 "$TEAM_PILOT_DIR"
37
+ mkdir -m 0700 "$TEAM_PILOT_DIR/author-workspace" "$TEAM_PILOT_DIR/reader-workspace"
38
+ TEAM_PILOT_EXPIRY=$(node -p 'new Date(Date.now() + 2 * 3600000).toISOString()')
39
+ team_pilot_admin() {
40
+ (cd "$TEAM_PILOT_DIR" && env -i PATH="$PATH" CAIRN_TEAM=1 \
41
+ "$TEAM_CAIRN" team "$@" --data "$TEAM_PILOT_DIR/store")
42
+ }
43
+ team_pilot_admin init --organization trial-org
44
+ team_pilot_admin project create trial-project
45
+ team_pilot_admin project create unrelated-project
46
+ team_pilot_admin member set author --project trial-project --roles reader,contributor
47
+ team_pilot_admin member set reader --project trial-project --roles reader
48
+ team_pilot_admin member set reviewer --project trial-project --roles reader,reviewer,auditor
49
+ team_pilot_admin credential issue author --class workload --expires-at "$TEAM_PILOT_EXPIRY" --output "$TEAM_PILOT_DIR/author.token"
50
+ team_pilot_admin credential issue reader --class workload --expires-at "$TEAM_PILOT_EXPIRY" --output "$TEAM_PILOT_DIR/reader.token"
51
+ team_pilot_admin credential issue reviewer --class human --expires-at "$TEAM_PILOT_EXPIRY" --output "$TEAM_PILOT_DIR/reviewer.token"
52
+ team_pilot_admin doctor
53
+ ```
54
+ <!-- team-pilot-setup:end -->
55
+
56
+ If setup fails, stop and inspect only that generated lab; do not rerun against a
57
+ partially initialized directory. Keep the reviewer token outside both agent
58
+ workspaces. File-only credentials are private, but processes under the same OS
59
+ owner are not mutually isolated: use separate accounts or machines if that is
60
+ part of the pilot's threat model. Do not claim role tests prove OS isolation.
61
+
62
+ ## 2. Start only the disposable service
63
+
64
+ In a dedicated terminal, choose a separate unused port and run the exact feature
65
+ command from the lab directory. Do not kill another listener to claim its port.
66
+
67
+ ```sh
68
+ cd "$TEAM_PILOT_DIR"
69
+ env -i PATH="$PATH" CAIRN_TEAM=1 CAIRN_TEAM_HTTP=1 \
70
+ "$TEAM_CAIRN" team serve --data "$TEAM_PILOT_DIR/store" --port 17955
71
+ ```
72
+
73
+ Keep it in the foreground and use Ctrl+C for shutdown. It binds loopback only.
74
+ A second machine needs an authenticated SSH tunnel, not a public API listener.
75
+ Keep the production service, personal stores and existing MCP definitions intact.
76
+
77
+ ## 3. Use two additional client profiles
78
+
79
+ Configure only a new `cairn-team-memory` stdio server in disposable profiles for
80
+ the chosen harnesses. Do not edit their user-wide settings, trust lists or tokens.
81
+ Use the feature command with arguments `team mcp --project-root WORKSPACE` and
82
+ an explicit private workspace path for each client. Both clients receive:
83
+
84
+ - `CAIRN_TEAM=1`, `CAIRN_TEAM_ORGANIZATION=trial-org`;
85
+ - `CAIRN_TEAM_URL=http://127.0.0.1:17955` (or the explicit loopback tunnel);
86
+ - `CAIRN_TEAM_TOKEN_FILE` pointing to **only** their own workload credential.
87
+
88
+ Each tool call must explicitly name project `trial-project`; the working folder
89
+ and client name do not select or grant project access.
90
+
91
+ The author uses `author.token`; the other client uses `reader.token` and
92
+ `CAIRN_TEAM_MCP_TOOL_PROFILE=read-only`. Never give either model `reviewer.token`,
93
+ an administrative command, production credentials or an inherited cloud-provider
94
+ key for this lab. Use a provider explicitly authorized for the pilot. Starting
95
+ a server or downloading a model is not implicit subscription authorization.
96
+
97
+ ## 4. Exercise the actual review boundary
98
+
99
+ Have the author propose one exact synthetic project decision, with explicit
100
+ mutation consent. Record the immutable proposal ID, digest, selected bytes and
101
+ provenance privately. The reader must not see it before publication.
102
+
103
+ In the operator-only terminal, use `proposal-show` with the human reviewer
104
+ credential to inspect the **actual stored proposal**, not an agent's paraphrase.
105
+ Only after the reviewer explicitly approves those bytes, call `review` with
106
+ the exact proposal digest as described in [the reference](team.md#harness-connection).
107
+ Do not put a human token into an agent profile or script automatic human review.
108
+ Checking a hash does not establish human consent or verify a person's identity.
109
+
110
+ Restart the reader harness in a different empty working folder, retaining the
111
+ explicit authorized team project. Verify it reads identical approved text and
112
+ provenance. Capture actual tool-use evidence, not a model's claim of recall.
113
+ Exercise an unrelated-project denial, a read-only proposal denial, membership
114
+ removal on a connected client, and restore into a fresh store with old tokens
115
+ refused. Do not change production roles or activate the restored lab implicitly.
116
+
117
+ ## 5. Record, stop and decide
118
+
119
+ Keep a private, payload-free summary of source revision, client versions,
120
+ projects/roles, consent method and outcomes. Label unattended SDK controls as
121
+ automated rehearsal; do not turn their pass result into a human-pilot claim.
122
+ Record missing steps and failures, including model/tool-use failures.
123
+
124
+ Stop the foreground lab server. Verify its listener and clients have exited.
125
+ Revoke lab credentials if retaining the store; retain or remove only the exact
126
+ generated lab after preserving agreed evidence. Never purge a real memory base.
127
+ Confirm production configuration hashes are unchanged. No team setting is
128
+ enabled globally, so stopping the lab requires no production rollback.
129
+
130
+ Independent security review, platform checks, pilot approval/results and release
131
+ authorization remain distinct gates. Completing this guide does not itself
132
+ authorize a merge, release, production enrollment or fleet deployment.