@cairnkeep/cli 2.22.5 → 2.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/claude/commands/recall.md +8 -1
  3. package/docs/README.md +3 -0
  4. package/docs/agents.md +9 -0
  5. package/docs/benchmarks/memory-retrieval-v1.json +115 -0
  6. package/docs/domain-knowledge.md +42 -4
  7. package/docs/learning/CURRICULUM-MAP.md +3 -3
  8. package/docs/learning/FEATURE-GUIDE.md +7 -1
  9. package/docs/learning/lessons/L00-why-cairnkeep.md +1 -1
  10. package/docs/learning/lessons/L01-safe-trial.md +3 -3
  11. package/docs/learning/lessons/L02-installation.md +2 -2
  12. package/docs/learning/lessons/L03-first-project.md +1 -1
  13. package/docs/learning/lessons/L04-memory-fundamentals.md +20 -0
  14. package/docs/learning/lessons/L09-domain-knowledge.md +11 -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/video-scripts/V04-memory-retrieval-supplement.md +34 -0
  26. package/docs/learning/video-scripts/V09-workspace-routing-supplement.md +36 -0
  27. package/docs/memory-retrieval.md +174 -0
  28. package/docs/operating.md +5 -0
  29. package/docs/releasing.md +7 -0
  30. package/docs/storage.md +5 -0
  31. package/examples/eval/bundled-fake.json +1 -1
  32. package/mcp-memory-server/dist/anythingllm-workspace.js +109 -0
  33. package/mcp-memory-server/dist/index.js +54 -6
  34. package/mcp-memory-server/dist/memory-retrieval.js +128 -0
  35. package/mcp-memory-server/package.json +5 -2
  36. package/opencode/command/recall.md +8 -1
  37. package/package.json +2 -2
  38. package/scripts/test-dependency-security.mjs +40 -0
  39. package/scripts/test-dependency-security.sh +4 -0
  40. package/scripts/test-memory-retrieval-docs.sh +19 -0
  41. package/scripts/test-release-sbom.sh +32 -0
  42. package/scripts/verify-dependency-security.mjs +19 -0
  43. package/templates/playbook-agent-instructions.md.template +5 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,49 @@ All notable user-facing changes are documented here. This project follows
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [2.23.1] - 2026-10-22
9
+
10
+ ### Domain knowledge
11
+
12
+ - Resolve local AnythingLLM defaults from the existing absolute project-path
13
+ mapping, with deepest-project matching and the sync script's discovery order.
14
+ Preserve explicit workspace overrides, legacy fallback, remote HTTP session
15
+ routing, OpenViking selection and synchronization approval requirements.
16
+ - Bound mapping reads and reject unsafe files, invalid slugs and ambiguous
17
+ canonical project declarations. Add pure, real stdio, HTTP and synchronization
18
+ regression controls; update operating guidance and the recording supplement.
19
+
20
+ ### Maintenance
21
+
22
+ - Allocate the remote-routing test provider's loopback port dynamically; retain
23
+ the formerly failing PID as a regression instead of hitting fetch's blocked
24
+ port 10080. Production routing and transport policy are unchanged.
25
+ - Refresh pinned setup, artifact-upload and code-scanning actions; align the
26
+ packaged CLI and server on Zod 4.6.7 with dependency-parity mutation controls.
27
+ - Update the isolated historical Python MCP integration experiment to 2.2.0;
28
+ this does not add Python or that experiment to the shipped Node runtime.
29
+
30
+ ## [2.23.0] - 2026-10-21
31
+
32
+ ### Memory retrieval
33
+
34
+ - Add opt-in `memory_search` hybrid lexical/identifier admission, bounded query
35
+ aliases, explicit semantic-only thresholds, deterministic ranking, duplicate
36
+ source locators and optional conflict/match explanations. Preserve existing
37
+ default responses, history, scope filters and storage layouts. Fall back to
38
+ lexical admission when optional embedding results are invalid or unavailable.
39
+ - Add a frozen continuity study against real curated Markdown files, including
40
+ the same-policy Markdown parity control and 0/100/1,000 distractors. Document
41
+ synthetic limitations and unsuccessful live-provider evaluation; update the
42
+ agent guidance, learning lesson and recording supplement.
43
+
44
+ ### CI
45
+
46
+ - Allow a retried, fully gated CI job to replace its run-local tree-addressed
47
+ release candidate instead of failing on the existing artifact name. Keep all
48
+ platform/runtime dependencies and immutable published versions unchanged; add
49
+ parsed-workflow positive and mutation controls.
50
+
8
51
  ## [2.22.5] - 2026-10-08
9
52
 
10
53
  ### Operations
@@ -19,7 +19,14 @@ Read order (canonical sources still win over derived layers):
19
19
 
20
20
  <process>
21
21
  ## 1. AgentFS
22
- `memory_search` scope `project` with $ARGUMENTS. If nothing relevant, retry scope `all`.
22
+ `memory_search` scope `project` with $ARGUMENTS. When the discovered schema
23
+ supports it, use `strategy: "hybrid"` for identifier-sensitive or mixed-wording
24
+ queries and `explain: true` to inspect matches. Supply only aliases already known
25
+ from the task. Semantic-only hybrid matches require an explicitly chosen
26
+ positive `min_score`; retain the existing semantic strategy for paraphrases
27
+ when no model-specific threshold is available. Empty results are valid.
28
+ Use broader configured scopes only when the question genuinely spans them;
29
+ do not automatically widen a search merely to force a hit.
23
30
 
24
31
  ## 2. Wiki
25
32
  Read `.planning/wiki/index.md` if present and follow links relevant to $ARGUMENTS.
package/docs/README.md CHANGED
@@ -31,6 +31,9 @@ linked guides rather than the project landing page.
31
31
 
32
32
  ## Context intelligence
33
33
 
34
+ - [Memory retrieval and the Markdown baseline](memory-retrieval.md) explains
35
+ optional hybrid admission, aliases, relevance diagnostics and reproducible
36
+ continuity evidence against searchable Markdown.
34
37
  - [Context intelligence](context-intelligence.md) connects progressive context-pack
35
38
  retrieval, the frozen benchmark, usage receipts, review-gated proposals, and
36
39
  the optional read-only OpenViking provider.
package/docs/agents.md CHANGED
@@ -27,6 +27,15 @@ constraints, recurring failures, or prior work:
27
27
  This protocol improves continuity without allowing stale memory to outrank
28
28
  code, tests, current documentation, or the user's request.
29
29
 
30
+ When the discovered tool schema supports it, `strategy: "hybrid"` is useful for
31
+ identifier-sensitive and mixed-wording queries. `explain: true` exposes selection
32
+ reasons; explicit `query_aliases` can express names already known from the task.
33
+ Do not invent aliases or broaden scopes to obtain a match. Semantic-only
34
+ paraphrase retrieval needs an explicitly chosen positive `min_score` in hybrid
35
+ mode; without a model-specific threshold, the existing semantic strategy remains
36
+ available. Empty results are valid, and ranking scores are not factual confidence.
37
+ See [memory retrieval and evidence](memory-retrieval.md).
38
+
30
39
  ## What setup installs
31
40
 
32
41
  `cairn setup` reconciles a delimited Cairnkeep block in the project's
@@ -0,0 +1,115 @@
1
+ {
2
+ "schema_version": 1,
3
+ "study": "synthetic-memory-continuity-v1",
4
+ "fixture_digest": "051a1ee175fc20d9e38c43d838b234c759133805ab335f74ef5603ee0871fce8",
5
+ "embedding": {
6
+ "mode": "none"
7
+ },
8
+ "limitations": [
9
+ "Synthetic retrieval scenarios, not autonomous task-quality or human-usability evidence.",
10
+ "Markdown baseline shares BM25/tokenization and receives identical alias information.",
11
+ "Markdown with the same admission policy is included to distinguish retrieval-policy gains from storage format.",
12
+ "Offline cases do not evaluate learned semantic paraphrase retrieval.",
13
+ "Explicit live threshold is an example, not universal calibration or a confidence probability.",
14
+ "Current-state fixture excludes archived history; actual supersession is covered by the MCP regression.",
15
+ "No automatic contradiction reconciliation, human consent or concurrent local-store access is claimed."
16
+ ],
17
+ "measurements": [
18
+ {
19
+ "adapter": "markdown-bm25",
20
+ "distractor_count": 0,
21
+ "hit_at_1": 0.8888888888888888,
22
+ "recall_at_5": 0.8888888888888888,
23
+ "negative_false_positive_rate": 0.75,
24
+ "irrelevant_bytes": 794
25
+ },
26
+ {
27
+ "adapter": "markdown-hybrid",
28
+ "distractor_count": 0,
29
+ "hit_at_1": 0.8888888888888888,
30
+ "recall_at_5": 0.8888888888888888,
31
+ "negative_false_positive_rate": 0,
32
+ "irrelevant_bytes": 0
33
+ },
34
+ {
35
+ "adapter": "legacy-substring",
36
+ "distractor_count": 0,
37
+ "hit_at_1": 0.3333333333333333,
38
+ "recall_at_5": 0.3333333333333333,
39
+ "negative_false_positive_rate": 0,
40
+ "irrelevant_bytes": 0
41
+ },
42
+ {
43
+ "adapter": "hybrid-lexical",
44
+ "distractor_count": 0,
45
+ "hit_at_1": 0.8888888888888888,
46
+ "recall_at_5": 0.8888888888888888,
47
+ "negative_false_positive_rate": 0,
48
+ "irrelevant_bytes": 0
49
+ },
50
+ {
51
+ "adapter": "markdown-bm25",
52
+ "distractor_count": 100,
53
+ "hit_at_1": 0.8888888888888888,
54
+ "recall_at_5": 0.8888888888888888,
55
+ "negative_false_positive_rate": 0.75,
56
+ "irrelevant_bytes": 3359
57
+ },
58
+ {
59
+ "adapter": "markdown-hybrid",
60
+ "distractor_count": 100,
61
+ "hit_at_1": 0.8888888888888888,
62
+ "recall_at_5": 0.8888888888888888,
63
+ "negative_false_positive_rate": 0,
64
+ "irrelevant_bytes": 0
65
+ },
66
+ {
67
+ "adapter": "legacy-substring",
68
+ "distractor_count": 100,
69
+ "hit_at_1": 0.3333333333333333,
70
+ "recall_at_5": 0.3333333333333333,
71
+ "negative_false_positive_rate": 0,
72
+ "irrelevant_bytes": 0
73
+ },
74
+ {
75
+ "adapter": "hybrid-lexical",
76
+ "distractor_count": 100,
77
+ "hit_at_1": 0.8888888888888888,
78
+ "recall_at_5": 0.8888888888888888,
79
+ "negative_false_positive_rate": 0,
80
+ "irrelevant_bytes": 0
81
+ },
82
+ {
83
+ "adapter": "markdown-bm25",
84
+ "distractor_count": 1000,
85
+ "hit_at_1": 0.8888888888888888,
86
+ "recall_at_5": 0.8888888888888888,
87
+ "negative_false_positive_rate": 0.75,
88
+ "irrelevant_bytes": 3359
89
+ },
90
+ {
91
+ "adapter": "markdown-hybrid",
92
+ "distractor_count": 1000,
93
+ "hit_at_1": 0.8888888888888888,
94
+ "recall_at_5": 0.8888888888888888,
95
+ "negative_false_positive_rate": 0,
96
+ "irrelevant_bytes": 0
97
+ },
98
+ {
99
+ "adapter": "legacy-substring",
100
+ "distractor_count": 1000,
101
+ "hit_at_1": 0.3333333333333333,
102
+ "recall_at_5": 0.3333333333333333,
103
+ "negative_false_positive_rate": 0,
104
+ "irrelevant_bytes": 0
105
+ },
106
+ {
107
+ "adapter": "hybrid-lexical",
108
+ "distractor_count": 1000,
109
+ "hit_at_1": 0.8888888888888888,
110
+ "recall_at_5": 0.8888888888888888,
111
+ "negative_false_positive_rate": 0,
112
+ "irrelevant_bytes": 0
113
+ }
114
+ ]
115
+ }
@@ -29,7 +29,7 @@ work exactly the same without them.
29
29
  | `ANYTHINGLLM_API_KEY` | **Required** for the domain-knowledge tools. Unset → the tools error at call time (everything else works). |
30
30
  | `ANYTHINGLLM_BASE_URL` | AnythingLLM base URL. Default `http://localhost:3001`. |
31
31
  | `CAIRN_ANYTHINGLLM_SYNC_SCRIPT` | Optional path to a custom document-sync script. Unset -> `domain_knowledge_sync` uses the bundled deployment-neutral example. |
32
- | `CAIRN_ANYTHINGLLM_PROJECTS_FILE` | Optional config path for the bundled sync script. Default `${XDG_CONFIG_HOME:-~/.config}/cairnkeep/anythingllm-projects.json`. |
32
+ | `CAIRN_ANYTHINGLLM_PROJECTS_FILE` | Optional config path for the bundled sync script, also used to pick the default workspace per repository. Default `${XDG_CONFIG_HOME:-~/.config}/cairnkeep/anythingllm-projects.json`. |
33
33
  | `CAIRN_ANYTHINGLLM_STATE_FILE` | Optional state path for the bundled sync script. Default `${XDG_STATE_HOME:-~/.local/state}/cairnkeep/anythingllm-sync.json`. |
34
34
 
35
35
  The query security follow-up validates HTTP(S) URLs and rejects embedded
@@ -54,9 +54,43 @@ first of `.agent/memory.json`, `.opencode/memory.json`, `.claude/memory.json`, o
54
54
  }
55
55
  ```
56
56
 
57
- `domain_knowledge_query` takes an explicit `workspace`, or falls back to the first
58
- configured workspace that is not `engineering-patterns` (the conventional shared
59
- workspace). With no workspace given and none configured, it errors.
57
+ ### Which workspace a call targets
58
+
59
+ A local stdio tool call without an explicit `workspace` resolves one in this order:
60
+
61
+ 1. The project in `anythingllm-projects.json` whose absolute `path` contains the current
62
+ working directory. The deepest match wins, so a checkout nested inside
63
+ another project resolves to its own workspace.
64
+ 2. Otherwise the first entry in `anythingllm_workspaces` that is not
65
+ `engineering-patterns`, which is reserved for cross-project patterns and is
66
+ never chosen as a project default.
67
+
68
+ Step 1 matters when one machine holds several checkouts that share a single
69
+ global memory config. Without it every repository resolves to the same
70
+ workspace, and a query made from a different repository reports "there is no
71
+ relevant information" instead of revealing that it searched somewhere
72
+ unrelated. Because the mapping is the same file the sync script uses, the
73
+ workspace a repository reads from is the one it embeds into.
74
+
75
+ If the mapping is absent, unreadable, or malformed, resolution falls back to
76
+ step 2, so existing single-project setups are unaffected.
77
+
78
+ Mapping discovery follows the bundled sync script exactly:
79
+ `CAIRN_ANYTHINGLLM_PROJECTS_FILE`, then a legacy file beside the selected sync
80
+ script, then `${XDG_CONFIG_HOME:-~/.config}/cairnkeep/anythingllm-projects.json`.
81
+ A missing explicit override does not select another mapping implicitly. Custom
82
+ sync implementations must honor the same mapping or configure an explicit
83
+ workspace; Cairnkeep cannot infer their private lookup rules.
84
+
85
+ Mapping reads are descriptor-bound UTF-8 JSON, limited to 1 MiB and 4,096
86
+ entries. Symlinked, special, changing and oversized mapping files are not read
87
+ as trusted content. Project paths must be absolute, without tilde expansion,
88
+ matching the sync script. They are canonicalized; relative declarations,
89
+ invalid workspace identifiers and the shared `engineering-patterns` slug are
90
+ skipped. Conflicting slugs for the same deepest canonical project raise a
91
+ controlled ambiguity error: specify `workspace` or correct the declarations.
92
+ Explicit tool arguments always win. With no resolved default, the tool errors.
93
+ This lookup selects a destination; it does not grant approval to synchronize.
60
94
 
61
95
  In local stdio mode, that config is read from the client project's working
62
96
  directory. In remote HTTP mode, the server cannot read files from the client
@@ -64,6 +98,10 @@ PC. Configure `ANYTHINGLLM_BASE_URL`, `ANYTHINGLLM_API_KEY`, and any sync script
64
98
  on the HTTP server host, then send the project workspaces in the
65
99
  `X-Cairn-AnythingLLM-Workspaces` session header. See
66
100
  [Memory storage and deployment](storage.md#per-project-remote-sessions).
101
+ HTTP calls never consult the server checkout's project mapping to choose a
102
+ client's default, including on the synchronization write path. The optional
103
+ OpenViking provider also retains its configured workspace selection rather
104
+ than consulting an AnythingLLM-specific mapping.
67
105
 
68
106
  The HTTP server performs queries and runs the sync script on its own host. A
69
107
  remote sync script must therefore obtain project documents from a server-side
@@ -1,7 +1,7 @@
1
1
  # Curriculum Coverage Map
2
2
 
3
- **Baseline:** Cairnkeep 2.22.5
4
- **Last reviewed:** 2026-10-07
3
+ **Baseline:** Cairnkeep 2.23.1
4
+ **Last reviewed:** 2026-10-22
5
5
 
6
6
  This map prevents the course from drifting behind the product. It assigns each
7
7
  user-facing surface to a lesson and records whether the lesson is complete or
@@ -20,7 +20,7 @@ been rehearsed.
20
20
  | Wiki, alignment, and repository quality workflows | L05-L06 | L05-L06 | Brief |
21
21
  | Optional local code graph, graph inspection, and harness delegates | L18 | L18 | Brief; default off |
22
22
  | Storage placement, export/import, and authenticated remote memory | L07 | L07-L08 | Brief |
23
- | Document RAG | L00 | L09 | Brief; optional |
23
+ | Document RAG | L00 | L09 | Brief; optional; [V09 routing supplement](video-scripts/V09-workspace-routing-supplement.md) covers local mappings and HTTP isolation |
24
24
  | token-miser exploration and routing | L00 | L10 | Brief; optional |
25
25
  | Rootless containers and persistent service operation | L01 | L11 | L01 Ready; L11 Brief |
26
26
  | Private managed distributions | L12 | L12 | Brief; optional |
@@ -1,6 +1,6 @@
1
1
  # Cairnkeep feature guide
2
2
 
3
- **Baseline:** Cairnkeep 2.22.5
3
+ **Baseline:** Cairnkeep 2.23.1
4
4
 
5
5
  This is the step-back map for choosing and operating Cairnkeep features. The
6
6
  [course labs](https://github.com/cairnkeep/cairnkeep-course-labs) provide one
@@ -36,6 +36,12 @@ explicit native Codex exec exports. See the L16 memory-protocol supplement;
36
36
  protocol observations and independently verified task correctness remain
37
37
  separate evidence, not a claim of model improvement.
38
38
 
39
+ Version 2.23 adds opt-in hybrid memory retrieval, explicit query aliases and
40
+ match/source/conflict explanations without changing legacy defaults. See
41
+ [memory retrieval](../memory-retrieval.md), [L04](lessons/L04-memory-fundamentals.md)
42
+ and its recording supplement. The synthetic Markdown comparison measures
43
+ retrieval policy, not general task quality or a storage-format advantage.
44
+
39
45
  ## The three-layer model
40
46
 
41
47
  1. **Memory server:** an MCP process that owns scoped durable storage. The
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Quickstart
5
5
  **Time:** 10 minutes
6
- **Tested with:** Cairnkeep 2.22.5
6
+ **Tested with:** Cairnkeep 2.23.1
7
7
 
8
8
  ## Outcome
9
9
 
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Quickstart
5
5
  **Time:** 15 minutes
6
- **Tested with:** Cairnkeep 2.22.5
6
+ **Tested with:** Cairnkeep 2.23.1
7
7
 
8
8
  ## Outcome
9
9
 
@@ -26,7 +26,7 @@ ephemeral; the named course volume is persistent.
26
26
  1. Pull the public image:
27
27
 
28
28
  ```bash
29
- podman pull ghcr.io/cairnkeep/cairnkeep:2.22.5
29
+ podman pull ghcr.io/cairnkeep/cairnkeep:2.23.1
30
30
  ```
31
31
 
32
32
  2. Start the stdio server with a read-only root filesystem and no Linux
@@ -38,7 +38,7 @@ ephemeral; the named course volume is persistent.
38
38
  --read-only --cap-drop=all --security-opt=no-new-privileges \
39
39
  --tmpfs=/tmp:rw,noexec,nosuid,size=64m,mode=1777 \
40
40
  --volume cairnkeep-course-data:/data:Z,U \
41
- ghcr.io/cairnkeep/cairnkeep:2.22.5 stdio
41
+ ghcr.io/cairnkeep/cairnkeep:2.23.1 stdio
42
42
  ```
43
43
 
44
44
  3. The process waits quietly for MCP input. Press `Ctrl-C` after confirming it
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Quickstart
5
5
  **Time:** 25 minutes
6
- **Tested with:** Cairnkeep 2.22.5 and Node.js 22 or newer
6
+ **Tested with:** Cairnkeep 2.23.1 and Node.js 22 or newer
7
7
 
8
8
  ## Outcome
9
9
 
@@ -47,7 +47,7 @@ sync. Codex project trust remains an explicit operator decision.
47
47
  2. Install Cairnkeep:
48
48
 
49
49
  ```bash
50
- npm install --global @cairnkeep/cli@2.22.5
50
+ npm install --global @cairnkeep/cli@2.23.1
51
51
  cairn --version
52
52
  ```
53
53
 
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Quickstart
5
5
  **Time:** 25 minutes
6
- **Tested with:** Cairnkeep 2.22.5
6
+ **Tested with:** Cairnkeep 2.23.1
7
7
 
8
8
  ## Outcome
9
9
 
@@ -15,6 +15,10 @@ review extracted candidates before they become durable memory.
15
15
  - Key families: `decisions/`, `pitfalls/`, `patterns/`, `bugs/`,
16
16
  `constraints/`, and `conventions/`.
17
17
  - Exact read versus semantic search and substring fallback.
18
+ - Optional hybrid lexical/identifier admission, explicit aliases, match reasons
19
+ and valid empty results; similarity scores are not factual confidence.
20
+ - Curated Markdown as a credible baseline; indexing policy and storage format
21
+ are separate decisions.
18
22
  - Superseding a fact without losing history.
19
23
  - Session-end candidate extraction and `/memory-review` as the acceptance gate.
20
24
  - Typed node metadata, tags, and hard filters as an independent opt-in.
@@ -27,10 +31,24 @@ Store three synthetic facts in different categories, retrieve them by an
27
31
  imprecise query, supersede one, inspect its history, and reject one staged
28
32
  candidate.
29
33
 
34
+ From a source checkout, run:
35
+
36
+ ```sh
37
+ npm --prefix mcp-memory-server run study:memory-retrieval
38
+ ```
39
+
40
+ Compare the 0/100/1,000-distractor results and explain
41
+ why Markdown with the same admission policy matches Cairnkeep. Inspect the
42
+ semantic-only case that lexical modes miss; do not describe the synthetic
43
+ report as general accuracy. Repeat retrieval after superseding a synthetic
44
+ fact and starting a fresh client, verifying the new value and explicit history.
45
+
30
46
  ## Acceptance criteria
31
47
 
32
48
  - The learner can justify the scope and category for each fact.
33
49
  - Search finds a fact without requiring its exact key.
50
+ - A nearby but incorrect identifier and an unrelated query return no hybrid
51
+ match; aliases never widen scope or grant authority.
34
52
  - Superseding preserves the prior value in history.
35
53
  - No extracted candidate becomes durable without an explicit review action.
36
54
  - Enabling typed nodes changes discovery structure, not the authority of a fact.
@@ -38,5 +56,7 @@ candidate.
38
56
  ## Source material
39
57
 
40
58
  - [Operating guide](../../operating.md#the-workflow)
59
+ - [Memory retrieval and the Markdown baseline](../../memory-retrieval.md)
60
+ - [Recording supplement](../video-scripts/V04-memory-retrieval-supplement.md)
41
61
  - [Storage and deployment](../../storage.md)
42
62
  - [L14 - Typed memory and controlled import](L14-typed-memory.md)
@@ -13,6 +13,8 @@ without affecting core Cairnkeep memory.
13
13
 
14
14
  - Memory versus document RAG responsibilities.
15
15
  - Workspace selection and project configuration.
16
+ - Explicit directory-to-workspace mapping for local stdio; HTTP session headers
17
+ remain authoritative for remote routing, not the server's current directory.
16
18
  - Query-only setup before document synchronization.
17
19
  - Incremental, full, and replacement synchronization boundaries.
18
20
  - Endpoint, credential, and document-selection safety.
@@ -24,12 +26,21 @@ Index a synthetic three-document corpus into a disposable workspace, ask a
24
26
  question requiring citations to two documents, update one document, resync, and
25
27
  verify the new answer. Then unset the integration and prove memory still works.
26
28
 
29
+ Use two disposable checkouts sharing a global memory configuration. Declare
30
+ their absolute paths and distinct slugs in `anythingllm-projects.json`; verify
31
+ root and subdirectory queries report the expected workspace. Check an explicit
32
+ workspace override and an undeclared-directory fallback. Keep synchronization
33
+ synthetic and separately approved; a destination mapping is not write consent.
34
+ See the [recording supplement](../video-scripts/V09-workspace-routing-supplement.md).
35
+
27
36
  ## Acceptance criteria
28
37
 
29
38
  - Only allowlisted synthetic documents are uploaded.
30
39
  - The learner can identify the selected workspace and endpoint without printing
31
40
  its credential.
32
41
  - Updated content replaces stale retrieval results.
42
+ - The learner verifies the returned workspace before trusting an empty answer;
43
+ conflicting deepest declarations require an explicit destination or repair.
33
44
  - Disabling RAG leaves `/remember` and `/recall` healthy.
34
45
 
35
46
  ## Source material
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Evidence and Evaluation
5
5
  **Time:** 50 minutes
6
- **Tested with:** Cairnkeep 2.22.5
6
+ **Tested with:** Cairnkeep 2.23.1
7
7
 
8
8
  ## Outcome
9
9
 
@@ -1,7 +1,7 @@
1
1
  # L20 - Least-authority MCP tool profiles
2
2
 
3
3
  **Status:** Ready
4
- **Tested with:** Cairnkeep 2.22.5 and Node.js 22 or newer
4
+ **Tested with:** Cairnkeep 2.23.1 and Node.js 22 or newer
5
5
  **Time:** 25 minutes
6
6
 
7
7
  ## Outcome
@@ -1,7 +1,7 @@
1
1
  # L21 - Immutable context packs and skill approval
2
2
 
3
3
  **Status:** Ready
4
- **Tested with:** Cairnkeep 2.22.5 and Node.js 22 or newer
4
+ **Tested with:** Cairnkeep 2.23.1 and Node.js 22 or newer
5
5
  **Time:** 40 minutes
6
6
 
7
7
  ## Outcome
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Operator
5
5
  **Time:** 30 minutes
6
- **Tested with:** Cairnkeep 2.22.5, Windows x64, and Node.js 22 or newer
6
+ **Tested with:** Cairnkeep 2.23.1, Windows x64, and Node.js 22 or newer
7
7
 
8
8
  ## Outcome
9
9
 
@@ -16,7 +16,7 @@ perform a reversible uninstall without relying on WSL or Git Bash.
16
16
  From PowerShell:
17
17
 
18
18
  ```powershell
19
- npm install --global @cairnkeep/cli@2.22.5
19
+ npm install --global @cairnkeep/cli@2.23.1
20
20
  cairn version
21
21
 
22
22
  $Lab = Join-Path $env:TEMP 'Cairnkeep Windows Lab'
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Quickstart and Operator
5
5
  **Time:** 35 minutes
6
- **Tested with:** Cairnkeep 2.22.5; Pi 0.84.1; Node.js 22, 24, and 26
6
+ **Tested with:** Cairnkeep 2.23.1; Pi 0.84.1; Node.js 22, 24, and 26
7
7
 
8
8
  ## Outcome
9
9
 
@@ -1,7 +1,7 @@
1
1
  # L24 - Reviewed knowledge exchange
2
2
 
3
3
  **Status:** Ready
4
- **Tested with:** Cairnkeep 2.22.5 and Node.js 22 or newer
4
+ **Tested with:** Cairnkeep 2.23.1 and Node.js 22 or newer
5
5
  **Time:** 35 minutes
6
6
 
7
7
  ## Outcome
@@ -1,7 +1,7 @@
1
1
  # L25 - Bounded workflow playbooks
2
2
 
3
3
  **Status:** Ready
4
- **Tested with:** Cairnkeep 2.22.5 and Node.js 22 or newer
4
+ **Tested with:** Cairnkeep 2.23.1 and Node.js 22 or newer
5
5
  **Time:** 35 minutes
6
6
 
7
7
  ## Outcome
@@ -1,7 +1,7 @@
1
1
  # L26 - Context intelligence with explicit authority
2
2
 
3
3
  **Status:** Ready
4
- **Tested with:** Cairnkeep 2.22.5 and Node.js 22 or newer
4
+ **Tested with:** Cairnkeep 2.23.1 and Node.js 22 or newer
5
5
 
6
6
  ## Outcome
7
7
 
@@ -1,6 +1,6 @@
1
1
  # L27 - Evaluate context companions without moving authority
2
2
 
3
- **Tested with:** Cairnkeep 2.22.5 and Node.js 22 or newer
3
+ **Tested with:** Cairnkeep 2.23.1 and Node.js 22 or newer
4
4
 
5
5
  ## Outcome
6
6
 
@@ -1,7 +1,7 @@
1
1
  # L28 - Verify Cairnkeep's security posture
2
2
 
3
3
  **Status:** Ready
4
- **Tested with:** Cairnkeep 2.22.5 and Node.js 22 or newer
4
+ **Tested with:** Cairnkeep 2.23.1 and Node.js 22 or newer
5
5
 
6
6
  ## Outcome
7
7
 
@@ -11,7 +11,7 @@ and choose least authority for a network-facing MCP client.
11
11
 
12
12
  ## Prerequisites
13
13
 
14
- - Install Cairnkeep 2.22.5 or use a disposable source checkout.
14
+ - Install Cairnkeep 2.23.1 or use a disposable source checkout.
15
15
  - Complete [L20 - Least-authority MCP tool profiles](L20-mcp-tool-profiles.md).
16
16
  - Use synthetic values only; never paste a real bearer token into a recording,
17
17
  terminal transcript, or issue.
@@ -0,0 +1,34 @@
1
+ # V04 supplement — Finding the current fact without flooding context
2
+
3
+ Technical recording brief; no video is claimed as recorded. Use the source
4
+ checkout containing hybrid memory search and only invented fixture content.
5
+
6
+ ## Real terminal demonstration
7
+
8
+ Type at readable human speed, leaving pauses after each command:
9
+
10
+ ```sh
11
+ npm --prefix mcp-memory-server run build
12
+ npm --prefix mcp-memory-server run check:memory-retrieval
13
+ npm --prefix mcp-memory-server run study:memory-retrieval
14
+ ```
15
+
16
+ Zoom into the real MCP test's new-process handoff, superseded-history exclusion,
17
+ wrong-identifier refusal and provider-failure result. Demonstrate an MCP call
18
+ with `strategy: "hybrid"` and `explain: true`; show matched terms and source
19
+ locators, then show an unrelated query returning zero results. Explain that
20
+ agents still verify maintained sources and do not automatically correct memory.
21
+
22
+ ## Evidence and pacing
23
+
24
+ Show the frozen 1,000-distractor table: 3/9 first hits for substring, 8/9 for
25
+ BM25 and hybrid. Pause on the difference in irrelevant bytes and negative hits.
26
+ Then highlight that Markdown with the same admission policy also achieves 8/9
27
+ and zero negative hits. State that storage format did not cause the gain.
28
+
29
+ Finish with the semantic-only paraphrase that lexical modes miss. Explain that
30
+ provider-specific thresholds need their own evidence, that a ranking score is
31
+ not confidence, and that the attempted live study failed with HTTP 502. Do not
32
+ invent a successful live result or claim general task-quality improvements.
33
+ Use short terminal zooms and side-by-side result comparisons instead of static
34
+ slides; keep credentials and real memory off screen.
@@ -0,0 +1,36 @@
1
+ # V09 supplement — The right documents for the right repository
2
+
3
+ Technical recording brief; no completed video or full Ready L09 lab is claimed.
4
+ Use invented repository names and a loopback mock, never private mappings,
5
+ provider keys, real documents or production synchronization.
6
+
7
+ ## Real terminal demonstration
8
+
9
+ Leave a readable pause after each command:
10
+
11
+ ```sh
12
+ npm --prefix mcp-memory-server run build
13
+ npm --prefix mcp-memory-server run check:anythingllm-workspace
14
+ npm --prefix mcp-memory-server run check:remote-context
15
+ ```
16
+
17
+ Show two synthetic checkouts sharing one global configuration, then highlight
18
+ the distinct workspace reported by each real stdio MCP query. Zoom into a
19
+ subdirectory call and an explicit override. Explain that an empty answer from
20
+ the wrong corpus is not evidence that the requested information does not exist.
21
+
22
+ The mock synchronization prints arguments only; it uploads nothing. Contrast
23
+ destination selection with write consent and show replacement being refused
24
+ without confirmation. For HTTP, show the conflicting server-directory mapping
25
+ fixture and the client header still winning. Do not run a live provider or
26
+ silently activate RAG merely to record this supplement.
27
+
28
+ ## Boundaries and recovery
29
+
30
+ Explain the lookup order: explicit mapping file, legacy mapping beside the
31
+ selected sync script, then XDG. Missing or invalid mappings keep the legacy
32
+ configured default; inspect the returned workspace. Ambiguous deepest entries
33
+ require an explicit workspace or a corrected mapping. Mapping files are bounded
34
+ and unsafe file types are rejected. Directory matching is routing, not an ACL
35
+ or publisher-authenticity guarantee. Keep the full L09 lesson marked Brief until
36
+ its separate live synthetic-corpus lab has been verified.