@journeykit/canon 0.40.0 → 0.42.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 (117) hide show
  1. package/dist/index.js +9 -64
  2. package/dist/skills/SKILL.src.md +14 -3
  3. package/dist/skills/reference/canon-subject.md +47 -0
  4. package/dist/skills/reference/role-implementer.md +4 -4
  5. package/dist/skills/reference/role-orchestrator.md +20 -4
  6. package/dist/skills/reference/role-planner.md +45 -4
  7. package/dist/skills/reference/role-reviewer.md +4 -4
  8. package/man/canon-adapter-authorize.1 +2 -2
  9. package/man/canon-adapter-validate.1 +2 -2
  10. package/man/canon-adapter.1 +2 -2
  11. package/man/canon-artifacts-move.1 +2 -2
  12. package/man/canon-artifacts-prune.1 +2 -2
  13. package/man/canon-artifacts-store.1 +2 -2
  14. package/man/canon-artifacts-verify.1 +2 -2
  15. package/man/canon-artifacts.1 +2 -2
  16. package/man/canon-brief-approve.1 +2 -2
  17. package/man/canon-brief-check.1 +2 -2
  18. package/man/canon-brief-show.1 +2 -2
  19. package/man/canon-brief.1 +2 -2
  20. package/man/canon-change-defer.1 +91 -0
  21. package/man/canon-change-drop.1 +77 -0
  22. package/man/canon-change-new.1 +2 -2
  23. package/man/canon-change-reopen.1 +78 -0
  24. package/man/canon-change.1 +21 -4
  25. package/man/canon-completion.1 +2 -2
  26. package/man/canon-context-pack-add.1 +2 -2
  27. package/man/canon-context-pack-show.1 +2 -2
  28. package/man/canon-context-pack-verify.1 +2 -2
  29. package/man/canon-context-pack.1 +2 -2
  30. package/man/canon-context.1 +2 -2
  31. package/man/canon-dashboard.1 +2 -2
  32. package/man/canon-demo-init.1 +2 -2
  33. package/man/canon-demo-review.1 +2 -2
  34. package/man/canon-demo.1 +2 -2
  35. package/man/canon-dispatch-begin.1 +2 -2
  36. package/man/canon-dispatch-diff.1 +2 -2
  37. package/man/canon-dispatch-end.1 +2 -2
  38. package/man/canon-dispatch.1 +2 -2
  39. package/man/canon-divergence-accept.1 +2 -2
  40. package/man/canon-divergence-add.1 +2 -2
  41. package/man/canon-divergence-defer.1 +2 -2
  42. package/man/canon-divergence-list.1 +2 -2
  43. package/man/canon-divergence-resolve.1 +2 -2
  44. package/man/canon-divergence.1 +2 -2
  45. package/man/canon-evidence-add.1 +2 -2
  46. package/man/canon-evidence-approval-payload.1 +2 -2
  47. package/man/canon-evidence-audit.1 +2 -2
  48. package/man/canon-evidence.1 +2 -2
  49. package/man/canon-export.1 +4 -2
  50. package/man/canon-feature-new.1 +2 -2
  51. package/man/canon-feature.1 +2 -2
  52. package/man/canon-finding-add.1 +2 -2
  53. package/man/canon-finding-close.1 +2 -2
  54. package/man/canon-finding-list.1 +2 -2
  55. package/man/canon-finding.1 +2 -2
  56. package/man/canon-format.1 +2 -2
  57. package/man/canon-gate-check.1 +2 -2
  58. package/man/canon-gate-install-hooks.1 +2 -2
  59. package/man/canon-gate-promote.1 +2 -2
  60. package/man/canon-gate.1 +2 -2
  61. package/man/canon-ingest-plans.1 +2 -2
  62. package/man/canon-ingest-records.1 +2 -2
  63. package/man/canon-ingest.1 +2 -2
  64. package/man/canon-init.1 +2 -2
  65. package/man/canon-inventory-sync.1 +2 -2
  66. package/man/canon-inventory.1 +2 -2
  67. package/man/canon-ledger-compact.1 +2 -2
  68. package/man/canon-ledger.1 +2 -2
  69. package/man/canon-migrate.1 +2 -2
  70. package/man/canon-plugin-sync.1 +2 -2
  71. package/man/canon-plugin.1 +2 -2
  72. package/man/canon-policy-approve.1 +2 -2
  73. package/man/canon-policy-show.1 +2 -2
  74. package/man/canon-policy.1 +2 -2
  75. package/man/canon-prompt-add.1 +2 -2
  76. package/man/canon-prompt-show.1 +2 -2
  77. package/man/canon-prompt.1 +2 -2
  78. package/man/canon-purge.1 +2 -2
  79. package/man/canon-query.1 +6 -4
  80. package/man/canon-regime-show.1 +2 -2
  81. package/man/canon-regime.1 +2 -2
  82. package/man/canon-report-build.1 +2 -2
  83. package/man/canon-report-check.1 +2 -2
  84. package/man/canon-report-snapshot.1 +2 -2
  85. package/man/canon-report.1 +2 -2
  86. package/man/canon-retrieve.1 +2 -2
  87. package/man/canon-review-change.1 +2 -2
  88. package/man/canon-review-scenario.1 +2 -2
  89. package/man/canon-review.1 +2 -2
  90. package/man/canon-scenario-new.1 +2 -2
  91. package/man/canon-scenario.1 +2 -2
  92. package/man/canon-schema.1 +2 -2
  93. package/man/canon-search.1 +4 -2
  94. package/man/canon-selftest.1 +2 -2
  95. package/man/canon-skills-check.1 +2 -2
  96. package/man/canon-skills-doctor.1 +2 -2
  97. package/man/canon-skills-install.1 +2 -2
  98. package/man/canon-skills-show.1 +2 -2
  99. package/man/canon-skills.1 +2 -2
  100. package/man/canon-status.1 +2 -2
  101. package/man/canon-strategy-approval-payload.1 +2 -2
  102. package/man/canon-strategy-promote.1 +2 -2
  103. package/man/canon-strategy-rollback.1 +2 -2
  104. package/man/canon-strategy.1 +2 -2
  105. package/man/canon-subject-adopt.1 +2 -2
  106. package/man/canon-subject-move.1 +2 -2
  107. package/man/canon-subject-new.1 +2 -2
  108. package/man/canon-subject-show.1 +2 -2
  109. package/man/canon-subject-unadopt.1 +5 -3
  110. package/man/canon-subject.1 +2 -2
  111. package/man/canon-task-done.1 +2 -2
  112. package/man/canon-task.1 +2 -2
  113. package/man/canon-tier-age.1 +2 -2
  114. package/man/canon-tier.1 +2 -2
  115. package/man/canon-trace.1 +2 -2
  116. package/man/canon.1 +3 -3
  117. package/package.json +5 -4
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/index.ts
4
- import { spawnSync, execSync } from "node:child_process";
5
- import { existsSync, readdirSync, realpathSync } from "node:fs";
4
+ import { spawnSync } from "node:child_process";
5
+ import { existsSync, realpathSync } from "node:fs";
6
6
  import { constants as osConstants } from "node:os";
7
7
  import { resolve, join, basename } from "node:path";
8
8
  import { fileURLToPath } from "node:url";
@@ -13,59 +13,6 @@ var isSubDir = dirName === "dist" || dirName === "src";
13
13
  var cliDir = isSubDir ? resolve(currentDir, "..") : currentDir;
14
14
  var scopeDir = resolve(cliDir, "..");
15
15
  var workspaceRoot = resolve(scopeDir, "..");
16
- function detectLibcKind() {
17
- const override = process.env.CANON_LIBC?.trim().toLowerCase();
18
- if (override === "musl")
19
- return "musl";
20
- if (override === "gnu" || override === "glibc")
21
- return "gnu";
22
- const report = process.report?.getReport?.();
23
- if (report?.header?.glibcVersionRuntime) {
24
- return "gnu";
25
- }
26
- if (Array.isArray(report?.sharedObjects) && report.sharedObjects.some((obj) => obj.toLowerCase().includes("musl"))) {
27
- return "musl";
28
- }
29
- if (report?.header?.release?.sourceUrl?.toLowerCase().includes("musl")) {
30
- return "musl";
31
- }
32
- try {
33
- const output = execSync("ldd --version", {
34
- encoding: "utf-8",
35
- stdio: ["ignore", "pipe", "pipe"]
36
- }).toLowerCase();
37
- if (output.includes("musl"))
38
- return "musl";
39
- if (output.includes("glibc") || output.includes("gnu"))
40
- return "gnu";
41
- } catch (error) {
42
- const { stdout, stderr } = error ?? {};
43
- const combined = `${stdout ?? ""}
44
- ${stderr ?? ""}`.toLowerCase();
45
- if (combined.includes("musl"))
46
- return "musl";
47
- if (combined.includes("glibc") || combined.includes("gnu"))
48
- return "gnu";
49
- }
50
- const hasGnuLoader = loaderPresent("ld-linux-");
51
- const hasMuslLoader = loaderPresent("ld-musl-");
52
- if (hasGnuLoader !== hasMuslLoader)
53
- return hasMuslLoader ? "musl" : "gnu";
54
- if (hasGnuLoader && hasMuslLoader) {
55
- return existsSync("/etc/alpine-release") ? "musl" : "gnu";
56
- }
57
- return "gnu";
58
- }
59
- function loaderPresent(prefix) {
60
- for (const dir of ["/lib", "/lib64"]) {
61
- try {
62
- if (readdirSync(dir).some((entry) => entry.startsWith(prefix))) {
63
- return true;
64
- }
65
- } catch {}
66
- }
67
- return false;
68
- }
69
16
  function resolveTargetPackageName() {
70
17
  const arch = process.arch;
71
18
  if (process.platform === "darwin") {
@@ -74,9 +21,10 @@ function resolveTargetPackageName() {
74
21
  return null;
75
22
  }
76
23
  if (process.platform === "linux") {
77
- const libc = detectLibcKind();
78
- if (arch === "x64" && libc === "gnu")
24
+ if (arch === "x64")
79
25
  return "core-linux-x64";
26
+ if (arch === "arm64")
27
+ return "core-linux-arm64";
80
28
  return null;
81
29
  }
82
30
  if (process.platform === "win32") {
@@ -96,13 +44,10 @@ function resolveRustTargetTriple() {
96
44
  return null;
97
45
  }
98
46
  if (process.platform === "linux") {
99
- const libc = detectLibcKind();
100
- if (arch === "arm64") {
101
- return libc === "musl" ? "aarch64-unknown-linux-musl" : "aarch64-unknown-linux-gnu";
102
- }
103
- if (arch === "x64") {
104
- return libc === "musl" ? "x86_64-unknown-linux-musl" : "x86_64-unknown-linux-gnu";
105
- }
47
+ if (arch === "arm64")
48
+ return "aarch64-unknown-linux-musl";
49
+ if (arch === "x64")
50
+ return "x86_64-unknown-linux-musl";
106
51
  return null;
107
52
  }
108
53
  if (process.platform === "win32") {
@@ -65,7 +65,8 @@ a feature, a one-line request included. A human is needed once per scope:
65
65
  change on a live subject waits on its own scenarios; an untagged scenario
66
66
  answers to every change with an `Approved:` line (an edited one refuses); `change new` and
67
67
  `subject adopt` warn when the subject is live. `canon subject unadopt <subject-id> --change <change>`
68
- takes a draft change back off (refused once approved). The subject
68
+ takes a draft change back off (refused once approved: the human's
69
+ `change defer` or `change drop` takes an approved one out). The subject
69
70
  answers for every adopted change that is tagged (a scenario of the subject
70
71
  is tagged `@flow:<change>.*`), has an `Approved:` line, or is a chore:
71
72
  reopen and ship pass only when all of them are approved now, whatever the
@@ -259,7 +260,7 @@ A role is guidance, not enforcement: `--role` on `evidence add` and
259
260
  `{"ok":true,"data":…,"meta":…}`; failure is
260
261
  `{"ok":false,"error":{…},"meta":…}` (a check that fails keeps its report in
261
262
  `data`). `meta` carries `tool`, `toolVersion`, `contract` (`atip/1`),
262
- `contractVersion` (`1.5`), `schemaVersion`,
263
+ `contractVersion` (`1.6`), `schemaVersion`,
263
264
  `command`, and when present `next`, `warnings` (`[{code, message}]`) and
264
265
  `page`; a repeated write that changed nothing reports `data.unchanged: true`.
265
266
  Absent members are omitted, never `null` or `[]` (a value you sent empty comes back as `received: ""`).
@@ -301,11 +302,21 @@ A role is guidance, not enforcement: `--role` on `evidence add` and
301
302
  - `--override-reason <text>` is the only way to proceed past a waivable
302
303
  refusal; it is recorded, echoed in `data.overrides[]` and listed by `status`
303
304
  for the human. There is no `--force`. `brief approve`, `policy approve`,
304
- `divergence accept` and the `migrate --commit` that re-binds `Approved:`
305
+ `divergence accept`, `change drop`, `change defer`, `change reopen` (six
306
+ leaves) and the `migrate --commit` that re-binds `Approved:`
305
307
  lines record a human's decision and refuse every agent role (`ACTOR_DENIED`)
306
308
  unless they record the explicit answer the human gave you, with
307
309
  `--relayed-via <tool>` (show, ask, record, as for the brief; `canon skills
308
310
  show role-planner`); never unset your role to run one.
311
+ To close a change the human no longer wants, ask with the question tool, then
312
+ record their answer with `canon change defer <slug> --reason "<their words>" --ref <link or date> --approver <their name> --relayed-via <the question tool> --actor <your actor id>`
313
+ (defer is "not this release", `canon change drop` is the end and takes the
314
+ same options, a deferred change comes back with `canon change reopen` and a
315
+ new `brief approve`; a shipped change cannot be closed; evidence, reviews and
316
+ findings stay). A closed change drops out of the requirements: `canon status`
317
+ lists it in `setAsideChanges` and `setAsideScenarios`, `canon gate check`
318
+ prints the advisory `closed_change`, `canon query --kind change_state` reads
319
+ its state.
309
320
 
310
321
  ### Many records at once: `--input`
311
322
 
@@ -435,6 +435,46 @@ for a change whose brief carries an `Approved:` line, and while a scenario
435
435
  the subject owns carries a `@flow:<change>.*` tag (it would fall back to an
436
436
  older approval; remove or retag those scenarios first, the hint names them);
437
437
  an unlinked pair is a no-op.
438
+ The refusal for an approved brief (`APPROVED_BRIEF`) is not a dead end: its
439
+ hint names `canon change defer` and `canon change drop`, the human's way to take
440
+ an approved change out of the work (next section).
441
+
442
+ ### Closing a change: `canon change defer`, `canon change drop`, `canon change reopen`
443
+
444
+ Three leaves are the human's, with `brief approve`, `policy approve` and
445
+ `divergence accept`: the human-only leaves are six, and each refuses every
446
+ agent role (`ACTOR_DENIED`) unless it records the answer the human gave you
447
+ (`--relayed-via`). When the human says a change is not wanted or not in this
448
+ release, ask with the harness question tool, count only an explicit answer, then
449
+ record it:
450
+
451
+ ```text
452
+ canon change defer <change> --reason "<their words>" --ref <link or date> --approver <their name> --relayed-via <the question tool> --actor <your actor id>
453
+ ```
454
+
455
+ `canon change drop <change>` takes the same options (`canon skills show
456
+ role-planner` has the steps). **Defer** is for "not this release": `canon
457
+ change reopen <change>` brings it back, and the reopened change needs a new
458
+ `brief approve` (the earlier `Approved:` line no longer counts). **Drop** is the
459
+ end: a dropped change cannot be reopened (`CHANGE_CONFLICT`, reason `DROPPED`).
460
+ A shipped change cannot be closed (reason `SHIPPED`), a closed one cannot be
461
+ closed again (`CLOSED`) and a change that is not deferred cannot be reopened
462
+ (`NOT_DEFERRED`). The change's evidence, reviews and findings stay as they are
463
+ (`CHANGE_RECORDS_KEPT`). `brief approve` and `scenario new --flow <F-id> --change
464
+ <change>` on a closed change are refused (reason `CLOSED`).
465
+
466
+ A closed change drops out of the requirements: the subject no longer answers
467
+ for it and the scenarios only closed changes made are not asked for. A repo
468
+ whose `canon.yaml` has no `change_state` line under `routing:` refuses the
469
+ three leaves with `CONFIG_INVALID`; `canon migrate` adds the line.
470
+
471
+ - `canon status --json`: `data.subjects[].setAsideChanges` (each `change`,
472
+ `state`, `reason`, `refs`, `approver`, `at`) and `setAsideScenarios` (each
473
+ `scenario`, `project`, `changes`), both omitted when empty.
474
+ - `canon gate check`: the advisory `closed_change`, one line per closed change
475
+ and per set-aside scenario; it never fails the gate.
476
+ - `canon query --kind change_state --change <change>` reads the current state;
477
+ `--history` adds the records before a reopen.
438
478
 
439
479
  ### Starting a new change: `canon change new`
440
480
 
@@ -811,6 +851,12 @@ only the pending drafts, and `flow` lists each flow step of every tagged
811
851
  change as `{ "id", "change", "scenarios": [{ id, title, failure, evidenced,
812
852
  review }], "gaps" }`.
813
853
 
854
+ `setAsideChanges` and `setAsideScenarios` (0.42) are present only for a subject
855
+ that has them: the changes a human closed with `canon change defer` or `canon
856
+ change drop` that the subject adopted (`change`, `state` `deferred` or
857
+ `dropped`, `reason`, `refs`, `approver`, `at`), and the scenarios only closed
858
+ changes made (`scenario`, `project`, `changes`). No check asks for either.
859
+
814
860
  Each `meta.next` entry's `x-canon.actor` is `agent` or `human` (a step only the
815
861
  human takes; its `reason` says what to get from them).
816
862
 
@@ -822,6 +868,7 @@ in 0.16, when `next[].command` stopped always being a command line
822
868
  0.17, when `brief.proposal` was removed: the canon `brief.md` is
823
869
  `brief.brief`, with `briefExists` and `source`. It is `4` since 0.31, when the
824
870
  `brief` object became the `briefs` list.
871
+ The two set-aside fields are additions: `statusVersion` stays `4`.
825
872
 
826
873
  `subject new`, `adopt`, `unadopt` and `move` write their records directly; the
827
874
  human-readable success line ends `— written directly; nothing to
@@ -9,8 +9,8 @@ build nothing meanwhile. The only waiver is `--override-reason
9
9
  "<why>"`, for the case where you were told to attest while the brief waits for
10
10
  the human's answer: canon records it on the evidence, echoes it in
11
11
  `data.overrides[]` and lists it in `status` for the human. Never use it to
12
- skip the wait yourself. `brief approve`, `policy approve` and `divergence
13
- accept` are the human's; they refuse you (`ACTOR_DENIED`) unless they record an
12
+ skip the wait yourself. `brief approve`, `policy approve`, `divergence accept`,
13
+ `change drop`, `change defer` and `change reopen` are the human's; they refuse you (`ACTOR_DENIED`) unless they record an
14
14
  answer the human gave in the conversation (`--relayed-via`, the planner's
15
15
  procedure: `canon skills show role-planner`). You never run them without that
16
16
  answer, and never remove or unset your role (`env -u CANON_ROLE`, dropping
@@ -156,7 +156,7 @@ canon inventory sync --json
156
156
  ```
157
157
  ```text
158
158
  # Read stored records across every storage tier
159
- usage: canon query --kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding> [--since <TIMESTAMP>] [--plugin <PLUGIN_ID> | --history] [--change <CHANGE_ID>] [--status <STATUS>] [--domain <NAME>] [--include-sensitive] [--limit <N> | --all] [--cursor <CURSOR>] [--fields <FIELDS>]
159
+ usage: canon query --kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding|change_state> [--since <TIMESTAMP>] [--plugin <PLUGIN_ID> | --history] [--change <CHANGE_ID>] [--status <STATUS>] [--domain <NAME>] [--include-sensitive] [--limit <N> | --all] [--cursor <CURSOR>] [--fields <FIELDS>]
160
160
  ```
161
161
  ```bash
162
162
  canon query --kind evidence --json
@@ -184,7 +184,7 @@ canon schema evidence add --json
184
184
  ```
185
185
  ```text
186
186
  # Search records, brief sections and scenario text, with each hit's neighbors in the record graph
187
- usage: canon search <TEXT> [--kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding|brief>]* [--expand <N>] [--limit <N>]
187
+ usage: canon search <TEXT> [--kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding|change_state|brief>]* [--expand <N>] [--limit <N>]
188
188
  ```
189
189
  ```bash
190
190
  canon search timeout --kind finding --json
@@ -3,7 +3,8 @@
3
3
  You run the loop across agents and move the subject. You write no brief,
4
4
  code or review yourself. Declare the role with `CANON_ROLE=orchestrator` (or
5
5
  `--as orchestrator`); your `canon status` also lists the human's steps. The
6
- human's acts (`brief approve`, `policy approve`, `divergence accept`) refuse
6
+ human's acts (`brief approve`, `policy approve`, `divergence accept`, `change drop`,
7
+ `change defer`, `change reopen`: six leaves) refuse
7
8
  every agent role, you included (`ACTOR_DENIED`), unless you record the answer the
8
9
  human gave you in the conversation with `--relayed-via <tool>` (below). You never
9
10
  run them without that answer, and never remove or unset your role (`env -u CANON_ROLE`,
@@ -158,7 +159,7 @@ canon evidence approval-payload --scenario auth.login.01 --project root --approv
158
159
  ```
159
160
  ```text
160
161
  # Export a redacted retention manifest without deleting records
161
- usage: canon export --kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding> [--before <TIMESTAMP>] [--after <TIMESTAMP>] [--output <FILE>] [--include-sensitive] [--limit <N> | --all] [--cursor <CURSOR>] [--fields <FIELDS>] [--dry-run] [--input]
162
+ usage: canon export --kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding|change_state> [--before <TIMESTAMP>] [--after <TIMESTAMP>] [--output <FILE>] [--include-sensitive] [--limit <N> | --all] [--cursor <CURSOR>] [--fields <FIELDS>] [--dry-run] [--input]
162
163
  ```
163
164
  ```bash
164
165
  canon export --kind evidence --output evidence.json --json
@@ -273,7 +274,7 @@ canon purge --kind run --before 2020-01-01T00:00:00Z --json
273
274
  ```
274
275
  ```text
275
276
  # Read stored records across every storage tier
276
- usage: canon query --kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding> [--since <TIMESTAMP>] [--plugin <PLUGIN_ID> | --history] [--change <CHANGE_ID>] [--status <STATUS>] [--domain <NAME>] [--include-sensitive] [--limit <N> | --all] [--cursor <CURSOR>] [--fields <FIELDS>]
277
+ usage: canon query --kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding|change_state> [--since <TIMESTAMP>] [--plugin <PLUGIN_ID> | --history] [--change <CHANGE_ID>] [--status <STATUS>] [--domain <NAME>] [--include-sensitive] [--limit <N> | --all] [--cursor <CURSOR>] [--fields <FIELDS>]
277
278
  ```
278
279
  ```bash
279
280
  canon query --kind evidence --json
@@ -322,7 +323,7 @@ canon schema evidence add --json
322
323
  ```
323
324
  ```text
324
325
  # Search records, brief sections and scenario text, with each hit's neighbors in the record graph
325
- usage: canon search <TEXT> [--kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding|brief>]* [--expand <N>] [--limit <N>]
326
+ usage: canon search <TEXT> [--kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding|change_state|brief>]* [--expand <N>] [--limit <N>]
326
327
  ```
327
328
  ```bash
328
329
  canon search timeout --kind finding --json
@@ -548,6 +549,21 @@ straight to the implementer and reviewer in the same change. A known gap the
548
549
  reviewer reports as tracked outside the change is accepted by the human with
549
550
  `canon divergence accept`; relay it the same way.
550
551
 
552
+ When the human says a change is not wanted, or not in this release, you are
553
+ the session that asks and records it; closing is theirs, never yours. Ask with
554
+ the harness question tool, count only an explicit answer, then record it:
555
+ `canon change defer <slug> --reason "<their words>" --ref <link or date> --approver <their name> --relayed-via <the question tool> --actor <your actor id>`.
556
+ `canon change drop <slug>` takes the same options; defer is for "not this
557
+ release", drop is the end, and `canon change reopen <slug>` (the human's answer
558
+ again) brings a deferred change back and needs a new `brief approve`. A shipped
559
+ change cannot be closed (`CHANGE_CONFLICT`, reason `SHIPPED`); its evidence,
560
+ reviews and findings stay (`CHANGE_RECORDS_KEPT`). A closed change drops out of
561
+ what the subject and the gate require: `canon status --json` lists it in
562
+ `setAsideChanges` and its scenarios in `setAsideScenarios`, `canon gate check`
563
+ prints the advisory `closed_change`, and `canon query --kind change_state
564
+ --change <slug>` reads its state. Do not start the implementer or the reviewer
565
+ for a closed change. `canon skills show role-planner` has the full steps.
566
+
551
567
  ## Hand off a note, not a copy
552
568
 
553
569
  A note one session leaves for another (a resume note, a spawn prompt, a
@@ -4,8 +4,9 @@ You turn a request into an approved scope: a subject, a change and a PRD
4
4
  brief the human answers once. You build nothing. Declare the role with
5
5
  `CANON_ROLE=planner` (or `--as planner`); `canon status` and `meta.next`
6
6
  then show your steps and count the rest under `waitingOn`. The approvals are
7
- the human's: `brief approve`, `policy approve`, `divergence accept` and the
8
- `migrate --commit` that re-binds `Approved:` lines refuse every agent role
7
+ the human's: `brief approve`, `policy approve`, `divergence accept`, `change drop`,
8
+ `change defer`, `change reopen` (six leaves) and the `migrate --commit` that
9
+ re-binds `Approved:` lines refuse every agent role
9
10
  (`ACTOR_DENIED`, `retryable: false`) unless you record the answer the human gave
10
11
  you in the conversation, with `--relayed-via <tool>` (step 4). Without a human's
11
12
  explicit answer you never run them, and you never remove or unset your role
@@ -95,7 +96,7 @@ canon gate check --json
95
96
  ```
96
97
  ```text
97
98
  # Read stored records across every storage tier
98
- usage: canon query --kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding> [--since <TIMESTAMP>] [--plugin <PLUGIN_ID> | --history] [--change <CHANGE_ID>] [--status <STATUS>] [--domain <NAME>] [--include-sensitive] [--limit <N> | --all] [--cursor <CURSOR>] [--fields <FIELDS>]
99
+ usage: canon query --kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding|change_state> [--since <TIMESTAMP>] [--plugin <PLUGIN_ID> | --history] [--change <CHANGE_ID>] [--status <STATUS>] [--domain <NAME>] [--include-sensitive] [--limit <N> | --all] [--cursor <CURSOR>] [--fields <FIELDS>]
99
100
  ```
100
101
  ```bash
101
102
  canon query --kind evidence --json
@@ -123,7 +124,7 @@ canon schema evidence add --json
123
124
  ```
124
125
  ```text
125
126
  # Search records, brief sections and scenario text, with each hit's neighbors in the record graph
126
- usage: canon search <TEXT> [--kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding|brief>]* [--expand <N>] [--limit <N>]
127
+ usage: canon search <TEXT> [--kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding|change_state|brief>]* [--expand <N>] [--limit <N>]
127
128
  ```
128
129
  ```bash
129
130
  canon search timeout --kind finding --json
@@ -204,6 +205,9 @@ ids); the human step comes after it. A policy that no longer matches its approva
204
205
  To park a draft that should not gate a live subject, `subject unadopt`
205
206
  it and adopt it into a `proposed` subject. Inside an approved scope there is no new
206
207
  subject or change: a fix or follow-up stays in the existing change.
208
+ An approved change is not parked that way (`subject unadopt` is refused
209
+ with `APPROVED_BRIEF`): taking an approved change out of the work is the
210
+ human's `change defer` or `change drop` (below).
207
211
  2. **Write the brief.** Briefs outlive the code that exists today and are
208
212
  read by sessions that did not write them. Intent says what the product
209
213
  does today, in behavior words, and why that is not enough; Desired outcome
@@ -317,6 +321,43 @@ when you have recorded their explicit approval (step 5) and the same command
317
321
  reports `state: approved`; read it in `data.state` of `canon brief show
318
322
  add-login --json`. Nothing else starts before that.
319
323
 
324
+ ## Closing a change is the human's call
325
+
326
+ `change drop`, `change defer` and `change reopen` are human-only like `brief
327
+ approve`: six leaves name no agent role, and each refuses every agent role
328
+ (`ACTOR_DENIED`) unless it records the answer the human gave you. When the human
329
+ says a change is not wanted, or not in this release, you do not stop it by
330
+ editing files or by `subject unadopt`; you ask, then record their answer.
331
+
332
+ 1. **Ask** with the harness question tool (`ask` in omp, `AskUserQuestion` in
333
+ Claude Code, otherwise in the chat): defer it (not this release), drop it
334
+ (the end of it) or keep it. Count only an explicit answer; no answer closes
335
+ nothing.
336
+ 2. **Record it:** `canon change defer <slug> --reason "<their words>" --ref <link or date> --approver <their name> --relayed-via <the question tool> --actor <your actor id>`.
337
+ `canon change drop <slug>` takes the same options. `--ref` names where the
338
+ decision lives (an issue link or a date) and may repeat. Never remove or
339
+ unset your role to run it.
340
+
341
+ - **Defer** is for "not this release": `canon change reopen <slug>` with the
342
+ human's answer brings it back, and the reopened change needs a new
343
+ `brief approve` (the earlier approval line no longer counts).
344
+ - **Drop** is the end: a dropped change is never reopened (`CHANGE_CONFLICT`,
345
+ reason `DROPPED`); a new change is a new scope.
346
+ - A shipped change cannot be closed (`CHANGE_CONFLICT`, reason `SHIPPED`), and
347
+ `brief approve` or `scenario new --flow <F-id> --change <slug>` on a closed
348
+ change is refused (reason `CLOSED`).
349
+ - Evidence, reviews and findings stay as they are; the warning
350
+ `CHANGE_RECORDS_KEPT` lists what the closed change keeps.
351
+ - A repo whose `canon.yaml` has no `change_state` line under `routing:` refuses
352
+ these leaves with `CONFIG_INVALID`; `canon migrate` previews and, committed
353
+ with its plan digest, adds the line.
354
+
355
+ A closed change drops out of what the subject and the gate require. `canon
356
+ status --json` lists it per subject in `setAsideChanges` and its scenarios in
357
+ `setAsideScenarios` (omitted when empty), `canon gate check` prints the advisory
358
+ `closed_change` for each, and `canon query --kind change_state --change <slug>`
359
+ reads its state (`--history` adds the records before a reopen).
360
+
320
361
  ## Non-behavior work is a chore
321
362
 
322
363
  A refactor, dependency, build, CI or infra change that alters nothing a user
@@ -3,8 +3,8 @@
3
3
  You are the independent second look. Declare the role with
4
4
  `CANON_ROLE=reviewer` (or `--as reviewer`); `--role` on `review scenario`,
5
5
  `review change` and `finding add` then defaults to `reviewer`. The human's
6
- acts refuse you (`ACTOR_DENIED`): `brief approve`, `policy approve` and
7
- `divergence accept`, unless you record the answer the human gave you in the
6
+ acts refuse you (`ACTOR_DENIED`): `brief approve`, `policy approve`,
7
+ `divergence accept`, `change drop`, `change defer` and `change reopen`, unless you record the answer the human gave you in the
8
8
  conversation with `--relayed-via <tool>` (the divergence acceptance below).
9
9
  Name what the human has to decide; never look for another flag that grants it.
10
10
  You never run them without that answer, and never remove or unset your role
@@ -115,7 +115,7 @@ canon gate check --json
115
115
  ```
116
116
  ```text
117
117
  # Read stored records across every storage tier
118
- usage: canon query --kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding> [--since <TIMESTAMP>] [--plugin <PLUGIN_ID> | --history] [--change <CHANGE_ID>] [--status <STATUS>] [--domain <NAME>] [--include-sensitive] [--limit <N> | --all] [--cursor <CURSOR>] [--fields <FIELDS>]
118
+ usage: canon query --kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding|change_state> [--since <TIMESTAMP>] [--plugin <PLUGIN_ID> | --history] [--change <CHANGE_ID>] [--status <STATUS>] [--domain <NAME>] [--include-sensitive] [--limit <N> | --all] [--cursor <CURSOR>] [--fields <FIELDS>]
119
119
  ```
120
120
  ```bash
121
121
  canon query --kind evidence --json
@@ -150,7 +150,7 @@ canon schema evidence add --json
150
150
  ```
151
151
  ```text
152
152
  # Search records, brief sections and scenario text, with each hit's neighbors in the record graph
153
- usage: canon search <TEXT> [--kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding|brief>]* [--expand <N>] [--limit <N>]
153
+ usage: canon search <TEXT> [--kind <change|task|scenario|run|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding|change_state|brief>]* [--expand <N>] [--limit <N>]
154
154
  ```
155
155
  ```bash
156
156
  canon search timeout --kind finding --json
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH canon-adapter-authorize 1 "authorize 0.40.0"
3
+ .TH canon-adapter-authorize 1 "authorize 0.42.0"
4
4
  .SH NAME
5
5
  canon\-adapter\-authorize \- Authorize declared capabilities against repository policy (preflight only)
6
6
  .SH SYNOPSIS
@@ -41,4 +41,4 @@ Print help
41
41
  \fB\-V\fR, \fB\-\-version\fR
42
42
  Print version
43
43
  .SH VERSION
44
- v0.40.0
44
+ v0.42.0
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH canon-adapter-validate 1 "validate 0.40.0"
3
+ .TH canon-adapter-validate 1 "validate 0.42.0"
4
4
  .SH NAME
5
5
  canon\-adapter\-validate \- Read and validate one provider\-neutral response envelope
6
6
  .SH SYNOPSIS
@@ -41,4 +41,4 @@ Print help
41
41
  \fB\-V\fR, \fB\-\-version\fR
42
42
  Print version
43
43
  .SH VERSION
44
- v0.40.0
44
+ v0.42.0
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH canon-adapter 1 "adapter 0.40.0"
3
+ .TH canon-adapter 1 "adapter 0.42.0"
4
4
  .SH NAME
5
5
  canon\-adapter \- Validate a provider\-neutral adapter response without executing a provider
6
6
  .SH SYNOPSIS
@@ -43,4 +43,4 @@ Examples:
43
43
  canon adapter validate \-\-response response.json
44
44
  canon adapter validate \-\-response response.json \-\-repo . \-\-json
45
45
  .SH VERSION
46
- v0.40.0
46
+ v0.42.0
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH canon-artifacts-move 1 "move 0.40.0"
3
+ .TH canon-artifacts-move 1 "move 0.42.0"
4
4
  .SH NAME
5
5
  canon\-artifacts\-move \- Move the local artifact blobs to an object\-store tier, verify them, and remove the local copies
6
6
  .SH SYNOPSIS
@@ -60,4 +60,4 @@ The bare run previews: it lists every upload and removal and prints a planDigest
60
60
 
61
61
  Idempotent and resumable: a run stopped anywhere leaves a repo the gate still passes, and the next run finishes; a second run finds nothing to do. A blob whose bytes do not match its name is never moved. Moving back to local is refused; `\-\-tier local` on a local repo is a no\-op.
62
62
  .SH VERSION
63
- v0.40.0
63
+ v0.42.0
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH canon-artifacts-prune 1 "prune 0.40.0"
3
+ .TH canon-artifacts-prune 1 "prune 0.42.0"
4
4
  .SH NAME
5
5
  canon\-artifacts\-prune \- Delete the artifact blobs no record binds any more (the bare run previews; \-\-commit \-\-plan\-digest deletes)
6
6
  .SH SYNOPSIS
@@ -74,4 +74,4 @@ It also deletes the stale temp files a killed blob write left in .canon/artifact
74
74
 
75
75
  Exit 0 for a preview or a commit, 1 when a delete failed, 2 when the plan is stale or the records or the store cannot be read.
76
76
  .SH VERSION
77
- v0.40.0
77
+ v0.42.0
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH canon-artifacts-store 1 "store 0.40.0"
3
+ .TH canon-artifacts-store 1 "store 0.42.0"
4
4
  .SH NAME
5
5
  canon\-artifacts\-store \- Store the bound files of existing evidence records and current reviews in the artifact store (.canon/artifacts/sha256/)
6
6
  .SH SYNOPSIS
@@ -51,4 +51,4 @@ For records written before canon stored bound bytes (0.11\-0.13), and for any ev
51
51
 
52
52
  Exit 0 when the pass ran (the gate decides whether an unstored file matters), 2 when the ledger cannot be read or a write fails.
53
53
  .SH VERSION
54
- v0.40.0
54
+ v0.42.0
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH canon-artifacts-verify 1 "verify 0.40.0"
3
+ .TH canon-artifacts-verify 1 "verify 0.42.0"
4
4
  .SH NAME
5
5
  canon\-artifacts\-verify \- Check that the artifact store holds every file the latest evidence and current reviews bind (\-\-full re\-hashes the stored bytes)
6
6
  .SH SYNOPSIS
@@ -47,4 +47,4 @@ Exit 0 when every file is stored, 1 when one is missing or altered (data.problem
47
47
 
48
48
  It also counts the stale temp files a killed blob write left in .canon/artifacts/sha256 (`.tmp\-<sha256>\-<pid>\-<nanos>`, modified over five minutes ago): data.staleTemps has their files and bytes (unreadable, never 0, when the directory cannot be read) and a line names `canon artifacts prune`, which deletes them. verify deletes nothing, and a temp file never changes the exit.
49
49
  .SH VERSION
50
- v0.40.0
50
+ v0.42.0
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH canon-artifacts 1 "artifacts 0.40.0"
3
+ .TH canon-artifacts 1 "artifacts 0.42.0"
4
4
  .SH NAME
5
5
  canon\-artifacts \- Check or move the evidence artifact store (local, or an object\-store tier)
6
6
  .SH SYNOPSIS
@@ -45,4 +45,4 @@ Move the local artifact blobs to an object\-store tier, verify them, and remove
45
45
  canon\-artifacts\-prune(1)
46
46
  Delete the artifact blobs no record binds any more (the bare run previews; \-\-commit \-\-plan\-digest deletes)
47
47
  .SH VERSION
48
- v0.40.0
48
+ v0.42.0
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH canon-brief-approve 1 "approve 0.40.0"
3
+ .TH canon-brief-approve 1 "approve 0.42.0"
4
4
  .SH NAME
5
5
  canon\-brief\-approve \- Record the human\*(Aqs approval of the brief, bound to its text; refused while `brief check` has blockers
6
6
  .SH SYNOPSIS
@@ -74,4 +74,4 @@ chore whose approval saw the code tree that is still the current one asks for no
74
74
  not approved (BRIEF_APPROVAL_STALE) until a human answers again and this
75
75
  runs again. Run it only from the human\*(Aqs answer, with their words as \-\-note.
76
76
  .SH VERSION
77
- v0.40.0
77
+ v0.42.0
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH canon-brief-check 1 "check 0.40.0"
3
+ .TH canon-brief-check 1 "check 0.42.0"
4
4
  .SH NAME
5
5
  canon\-brief\-check \- Read the brief against the rules: blocker and advisory findings (exit 0 clean, 1 blockers, 2 refused)
6
6
  .SH SYNOPSIS
@@ -41,4 +41,4 @@ Print version
41
41
  [\fICHANGE_ID\fR]
42
42
  The change to read (default: the repo\*(Aqs only live change)
43
43
  .SH VERSION
44
- v0.40.0
44
+ v0.42.0
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH canon-brief-show 1 "show 0.40.0"
3
+ .TH canon-brief-show 1 "show 0.42.0"
4
4
  .SH NAME
5
5
  canon\-brief\-show \- Show where the change stands and the next one to three steps; never edits
6
6
  .SH SYNOPSIS
@@ -50,4 +50,4 @@ Examples:
50
50
 
51
51
  The operand names the change; without it the repo\*(Aqs only live change is read.
52
52
  .SH VERSION
53
- v0.40.0
53
+ v0.42.0
package/man/canon-brief.1 CHANGED
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH canon-brief 1 "brief 0.40.0"
3
+ .TH canon-brief 1 "brief 0.42.0"
4
4
  .SH NAME
5
5
  canon\-brief \- Check a change\*(Aqs brief (PRD format) and see the next steps; never edits
6
6
  .SH SYNOPSIS
@@ -61,4 +61,4 @@ gets one blocker, `brief.old\-format`: `canon migrate` rewrites it. A brief
61
61
  with fewer than two known headings (written before 0.19) checks as `brief.legacy`, an
62
62
  advisory. Without \-\-change, the repo\*(Aqs only live change is checked.
63
63
  .SH VERSION
64
- v0.40.0
64
+ v0.42.0