@cairnkeep/cli 2.15.2 → 2.15.4

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,39 @@ All notable user-facing changes are documented here. This project follows
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [2.15.4] - 2026-08-19
9
+
10
+ ### Changed
11
+
12
+ - Make the managed project-memory retrieval contract explicit that retrieval
13
+ is the first tool or command, including before `pwd`, `ls`, inventory, or
14
+ search commands.
15
+ - Put the bounded complexity, familiarity, and risk values directly in the
16
+ managed playbook commands so agents do not need to guess them.
17
+
18
+ ### Fixed
19
+
20
+ - Support event-scoped playbook help such as
21
+ `cairn playbook check start --help` while continuing to reject ambiguous or
22
+ unknown help forms.
23
+
24
+ ## [2.15.3] - 2026-08-18
25
+
26
+ ### Changed
27
+
28
+ - Require the generic managed memory step before repository inventory or
29
+ search commands, with task-derived query guidance that does not need an
30
+ exploratory file read first.
31
+ - Make the managed playbook receipt guidance directly executable, including
32
+ the lifecycle event, action, outcome, session, optional reason, and one-call
33
+ per-action boundary.
34
+
35
+ ### Fixed
36
+
37
+ - Add successful command-scoped help for `cairn playbook check --help` and
38
+ `cairn playbook record --help`, including the bounded event, outcome,
39
+ identity, project, and output options agents need to avoid CLI probing.
40
+
8
41
  ## [2.15.2] - 2026-08-18
9
42
 
10
43
  ### Added
package/README.md CHANGED
@@ -51,9 +51,11 @@ launchers, including native Windows, without capturing prompts or replacing Git.
51
51
  Version 2.15 adds bounded project playbooks that help agents select existing
52
52
  recall, planning, verification, review, security, documentation, and learning
53
53
  steps without becoming an agent runtime or granting approval.
54
- Version 2.15.2 adds a generic durable-context protocol to the ownership-safe
55
- managed project instructions so compatible agents can derive one project
56
- memory query before broad exploration and verify its repository provenance.
54
+ Version 2.15.4 makes the generic durable-context retrieval the first tool or
55
+ command for compatible agents, puts bounded playbook signal values inline,
56
+ and supports command- and event-scoped playbook help. Agents still verify
57
+ repository provenance, and instruction presence remains distinct from runtime
58
+ evidence that a tool was called.
57
59
 
58
60
  ## Compatibility
59
61
 
@@ -28,9 +28,12 @@ neither is equivalent to the full commands, agents, hooks, and plugins surface.
28
28
  Qwen skills and hooks still require harness-specific adaptation and validation.
29
29
  Codex receives a project-local MCP entry, launcher, and portable durable-context
30
30
  and playbook instructions, but not Cairnkeep-specific commands, hooks, agents,
31
- or automatic skill activation. Harness behavior remains probabilistic;
32
- instruction presence must not be reported as a tool invocation without runtime
33
- evidence.
31
+ or automatic skill activation. The durable-context protocol makes its
32
+ task-derived search the first tool or command, and the playbook instructions
33
+ provide bounded signal values, executable receipt syntax, and command- or
34
+ event-scoped help.
35
+ Harness behavior remains probabilistic; instruction presence must not be
36
+ reported as a tool invocation without runtime evidence.
34
37
 
35
38
  Every MCP client receives complete tool annotations and may use a Cairnkeep
36
39
  least-authority profile independent of harness assets. Context-pack tools are
@@ -1,7 +1,7 @@
1
1
  # Curriculum Coverage Map
2
2
 
3
- **Baseline:** Cairnkeep 2.15.2
4
- **Last reviewed:** 2026-08-18
3
+ **Baseline:** Cairnkeep 2.15.4
4
+ **Last reviewed:** 2026-08-19
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
@@ -1,6 +1,6 @@
1
1
  # Cairnkeep feature guide
2
2
 
3
- **Baseline:** Cairnkeep 2.15.2
3
+ **Baseline:** Cairnkeep 2.15.4
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
@@ -20,9 +20,10 @@ deterministic links, and reviewed OKF 0.2 export; see
20
20
  [L24](lessons/L24-okf-exchange.md).
21
21
  Version 2.15 adds local bounded playbooks and private outcome receipts; see
22
22
  [L25](lessons/L25-playbooks.md).
23
- Version 2.15.2 adds generic task-derived, project-scoped memory guidance to the
24
- same ownership-safe managed instructions. Retrieval remains a locator and
25
- actual tool invocation must be verified from runtime evidence.
23
+ Version 2.15.4 makes generic task-derived, project-scoped retrieval the first
24
+ tool or command, puts bounded playbook signal values inline, and adds
25
+ event-scoped check help to executable receipt guidance. Retrieval remains a
26
+ locator and actual tool invocation must be verified from runtime evidence.
26
27
 
27
28
  ## The three-layer model
28
29
 
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Quickstart
5
5
  **Time:** 10 minutes
6
- **Tested with:** Cairnkeep 2.15.2
6
+ **Tested with:** Cairnkeep 2.15.4
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.15.2
6
+ **Tested with:** Cairnkeep 2.15.4
7
7
 
8
8
  ## Outcome
9
9
 
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Quickstart
5
5
  **Time:** 25 minutes
6
- **Tested with:** Cairnkeep 2.15.2 and Node.js 22 or newer
6
+ **Tested with:** Cairnkeep 2.15.4 and Node.js 22 or newer
7
7
 
8
8
  ## Outcome
9
9
 
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Quickstart
5
5
  **Time:** 25 minutes
6
- **Tested with:** Cairnkeep 2.15.2
6
+ **Tested with:** Cairnkeep 2.15.4
7
7
 
8
8
  ## Outcome
9
9
 
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Evidence and Evaluation
5
5
  **Time:** 50 minutes
6
- **Tested with:** Cairnkeep 2.15.2
6
+ **Tested with:** Cairnkeep 2.15.4
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.15.2 and Node.js 22 or newer
4
+ **Tested with:** Cairnkeep 2.15.4 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.15.2 and Node.js 22 or newer
4
+ **Tested with:** Cairnkeep 2.15.4 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.15.2, Windows x64, and Node.js 22 or newer
6
+ **Tested with:** Cairnkeep 2.15.4, Windows x64, and Node.js 22 or newer
7
7
 
8
8
  ## Outcome
9
9
 
@@ -3,7 +3,7 @@
3
3
  **Status:** Ready
4
4
  **Track:** Quickstart and Operator
5
5
  **Time:** 35 minutes
6
- **Tested with:** Cairnkeep 2.15.2; Pi 0.84.1; Node.js 22, 24, and 26
6
+ **Tested with:** Cairnkeep 2.15.4; 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.15.2 and Node.js 22 or newer
4
+ **Tested with:** Cairnkeep 2.15.4 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.15.2 and Node.js 22 or newer
4
+ **Tested with:** Cairnkeep 2.15.4 and Node.js 22 or newer
5
5
  **Time:** 35 minutes
6
6
 
7
7
  ## Outcome
@@ -65,6 +65,10 @@ cairn playbook receipts list
65
65
  cairn playbook doctor
66
66
  ```
67
67
 
68
+ `cairn playbook record --help` prints this command's bounded event, action,
69
+ outcome, identity, session, project, and output options. A receipt records one
70
+ action outcome; use another call only for another material outcome.
71
+
68
72
  Try a bounded customization, then restore the profile behavior:
69
73
 
70
74
  ```bash
@@ -87,11 +91,11 @@ cairn playbook set balanced
87
91
  ## Privacy and trust boundary
88
92
 
89
93
  The managed `AGENTS.md` block also gives compatible agents a bounded durable
90
- context protocol: derive one short project query for a nontrivial task, treat
91
- memory as a locator, and verify the maintained source. It does not contain a
92
- task-specific query, force a tool call, or authorize an automatic memory write.
93
- When evaluating the protocol, inspect the actual `memory_search` event rather
94
- than assuming the instruction was followed.
94
+ context protocol: derive one short project query as the first tool or command,
95
+ treat memory as a locator, and verify the maintained source. It does not
96
+ contain a task-specific query or authorize an automatic memory write. When
97
+ evaluating the protocol, inspect the actual `memory_search` event rather than
98
+ assuming the instruction was followed.
95
99
 
96
100
  Checks are offline and store nothing. Explicit receipts contain bounded
97
101
  identifiers, digests, event/action/outcome/reason, and a timestamp, but no
@@ -10,7 +10,8 @@
10
10
  2. Run guided setup in a synthetic project. Show `.ai/playbooks.json` mode and
11
11
  the delimited Cairnkeep block inside an `AGENTS.md` that already has user
12
12
  content. Point out the generic durable-context protocol: it derives a query
13
- from the task, treats memory as a locator, and never writes automatically.
13
+ from the task as the first tool or command, treats memory as a
14
+ locator, and never writes automatically.
14
15
  3. Compare `minimal`, `balanced`, and `strict` with `cairn playbook status`.
15
16
  Customize one canonical action and show that an arbitrary command or unknown
16
17
  field is rejected.
@@ -19,9 +20,9 @@
19
20
  5. Run a security-sensitive `check finish --enforce` without evidence and show
20
21
  exit 3. Perform synthetic verification, then re-run with completed and
21
22
  reasoned skipped evidence.
22
- 6. Record one outcome with exact policy and decision digests. Inspect the
23
- private receipt and show that changed paths, prompts, source, and output are
24
- absent.
23
+ 6. Run `cairn playbook record --help`, then record one outcome with exact
24
+ policy and decision digests. Inspect the private receipt and show that
25
+ changed paths, prompts, source, and output are absent.
25
26
  7. Show `/cairn-work` in Claude or OpenCode and the portable `AGENTS.md`
26
27
  guidance for Codex/Qwen. State that adapters route to the same CLI and do not
27
28
  automatically activate skills. Show one real `memory_search` event so the
package/docs/operating.md CHANGED
@@ -841,11 +841,13 @@ cannot contain commands, prompts, URLs, or extensions.
841
841
  The same ownership-safe block contains a generic durable-context protocol. For
842
842
  nontrivial work that may depend on existing decisions, conventions,
843
843
  constraints, recurring failures, or prior work, compatible agents derive one
844
- short task query and call `memory_search` with `scope: project` before broad
845
- exploration. A result is only a locator: the maintained repository source must
846
- still be read and verified. Missing tools and zero results fall back to normal
847
- inspection, and the protocol never authorizes an automatic memory write,
848
- supersede, or approval.
844
+ short query directly from the task and call `memory_search` with
845
+ `scope: project` as their first tool or command, before `pwd`, `ls`, repository
846
+ inventory, or search commands such as `rg --files`, `find`, `tree`, or broad
847
+ text search. A result is only a locator:
848
+ the maintained repository source must still be read and verified. Missing
849
+ tools and zero results fall back to normal inspection, and the protocol never
850
+ authorizes an automatic memory write, supersede, or approval.
849
851
 
850
852
  ```bash
851
853
  cairn playbook list
@@ -873,12 +875,20 @@ advisory and should carry a concrete `--skipped ACTION=REASON` when omitted.
873
875
  Checking never executes the displayed commands, contacts a service, enables a
874
876
  capability, or grants approval.
875
877
 
876
- Material outcomes can be stored with `cairn playbook record` using the exact
877
- policy and decision digests from the check. Inspect them with `cairn playbook
878
- receipts list|show`; validate state with `cairn playbook doctor`. Actor and
879
- session options are provenance labels only: v2.15 does not authenticate them
880
- and does not provide team ACLs. See [team mode](design/team-mode.md) for the
881
- future admission contract.
878
+ Material outcomes can be stored one action per call using the exact policy and
879
+ decision digests from the check:
880
+
881
+ ```bash
882
+ cairn playbook record --policy POLICY_DIGEST --decision DECISION_DIGEST \
883
+ --event finish --action verify.tests --outcome completed \
884
+ --session SESSION --reason 'targeted tests passed'
885
+ cairn playbook record --help
886
+ ```
887
+
888
+ Inspect receipts with `cairn playbook receipts list|show`; validate state with
889
+ `cairn playbook doctor`. Actor and session options are provenance labels only:
890
+ v2.15 does not authenticate them and does not provide team ACLs. See
891
+ [team mode](design/team-mode.md) for the future admission contract.
882
892
 
883
893
  The managed instruction lifecycle is explicit and ownership-safe:
884
894
 
@@ -72,8 +72,9 @@ result should survive the restart.
72
72
  `.planning`, and `.agentfs` scaffold. It also reconciles Cairnkeep's delimited
73
73
  instruction block in `AGENTS.md` while preserving every surrounding user byte
74
74
  and file mode. The block tells compatible agents when to make one
75
- task-derived, project-scoped memory search, to verify maintained repository
76
- sources, and never to promote memory automatically. It initializes Git only
75
+ task-derived, project-scoped memory search as their first tool or command, to
76
+ verify maintained repository sources, and never to promote memory
77
+ automatically. It initializes Git only
77
78
  with explicit
78
79
  `--git init`, preserves unrelated files, does not overwrite modified files it
79
80
  does not own, and records managed digests in private `.ai/cairnkeep.json`.
@@ -93,6 +94,7 @@ workflow checks apply. Inspect it directly before relying on agent routing:
93
94
  cairn playbook status
94
95
  cairn playbook check start --complexity standard --familiarity mixed
95
96
  cairn playbook check finish --changed README.md --completed docs.update --enforce
97
+ cairn playbook record --help
96
98
  ```
97
99
 
98
100
  `must` can produce a non-zero enforcement result; `should` is advisory with a
@@ -1 +1 @@
1
- {"identifier":"cairn-offline-fake-v1","package_version":"2.15.2","schema_version":1,"task_set_digest":"13e95379f35839593047ec34521a65a8fa3ab92bd3993bca9dc8bf5c4a9ff36f"}
1
+ {"identifier":"cairn-offline-fake-v1","package_version":"2.15.4","schema_version":1,"task_set_digest":"13e95379f35839593047ec34521a65a8fa3ab92bd3993bca9dc8bf5c4a9ff36f"}
@@ -36,6 +36,37 @@ contacts a network service, or grants approval. Actor identity is caller-supplie
36
36
  and unauthenticated until a future team deployment binds it to authentication.
37
37
  `;
38
38
  }
39
+ function checkUsage() {
40
+ return `Usage:
41
+ cairn playbook check start|check|finish [signals] [evidence] [--enforce] [--json]
42
+
43
+ Signals:
44
+ --complexity trivial|standard|complex --familiarity known|mixed|unfamiliar
45
+ --risk low|normal|high|security --public-change
46
+ --changed PATH... --change-type TYPE...
47
+
48
+ Evidence and provenance:
49
+ --completed ACTION... --skipped ACTION=REASON...
50
+ --failed ACTION=REASON... --actor ID --actor-kind user|agent|service
51
+ --session ID
52
+ `;
53
+ }
54
+ function recordUsage() {
55
+ return `Usage:
56
+ cairn playbook record --policy DIGEST --decision DIGEST --event start|check|finish \\
57
+ --action ACTION --outcome completed|skipped|failed [--reason REASON] \\
58
+ [--actor ID] [--actor-kind user|agent|service] [--session ID] \\
59
+ [--project PATH] [--json]
60
+
61
+ Record one material action outcome per call using the exact policy and decision
62
+ digests returned by the corresponding check. Actor identity is caller-supplied
63
+ and unauthenticated in this release.
64
+
65
+ Actions:
66
+ context.recall context.explore work.plan verify.tests
67
+ review.repository review.security docs.update learning.capture
68
+ `;
69
+ }
39
70
  const VALUE_OPTIONS = new Set([
40
71
  "--project", "--complexity", "--familiarity", "--risk", "--changed", "--change-type",
41
72
  "--completed", "--skipped", "--failed", "--actor", "--actor-kind", "--session",
@@ -214,6 +245,20 @@ async function main() {
214
245
  process.stdout.write(usage());
215
246
  return;
216
247
  }
248
+ if (command === "check" && raw.some((value) => ["--help", "-h"].includes(value))) {
249
+ const helpArguments = raw.filter((value) => !["--help", "-h"].includes(value));
250
+ if (raw.length !== helpArguments.length + 1
251
+ || helpArguments.length > 1
252
+ || (helpArguments.length === 1 && !["start", "check", "finish"].includes(helpArguments[0]))) {
253
+ throw new Error("check help accepts at most one event: start, check, or finish.");
254
+ }
255
+ process.stdout.write(checkUsage());
256
+ return;
257
+ }
258
+ if (command === "record" && raw.length === 1 && ["--help", "-h"].includes(raw[0])) {
259
+ process.stdout.write(recordUsage());
260
+ return;
261
+ }
217
262
  const parsed = parse(raw);
218
263
  if (command === "list") {
219
264
  ensureAllowed(parsed, [], ["--json"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cairnkeep/cli",
3
- "version": "2.15.2",
3
+ "version": "2.15.4",
4
4
  "description": "A durable, harness-agnostic memory + context layer for coding agents and MCP clients.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -28,6 +28,18 @@ env -u CAIRN_NOTE_DISTILLATION "$cairn" notes --help >/dev/null 2>&1 || fail "ca
28
28
  "$cairn" artifact --help | grep -q "cairn artifact list" || fail "cairn artifact dispatch"
29
29
  "$cairn" evidence --help | grep -q "cairn evidence list" || fail "cairn evidence dispatch"
30
30
  "$cairn" playbook --help | grep -q "cairn playbook list" || fail "cairn playbook dispatch"
31
+ "$cairn" playbook check --help | grep -q "check start|check|finish" || fail "cairn playbook check help"
32
+ "$cairn" playbook check start --help | grep -q "trivial|standard|complex" || fail "cairn playbook event help"
33
+ if "$cairn" playbook check start finish --help >/dev/null 2>&1; then
34
+ fail "playbook check help should reject multiple events"
35
+ fi
36
+ "$cairn" playbook record --help >"$tmp/playbook-record-help" || fail "cairn playbook record help"
37
+ grep -qF -- '--event start|check|finish' "$tmp/playbook-record-help" || fail "playbook record help missing events"
38
+ grep -qF -- '--outcome completed|skipped|failed' "$tmp/playbook-record-help" || fail "playbook record help missing outcomes"
39
+ grep -qF 'review.security' "$tmp/playbook-record-help" || fail "playbook record help missing actions"
40
+ if "$cairn" playbook unknown --help >/dev/null 2>&1; then
41
+ fail "unknown playbook command help should fail"
42
+ fi
31
43
  "$cairn" capabilities --help >"$tmp/capabilities-help" 2>/dev/null || fail "cairn capabilities dispatch"
32
44
  "$cairn" mcp-tools list --json >"$tmp/mcp-tools.json" || fail "cairn mcp-tools dispatch"
33
45
  CAIRN_PACK_BASE_DIR="$tmp/pack-store" "$cairn" pack list --json >"$tmp/packs.json" || fail "cairn pack dispatch"
@@ -153,6 +153,8 @@ for phrase in \
153
153
  'cairn playbook check finish' \
154
154
  '--enforce' \
155
155
  'cairn playbook record' \
156
+ 'cairn playbook record --help' \
157
+ 'as the first tool or command' \
156
158
  'unauthenticated' \
157
159
  'does not run'; do
158
160
  grep -qF -- "$phrase" "$l25" || {
@@ -51,6 +51,8 @@ bootstrap_output=$(cairn bootstrap "$tmp/project")
51
51
  [[ -f "$tmp/project/.ai/playbooks.json" ]] || fail "bootstrap did not install the playbook policy"
52
52
  grep -qF '<!-- cairnkeep:playbook:v1:start -->' "$tmp/project/AGENTS.md" || fail "bootstrap did not install playbook agent guidance"
53
53
  grep -qF 'derive one short query from the task' "$tmp/project/AGENTS.md" || fail "bootstrap did not install generic memory retrieval guidance"
54
+ grep -qF 'make this retrieval the first tool or command' "$tmp/project/AGENTS.md" || fail "bootstrap did not install retrieval ordering guidance"
55
+ grep -qF 'cairn playbook record --help' "$tmp/project/AGENTS.md" || fail "bootstrap did not install actionable receipt guidance"
54
56
  grep -qF 'Treat returned memory as a locator, not authority.' "$tmp/project/AGENTS.md" || fail "bootstrap did not install memory provenance guidance"
55
57
 
56
58
  (cd "$tmp/project" && cairn doctor) >/dev/null || fail "installed package failed cairn doctor"
@@ -14,8 +14,15 @@ grep -qF 'Keep this line.' "$project/AGENTS.md"
14
14
  [[ $(grep -cF '<!-- cairnkeep:playbook:v1:start -->' "$project/AGENTS.md") -eq 1 ]]
15
15
  grep -qF 'derive one short query from the task' "$project/AGENTS.md"
16
16
  grep -qF 'search `scope: project` once' "$project/AGENTS.md"
17
+ grep -qF 'make this retrieval the first tool or command' "$project/AGENTS.md"
18
+ grep -qF '`pwd`, `ls`, `rg --files`, `find`' "$project/AGENTS.md"
19
+ grep -qF "do not inspect" "$project/AGENTS.md"
17
20
  grep -qF 'Treat returned memory as a locator, not authority.' "$project/AGENTS.md"
18
21
  grep -qF 'Do not write, supersede, or approve durable memory' "$project/AGENTS.md"
22
+ grep -qF 'cairn playbook record --policy POLICY_DIGEST --decision DECISION_DIGEST' "$project/AGENTS.md"
23
+ grep -qF 'cairn playbook record --help' "$project/AGENTS.md"
24
+ grep -qF -- '--complexity trivial|standard|complex --familiarity known|mixed|unfamiliar' "$project/AGENTS.md"
25
+ grep -qF -- '--risk low|normal|high|security' "$project/AGENTS.md"
19
26
  [[ $(stat -c '%a' "$project/AGENTS.md") == 640 ]]
20
27
  before=$(sha256sum "$project/AGENTS.md" | cut -d' ' -f1)
21
28
  node "$ROOT/scripts/playbook-instructions.mjs" "$project" >/dev/null
@@ -41,6 +41,8 @@ try {
41
41
  assert.match(launcherPowerShell(), /CAIRN_WORK_EVIDENCE/);
42
42
  assert.match(readFileSync(join(project, "AGENTS.md"), "utf8"), /cairnkeep:playbook:v1:start/);
43
43
  assert.match(readFileSync(join(project, "AGENTS.md"), "utf8"), /derive one short query from the task/);
44
+ assert.match(readFileSync(join(project, "AGENTS.md"), "utf8"), /make this retrieval the first tool or command/);
45
+ assert.match(readFileSync(join(project, "AGENTS.md"), "utf8"), /cairn playbook record --help/);
44
46
  assert.match(readFileSync(join(project, "AGENTS.md"), "utf8"), /Treat returned memory as a locator, not authority\./);
45
47
  assert.match(readFileSync(join(project, "AGENTS.md"), "utf8"), /Keep this line\./);
46
48
 
@@ -1,12 +1,15 @@
1
1
  <!-- cairnkeep:playbook:v1:start -->
2
2
  ## Cairnkeep Durable Context
3
3
 
4
- Before broad repository exploration on a nontrivial task that may depend on
5
- existing project decisions, conventions, constraints, recurring failures, or
6
- prior work:
4
+ At the start of a nontrivial task that may depend on existing project
5
+ decisions, conventions, constraints, recurring failures, or prior work,
6
+ make this retrieval the first tool or command. Do not run repository location,
7
+ inventory, or search commands such as `pwd`, `ls`, `rg --files`, `find`,
8
+ `tree`, or broad text searches first:
7
9
 
8
10
  - If `memory_search` is available, derive one short query from the task and
9
- search `scope: project` once.
11
+ search `scope: project` once. Derive it from the user's task; do not inspect
12
+ the repository first merely to formulate the query.
10
13
  - Treat returned memory as a locator, not authority. Read and verify the
11
14
  maintained repository sources it references before implementing a result.
12
15
  - If the tool is unavailable or no relevant result exists, continue with
@@ -20,11 +23,11 @@ prior work:
20
23
  Use Cairnkeep's bounded playbook policy to select workflow steps. It advises or
21
24
  enforces existing capabilities; it does not execute a workflow for you.
22
25
 
23
- - At task start, run `cairn playbook check start --session SESSION --complexity LEVEL --familiarity LEVEL` and follow every applicable `must` action. Apply `should` actions unless there is a concrete reason to skip them; use judgment for `may` actions.
26
+ - At task start, run `cairn playbook check start --session SESSION --complexity trivial|standard|complex --familiarity known|mixed|unfamiliar` with one value from each bounded set, and follow every applicable `must` action. Apply `should` actions unless there is a concrete reason to skip them; use judgment for `may` actions.
24
27
  - Re-run `cairn playbook check check` when scope, familiarity, complexity, or risk changes materially.
25
- - Before claiming completion, run `cairn playbook check finish --session SESSION --changed PATH... --risk LEVEL --public-change --completed ACTION... --skipped ACTION=REASON... --enforce` with accurate signals and evidence.
28
+ - Before claiming completion, run `cairn playbook check finish --session SESSION --changed PATH... --risk low|normal|high|security --public-change --completed ACTION... --skipped ACTION=REASON... --enforce` with one bounded risk value and accurate signals and evidence.
26
29
  - A non-zero enforcement result means applicable `must` evidence is missing. Perform the action and check again; do not relabel a skipped or failed action as completed.
27
- - Record material outcomes with `cairn playbook record`, using the exact policy and decision digests returned by the check. Actor identity is an unverified local assertion in this release.
30
+ - After a successful finish check, record only material outcomes with `cairn playbook record --policy POLICY_DIGEST --decision DECISION_DIGEST --event finish --action ACTION --outcome OUTCOME --session SESSION [--reason REASON]`, using one call per recorded action and the exact digests returned by the check. Run `cairn playbook record --help` for the bounded values. Actor identity is an unverified local assertion in this release.
28
31
  - Existing approval and capability boundaries still apply. A playbook cannot enable a disabled capability, grant approval, write durable memory automatically, run arbitrary commands, or authorize destructive work.
29
32
  - If the CLI or an applicable capability is unavailable, state that limitation and follow the policy intent manually; never invent a receipt or successful result.
30
33
  <!-- cairnkeep:playbook:v1:end -->