@cairnkeep/cli 2.9.0 → 2.12.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 (86) hide show
  1. package/CHANGELOG.md +66 -1
  2. package/README.md +83 -29
  3. package/bin/cairn +6 -165
  4. package/bin/cairn-container +8 -0
  5. package/docs/building-an-overlay.md +42 -5
  6. package/docs/containers.md +10 -0
  7. package/docs/harness-compatibility.md +64 -3
  8. package/docs/learning/CURRICULUM-MAP.md +13 -6
  9. package/docs/learning/FEATURE-GUIDE.md +14 -3
  10. package/docs/learning/README.md +5 -2
  11. package/docs/learning/lessons/L00-why-cairnkeep.md +1 -1
  12. package/docs/learning/lessons/L01-safe-trial.md +3 -3
  13. package/docs/learning/lessons/L02-installation.md +24 -8
  14. package/docs/learning/lessons/L03-first-project.md +34 -15
  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 +83 -0
  19. package/docs/learning/lessons/L23-guided-setup.md +142 -0
  20. package/docs/learning/tracks/operator.md +8 -3
  21. package/docs/learning/tracks/quickstart.md +9 -4
  22. package/docs/native-windows.md +136 -0
  23. package/docs/operating.md +142 -20
  24. package/docs/privacy-and-data-flow.md +41 -1
  25. package/docs/quickstart.md +86 -0
  26. package/docs/storage.md +14 -2
  27. package/examples/eval/bundled-fake.json +1 -1
  28. package/mcp-memory-server/dist/artifact-store-windows-worker.js +74 -0
  29. package/mcp-memory-server/dist/artifact-store.js +196 -55
  30. package/mcp-memory-server/dist/capability-cli.js +2 -1
  31. package/mcp-memory-server/dist/capability-config.js +4 -3
  32. package/mcp-memory-server/dist/capability-harness.js +34 -7
  33. package/mcp-memory-server/dist/context-pack.js +84 -25
  34. package/mcp-memory-server/dist/eval-cli.js +6 -5
  35. package/mcp-memory-server/dist/eval-plan.js +35 -13
  36. package/mcp-memory-server/dist/eval-process.js +11 -4
  37. package/mcp-memory-server/dist/eval-report.js +7 -5
  38. package/mcp-memory-server/dist/graph-cli.js +7 -1
  39. package/mcp-memory-server/dist/index.js +19 -20
  40. package/mcp-memory-server/dist/mcp-tool-profile.js +6 -4
  41. package/mcp-memory-server/dist/note-store.js +12 -3
  42. package/mcp-memory-server/dist/pi-mcp-bridge.js +185 -0
  43. package/mcp-memory-server/dist/platform-security.js +102 -0
  44. package/mcp-memory-server/dist/skill-store.js +27 -12
  45. package/mcp-memory-server/package.json +2 -1
  46. package/package.json +6 -4
  47. package/pi/extensions/cairnkeep-memory.ts +61 -0
  48. package/schemas/cairnkeep-setup-policy.schema.json +55 -0
  49. package/schemas/cairnkeep-setup.schema.json +36 -0
  50. package/scripts/bootstrap.sh +7 -15
  51. package/scripts/cairn-cli.mjs +119 -0
  52. package/scripts/cairn-container-cli.mjs +121 -0
  53. package/scripts/cairn-hook.mjs +199 -0
  54. package/scripts/completion.sh +17 -6
  55. package/scripts/doctor.sh +58 -0
  56. package/scripts/fix-permissions.mjs +12 -0
  57. package/scripts/harness-registry.mjs +126 -0
  58. package/scripts/memory-wiki-audit.mjs +95 -0
  59. package/scripts/phase26-test-manifest.mjs +26 -0
  60. package/scripts/run-repository-tests.mjs +76 -0
  61. package/scripts/setup-core.mjs +312 -0
  62. package/scripts/setup-reconcile.mjs +332 -0
  63. package/scripts/setup.mjs +342 -0
  64. package/scripts/sync-pi-assets.sh +19 -4
  65. package/scripts/test-bootstrap-untracked.sh +2 -1
  66. package/scripts/test-completion.sh +41 -0
  67. package/scripts/test-doctor.sh +66 -0
  68. package/scripts/test-harness-registry.sh +94 -0
  69. package/scripts/test-learning-docs.sh +52 -3
  70. package/scripts/test-package-install.sh +69 -0
  71. package/scripts/test-phase17-artifact-lifecycle.sh +1 -1
  72. package/scripts/test-phase18-capability-lifecycle.sh +1 -1
  73. package/scripts/test-phase19-eval-lifecycle.sh +12 -2
  74. package/scripts/test-pi-lifecycle.mjs +190 -0
  75. package/scripts/test-setup-compatibility.mjs +187 -0
  76. package/scripts/test-setup-output.sh +131 -0
  77. package/scripts/test-setup-overlay.sh +113 -0
  78. package/scripts/test-setup-preflight.mjs +281 -0
  79. package/scripts/test-setup-reconcile.mjs +257 -0
  80. package/scripts/test-uninstall.sh +50 -0
  81. package/scripts/test-windows-native.mjs +159 -0
  82. package/scripts/uninstall.sh +73 -6
  83. package/scripts/verify-pi-mcp-bridge.mjs +588 -0
  84. package/scripts/windows-platform.mjs +733 -0
  85. package/templates/codex-config.toml.template +5 -0
  86. package/templates/start-codex.sh.template +30 -0
@@ -12,14 +12,16 @@ commands, hooks, plugins, or trajectory adapters.
12
12
  | OpenCode | Memory MCP, commands, workflows, plugins, launcher | Exercised by Cairnkeep tests |
13
13
  | Kimi Code | Memory MCP, `AGENTS.md`, launcher, opt-in graph Skill | Launcher tested; remote MCP tested with Kimi Code 0.30.0; graph Skill contract-tested |
14
14
  | Qwen Code | Memory MCP, launcher | Launcher tested; stdio and remote MCP tested with Qwen Code 0.21.1 |
15
- | Pi | Native opt-in trajectory extension, launcher, and graph prompt | Exercised by Cairnkeep tests; no bundled MCP bridge |
16
- | Codex CLI | Memory MCP | Configuration supported; no Cairnkeep operating-layer assets or launcher |
15
+ | Pi | Memory MCP through maintained local stdio extension, native opt-in trajectory extension, launcher, and graph prompt | Pi 0.84.1 validated minimum; deterministic and real bridge/lifecycle tests |
16
+ | Codex CLI | Project-scoped memory MCP and launcher | Setup and launcher contract-tested on POSIX and simulated native Windows; project trust remains operator-controlled |
17
17
  | Other MCP clients | Memory plus optional domain-knowledge and context-pack tools | Protocol-compatible; not automatically runtime-tested |
18
18
 
19
19
  Only Claude Code and OpenCode currently receive the complete operating layer.
20
20
  Kimi receives one narrow graph Skill, while Pi receives one narrow graph prompt;
21
21
  neither is equivalent to the full commands, agents, hooks, and plugins surface.
22
22
  Qwen skills and hooks still require harness-specific adaptation and validation.
23
+ Codex receives a project-local MCP entry and launcher, but not Cairnkeep-specific
24
+ commands, hooks, agents, or automatic skill activation.
23
25
 
24
26
  Every MCP client receives complete tool annotations and may use a Cairnkeep
25
27
  least-authority profile independent of harness assets. Context-pack tools are
@@ -33,7 +35,35 @@ Pi, Qwen Code, Codex, and other shell-capable clients can invoke
33
35
  `graphify` executable are on `PATH`. `cairn sync-kimi --apply` registers a Kimi
34
36
  Skill as `/graphify` (or `/skill:graphify`), and `cairn sync-pi --apply`
35
37
  registers a Pi prompt template as `/graphify`; both delegate exclusively to
36
- that CLI. Neither adds an MCP bridge to Pi or expands the other support levels.
38
+ that CLI. Pi sync separately installs the Cairnkeep-owned local stdio memory
39
+ extension; it does not expand the other support levels.
40
+
41
+ ## Pi
42
+
43
+ Run `cairn sync-pi --apply` explicitly to install
44
+ `extensions/cairnkeep-memory.ts`, `extensions/cairnkeep-trajectory.ts`, and
45
+ `prompts/graphify.md` under the Pi agent root. Use `--check` for drift and
46
+ `cairn doctor` from a project that selected Pi for setup-aware diagnosis. Setup
47
+ reports this machine command but never runs it automatically. Uninstall removes
48
+ only those owned paths, backup-first.
49
+
50
+ The memory extension supervises `cairn memory-server` as a local stdio child.
51
+ It discovers the effective MCP catalog dynamically and preserves names,
52
+ descriptions, input/output schemas, original content, `structuredContent`,
53
+ `_meta`, failure behavior, and the exact tool annotations in trusted result
54
+ `details`. Pi 0.84.1 exposes no native annotations field in its public tool API,
55
+ so those annotations are not claimed as native model-facing metadata. Server
56
+ feature gates, capability state, and least-authority profiles continue to
57
+ decide which tools exist.
58
+
59
+ Startup, calls, results, stderr retention, cancellation, and shutdown are
60
+ bounded. The extension adds tools only: it does not run prompts, activate
61
+ context-pack skills, create an autonomous loop, or add a remote transport.
62
+ Pi 0.84.1 is the validated minimum. The v2.11 release matrix passed separate
63
+ installations for that minimum and the explicitly versioned registry-current Pi
64
+ release, together with Node.js 22/24/26, Bash 3.2, and native Windows. The
65
+ executable paths were distinct; both reported 0.84.1 because that was also the
66
+ registry-current release.
37
67
 
38
68
  ## Kimi Code
39
69
 
@@ -172,6 +202,37 @@ Git, and leave secret values as environment references.
172
202
  Qwen MCP configuration is documented at
173
203
  [Qwen Code MCP](https://qwenlm.github.io/qwen-code-docs/en/users/features/mcp/).
174
204
 
205
+ ## Codex CLI
206
+
207
+ Select Codex during setup to create a project-scoped local stdio entry and
208
+ launcher:
209
+
210
+ ```bash
211
+ cairn setup /path/to/project --git init --harness codex --memory local --yes
212
+ cd /path/to/project
213
+ ./.ai/start-codex.sh
214
+ ```
215
+
216
+ Native Windows uses `.\.ai\start-codex.cmd`. The generated
217
+ `.codex/config.toml` contains only:
218
+
219
+ ```toml
220
+ [mcp_servers.cairn-memory]
221
+ command = "cairn"
222
+ args = ["memory-server"]
223
+ ```
224
+
225
+ Review this file before accepting Codex's project-trust prompt. Cairnkeep does
226
+ not grant trust, edit the user-wide Codex configuration, or start Codex during
227
+ setup. If an operator-owned `.codex/config.toml` already differs, setup reports
228
+ `skipped` and leaves it unchanged; merge the table manually and run `cairn
229
+ doctor` to verify the effective entry. Uninstall never removes an
230
+ operator-owned configuration file.
231
+
232
+ The launcher loads `.ai/.env`, runs optional pre/post hooks, changes to the
233
+ project root, and passes all arguments to `codex`. It does not install native
234
+ Codex Skills or instructions and does not activate approved context-pack skills.
235
+
175
236
  ## Candidate memory clients
176
237
 
177
238
  The following clients have documented MCP support and are reasonable adapter
@@ -1,7 +1,7 @@
1
1
  # Curriculum Coverage Map
2
2
 
3
- **Baseline:** Cairnkeep 2.9.0
4
- **Last reviewed:** 2026-08-06
3
+ **Baseline:** Cairnkeep 2.12.0
4
+ **Last reviewed:** 2026-08-13
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
@@ -14,7 +14,8 @@ been rehearsed.
14
14
  | Product surface | Introduced | Practised or operated | Learning status |
15
15
  |---|---|---|---|
16
16
  | Local stdio memory and MCP registration | L00-L02 | L03-L04 | L00-L03 Ready; L04 Brief |
17
- | Project bootstrap, launchers, and contributor mode | L02-L03 | L05 | L02-L03 Ready; L05 Brief |
17
+ | Guided project setup, launchers, and bootstrap compatibility/contributor mode | L02-L03 | L05 and L23 | L02-L03 and L23 Ready; L05 Brief |
18
+ | Declarative harness registry and Codex project-scoped MCP setup | L03 | L03 and L23 | Ready; project trust remains explicit |
18
19
  | Memory scopes, keys, search, supersession, and history | L04 | L04-L05 | Brief |
19
20
  | Wiki, alignment, and repository quality workflows | L05-L06 | L05-L06 | Brief |
20
21
  | Optional local code graph, graph inspection, and harness delegates | L18 | L18 | Brief; default off |
@@ -34,6 +35,9 @@ been rehearsed.
34
35
  | Reviewed, evaluated, reversible skill-file improvement | L19 | L19 | Ready; explicit and default off |
35
36
  | Complete MCP annotations and least-authority tool profiles | L20 | L20 | Ready; default profile remains full |
36
37
  | Immutable context packs and exact-digest skill approval | L21 | L21 | Ready; default off |
38
+ | Native Windows x64 CLI, hooks, ACLs, scheduling, and recovery | L22 | L22 | Ready; PowerShell-native |
39
+ | Guided project setup, selected harness state, and Git-less limitations | L03 | L03 and L23 | Ready |
40
+ | Pi local stdio memory bridge, trusted annotation details, and explicit lifecycle | L23 | L23 | Ready; Pi 0.84.1 validated minimum |
37
41
 
38
42
  ## Release Review
39
43
 
@@ -55,7 +59,7 @@ repository remains the canonical source for explanations and scripts.
55
59
  | Checkpoint | Lessons | Purpose |
56
60
  |---|---|---|
57
61
  | `course-00-app` | L00-L02 | Plain synthetic application before Cairnkeep |
58
- | `course-01-bootstrap` | L03 | Neutral bootstrap and isolated environment |
62
+ | `course-01-bootstrap` | L03 | Guided local setup, Codex project configuration, and isolated environment |
59
63
  | `course-02-memory` | L04-L05 | Memory lifecycle and derived knowledge |
60
64
  | `course-03-quality` | L06 | Repository review and deliberately vulnerable fixture |
61
65
  | `course-04-operation` | L07-L12 | Storage, routing, integrations, containers, overlays |
@@ -65,6 +69,8 @@ repository remains the canonical source for explanations and scripts.
65
69
  | `course-08-graph` | L18 | Optional local structural graph workflow |
66
70
  | `course-09-skill` | L19 | Validated skill improvement in a disposable project |
67
71
  | `course-10-trust-context` | L20-L21 | MCP authority profiles and offline context-pack lifecycle |
72
+ | `course-11-windows` | L22 | Native PowerShell lifecycle, ACL inspection, and reversible uninstall |
73
+ | `course-12-guided-setup` | L23 | Deterministic setup, Pi local stdio, recovery, and backup-first uninstall |
68
74
 
69
75
  ## Command Ownership
70
76
 
@@ -73,10 +79,11 @@ against `cairn help` so a new command cannot bypass a curriculum decision.
73
79
 
74
80
  | Command | Primary lesson |
75
81
  |---|---|
76
- | `cairn bootstrap` | L03 |
82
+ | `cairn bootstrap` | L03 compatibility challenge |
83
+ | `cairn setup` | L03 for Claude/Codex; advanced Pi lifecycle in L23 |
77
84
  | `cairn memory-server` | L02 |
78
85
  | `cairn sync` | L02 |
79
- | `cairn sync-pi` | L13 |
86
+ | `cairn sync-pi` | L13 and L23 |
80
87
  | `cairn sync-kimi` | L02 |
81
88
  | `cairn doctor` | L03; advanced repair in L13-L14 |
82
89
  | `cairn trajectory` | L13 |
@@ -1,6 +1,6 @@
1
1
  # Cairnkeep feature guide
2
2
 
3
- **Baseline:** Cairnkeep 2.9.0
3
+ **Baseline:** Cairnkeep 2.12.0
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
@@ -8,13 +8,19 @@ synthetic Trail Ledger project with tagged states from a plain application to
8
8
  offline evaluation. Detailed contracts remain in the linked operating,
9
9
  storage, privacy, and lesson documents.
10
10
 
11
+ Guided setup and the maintained Pi memory extension shipped in v2.11. The v2.12
12
+ harness registry adds first-class Codex project setup without granting project
13
+ trust. See [L03](lessons/L03-first-project.md) and
14
+ [L23](lessons/L23-guided-setup.md) for the tested boundaries.
15
+
11
16
  ## The three-layer model
12
17
 
13
18
  1. **Memory server:** an MCP process that owns scoped durable storage. The
14
19
  default stdio setup runs on the current machine; installation never
15
20
  discovers or selects a remote host.
16
21
  2. **Project scaffold:** launchers, private environment, and `.planning/`
17
- policy/derived-knowledge files created by `cairn bootstrap`.
22
+ policy/derived-knowledge files reconciled by `cairn setup`; `cairn bootstrap`
23
+ remains the deterministic compatibility primitive.
18
24
  3. **Operating layer:** harness commands, agents, and hooks installed by
19
25
  `cairn sync --apply` or the harness-specific equivalent.
20
26
 
@@ -48,6 +54,8 @@ prerequisites for ordinary memory.
48
54
  | Wiki and alignment | `/wiki-ingest`, `/wiki-query`, `/wiki-lint`, alignment files | Written only when invoked; reviewable `.planning/` artifacts | Re-run lint, inspect source citations, revert tracked changes normally | `course-02-memory` |
49
55
  | Local code graph | `cairn graph build|query|status|diff|explain|path`; `/graphify` delegates | Default off; optional isolated `graphify` executable; incremental work under `graphify-out/`, published view under `.planning/graphs/` | Ignore both derived locations; check status and source before trusting a result; use `--force` only after intentional deletion; uninstall adapters separately | `course-08-graph` |
50
56
  | Repository quality | `/repo-review`, `/security-audit` | On-demand workflow; findings are hypotheses until reproduced | Require file/line evidence and regression tests | `course-03-quality` |
57
+ | Guided project setup | `cairn setup PATH --git init\|existing\|none --harness LIST --memory local\|none --yes` | Reconciles only selected project assets from one harness registry; private `.ai/cairnkeep.json`; machine sync is never automatic | Repeat deterministically, run doctor, or replay its recovery command; Git-less mode remains limited | `course-12-guided-setup` |
58
+ | Codex project memory | Select `--harness codex --memory local` | Writes `.codex/config.toml` plus POSIX/native Windows launchers; local stdio; user-wide configuration and trust remain untouched | Review the MCP table, accept Codex project trust, run doctor, and relaunch; uninstall is backup-first | `course-01-bootstrap` |
51
59
 
52
60
  ## Storage and optional topology
53
61
 
@@ -62,6 +70,7 @@ prerequisites for ordinary memory.
62
70
  | Managed overlays | Separate distribution manifest, wrapper, profile lock, fleet and rollback gates | Policy and secrets belong in the private distribution/machine config, never core | `overlay info`, doctor, fleet dry run/current state, rollback | `course-04-operation` |
63
71
  | MCP tool profiles | `cairn mcp-tools set full|read-only|custom` | Strict mode-`0600` project config; process overrides take precedence; profile only removes tools | Inspect catalog/status digest; reset and restart MCP | `course-10-trust-context` |
64
72
  | Context packs | Manual local or commit-pinned Git install plus project enablement | Immutable objects and atomic pointers under `CAIRN_PACK_BASE_DIR`; no background sync | Validate, inspect digest, check/apply update, disable/remove | `course-10-trust-context` |
73
+ | Pi local stdio memory | Select Pi during setup, then explicitly run `cairn sync-pi --apply` | Local memory-server child; dynamic effective tool catalog; annotations retained in trusted details, not a native Pi field | `cairn sync-pi --check`, `cairn doctor`, cancel one call, then observe awaited shutdown with no orphan | `course-12-guided-setup` |
65
74
 
66
75
  ## Evidence, governance, and measurement
67
76
 
@@ -82,8 +91,10 @@ prerequisites for ordinary memory.
82
91
  ## Harness and maintenance checks
83
92
 
84
93
  - Use a generated launcher so project environment and hooks are repeatable.
94
+ - For Codex, review `.codex/config.toml` and accept project trust; no machine
95
+ sync is required for the memory-only integration.
85
96
  - Run `cairn sync --check` after every core upgrade; apply only reported drift.
86
- - Run `cairn sync-pi --check` when the optional Pi capture/graph adapter is installed.
97
+ - Run `cairn sync-pi --check` when the Pi memory/trajectory/graph assets are installed.
87
98
  - Run `cairn sync-kimi --check` when the optional Kimi graph Skill is installed.
88
99
  - Use `cairn doctor --repair` only after preserving the affected store and only
89
100
  for repairable derived indexes/metadata.
@@ -8,7 +8,8 @@ publication material.
8
8
 
9
9
  Choose the shortest track that matches your goal:
10
10
 
11
- - [Quickstart](tracks/quickstart.md) - prove the core value in about 75 minutes.
11
+ - [Quickstart](tracks/quickstart.md) - prove the core value, including the
12
+ one-command Codex project path and the explicit Pi lifecycle, in about 110 minutes.
12
13
  - [Practitioner](tracks/practitioner.md) - adopt Cairnkeep in daily project work.
13
14
  - [Evidence and evaluation](tracks/evidence-and-evaluation.md) - inspect optional
14
15
  session evidence, govern capabilities, and measure changes without overstating
@@ -33,7 +34,7 @@ expanded only after their labs are executable.
33
34
  | L00 | [Why Cairnkeep?](lessons/L00-why-cairnkeep.md) | Ready | 10 min |
34
35
  | L01 | [Try it safely](lessons/L01-safe-trial.md) | Ready | 15 min |
35
36
  | L02 | [Install the local workflow](lessons/L02-installation.md) | Ready | 25 min |
36
- | L03 | [Bootstrap the first project](lessons/L03-first-project.md) | Ready | 25 min |
37
+ | L03 | [Set up the first project](lessons/L03-first-project.md) | Ready | 25 min |
37
38
  | L04 | [Memory fundamentals](lessons/L04-memory-fundamentals.md) | Brief | 35 min |
38
39
  | L05 | [The daily workflow](lessons/L05-daily-workflow.md) | Brief | 40 min |
39
40
  | L06 | [Repository review and security](lessons/L06-repository-quality.md) | Brief | 45 min |
@@ -52,6 +53,8 @@ expanded only after their labs are executable.
52
53
  | L19 | [Validated skill improvement](lessons/L19-validated-skill-improvement.md) | Ready | 50 min |
53
54
  | L20 | [Least-authority MCP tool profiles](lessons/L20-mcp-tool-profiles.md) | Ready | 25 min |
54
55
  | L21 | [Immutable context packs and skill approval](lessons/L21-context-packs.md) | Ready | 40 min |
56
+ | L22 | [Operate Cairnkeep on native Windows](lessons/L22-native-windows.md) | Ready | 30 min |
57
+ | L23 | [Guided setup and Pi memory](lessons/L23-guided-setup.md) | Ready | 35 min |
55
58
 
56
59
  The [curriculum coverage map](CURRICULUM-MAP.md) records where every public
57
60
  feature is introduced, practised, and operated. It also marks design-only work
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Quickstart
5
5
  **Time:** 10 minutes
6
- **Tested with:** Cairnkeep 2.9.0
6
+ **Tested with:** Cairnkeep 2.12.0
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.9.0
6
+ **Tested with:** Cairnkeep 2.12.0
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.9.0
29
+ podman pull ghcr.io/cairnkeep/cairnkeep:2.12.0
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.9.0 stdio
41
+ ghcr.io/cairnkeep/cairnkeep:2.12.0 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.9.0 and Node.js 22 or newer
6
+ **Tested with:** Cairnkeep 2.12.0 and Node.js 22 or newer
7
7
 
8
8
  ## Outcome
9
9
 
@@ -13,7 +13,8 @@ layer, and distinguish a complete installation from a partial one.
13
13
  ## Prerequisites
14
14
 
15
15
  - Node.js 22 or newer and npm.
16
- - Claude Code installed for the commands below. OpenCode, Kimi Code, and Qwen Code users
16
+ - Claude Code installed for the full operating-layer commands below. Codex CLI
17
+ users can take the project-scoped path in L03. OpenCode, Kimi Code, and Qwen Code users
17
18
  should follow the equivalent setup in
18
19
  [the operating guide](../../operating.md).
19
20
  - Permission to install an npm package globally for your user.
@@ -26,8 +27,13 @@ A complete setup has three independent parts:
26
27
  2. the MCP registration used by the harness;
27
28
  3. the operating layer containing commands, agents, hooks, and templates.
28
29
 
29
- `cairn bootstrap` configures a project later; it does not perform the first two
30
- machine-level steps.
30
+ `cairn setup` configures a project later; it does not perform the first two
31
+ machine-level steps. `cairn bootstrap` remains the compatibility primitive for
32
+ scripts and overlays that already own their setup policy.
33
+
34
+ Codex is the simpler memory-only exception: L03 writes its project-scoped MCP
35
+ entry and launcher, so it needs no user-wide MCP registration or machine-level
36
+ sync. Codex project trust remains an explicit operator decision.
31
37
 
32
38
  ## Exercise
33
39
 
@@ -41,7 +47,7 @@ machine-level steps.
41
47
  2. Install Cairnkeep:
42
48
 
43
49
  ```bash
44
- npm install --global @cairnkeep/cli@2.9.0
50
+ npm install --global @cairnkeep/cli@2.12.0
45
51
  cairn --version
46
52
  ```
47
53
 
@@ -72,6 +78,15 @@ machine-level steps.
72
78
  Use `cairn completion zsh` or `cairn completion fish` for those shells.
73
79
  Completion is a convenience and is not another runtime component.
74
80
 
81
+ On native Windows PowerShell, use:
82
+
83
+ ```powershell
84
+ Invoke-Expression (& cairn completion powershell | Out-String)
85
+ ```
86
+
87
+ Project setup emits `.cmd` launchers on Windows; use
88
+ `.\.ai\start-claude.cmd` instead of the Unix `.sh` launcher.
89
+
75
90
  ## Verify
76
91
 
77
92
  Run both checks:
@@ -99,8 +114,9 @@ installation.
99
114
  This registration starts `cairn memory-server` locally as a stdio child. It
100
115
  does not discover a server, send memory to a remote host, configure embeddings,
101
116
  enable session capture, or enable an optional document-RAG integration. Pi uses
102
- the separate `cairn sync-pi` trajectory and graph-prompt adapter and still needs
103
- a user-selected bridge if Pi should expose MCP memory tools.
117
+ the separate, explicit `cairn sync-pi --apply` command to install Cairnkeep's
118
+ maintained local stdio memory extension, trajectory extension, and graph prompt.
119
+ Project setup records the Pi selection but never changes machine-level Pi assets.
104
120
 
105
121
  Kimi Code can use the same memory server through its generated
106
122
  `.ai/start-kimi.sh` launcher, but its HTTP MCP configuration requires a literal
@@ -136,4 +152,4 @@ Do not delete memory stores as part of a course cleanup.
136
152
  - `sync --check` is the non-writing drift check.
137
153
  - Default stdio memory is local.
138
154
 
139
- Next: [L03 - Bootstrap the first project](L03-first-project.md).
155
+ Next: [L03 - Set up the first project](L03-first-project.md).
@@ -1,14 +1,15 @@
1
- # L03 - Bootstrap the first project
1
+ # L03 - Set up the first project
2
2
 
3
3
  **Status:** Ready
4
4
  **Track:** Quickstart
5
5
  **Time:** 25 minutes
6
- **Tested with:** Cairnkeep 2.9.0
6
+ **Tested with:** Cairnkeep 2.12.0
7
7
 
8
8
  ## Outcome
9
9
 
10
- You can bootstrap a disposable project, verify its wiring, store one accepted
11
- fact, and recall it from a new harness session.
10
+ You can use the guided setup contract on an empty directory, choose Claude Code
11
+ or Codex CLI, verify its Git and harness wiring, store one accepted fact, and
12
+ recall it from a new session.
12
13
 
13
14
  ## Prerequisites
14
15
 
@@ -18,22 +19,32 @@ fact, and recall it from a new harness session.
18
19
 
19
20
  ## Exercise
20
21
 
21
- 1. Create a disposable repository:
22
+ 1. Create an empty disposable project directory:
22
23
 
23
24
  ```bash
24
25
  mkdir -p "$HOME/cairnkeep-course/first-project"
25
26
  cd "$HOME/cairnkeep-course/first-project"
26
- git init
27
- printf '# Cairnkeep course project\n' > README.md
28
27
  ```
29
28
 
30
- 2. Bootstrap the project:
29
+ 2. Choose one harness and run the deterministic form of guided setup. The
30
+ explicit flags make the
31
+ exercise reproducible while exercising the same preflight as interactive
32
+ `cairn setup`:
31
33
 
32
34
  ```bash
33
- cairn bootstrap "$PWD"
35
+ # Full operating-layer route from L02:
36
+ cairn setup "$PWD" --git init --harness claude --memory local --yes
37
+
38
+ # Or the self-contained Codex memory route:
39
+ # cairn setup "$PWD" --git init --harness codex --memory local --yes
34
40
  cp .ai/env.example .ai/.env
35
41
  ```
36
42
 
43
+ Setup must create the Git repository, generate only the selected harness
44
+ assets, and write the private `.ai/cairnkeep.json` setup record. Codex also
45
+ receives `.codex/config.toml`; review it and accept Codex's project-trust
46
+ prompt before launching.
47
+
37
48
  3. Keep optional endpoint and model values unset for this local exercise. Run
38
49
  diagnostics:
39
50
 
@@ -45,10 +56,11 @@ fact, and recall it from a new harness session.
45
56
  and evaluation flags unset. The quickstart proves core memory without
46
57
  silently changing the amount of retained data.
47
58
 
48
- 4. Launch Claude Code through the generated project launcher:
59
+ 4. Launch the selected harness through its generated project launcher:
49
60
 
50
61
  ```bash
51
62
  ./.ai/start-claude.sh
63
+ # Codex route: ./.ai/start-codex.sh
52
64
  ```
53
65
 
54
66
  5. In the harness, store a deliberately synthetic convention:
@@ -79,9 +91,11 @@ The lesson is complete only if:
79
91
 
80
92
  | Symptom | Cause | Recovery |
81
93
  |---|---|---|
82
- | Launcher is missing | A different directory was bootstrapped | Run `pwd`, then bootstrap that exact path |
94
+ | Setup refuses the target | The directory is non-empty or its Git state conflicts with `--git init` | Preserve the directory, inspect it, then select `--git existing` or use a genuinely empty disposable path |
95
+ | Launcher is missing | A different directory was configured or Claude was not selected | Run `pwd`, inspect `.ai/cairnkeep.json`, then replay the recovery command from `cairn doctor` |
83
96
  | `.ai/.env` is missing | Only the example is generated | Copy `.ai/env.example` to `.ai/.env` |
84
- | `cairn-memory` is unavailable | L02 MCP registration is absent or stale | Run `claude mcp get cairn-memory`, repair it, then restart Claude Code |
97
+ | `cairn-memory` is unavailable in Claude | L02 MCP registration is absent or stale | Run `claude mcp get cairn-memory`, repair it, then restart Claude Code |
98
+ | `cairn-memory` is unavailable in Codex | Project configuration was skipped or the project is not trusted | Review/merge `.codex/config.toml`, rerun setup, then accept project trust and relaunch |
85
99
  | Slash commands are unknown | Operating assets were not loaded | Run `cairn sync --check`, apply if needed, then restart the harness |
86
100
  | Recall works only in the first session | Sessions used different storage routing | Compare launchers and environment, then inspect `cairn memory path` |
87
101
 
@@ -105,13 +119,18 @@ synthetic memory through the normal memory review/delete workflow if required.
105
119
 
106
120
  ## Optional challenge
107
121
 
108
- Repeat bootstrap with `--untracked` in another disposable Git repository, then
109
- inspect `.git/info/exclude` to see how contributor mode avoids shared changes.
122
+ Create another disposable Git repository and run `cairn bootstrap --untracked`
123
+ there. Inspect `.git/info/exclude` to see how the compatibility primitive keeps
124
+ contributor-mode scaffolding out of shared changes.
110
125
 
111
126
  ## Recap
112
127
 
113
- - Bootstrap is project-specific and follows machine setup.
128
+ - Guided setup owns target preflight, Git choice, harness selection, and a
129
+ private reconciliation record.
130
+ - Bootstrap remains available for compatibility and contributor workflows.
114
131
  - The generated launcher establishes a repeatable project environment.
132
+ - Codex memory setup is project-scoped and does not silently grant trust or
133
+ modify the user-wide Codex configuration.
115
134
  - Persistence is proven only after a new session recalls the accepted fact.
116
135
 
117
136
  Next: [L04 - Memory fundamentals](L04-memory-fundamentals.md).
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Evidence and Evaluation
5
5
  **Time:** 50 minutes
6
- **Tested with:** Cairnkeep 2.9.0
6
+ **Tested with:** Cairnkeep 2.12.0
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.9.0 and Node.js 22 or newer
4
+ **Tested with:** Cairnkeep 2.12.0 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.9.0 and Node.js 22 or newer
4
+ **Tested with:** Cairnkeep 2.12.0 and Node.js 22 or newer
5
5
  **Time:** 40 minutes
6
6
 
7
7
  ## Outcome
@@ -0,0 +1,83 @@
1
+ # L22 - Operate Cairnkeep on native Windows
2
+
3
+ **Status:** Ready
4
+ **Track:** Operator
5
+ **Time:** 30 minutes
6
+ **Tested with:** Cairnkeep 2.12.0, Windows x64, and Node.js 22 or newer
7
+
8
+ ## Outcome
9
+
10
+ You can prove that Cairnkeep is running natively from PowerShell, run guided
11
+ setup on an empty path containing spaces, inspect its security boundary, and
12
+ perform a reversible uninstall without relying on WSL or Git Bash.
13
+
14
+ ## Exercise
15
+
16
+ From PowerShell:
17
+
18
+ ```powershell
19
+ npm install --global @cairnkeep/cli@2.12.0
20
+ cairn version
21
+
22
+ $Lab = Join-Path $env:TEMP 'Cairnkeep Windows Lab'
23
+ New-Item -ItemType Directory -Force -Path $Lab | Out-Null
24
+ cairn setup $Lab --git init --harness claude --memory local --yes
25
+ cairn sync --apply --live-root (Join-Path $Lab '.claude-test')
26
+ cairn sync --check --live-root (Join-Path $Lab '.claude-test')
27
+ Push-Location $Lab
28
+ cairn doctor
29
+ Pop-Location
30
+ ```
31
+
32
+ Verify that `.git`, `.ai/cairnkeep.json`, `.ai/start-claude.cmd`,
33
+ `.ai/start-harness.ps1`, and the managed Claude assets exist. `cairn doctor`
34
+ must identify native Windows x64 and complete an MCP stdio handshake.
35
+
36
+ ## Permission check
37
+
38
+ ```powershell
39
+ Get-Acl (Join-Path $Lab '.ai\capabilities.json') | Format-List
40
+ ```
41
+
42
+ Managed private files remove inherited broad access and retain only the current
43
+ identity, Local System, and Administrators. Do not replace this with a Unix-mode
44
+ check; Windows authorization is an ACL contract.
45
+
46
+ ## Recovery exercise
47
+
48
+ ```powershell
49
+ cairn uninstall --dry-run --live-root (Join-Path $Lab '.claude-test') $Lab
50
+ cairn uninstall --yes --live-root (Join-Path $Lab '.claude-test') $Lab
51
+ ```
52
+
53
+ The command prints the timestamped backup location. Inspect `manifest.json` and
54
+ `revert.ps1`; run the revert script only if you intentionally want to restore
55
+ the removed managed assets.
56
+
57
+ ## Common failures
58
+
59
+ | Symptom | Cause | Recovery |
60
+ |---|---|---|
61
+ | `cairn.cmd` is not found | npm's global directory is not on `PATH` | Run `npm prefix -g`, add the resulting directory to the user `PATH`, then open a new PowerShell session |
62
+ | Hook registration reports drift | Managed `.cmd` hook or settings entry is absent | Run `cairn sync --apply`, then repeat `cairn sync --check` |
63
+ | Memory export fails | `sqlite3.exe` is absent | Install SQLite and confirm `Get-Command sqlite3.exe`; runtime and import remain available |
64
+ | A private-state check fails | The file inherited a broader ACL | Preserve the file, inspect it with `Get-Acl`, and recreate it through the owning Cairnkeep command |
65
+
66
+ ## Privacy and trust boundary
67
+
68
+ Native support changes process, path, and permission mechanics; it does not
69
+ enable a network, model, capture, artifact, context-pack, or capability flag.
70
+ The Windows ACL is a local-host access boundary, while pack digests establish
71
+ content integrity rather than publisher authenticity. Task Scheduler and purge
72
+ operations remain separate explicit actions.
73
+
74
+ ## Boundaries
75
+
76
+ - Windows x64 is native; Windows ARM64 is currently x64 emulation.
77
+ - `sqlite3.exe` is optional for runtime and import, but required for a WAL-safe
78
+ memory export.
79
+ - WSL is a separate Linux topology. Git Bash is not native-Windows evidence.
80
+ - Task Scheduler changes remain opt-in through `cairn audit-timer`.
81
+
82
+ See [Native Windows operation](../../native-windows.md) for the complete
83
+ platform contract.