@cairnkeep/cli 2.8.0 → 2.11.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 (89) hide show
  1. package/CHANGELOG.md +68 -1
  2. package/README.md +82 -27
  3. package/bin/cairn +6 -153
  4. package/bin/cairn-container +8 -0
  5. package/docs/building-an-overlay.md +41 -4
  6. package/docs/containers.md +10 -0
  7. package/docs/context-packs.md +94 -0
  8. package/docs/harness-compatibility.md +37 -3
  9. package/docs/learning/CURRICULUM-MAP.md +16 -5
  10. package/docs/learning/FEATURE-GUIDE.md +15 -4
  11. package/docs/learning/README.md +8 -2
  12. package/docs/learning/lessons/L00-why-cairnkeep.md +1 -1
  13. package/docs/learning/lessons/L01-safe-trial.md +3 -3
  14. package/docs/learning/lessons/L02-installation.md +11 -2
  15. package/docs/learning/lessons/L03-first-project.md +1 -1
  16. package/docs/learning/lessons/L19-validated-skill-improvement.md +52 -21
  17. package/docs/learning/lessons/L20-mcp-tool-profiles.md +67 -0
  18. package/docs/learning/lessons/L21-context-packs.md +79 -0
  19. package/docs/learning/lessons/L22-native-windows.md +83 -0
  20. package/docs/learning/lessons/L23-guided-setup.md +138 -0
  21. package/docs/learning/tracks/operator.md +10 -3
  22. package/docs/learning/tracks/quickstart.md +7 -3
  23. package/docs/mcp-tool-profiles.md +43 -0
  24. package/docs/native-windows.md +122 -0
  25. package/docs/operating.md +157 -18
  26. package/docs/privacy-and-data-flow.md +51 -1
  27. package/docs/storage.md +29 -0
  28. package/examples/eval/bundled-fake.json +1 -1
  29. package/mcp-memory-server/dist/artifact-store-windows-worker.js +74 -0
  30. package/mcp-memory-server/dist/artifact-store.js +196 -55
  31. package/mcp-memory-server/dist/capability-cli.js +2 -1
  32. package/mcp-memory-server/dist/capability-config.js +4 -3
  33. package/mcp-memory-server/dist/capability-harness.js +34 -7
  34. package/mcp-memory-server/dist/context-pack-cli.js +185 -0
  35. package/mcp-memory-server/dist/context-pack.js +889 -0
  36. package/mcp-memory-server/dist/eval-cli.js +6 -5
  37. package/mcp-memory-server/dist/eval-plan.js +35 -13
  38. package/mcp-memory-server/dist/eval-process.js +11 -4
  39. package/mcp-memory-server/dist/eval-report.js +8 -5
  40. package/mcp-memory-server/dist/eval-runner.js +2 -0
  41. package/mcp-memory-server/dist/eval-schema.js +1 -0
  42. package/mcp-memory-server/dist/graph-cli.js +7 -1
  43. package/mcp-memory-server/dist/index.js +87 -37
  44. package/mcp-memory-server/dist/mcp-tool-catalog.js +47 -0
  45. package/mcp-memory-server/dist/mcp-tool-cli.js +85 -0
  46. package/mcp-memory-server/dist/mcp-tool-profile.js +164 -0
  47. package/mcp-memory-server/dist/note-store.js +12 -3
  48. package/mcp-memory-server/dist/pi-mcp-bridge.js +185 -0
  49. package/mcp-memory-server/dist/platform-security.js +102 -0
  50. package/mcp-memory-server/dist/skill-store.js +27 -12
  51. package/mcp-memory-server/package.json +4 -1
  52. package/package.json +5 -4
  53. package/pi/extensions/cairnkeep-memory.ts +61 -0
  54. package/schemas/cairnkeep-setup-policy.schema.json +55 -0
  55. package/schemas/cairnkeep-setup.schema.json +36 -0
  56. package/schemas/context-pack.schema.json +33 -0
  57. package/schemas/eval-report.schema.json +1 -0
  58. package/scripts/cairn-cli.mjs +119 -0
  59. package/scripts/cairn-container-cli.mjs +121 -0
  60. package/scripts/cairn-hook.mjs +199 -0
  61. package/scripts/completion.sh +33 -5
  62. package/scripts/doctor.sh +96 -0
  63. package/scripts/fix-permissions.mjs +12 -0
  64. package/scripts/memory-wiki-audit.mjs +95 -0
  65. package/scripts/phase26-test-manifest.mjs +26 -0
  66. package/scripts/run-repository-tests.mjs +76 -0
  67. package/scripts/setup-core.mjs +310 -0
  68. package/scripts/setup-reconcile.mjs +331 -0
  69. package/scripts/setup.mjs +306 -0
  70. package/scripts/sync-pi-assets.sh +19 -4
  71. package/scripts/test-cli-dispatch.sh +6 -0
  72. package/scripts/test-completion.sh +44 -0
  73. package/scripts/test-doctor.sh +66 -0
  74. package/scripts/test-learning-docs.sh +53 -3
  75. package/scripts/test-package-install.sh +81 -0
  76. package/scripts/test-phase17-artifact-lifecycle.sh +1 -1
  77. package/scripts/test-phase18-capability-lifecycle.sh +1 -1
  78. package/scripts/test-pi-lifecycle.mjs +190 -0
  79. package/scripts/test-setup-compatibility.mjs +186 -0
  80. package/scripts/test-setup-output.sh +131 -0
  81. package/scripts/test-setup-overlay.sh +113 -0
  82. package/scripts/test-setup-preflight.mjs +281 -0
  83. package/scripts/test-setup-reconcile.mjs +257 -0
  84. package/scripts/test-uninstall.sh +71 -0
  85. package/scripts/test-windows-native.mjs +136 -0
  86. package/scripts/uninstall.sh +95 -7
  87. package/scripts/verify-pi-mcp-bridge.mjs +588 -0
  88. package/scripts/windows-platform.mjs +725 -0
  89. package/templates/env.example.template +11 -0
@@ -12,22 +12,56 @@ 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 |
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
16
  | Codex CLI | Memory MCP | Configuration supported; no Cairnkeep operating-layer assets or launcher |
17
- | Other MCP clients | Memory and optional domain-knowledge tools | Protocol-compatible; not automatically runtime-tested |
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
23
 
24
+ Every MCP client receives complete tool annotations and may use a Cairnkeep
25
+ least-authority profile independent of harness assets. Context-pack tools are
26
+ ordinary read-only MCP tools and require the pack feature gate; authenticated
27
+ HTTP additionally requires separate pack-HTTP consent. Approved pack skills
28
+ remain context documents, not native harness Skills or automatic instructions.
29
+
24
30
  `cairn graph` is a separate, harness-independent project-shell CLI. Kimi Code,
25
31
  Pi, Qwen Code, Codex, and other shell-capable clients can invoke
26
32
  `cairn graph build|query|status|diff|explain|path` when `cairn` and the isolated
27
33
  `graphify` executable are on `PATH`. `cairn sync-kimi --apply` registers a Kimi
28
34
  Skill as `/graphify` (or `/skill:graphify`), and `cairn sync-pi --apply`
29
35
  registers a Pi prompt template as `/graphify`; both delegate exclusively to
30
- that CLI. Neither adds an MCP bridge to Pi or expands the other support levels.
36
+ that CLI. Pi sync separately installs the Cairnkeep-owned local stdio memory
37
+ extension; it does not expand the other support levels.
38
+
39
+ ## Pi
40
+
41
+ Run `cairn sync-pi --apply` explicitly to install
42
+ `extensions/cairnkeep-memory.ts`, `extensions/cairnkeep-trajectory.ts`, and
43
+ `prompts/graphify.md` under the Pi agent root. Use `--check` for drift and
44
+ `cairn doctor` from a project that selected Pi for setup-aware diagnosis. Setup
45
+ reports this machine command but never runs it automatically. Uninstall removes
46
+ only those owned paths, backup-first.
47
+
48
+ The memory extension supervises `cairn memory-server` as a local stdio child.
49
+ It discovers the effective MCP catalog dynamically and preserves names,
50
+ descriptions, input/output schemas, original content, `structuredContent`,
51
+ `_meta`, failure behavior, and the exact tool annotations in trusted result
52
+ `details`. Pi 0.84.1 exposes no native annotations field in its public tool API,
53
+ so those annotations are not claimed as native model-facing metadata. Server
54
+ feature gates, capability state, and least-authority profiles continue to
55
+ decide which tools exist.
56
+
57
+ Startup, calls, results, stderr retention, cancellation, and shutdown are
58
+ bounded. The extension adds tools only: it does not run prompts, activate
59
+ context-pack skills, create an autonomous loop, or add a remote transport.
60
+ Pi 0.84.1 is the validated minimum. The v2.11 release matrix passed separate
61
+ installations for that minimum and the explicitly versioned registry-current Pi
62
+ release, together with Node.js 22/24/26, Bash 3.2, and native Windows. The
63
+ executable paths were distinct; both reported 0.84.1 because that was also the
64
+ registry-current release.
31
65
 
32
66
  ## Kimi Code
33
67
 
@@ -1,7 +1,7 @@
1
1
  # Curriculum Coverage Map
2
2
 
3
- **Baseline:** Cairnkeep 2.8.0
4
- **Last reviewed:** 2026-08-03
3
+ **Baseline:** Cairnkeep 2.11.0
4
+ **Last reviewed:** 2026-08-12
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
@@ -31,7 +31,12 @@ been rehearsed.
31
31
  | Deterministic two-pass evaluation and one-capability ablation | L16 | L16 | Brief; default off |
32
32
  | Shell completion | L02 | L02 | Ready; optional convenience |
33
33
  | Bounded meta-agent configuration loop | L17 | None | Design-only; not shipped |
34
- | Reviewed, evaluated, reversible skill-file improvement | L19 | L19 | Brief; explicit and default off |
34
+ | Reviewed, evaluated, reversible skill-file improvement | L19 | L19 | Ready; explicit and default off |
35
+ | Complete MCP annotations and least-authority tool profiles | L20 | L20 | Ready; default profile remains full |
36
+ | Immutable context packs and exact-digest skill approval | L21 | L21 | Ready; default off |
37
+ | Native Windows x64 CLI, hooks, ACLs, scheduling, and recovery | L22 | L22 | Ready; PowerShell-native |
38
+ | Guided project setup, selected harness state, and Git-less limitations | L23 | L23 | Ready |
39
+ | Pi local stdio memory bridge, trusted annotation details, and explicit lifecycle | L23 | L23 | Ready; Pi 0.84.1 validated minimum |
35
40
 
36
41
  ## Release Review
37
42
 
@@ -61,7 +66,10 @@ repository remains the canonical source for explanations and scripts.
61
66
  | `course-06-governance` | L15 | Capability precedence and restart boundaries |
62
67
  | `course-07-evaluation` | L16-L17 | Package-owned offline fixture and design boundary |
63
68
  | `course-08-graph` | L18 | Optional local structural graph workflow |
64
- | Planned: `course-09-skill` | L19 | Validated skill improvement after a disposable lab exists |
69
+ | `course-09-skill` | L19 | Validated skill improvement in a disposable project |
70
+ | `course-10-trust-context` | L20-L21 | MCP authority profiles and offline context-pack lifecycle |
71
+ | `course-11-windows` | L22 | Native PowerShell lifecycle, ACL inspection, and reversible uninstall |
72
+ | `course-12-guided-setup` | L23 | Deterministic setup, Pi local stdio, recovery, and backup-first uninstall |
65
73
 
66
74
  ## Command Ownership
67
75
 
@@ -71,14 +79,17 @@ against `cairn help` so a new command cannot bypass a curriculum decision.
71
79
  | Command | Primary lesson |
72
80
  |---|---|
73
81
  | `cairn bootstrap` | L03 |
82
+ | `cairn setup` | L23 |
74
83
  | `cairn memory-server` | L02 |
75
84
  | `cairn sync` | L02 |
76
- | `cairn sync-pi` | L13 |
85
+ | `cairn sync-pi` | L13 and L23 |
77
86
  | `cairn sync-kimi` | L02 |
78
87
  | `cairn doctor` | L03; advanced repair in L13-L14 |
79
88
  | `cairn trajectory` | L13 |
80
89
  | `cairn artifact` | L13 |
81
90
  | `cairn capabilities` | L15 |
91
+ | `cairn mcp-tools` | L20 |
92
+ | `cairn pack` | L21 |
82
93
  | `cairn notes` | L13 |
83
94
  | `cairn eval` | L16 |
84
95
  | `cairn skill` | L19 |
@@ -1,6 +1,6 @@
1
1
  # Cairnkeep feature guide
2
2
 
3
- **Baseline:** Cairnkeep 2.8.0
3
+ **Baseline:** Cairnkeep 2.11.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,17 @@ 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 ship in v2.11. See
12
+ [L23](lessons/L23-guided-setup.md) for the tested boundary.
13
+
11
14
  ## The three-layer model
12
15
 
13
16
  1. **Memory server:** an MCP process that owns scoped durable storage. The
14
17
  default stdio setup runs on the current machine; installation never
15
18
  discovers or selects a remote host.
16
19
  2. **Project scaffold:** launchers, private environment, and `.planning/`
17
- policy/derived-knowledge files created by `cairn bootstrap`.
20
+ policy/derived-knowledge files reconciled by `cairn setup`; `cairn bootstrap`
21
+ remains the deterministic compatibility primitive.
18
22
  3. **Operating layer:** harness commands, agents, and hooks installed by
19
23
  `cairn sync --apply` or the harness-specific equivalent.
20
24
 
@@ -33,6 +37,8 @@ Run setup in that order, then confirm `cairn doctor`, `cairn sync --check`, and
33
37
  | 6 | Typed nodes and capability governance | Filtering and centrally inspectable feature state are needed |
34
38
  | 7 | Evaluation and ablation | A concrete change needs bounded measurement |
35
39
  | 8 | Validated skill improvement | Repeated resolved hindsight warrants a measured skill change |
40
+ | 9 | Least-authority MCP profiles | A client should receive fewer tools than the default catalog |
41
+ | 10 | Immutable context packs | Reviewed external context should be pinned without becoming memory |
36
42
 
37
43
  Every stage is independently useful. Stages 4-8 are opt-in and are not
38
44
  prerequisites for ordinary memory.
@@ -46,6 +52,7 @@ prerequisites for ordinary memory.
46
52
  | 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` |
47
53
  | 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` |
48
54
  | Repository quality | `/repo-review`, `/security-audit` | On-demand workflow; findings are hypotheses until reproduced | Require file/line evidence and regression tests | `course-03-quality` |
55
+ | Guided project setup | `cairn setup PATH --git init\|existing\|none --harness LIST --memory local\|none --yes` | Reconciles only selected project assets; 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` |
49
56
 
50
57
  ## Storage and optional topology
51
58
 
@@ -58,6 +65,9 @@ prerequisites for ordinary memory.
58
65
  | Context exploration | Configure an operator-owned exploration binary or route endpoint | Source/context goes only to the selected local or remote component | Check citations/cache; remove variables and relaunch | `course-04-operation` |
59
66
  | Containers | Rootless memory or workspace launcher | Named volumes persist; shared checkout mode is read/write, sandbox mode copies into a volume | Inspect mounts/volumes; remove only explicitly named disposable resources | `course-04-operation` |
60
67
  | 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` |
68
+ | 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` |
69
+ | 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` |
70
+ | 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` |
61
71
 
62
72
  ## Evidence, governance, and measurement
63
73
 
@@ -71,14 +81,15 @@ prerequisites for ordinary memory.
71
81
  | Typed nodes/import | `CAIRN_TYPED_MEMORY_NODES=1` | Restart MCP server; tool schema changes | Hard-filter search; dry-run, replay-safe import; `cairn doctor --repair` only for derived state | `course-05-evidence` |
72
82
  | Capability contract | `CAIRN_CAPABILITY_CONTRACT=1` | MCP changes require restart; operating changes apply next invocation | `cairn capabilities list|status|enable|disable|reset|logging`; digest identifies state only | `course-06-governance` |
73
83
  | Evaluation | `CAIRN_EVAL=1` for the coordinator process | No harness chosen by Cairnkeep | `validate` before `run`; inspect report, missingness and evidence scope; dry-run prune/delete | `course-07-evaluation` |
74
- | Validated skill improvement | Reviewed recurring hindsight; proposal adapter; `CAIRN_EVAL=1` for evaluation | No server restart; explicit subprocesses only | `cairn skill list|show`; exact-digest apply; concurrent-edit-safe rollback | Planned: `course-09-skill` |
84
+ | Validated skill improvement | Reviewed recurring hindsight; proposal adapter; `CAIRN_EVAL=1` for evaluation | No server restart; explicit subprocesses only | `cairn skill list|show`; exact-digest apply; concurrent-edit-safe rollback | `course-09-skill` |
75
85
  | General meta-agent loop | Not shipped | Not applicable | Skill-file lifecycle only; no generic configuration loop or scheduler | `course-07-evaluation` |
86
+ | Pack retrieval and skills | `CAIRN_CONTEXT_PACKS=1`; HTTP needs separate consent; skills need exact-digest approval | Restart MCP server | `cairn pack skills`; revoke approval or disable pack; no automatic execution | `course-10-trust-context` |
76
87
 
77
88
  ## Harness and maintenance checks
78
89
 
79
90
  - Use a generated launcher so project environment and hooks are repeatable.
80
91
  - Run `cairn sync --check` after every core upgrade; apply only reported drift.
81
- - Run `cairn sync-pi --check` when the optional Pi capture/graph adapter is installed.
92
+ - Run `cairn sync-pi --check` when the Pi memory/trajectory/graph assets are installed.
82
93
  - Run `cairn sync-kimi --check` when the optional Kimi graph Skill is installed.
83
94
  - Use `cairn doctor --repair` only after preserving the affected store and only
84
95
  for repairable derived indexes/metadata.
@@ -49,7 +49,11 @@ expanded only after their labs are executable.
49
49
  | L16 | [Evaluation and ablation](lessons/L16-evaluation.md) | Brief | 50 min |
50
50
  | L17 | [The agent boundary](lessons/L17-agent-boundary.md) | Brief | 25 min |
51
51
  | L18 | [Local code graph](lessons/L18-local-code-graph.md) | Brief | 35 min |
52
- | L19 | [Validated skill improvement](lessons/L19-validated-skill-improvement.md) | Brief | 50 min |
52
+ | L19 | [Validated skill improvement](lessons/L19-validated-skill-improvement.md) | Ready | 50 min |
53
+ | L20 | [Least-authority MCP tool profiles](lessons/L20-mcp-tool-profiles.md) | Ready | 25 min |
54
+ | L21 | [Immutable context packs and skill approval](lessons/L21-context-packs.md) | Ready | 40 min |
55
+ | L22 | [Operate Cairnkeep on native Windows](lessons/L22-native-windows.md) | Ready | 30 min |
56
+ | L23 | [Guided setup and Pi memory](lessons/L23-guided-setup.md) | Ready | 35 min |
53
57
 
54
58
  The [curriculum coverage map](CURRICULUM-MAP.md) records where every public
55
59
  feature is introduced, practised, and operated. It also marks design-only work
@@ -68,7 +72,9 @@ Every complete lesson contains:
68
72
 
69
73
  The learner should never need optional infrastructure to complete L00-L06.
70
74
  Remote memory, RAG, routing, containers, graph indexing, structured capture,
71
- typed nodes, capability governance, and evaluation are separate opt-in modules.
75
+ typed nodes, capability governance, evaluation, and context packs are separate
76
+ opt-in modules. MCP profiles are restrictive and never activate an optional
77
+ feature.
72
78
 
73
79
  ## For contributors
74
80
 
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Quickstart
5
5
  **Time:** 10 minutes
6
- **Tested with:** Cairnkeep 2.8.0
6
+ **Tested with:** Cairnkeep 2.11.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.8.0
6
+ **Tested with:** Cairnkeep 2.11.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.8.0
29
+ podman pull ghcr.io/cairnkeep/cairnkeep:2.11.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.8.0 stdio
41
+ ghcr.io/cairnkeep/cairnkeep:2.11.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.8.0 and Node.js 22 or newer
6
+ **Tested with:** Cairnkeep 2.11.0 and Node.js 22 or newer
7
7
 
8
8
  ## Outcome
9
9
 
@@ -41,7 +41,7 @@ machine-level steps.
41
41
  2. Install Cairnkeep:
42
42
 
43
43
  ```bash
44
- npm install --global @cairnkeep/cli@2.8.0
44
+ npm install --global @cairnkeep/cli@2.11.0
45
45
  cairn --version
46
46
  ```
47
47
 
@@ -72,6 +72,15 @@ machine-level steps.
72
72
  Use `cairn completion zsh` or `cairn completion fish` for those shells.
73
73
  Completion is a convenience and is not another runtime component.
74
74
 
75
+ On native Windows PowerShell, use:
76
+
77
+ ```powershell
78
+ Invoke-Expression (& cairn completion powershell | Out-String)
79
+ ```
80
+
81
+ Bootstrap emits `.cmd` launchers on Windows; use
82
+ `.\.ai\start-claude.cmd` instead of the Unix `.sh` launcher.
83
+
75
84
  ## Verify
76
85
 
77
86
  Run both checks:
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Quickstart
5
5
  **Time:** 25 minutes
6
- **Tested with:** Cairnkeep 2.8.0
6
+ **Tested with:** Cairnkeep 2.11.0
7
7
 
8
8
  ## Outcome
9
9
 
@@ -1,9 +1,9 @@
1
1
  # L19 - Validated skill improvement
2
2
 
3
- **Status:** Brief
3
+ **Status:** Ready
4
4
  **Track:** Evidence and Evaluation
5
- **Planned time:** 50 minutes
6
- **Introduced in:** Cairnkeep 2.8.0
5
+ **Time:** 50 minutes
6
+ **Tested with:** Cairnkeep 2.11.0
7
7
 
8
8
  ## Outcome
9
9
 
@@ -12,7 +12,7 @@ skill proposal, measure it on separate exploration and confirmation tasks,
12
12
  apply only the exact eligible digest, and prove rollback without risking a real
13
13
  project.
14
14
 
15
- ## Planned lesson
15
+ ## Lesson
16
16
 
17
17
  - Why harvest requires failures from at least two sessions and at least one
18
18
  recorded resolution.
@@ -31,30 +31,45 @@ project.
31
31
 
32
32
  ## Hands-on lab
33
33
 
34
- Use a future disposable `course-09-skill` checkpoint containing synthetic
35
- hindsight evidence, a small `SKILL.md`, deterministic proposal and evaluation
36
- adapters, and separate committed task sets. The lab will run:
34
+ Use the disposable `course-09-skill` checkpoint from the synthetic course
35
+ repository. It contains bounded hindsight evidence, one existing `SKILL.md`,
36
+ deterministic proposal and evaluation adapters, and separate committed task
37
+ sets. Keep every generated artifact under `.course-state/`:
37
38
 
38
39
  ```bash
39
- cairn skill harvest --project . --json
40
- cairn skill show --kind candidate --id CANDIDATE_ID
41
- cairn skill review --candidate CANDIDATE_ID --approve --json
42
- cairn skill propose --candidate CANDIDATE_ID --target skills/demo/SKILL.md \
43
- --adapter fixtures/proposal-adapter.json --json
40
+ git switch --detach course-09-skill
41
+ scripts/reset-course-state.sh --yes
42
+ node scripts/setup-skill-lab.mjs
43
+ core=$(node scripts/locate-cairnkeep-core.mjs)
44
+ lab="$PWD/.course-state/skill-project"
45
+ export CAIRN_AGENTFS_BASE_DIR="$PWD/.course-state/agentfs"
46
+
47
+ "$core/bin/cairn" skill harvest --project "$lab" --json
48
+ "$core/bin/cairn" skill show --project "$lab" \
49
+ --kind candidate --id CANDIDATE_ID
50
+ "$core/bin/cairn" skill review --project "$lab" \
51
+ --candidate CANDIDATE_ID --approve --json
52
+ "$core/bin/cairn" skill propose --project "$lab" \
53
+ --candidate CANDIDATE_ID --target skills/course-review/SKILL.md \
54
+ --adapter "$lab/fixtures/proposal-adapter.json" --json
44
55
 
45
56
  export CAIRN_EVAL=1
46
- cairn skill evaluate --proposal PROPOSAL_ID \
47
- --exploration-task-set eval/exploration.json \
48
- --confirmation-task-set eval/confirmation.json \
49
- --adapter eval/adapter.json --repetitions 2 --yes --json
50
-
51
- cairn skill apply --proposal PROPOSAL_ID --evaluation EVALUATION_ID \
57
+ "$core/bin/cairn" skill evaluate --project "$lab" \
58
+ --proposal PROPOSAL_ID \
59
+ --exploration-task-set "$lab/eval/exploration.json" \
60
+ --confirmation-task-set "$lab/eval/confirmation.json" \
61
+ --adapter "$lab/eval/eval-adapter.json" \
62
+ --repetitions 1 --minimum-improvement 1 --yes --json
63
+
64
+ "$core/bin/cairn" skill apply --project "$lab" \
65
+ --proposal PROPOSAL_ID --evaluation EVALUATION_ID \
52
66
  --confirm FULL_PROPOSAL_DIGEST --json
53
- cairn skill rollback --application APPLICATION_ID --confirm --json
67
+ "$core/bin/cairn" skill rollback --project "$lab" \
68
+ --application APPLICATION_ID --confirm --json
54
69
  ```
55
70
 
56
- The lesson remains a Brief until that checkpoint is public and every command is
57
- rehearsed against the release package.
71
+ Before applying, deliberately try an incorrect digest and verify it is rejected.
72
+ After rollback, compare the target with `fixtures/skill/SKILL.md` byte for byte.
58
73
 
59
74
  ## Acceptance criteria
60
75
 
@@ -69,6 +84,22 @@ rehearsed against the release package.
69
84
  - The learner can explain why an eligible small task set supports one local
70
85
  decision but not a universal performance claim.
71
86
 
87
+ ## Common failures
88
+
89
+ - If harvest returns no candidate, confirm the evidence contains the same
90
+ failure family in at least two distinct sessions and a recorded resolution.
91
+ - If proposal validation rejects the adapter program, regenerate the lab and
92
+ verify its configuration resolves to the reviewed executable by absolute
93
+ path.
94
+ - If evaluation is disabled, set `CAIRN_EVAL=1` only for this disposable lab
95
+ and retain the explicit `--yes` confirmation.
96
+ - If task validation reports overlap or a mutable revision, use the committed
97
+ exploration and confirmation fixtures from `course-09-skill` unchanged.
98
+ - If apply rejects the confirmation, copy the full `proposal_digest` from the
99
+ reviewed proposal rather than an ID, prefix, or candidate-content digest.
100
+ - If rollback reports a concurrent target change, stop and inspect that edit;
101
+ do not overwrite it by copying the backup manually.
102
+
72
103
  ## Privacy and trust boundary
73
104
 
74
105
  Hindsight excerpts and skill content remain local until candidate approval.
@@ -0,0 +1,67 @@
1
+ # L20 - Least-authority MCP tool profiles
2
+
3
+ **Status:** Ready
4
+ **Tested with:** Cairnkeep 2.11.0 and Node.js 22 or newer
5
+ **Time:** 25 minutes
6
+
7
+ ## Outcome
8
+
9
+ Classify every MCP tool as an observation or mutation, apply a read-only project
10
+ profile, replace it with an exact allowlist, and prove that invalid authority is
11
+ rejected before server startup.
12
+
13
+ ## Exercise
14
+
15
+ Use a disposable directory so no real project policy changes:
16
+
17
+ ```bash
18
+ lab=$(mktemp -d)
19
+ cairn mcp-tools list --json >"$lab/catalog.json"
20
+ cairn mcp-tools status --project "$lab" --json
21
+ cairn mcp-tools set read-only --project "$lab"
22
+ cairn mcp-tools status --project "$lab" --json >"$lab/read-only.json"
23
+ test "$(stat -c '%a' "$lab/.ai/mcp-tools.json" 2>/dev/null || stat -f '%Lp' "$lab/.ai/mcp-tools.json")" = 600
24
+ cairn mcp-tools set custom --tool memory_read --tool memory_search --project "$lab"
25
+ cairn mcp-tools status --project "$lab" --json >"$lab/custom.json"
26
+ ```
27
+
28
+ Inspect the catalog. Every entry must contain a title and four Boolean hints.
29
+ The read-only profile must contain only tools whose `readOnlyHint` is true. The
30
+ custom profile contains exactly the two named tools in canonical discovery
31
+ order.
32
+
33
+ Confirm environment precedence without changing the project file:
34
+
35
+ ```bash
36
+ CAIRN_MCP_TOOL_PROFILE=full cairn mcp-tools status --project "$lab" --json
37
+ ```
38
+
39
+ The source is `environment`; the project remains custom when the override is
40
+ removed. A profile cannot enable a feature-gated tool, and a disabled capability
41
+ still removes its tool. Restart the memory server after profile changes.
42
+
43
+ ## Common failures
44
+
45
+ - `custom` without `--tool` is invalid because an empty accidental server is
46
+ more likely to be a configuration mistake than useful least authority.
47
+ - Unknown names and a group/world-readable project config fail closed.
48
+ - A running MCP session keeps its discovery snapshot until restarted.
49
+
50
+ ## Privacy and trust boundary
51
+
52
+ Profiles do not read tool payloads or add telemetry. The digest identifies the
53
+ allowlist, not the user's identity or the independent capability state. Client
54
+ approval remains necessary for mutations even when a profile exposes them.
55
+
56
+ ## Recovery and acceptance
57
+
58
+ ```bash
59
+ cairn mcp-tools reset --project "$lab"
60
+ test ! -e "$lab/.ai/mcp-tools.json"
61
+ rm -rf "$lab"
62
+ ```
63
+
64
+ - Unknown custom tool names fail `set`, server startup, and `cairn doctor`.
65
+ - Profile and capability digests are independent.
66
+ - Conservative clients may execute read-only observations; mutations still
67
+ require their approval policy.
@@ -0,0 +1,79 @@
1
+ # L21 - Immutable context packs and skill approval
2
+
3
+ **Status:** Ready
4
+ **Tested with:** Cairnkeep 2.11.0 and Node.js 22 or newer
5
+ **Time:** 40 minutes
6
+
7
+ ## Outcome
8
+
9
+ Build a local offline context pack, verify its immutable identity, pin it to a
10
+ disposable project, and explain why document enablement and skill approval are
11
+ different trust decisions.
12
+
13
+ ## Exercise
14
+
15
+ ```bash
16
+ lab=$(mktemp -d)
17
+ mkdir -p "$lab/pack" "$lab/project"
18
+ printf '# Local guide\n\nSynthetic offline guidance.\n' >"$lab/pack/guide.md"
19
+ export CAIRN_PACK_BASE_DIR="$lab/store"
20
+ cairn pack init "$lab/pack" --id course-guide --version 1.0.0 \
21
+ --title "Course guide" --description "Synthetic local reference" \
22
+ --license Apache-2.0
23
+ cairn pack lock "$lab/pack"
24
+ cairn pack validate "$lab/pack"
25
+ cairn pack install "$lab/pack" --json >"$lab/install.json"
26
+ digest=$(node -e 'process.stdout.write(require(process.argv[1]).digest)' "$lab/install.json")
27
+ cairn pack enable "$digest" --project "$lab/project"
28
+ cairn pack show "$digest" --json
29
+ cairn pack skills --project "$lab/project" --json
30
+ ```
31
+
32
+ The local lifecycle makes no network request. The pack digest covers exact
33
+ manifest and content bytes; `version` is a label, not identity. Objects remain
34
+ under `$CAIRN_PACK_BASE_DIR` after disablement and ordinary uninstall.
35
+
36
+ Add a file with `kind: skill`, refresh it with `cairn pack lock`, install the new
37
+ digest, and enable it. `cairn pack skills` shows the skill but the MCP list/read
38
+ surface does not expose it until:
39
+
40
+ ```bash
41
+ cairn pack approve-skill NEW-PACK-DIGEST path/to/SKILL.md \
42
+ --confirm FILE-DIGEST --project "$lab/project"
43
+ ```
44
+
45
+ Approval binds the project, pack, path, and file bytes. A later pack update
46
+ invalidates it. Approval makes instructions readable only; it never executes or
47
+ copies them into a harness.
48
+
49
+ ## Common failures
50
+
51
+ - Adding a file after `init` requires declaring it in the manifest before
52
+ `lock`; undeclared content is rejected.
53
+ - Git installation without `--ref`, a stale update confirmation, and removal of
54
+ an enabled digest all fail closed.
55
+ - Enabling the pack does not expose a skill until its current file digest is
56
+ approved.
57
+
58
+ ## Privacy and trust boundary
59
+
60
+ Local pack operations are offline. Configured semantic search can send enabled
61
+ chunks and a query to the explicit embedding endpoint; failure falls back to
62
+ substring search. A digest detects changed bytes but does not authenticate the
63
+ publisher. Approved instructions remain untrusted readable context, not code.
64
+
65
+ ## Recovery and acceptance
66
+
67
+ ```bash
68
+ cairn pack disable course-guide --project "$lab/project"
69
+ cairn pack remove "$digest"
70
+ unset CAIRN_PACK_BASE_DIR
71
+ rm -rf "$lab"
72
+ ```
73
+
74
+ - Traversal, symlinks, undeclared files, invalid UTF-8, and digest tampering fail
75
+ validation.
76
+ - `update --check` never switches a project; apply requires the inspected digest.
77
+ - `CAIRN_CONTEXT_PACKS=1` enables local read-only tools only after restart.
78
+ - HTTP additionally requires `CAIRN_CONTEXT_PACK_HTTP=1` and existing auth.
79
+ - A digest proves integrity, not publisher authenticity.
@@ -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.11.0, Windows x64, and Node.js 22 or newer
7
+
8
+ ## Outcome
9
+
10
+ You can prove that Cairnkeep is running natively from PowerShell, bootstrap a
11
+ path containing spaces, inspect its security boundary, and perform a reversible
12
+ 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.11.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 bootstrap $Lab
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 `.ai/start-claude.cmd`, `.ai/start-harness.ps1`, and the managed
33
+ Claude assets exist. `cairn doctor` must identify native Windows x64 and complete
34
+ 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.