@journeykit/canon 0.26.0 → 0.28.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 (133) hide show
  1. package/dist/skills/SKILL.src.md +245 -89
  2. package/dist/skills/reference/brief-align.md +4 -2
  3. package/dist/skills/reference/brief-clarify.md +7 -5
  4. package/dist/skills/reference/brief-harden.md +4 -2
  5. package/dist/skills/reference/brief-polish.md +7 -5
  6. package/dist/skills/reference/brief-shape.md +4 -2
  7. package/dist/skills/reference/canon-artifact-ingest.md +11 -7
  8. package/dist/skills/reference/canon-authoring.md +16 -2
  9. package/dist/skills/reference/canon-context.md +21 -11
  10. package/dist/skills/reference/canon-fmt.md +10 -2
  11. package/dist/skills/reference/canon-gate.md +119 -83
  12. package/dist/skills/reference/canon-inventory.md +34 -22
  13. package/dist/skills/reference/canon-learn.md +23 -19
  14. package/dist/skills/reference/canon-plan-import.md +10 -7
  15. package/dist/skills/reference/canon-plugins.md +15 -8
  16. package/dist/skills/reference/canon-policy.md +20 -16
  17. package/dist/skills/reference/canon-report-dashboard.md +30 -19
  18. package/dist/skills/reference/canon-retrieve.md +13 -10
  19. package/dist/skills/reference/canon-review.md +96 -68
  20. package/dist/skills/reference/canon-session-ingest.md +7 -3
  21. package/dist/skills/reference/canon-storage.md +82 -51
  22. package/dist/skills/reference/canon-subject.md +123 -84
  23. package/dist/skills/reference/canon-vocab.md +1 -1
  24. package/dist/skills/reference/role-implementer.md +295 -64
  25. package/dist/skills/reference/role-orchestrator.md +547 -55
  26. package/dist/skills/reference/role-planner.md +189 -32
  27. package/dist/skills/reference/role-reviewer.md +257 -58
  28. package/dist/skills/scripts/canon-retrieve-pre-dispatch.sh +10 -5
  29. package/man/canon-adapter-authorize.1 +44 -0
  30. package/man/canon-adapter-validate.1 +44 -0
  31. package/man/canon-adapter.1 +46 -0
  32. package/man/canon-artifacts-move.1 +63 -0
  33. package/man/canon-artifacts-store.1 +54 -0
  34. package/man/canon-artifacts-verify.1 +48 -0
  35. package/man/canon-artifacts.1 +45 -0
  36. package/man/canon-brief-approve.1 +62 -0
  37. package/man/canon-brief-check.1 +44 -0
  38. package/man/canon-brief-show.1 +50 -0
  39. package/man/canon-brief.1 +63 -0
  40. package/man/canon-change-new.1 +66 -0
  41. package/man/canon-change.1 +42 -0
  42. package/man/canon-completion.1 +60 -0
  43. package/man/canon-context-pack-add.1 +47 -0
  44. package/man/canon-context-pack-show.1 +44 -0
  45. package/man/canon-context-pack-verify.1 +44 -0
  46. package/man/canon-context-pack.1 +50 -0
  47. package/man/canon-context.1 +44 -0
  48. package/man/canon-dashboard.1 +50 -0
  49. package/man/canon-demo-init.1 +44 -0
  50. package/man/canon-demo-review.1 +44 -0
  51. package/man/canon-demo.1 +47 -0
  52. package/man/canon-dispatch-begin.1 +80 -0
  53. package/man/canon-dispatch-diff.1 +41 -0
  54. package/man/canon-dispatch-end.1 +60 -0
  55. package/man/canon-dispatch.1 +45 -0
  56. package/man/canon-divergence-accept.1 +68 -0
  57. package/man/canon-divergence-add.1 +97 -0
  58. package/man/canon-divergence-defer.1 +71 -0
  59. package/man/canon-divergence-list.1 +56 -0
  60. package/man/canon-divergence-resolve.1 +68 -0
  61. package/man/canon-divergence.1 +51 -0
  62. package/man/canon-evidence-add.1 +168 -0
  63. package/man/canon-evidence-approval-payload.1 +65 -0
  64. package/man/canon-evidence-audit.1 +121 -0
  65. package/man/canon-evidence.1 +57 -0
  66. package/man/canon-export.1 +108 -0
  67. package/man/canon-feature-new.1 +62 -0
  68. package/man/canon-feature.1 +39 -0
  69. package/man/canon-finding-add.1 +196 -0
  70. package/man/canon-finding-close.1 +117 -0
  71. package/man/canon-finding-list.1 +59 -0
  72. package/man/canon-finding.1 +67 -0
  73. package/man/canon-format.1 +49 -0
  74. package/man/canon-gate-check.1 +44 -0
  75. package/man/canon-gate-install-hooks.1 +59 -0
  76. package/man/canon-gate-promote.1 +62 -0
  77. package/man/canon-gate.1 +50 -0
  78. package/man/canon-ingest-plans.1 +53 -0
  79. package/man/canon-ingest-records.1 +56 -0
  80. package/man/canon-ingest-sessions.1 +62 -0
  81. package/man/canon-ingest.1 +50 -0
  82. package/man/canon-init.1 +98 -0
  83. package/man/canon-inventory-sync.1 +50 -0
  84. package/man/canon-inventory.1 +39 -0
  85. package/man/canon-ledger-compact.1 +50 -0
  86. package/man/canon-ledger.1 +54 -0
  87. package/man/canon-migrate.1 +89 -0
  88. package/man/canon-plugin-sync.1 +53 -0
  89. package/man/canon-plugin.1 +39 -0
  90. package/man/canon-policy-approve.1 +50 -0
  91. package/man/canon-policy-show.1 +41 -0
  92. package/man/canon-policy.1 +52 -0
  93. package/man/canon-prompt-add.1 +47 -0
  94. package/man/canon-prompt-show.1 +41 -0
  95. package/man/canon-prompt.1 +43 -0
  96. package/man/canon-purge.1 +70 -0
  97. package/man/canon-query.1 +111 -0
  98. package/man/canon-regime-show.1 +50 -0
  99. package/man/canon-regime.1 +39 -0
  100. package/man/canon-report-build.1 +44 -0
  101. package/man/canon-report-check.1 +41 -0
  102. package/man/canon-report-snapshot.1 +47 -0
  103. package/man/canon-report.1 +45 -0
  104. package/man/canon-retrieve.1 +56 -0
  105. package/man/canon-review-change.1 +98 -0
  106. package/man/canon-review-scenario.1 +98 -0
  107. package/man/canon-review.1 +42 -0
  108. package/man/canon-scenario-new.1 +80 -0
  109. package/man/canon-scenario.1 +39 -0
  110. package/man/canon-schema.1 +63 -0
  111. package/man/canon-selftest.1 +69 -0
  112. package/man/canon-skills-check.1 +47 -0
  113. package/man/canon-skills-doctor.1 +47 -0
  114. package/man/canon-skills-install.1 +53 -0
  115. package/man/canon-skills-show.1 +104 -0
  116. package/man/canon-skills.1 +48 -0
  117. package/man/canon-status.1 +51 -0
  118. package/man/canon-strategy-approval-payload.1 +53 -0
  119. package/man/canon-strategy-promote.1 +59 -0
  120. package/man/canon-strategy-rollback.1 +62 -0
  121. package/man/canon-strategy.1 +45 -0
  122. package/man/canon-subject-adopt.1 +53 -0
  123. package/man/canon-subject-move.1 +80 -0
  124. package/man/canon-subject-new.1 +65 -0
  125. package/man/canon-subject-show.1 +44 -0
  126. package/man/canon-subject-unadopt.1 +63 -0
  127. package/man/canon-subject.1 +51 -0
  128. package/man/canon-task-done.1 +47 -0
  129. package/man/canon-task.1 +42 -0
  130. package/man/canon-tier-age.1 +50 -0
  131. package/man/canon-tier.1 +39 -0
  132. package/man/canon.1 +169 -0
  133. package/package.json +9 -5
@@ -2,36 +2,444 @@
2
2
 
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
- `--as orchestrator`); your `canon status` also lists the human's steps.
5
+ `--as orchestrator`); your `canon status` also lists the human's steps. The
6
+ human's acts (`brief approve`, `policy approve`, `divergence accept`) refuse
7
+ every agent role, you included (`HUMAN_ONLY`). You never run them, and never remove or unset your role (`env -u CANON_ROLE`,
8
+ dropping `--as`) to get past the refusal: report the exact call, slug filled in, and
9
+ wait; the human runs it (or uses `canon dashboard`).
6
10
 
7
11
  ## Commands
8
12
 
9
- Every line is complete; fill the `<placeholders>`.
13
+ Every leaf of this role is below with its full syntax line (every option the leaf
14
+ has) and an example generated from the CLI's own spec, which runs as written against
15
+ the example story (subject `demo`, change `add-login`, scenario `auth.login.01`): swap
16
+ in your ids. Use only the options on a line; never guess one. Ask `canon schema
17
+ <command> --json` only for a leaf this block does not list, or after a `USAGE` refusal.
10
18
 
19
+ <!-- canon:generated commands-orchestrator begin -->
20
+ Every leaf takes `--as <ROLE>` and `--json`; `--repo <DIR>` too, except `completion`, `regime show`, `schema`, `selftest`, `skills show`. `--input <JSON|FILE|->` runs a leaf from one JSON document (an array is a batch) and is only on the lines ending `[--input]`. Its document keys are the option names in camelCase, singular even when the option repeats (the value is then an array), and `operands` holds the operands. `--fields <FIELDS>` is a comma list; camelCase and snake_case both match.
21
+ In a syntax line `<X>` is a value, `[x]` optional, `a | b` a choice, `(a | b)` exactly one is required, `[--x <V>]*` may repeat, `<X>+` is one or more, `[--a --b <V>]` go together. An option that is not on the line does not exist: it is refused (`USAGE`).
22
+
23
+ ```text
24
+ # Authorize declared capabilities against repository policy (preflight only)
25
+ canon adapter authorize --response <FILE>
26
+ ```
27
+ ```bash
28
+ canon adapter authorize --response adapter-response.json --repo .
29
+ ```
30
+ ```text
31
+ # Read and validate one provider-neutral response envelope
32
+ canon adapter validate --response <FILE>
33
+ ```
34
+ ```bash
35
+ canon adapter validate --response adapter-response.json
36
+ ```
37
+ ```text
38
+ # Move the local artifact blobs to an object-store tier, verify them, and remove the local copies
39
+ canon artifacts move --tier <TIER> [--commit --plan-digest <DIGEST>] [--input]
40
+ # a bare run previews and prints planDigest; `--commit --plan-digest <DIGEST>` with that digest acts
41
+ ```
42
+ ```bash
43
+ canon artifacts move --tier cold
44
+ ```
45
+ ```text
46
+ # Store the bound files of existing evidence records and current reviews in the artifact store (.canon/artifacts/sha256/)
47
+ canon artifacts store [--max-artifact-mib <N>] [--dry-run] [--input]
48
+ ```
49
+ ```bash
50
+ canon artifacts store
51
+ ```
52
+ ```text
53
+ # Check that the artifact store holds every file the latest evidence and current reviews bind (--full re-hashes the stored bytes)
54
+ canon artifacts verify [--full]
55
+ ```
56
+ ```bash
57
+ canon artifacts verify
58
+ ```
59
+ ```text
60
+ # Write the shell completion script for canon (bash, zsh or fish)
61
+ canon completion <SHELL>
62
+ ```
63
+ ```bash
64
+ canon completion zsh
65
+ ```
66
+ ```text
67
+ # Show what you can author here: record kinds, fields, enums, policies
68
+ canon context [--fields <FIELDS>]
69
+ ```
70
+ ```bash
71
+ canon context
72
+ ```
73
+ ```text
74
+ # Create an immutable context pack from a repository-local JSON manifest
75
+ canon context-pack add --manifest <FILE> [--input]
76
+ ```
77
+ ```bash
78
+ canon context-pack add --manifest .canon/context-manifest.json
79
+ ```
80
+ ```text
81
+ # Show a context pack after verifying its manifest and content objects
82
+ canon context-pack show <PACK_ID>
83
+ ```
84
+ ```bash
85
+ canon context-pack show sha256:0000000000000000000000000000000000000000000000000000000000000000
86
+ ```
87
+ ```text
88
+ # Verify a context pack's manifest and immutable content objects
89
+ canon context-pack verify <PACK_ID>
90
+ ```
91
+ ```bash
92
+ canon context-pack verify sha256:0000000000000000000000000000000000000000000000000000000000000000
93
+ ```
94
+ ```text
95
+ # Serve the local status dashboard
96
+ canon dashboard [--snapshot <DIR>] [--port <N>] [--input]
97
+ ```
98
+ ```bash
99
+ canon dashboard
100
+ ```
101
+ ```text
102
+ # Scaffold the demo repo (gate starts RED)
103
+ canon demo init [--input]
104
+ ```
105
+ ```bash
106
+ canon demo init --repo canon-demo
107
+ ```
108
+ ```text
109
+ # Record the missing reviewer evidence (gate turns GREEN)
110
+ canon demo review [--input]
111
+ ```
112
+ ```bash
113
+ canon demo review
114
+ ```
115
+ ```text
116
+ # Mint a Run manifest with retrieved guidance and context/policy lineage
117
+ canon dispatch begin --regime <KEY> [--role <ROLE>] [--actor-id <ACTOR_ID>] [--session-id <SESSION_ID>] [--provider <NAME>] [--model <NAME>] [--skill-id <ID>] [--skill-digest <DIGEST>] [--manifest <FILE>] [--prompt-bundle <NAME@VERSION>] [--task-id <TASK_ID>] [--parent-run-id <RUN_ID>] [--input]
118
+ ```
119
+ ```bash
120
+ canon dispatch begin --regime implementer/my-repo/api/abcdef012345 --role implementer
121
+ ```
122
+ ```text
123
+ # Diff the declared plan DAG against the observed execution graph
124
+ canon dispatch diff
125
+ ```
126
+ ```bash
127
+ canon dispatch diff
128
+ ```
129
+ ```text
130
+ # Close a dispatched run with a terminal status and an ended_at
131
+ canon dispatch end <RUN_ID> --run-outcome <succeeded|failed> [--input]
132
+ ```
11
133
  ```bash
12
- canon status --as orchestrator --json --fields next,waitingOn # at the start and when resuming
13
- canon brief approve --change-id <slug> --by "<the human>" --note "<their words>" --as orchestrator --json
14
- canon subject status <subject-id> --to <proposed|specced|building|verifying|shipped> --actor-id <unit> --as orchestrator --json
15
- canon subject status <subject-id> --to verifying --reason "<why>" --actor-id <unit> --as orchestrator --json # reopen a shipped subject (--reason is required here; any other transition accepts it as a note)
16
- canon policy show --as orchestrator --json # policy digest and its approval: approved, changed, unreadable or unapproved
17
- canon gate check --as orchestrator --json
18
- canon migrate --dry-run --as orchestrator --json # on a repo upgraded from an earlier canon: the plan, nothing written
19
- canon migrate --as orchestrator --json # applies it (see "Upgraded repo")
20
- canon artifacts verify --as orchestrator --json # the artifact store holds every bound file; refuses when an object store is unreachable
134
+ canon dispatch end 01ARZ3NDEKTSV4RRFFQ69G5FAV --run-outcome succeeded
135
+ ```
136
+ ```text
137
+ # List the current divergence burn-down state
138
+ canon divergence list [--as-of <TIMESTAMP>] [--limit <N> | --all] [--cursor <CURSOR>] [--fields <FIELDS>]
139
+ ```
140
+ ```bash
141
+ canon divergence list --as-of 2030-01-01
142
+ ```
143
+ ```text
144
+ # Emit exact bytes for external `ssh-keygen -Y sign -n canon-approval-v1`
145
+ canon evidence approval-payload --approver <NAME> --approval-at <TIMESTAMP> [--task-id <TASK_ID>] [--project-id <PROJECT_ID>] [--scenario-id <SCENARIO_ID>] [--run-id <RUN_ID>] [--rev <REV>] [--surface-ref <PATH_OR_EFFECT>]*
146
+ ```
147
+ ```bash
148
+ canon evidence approval-payload --scenario-id auth.login.01 --project-id root --approver alice --approval-at 2030-01-01T00:00:00Z
149
+ ```
150
+ ```text
151
+ # Export a redacted retention manifest without deleting records
152
+ canon export --kind <change|task|scenario|session|run|event|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]
153
+ ```
154
+ ```bash
155
+ canon export --kind evidence --output evidence.json
156
+ ```
157
+ ```text
158
+ # List a change's committed findings at their latest version
159
+ canon finding list --change-id <CHANGE_ID> [--open] [--limit <N> | --all] [--cursor <CURSOR>] [--fields <FIELDS>]
160
+ ```
161
+ ```bash
162
+ canon finding list --change-id add-login
163
+ ```
164
+ ```text
165
+ # Validate a spec/artifact corpus against canon's format
166
+ canon format [<DIR>]
167
+ ```
168
+ ```bash
169
+ canon format .canon/specs
170
+ ```
171
+ ```text
172
+ # Run the coverage/ledger/staleness/trust checks (0 clean, 1 red, 2 usage)
173
+ canon gate check [--release]
174
+ ```
175
+ ```bash
176
+ canon gate check
177
+ ```
178
+ ```text
179
+ # Install the gate hook into .claude/settings.json / .codex/hooks.json
180
+ canon gate install-hooks [--event <NAME>] [--matcher <TEXT>] [--command <TEXT>] [--timeout <N>] [--dry-run] [--input]
181
+ ```
182
+ ```bash
183
+ canon gate install-hooks
184
+ ```
185
+ ```text
186
+ # Import plans as Change/Task records
187
+ canon ingest plans [--dialect <NAME> --plan-source <DIR>] [--dry-run] [--input]
188
+ ```
189
+ ```bash
190
+ canon ingest plans
191
+ ```
192
+ ```text
193
+ # Import review/divergence/task/handoff records and derive verdicts
194
+ canon ingest records [--watch] [--interval-secs <N>] [--dry-run] [--run-id <RUN_ID>] [--input]
195
+ ```
196
+ ```bash
197
+ canon ingest records
198
+ ```
199
+ ```text
200
+ # Import agent CLI session transcripts (omp/pi, Claude Code, Codex, Hermes)
201
+ canon ingest sessions [--watch] [--interval-secs <N>] [--home <DIR>] [--full] [--all-workspaces] [--dry-run] [--input]
202
+ ```
203
+ ```bash
204
+ canon ingest sessions
205
+ ```
206
+ ```text
207
+ # Set up canon in a repo (canon.yaml, a starter policy, the AGENTS.md block, a plans home)
208
+ canon init [--check] [--no-agents-md | --check] [--policy <light|standard|strict> | --check | --no-policy] [--providers <LIST> | --check] [--language <TAG> | --check] [--dry-run | --check] [--input]
209
+ ```
210
+ ```bash
211
+ canon init
212
+ ```
213
+ ```text
214
+ # Validate each spec root, then materialize scenario index records
215
+ canon inventory sync [--spec-root <DIR>] [--dry-run] [--input]
216
+ ```
217
+ ```bash
218
+ canon inventory sync
219
+ ```
220
+ ```text
221
+ # Move superseded versions of every record out of the ledger into the archive
222
+ canon ledger compact [--commit --plan-digest <DIGEST>] [--input]
223
+ # a bare run previews and prints planDigest; `--commit --plan-digest <DIGEST>` with that digest acts
224
+ ```
225
+ ```bash
226
+ canon ledger compact
227
+ ```
228
+ ```text
229
+ # Bring a repo from an earlier canon up to date
230
+ canon migrate [--commit --plan-digest <DIGEST>] [--input]
231
+ # a bare run previews and prints planDigest; `--commit --plan-digest <DIGEST>` with that digest acts
232
+ ```
233
+ ```bash
234
+ canon migrate
235
+ ```
236
+ ```text
237
+ # Validate and write a plugin's overlay records
238
+ canon plugin sync <PLUGIN_ID> [--spec-root <DIR>] [--dry-run] [--input]
239
+ ```
240
+ ```bash
241
+ canon plugin sync my-plugin
242
+ ```
243
+ ```text
244
+ # Show the policy's digest and its approval (who, when, which bytes)
245
+ canon policy show
21
246
  ```
247
+ ```bash
248
+ canon policy show
249
+ ```
250
+ ```text
251
+ # Add a prompt bundle from a repository-local JSON manifest
252
+ canon prompt add <NAME@VERSION> --manifest <FILE> [--input]
253
+ ```
254
+ ```bash
255
+ canon prompt add reviewer@v1 --manifest .canon/prompt-manifest.json
256
+ ```
257
+ ```text
258
+ # Select a registered prompt bundle version
259
+ canon prompt show <NAME@VERSION>
260
+ ```
261
+ ```bash
262
+ canon prompt show reviewer@v1
263
+ ```
264
+ ```text
265
+ # Remove allowlisted records older than a cutoff
266
+ canon purge --kind <session|run|event|trajectory> --before <TIMESTAMP> [--commit --plan-digest <DIGEST>] [--input]
267
+ # a bare run previews and prints planDigest; `--commit --plan-digest <DIGEST>` with that digest acts
268
+ ```
269
+ ```bash
270
+ canon purge --kind session --before 2020-01-01T00:00:00Z
271
+ ```
272
+ ```text
273
+ # Read stored records across every storage tier
274
+ canon query --kind <change|task|scenario|session|run|event|handoff|review|divergence|trajectory|strategy_item|evidence|subject|finding> [--since <TIMESTAMP>] [--plugin-id <PLUGIN_ID> | --history] [--change-id <CHANGE_ID>] [--status <STATUS>] [--domain <NAME>] [--include-sensitive] [--limit <N> | --all] [--cursor <CURSOR>] [--fields <FIELDS>]
275
+ ```
276
+ ```bash
277
+ canon query --kind evidence
278
+ ```
279
+ ```text
280
+ # Build a canonical regime key for hook scripts
281
+ canon regime show --role-segment <NAME> --repo-name <NAME> --area <NAME> --hash <HASH>
282
+ ```
283
+ ```bash
284
+ canon regime show --role-segment reviewer --repo-name my-repo --area api --hash abcdef012345
285
+ ```
286
+ ```text
287
+ # Write the status report (.canon/REPORT.md)
288
+ canon report build [--input]
289
+ ```
290
+ ```bash
291
+ canon report build
292
+ ```
293
+ ```text
294
+ # Byte-diff .canon/REPORT.md against a fresh build (0 fresh, 1 missing or drifted); writes nothing
295
+ canon report check
296
+ ```
297
+ ```bash
298
+ canon report check
299
+ ```
300
+ ```text
301
+ # Export the panel marts to <DIR>/*.parquet plus manifest.json
302
+ canon report snapshot <DIR> [--input]
303
+ ```
304
+ ```bash
305
+ canon report snapshot snapshot-out
306
+ ```
307
+ ```text
308
+ # Fetch role-scoped strategy guidance
309
+ canon retrieve --for-role <ROLE> [--regime <KEY>] [--domain <NAME>] [--subject-id <SUBJECT_ID>] [--limit <N>]
310
+ ```
311
+ ```bash
312
+ canon retrieve --for-role reviewer --domain dev --limit 20
313
+ ```
314
+ ```text
315
+ # Describe canon's own commands
316
+ canon schema [<PATH>]* [--errors | --error <CODE>]
317
+ ```
318
+ ```bash
319
+ canon schema evidence add
320
+ ```
321
+ ```text
322
+ # Run canon's built-in fixture self-tests
323
+ canon selftest [--suite <trust-spine-gate|tiered-storage|typed-authoring-vocabulary|policy-expressions|format-authority|session-ingest|canon-context|artifact-ingest|spec-ledger-selftest|plugin-overlays|plan-import>]
324
+ ```
325
+ ```bash
326
+ canon selftest --suite trust-spine-gate
327
+ ```
328
+ ```text
329
+ # Check canonical projections without writing; exit 1 on drift, a legacy remnant, or a lock another canon version wrote
330
+ canon skills check [--skills-source <DIR>] [--providers <LIST>]
331
+ ```
332
+ ```bash
333
+ canon skills check
334
+ ```
335
+ ```text
336
+ # Print diagnostics for canonical projections, the install lock's canon version, legacy remnants, canon projections for a provider that is not selected, and other skills whose description claims build work; reports only, never edits
337
+ canon skills doctor [--skills-source <DIR>] [--providers <LIST>]
338
+ ```
339
+ ```bash
340
+ canon skills doctor
341
+ ```
342
+ ```text
343
+ # Install the canonical `canon` bundle or legacy developer skills
344
+ canon skills install [--skills-source <DIR>] [--providers <LIST>] [--dry-run] [--input]
345
+ ```
346
+ ```bash
347
+ canon skills install
348
+ ```
349
+ ```text
350
+ # Print a guide built into this binary (markdown on stdout); the installed SKILL.md is a stub that points here
351
+ canon skills show <NAME> [--full]
352
+ ```
353
+ ```bash
354
+ canon skills show canon --full
355
+ ```
356
+ ```text
357
+ # Show where this repo stands: subjects by status, their gaps, and the next commands
358
+ canon status [--fields <FIELDS>]
359
+ ```
360
+ ```bash
361
+ canon status
362
+ ```
363
+ ```text
364
+ # The unsigned approval payload bytes an external signer signs
365
+ canon strategy approval-payload <STRATEGY_ID> --evaluation <FILE> --approver <NAME> --approval-at <TIMESTAMP>
366
+ ```
367
+ ```bash
368
+ canon strategy approval-payload 01ARZ3NDEKTSV4RRFFQ69G5FAV --evaluation evaluation.json --approver alice --approval-at 2030-01-01T00:00:00Z
369
+ ```
370
+ ```text
371
+ # Promote a strategy after paired evaluation and signed approval
372
+ canon strategy promote <STRATEGY_ID> [--evaluation <FILE> --approval <FILE>] [--signature-file <FILE> (with --approval)] [--dry-run] [--input]
373
+ ```
374
+ ```bash
375
+ canon strategy promote 01ARZ3NDEKTSV4RRFFQ69G5FAV
376
+ ```
377
+ ```text
378
+ # Disable an active strategy with durable rollback provenance
379
+ canon strategy rollback <STRATEGY_ID> --reason <TEXT> --actor-id <ACTOR_ID> --signature-file <FILE> --approval-at <TIMESTAMP> [--contradicting-trajectory-id <ID>] [--input]
380
+ ```
381
+ ```bash
382
+ canon strategy rollback 01ARZ3NDEKTSV4RRFFQ69G5FAV --reason "regressed in production" --actor-id alice --signature-file approval.sig --approval-at 2030-01-01T00:00:00Z
383
+ ```
384
+ ```text
385
+ # Link an imported plan change to a subject (adopting it under another subject adds that subject; a change may belong to several)
386
+ canon subject adopt <SUBJECT_ID> --change-id <CHANGE_ID> [--dry-run] [--input]
387
+ ```
388
+ ```bash
389
+ canon subject adopt demo --change-id add-login
390
+ ```
391
+ ```text
392
+ # Move a subject to another lifecycle state (shipping is evidence-gated; with spec_coverage.require_review, entering its scope is review-gated; shipped → verifying reopens with --reason)
393
+ canon subject move <SUBJECT_ID> --to <proposed|specced|building|verifying|shipped|retired> [--override-reason <TEXT>] [--reason <TEXT>] [--actor-id <ACTOR_ID>] [--session-id <SESSION_ID>] [--input]
394
+ ```
395
+ ```bash
396
+ canon subject move demo --to specced
397
+ ```
398
+ ```text
399
+ # Author a new subject at status `proposed`
400
+ canon subject new <SUBJECT_ID> --domain <NAME> --title <TEXT> [--summary <TEXT>] [--owner-role <ROLE>] [--actor-id <ACTOR_ID>] [--session-id <SESSION_ID>] [--input]
401
+ ```
402
+ ```bash
403
+ canon subject new payments --domain dev --title Payments
404
+ ```
405
+ ```text
406
+ # Show a subject (read-only)
407
+ canon subject show <SUBJECT_ID>
408
+ ```
409
+ ```bash
410
+ canon subject show demo
411
+ ```
412
+ ```text
413
+ # Take a change back out of a subject (the mirror of adopt; refused for a change whose brief is approved)
414
+ canon subject unadopt <SUBJECT_ID> --change-id <CHANGE_ID> [--dry-run] [--input]
415
+ ```
416
+ ```bash
417
+ canon subject unadopt demo --change-id add-login
418
+ ```
419
+ ```text
420
+ # Apply canon.yaml aging rules, moving old records to their destination tier
421
+ canon tier age [--commit --plan-digest <DIGEST>] [--input]
422
+ # a bare run previews and prints planDigest; `--commit --plan-digest <DIGEST>` with that digest acts
423
+ ```
424
+ ```bash
425
+ canon tier age
426
+ ```
427
+ <!-- canon:generated commands-orchestrator end -->
22
428
 
23
429
  ## Read the state
24
430
 
25
431
  `canon status` lists the next steps, each with the `role` that takes it
26
432
  (`null` for the human), and `waitingOn` counts the steps held by each other
27
433
  owner, `human` included. Call it once at the start and when resuming, not
28
- after a write: after `subject status --to` or `brief approve`, the write's
29
- `meta.next` and `meta.waitingOn` are the status for what it touched.
434
+ after a write: after `subject move --to` or a spawned role's write, the
435
+ write's `meta.next` and `meta.waitingOn` are the status for what it touched.
30
436
 
31
437
  ## Spawn each role
32
438
 
33
439
  Start one agent per role with `CANON_ROLE` set in its environment, and tell
34
- it to load only `reference/role-<role>.md`:
440
+ it to read only its guide, `canon skills show role-<role>` (the guide is
441
+ printed by the binary; the installed `SKILL.md` is a stub that points to
442
+ it):
35
443
 
36
444
  ```bash
37
445
  CANON_ROLE=planner <harness> "<task: the request, the subject, the brief to write>"
@@ -41,7 +449,7 @@ CANON_ROLE=reviewer <harness> "<task: change <slug>; review it>"
41
449
 
42
450
  A subagent tool that cannot set its child's environment (most in-harness
43
451
  subagents share yours) passes the role in the task instead: tell the child
44
- its role, to load only `reference/role-<role>.md`, and to pass `--as <role>`
452
+ its role, to read only `canon skills show role-<role>`, and to pass `--as <role>`
45
453
  on every canon call (or run `export CANON_ROLE=<role>` first in its own
46
454
  shell).
47
455
 
@@ -90,17 +498,24 @@ not sign off.
90
498
  When `status` or `meta.next` shows a step with `actor: human` (the brief's
91
499
  approval), stop everything for that scope, report the brief to the human in
92
500
  its language, and wait. Tell the human they can approve the clean briefs in
93
- `canon dashboard` (the briefs page) or answer in chat; you never click
94
- Approve or fill the form, and you run `brief approve` only from their words. Do not start the implementer before the answer.
95
- Record the answer with `brief approve`. Never approve it yourself and never
96
- edit the policy to pass the gate. A policy that no longer matches the
97
- approval fails closed (`POLICY_CHANGED_SINCE_APPROVAL`, or
98
- `POLICY_APPROVAL_UNREADABLE`): the ship guard and the reopen refuse, and
99
- `--override-reason` does not waive it. Run `canon policy show`, then stop and
100
- ask the human to re-approve (`canon policy approve --by <human>`) or restore
101
- the approved policy from git; never edit the policy yourself. Inside an
501
+ `canon dashboard` (the briefs page) or run, in their own shell, the exact call
502
+ with the slug filled in: `canon brief approve <slug> --approver <their name>
503
+ --note "<their own words>"`. You never click Approve, fill the form or run
504
+ `brief approve` yourself: it refuses you (`HUMAN_ONLY`), and removing or
505
+ unsetting your declared role (`env -u CANON_ROLE`, dropping `--as`) to get past
506
+ that is the same act under another label. Report the call and wait. Do not start the
507
+ implementer before `canon brief show <slug>` reports `state: approved`.
508
+ Never approve it yourself and never edit the policy to pass the gate. A
509
+ policy that no longer matches the approval fails closed
510
+ (`POLICY_CHANGED_SINCE_APPROVAL`, or `POLICY_APPROVAL_UNREADABLE`): the ship
511
+ guard and the reopen refuse, and `--override-reason` does not waive it. Run
512
+ `canon policy show`, then stop and ask the human to re-approve
513
+ (the call `canon policy approve --approver <their name>` is theirs to run, never yours) or restore the
514
+ approved policy from git; never edit the policy yourself. Inside an
102
515
  approved scope never stop for a human: fixes, follow-ups and re-reviews go
103
- straight to the implementer and reviewer in the same change.
516
+ straight to the implementer and reviewer in the same change. A known gap the
517
+ reviewer reports as tracked outside the change is accepted by the human with
518
+ `canon divergence accept`; relay it the same way.
104
519
 
105
520
  ## Hand off a note, not a copy
106
521
 
@@ -111,7 +526,21 @@ files, and the next command. Say what was verified (a command that ran, with
111
526
  its result) apart from what is only claimed. Redact secrets: tokens, keys,
112
527
  passwords and private URLs never go into a note, a `--ref`, a `--summary`
113
528
  or a brief. When a `Handoff` body carries a continuation, its `summary`
114
- holds the next command and the verified claims (`reference/canon-vocab.md`).
529
+ holds the next command and the verified claims (`canon skills show canon-vocab`).
530
+
531
+ ## Retry safety
532
+
533
+ After a timeout or a lost response, repeat the write only when its repeat is
534
+ safe. `evidence add`, `review scenario`, `review change` and `finding add`
535
+ are content-keyed: an identical repeat returns the existing record with
536
+ `meta.unchanged: true` (a batch reports the element `unchanged`).
537
+ `finding close`, `subject adopt`, `inventory sync`, `ingest *`, `gate
538
+ promote` and `task done` are replay-safe the same way. `subject new`,
539
+ `change new`, `feature new`, `scenario new`, `subject move` and `dispatch
540
+ end` are once-only: a repeat is refused (exit 2) and changes nothing, so read
541
+ the state (`subject show`, `brief show`, `finding list`) before you retry.
542
+ A refusal leaves the tree unchanged. A destructive command is retried from
543
+ its preview, never from an old digest.
115
544
 
116
545
  ## Excuses that fail
117
546
 
@@ -119,42 +548,105 @@ holds the next command and the verified claims (`reference/canon-vocab.md`).
119
548
  |---|---|
120
549
  | "Edit the policy so the gate passes." | A changed policy fails closed (`POLICY_CHANGED_SINCE_APPROVAL`); ask the human to re-approve or restore it from git. |
121
550
  | "The reviewer can be me under another label." | The reviewer is a separate process with its own real session id (#39). |
122
- | "Approve the brief; the human said they are busy." | Never approve for the human; report the brief and wait. |
123
- | "Override the refusal to ship." | Fix the gap the refusal names; `--override-reason` does not waive an approval. |
551
+ | "Approve the brief; the human said they are busy." | `brief approve` refuses agent roles. Report the brief and wait. |
552
+ | "Override the refusal to ship." | Fix the gap the refusal names; `--override-reason` waives only the `require_review` gaps and the brief gap, is recorded on the subject, and is for the human's call, not a shortcut. |
553
+ | "Run the commit now, the preview looked fine earlier." | A bare run previews; `--commit --plan-digest` acts only on the plan you just previewed (`PLAN_CHANGED` otherwise). Preview again, then act. |
124
554
  | "I have corrected this agent before." | A correction repeated across runs belongs in a scenario, the policy or a gate, not more prose. Tell the human. |
125
555
 
126
556
  ## Move the subject
127
557
 
128
558
  Move along `proposed → specced → building → verifying → shipped` with
129
- `subject status --to`. It refuses a move the policy does not allow (missing
130
- evidence or reviews, open blockers, an unapproved brief); fix the gap rather
131
- than overriding. Move to `shipped` yourself once its guard passes, unless the
132
- brief says the human ships. A follow-up on a shipped subject goes back to
133
- `verifying` with `--reason`, then the implementer and reviewer in the same
134
- change, then `--to shipped` again. A chore on a shipped subject (`change
135
- new … --kind chore` names the reopen command) is approved first, then
136
- reopened the same way; shipping again needs the whole suite evidenced after
137
- the chore's approval (the implementer's `evidence add --all-scenarios`) and
138
- one change-level review of the chore from the reviewer (`review add --change-id
139
- <slug>`): the order is approval, evidence, review. A blocker closed
140
- `fixed` needs the suite again. The refusal names the scenarios and
141
- the command; never override them. `canon status` flags a shipped subject
142
- whose gate went red. A bad `--to` fails with `error.field` `--to` and
143
- `error.expected` listing the states.
559
+ `subject move <id> --to <state>`; `subject show <id>` reads it. It runs
560
+ directly (a transition is a state change, not a destructive act) and is not
561
+ repeatable: a move to the state the subject is already in is refused
562
+ (exit 2), so after a lost response read `subject show` before you retry.
563
+ It refuses a move the policy does not allow (missing evidence or reviews,
564
+ open blockers, an unapproved brief) with `SUBJECT_GATE_VIOLATION` and exit 1,
565
+ the record unchanged; fix the gap rather than overriding. Move to `shipped`
566
+ yourself once its guard passes, unless the brief says the human ships. A
567
+ follow-up on a shipped subject goes back to `verifying` with `--reason`,
568
+ then the implementer and reviewer in the same change, then `--to shipped`
569
+ again. A chore on a shipped subject (`change new --change-kind chore` names
570
+ the reopen command) is approved first, then reopened the same way; shipping
571
+ again needs the chore's one change-level review from the reviewer (`review
572
+ change <slug>`) and new evidence on every scenario whose code changed since
573
+ its latest evidence (the implementer's `evidence add --all-scenarios`
574
+ batch, which the refusal names with the real report paths); a docs-only
575
+ chore needs the review alone. The order is approval, evidence where the
576
+ code changed, review. A blocker closed `fixed` needs evidence on the
577
+ scenarios it names. The refusal names the scenarios and the command; never
578
+ override them. `--override-reason "<why>"` is the one waiver, available to
579
+ every role: it covers only the `require_review` gaps (`unreviewed-promotion`,
580
+ `open-blocker`) and the brief gap, is recorded on the subject, echoed in
581
+ `data.overrides[]` and listed by `canon status` for the human. Use it only
582
+ on the human's word. `canon status` flags a shipped subject whose gate went
583
+ red. A bad `--to` fails with `error.field` `--to` and `error.expected`
584
+ listing the states.
585
+
586
+ **Done when:** `canon subject show demo` (the subject's id) reports the
587
+ state you moved it to and `canon gate check` is clean; when the move exits 1,
588
+ read the refusal in `error` of `canon subject move demo --to shipped --json`.
589
+
590
+ ## Destructive commands preview first
591
+
592
+ `canon purge`, `canon tier age`, `canon ledger compact`, `canon artifacts
593
+ move` and `canon migrate` delete or rewrite existing data. A bare run only
594
+ previews: exit 0, nothing written, a report with `planDigest` and
595
+ `effects[]`. Read the effects, then act with `--commit --plan-digest
596
+ <planDigest>`; it refuses (`PLAN_CHANGED`, exit 2) when the plan recomputed
597
+ now differs from the one you previewed. A document passed with `--input`
598
+ never carries `--commit` or `--plan-digest`, and these five leaves take one
599
+ object only (`INPUT_BATCH_UNSUPPORTED`).
600
+
601
+ ```bash
602
+ canon purge --kind session --before 2026-01-01
603
+ canon tier age
604
+ canon ledger compact
605
+ ```
606
+
607
+ `canon artifacts move --tier <tier>` moves the local artifact store to an
608
+ object store and removes the local blobs, and `purge` deletes records. They
609
+ are the repo owner's decisions, not steps of the loop: run the preview, give
610
+ the human the effects, and run the commit only on their answer. If the repo is
611
+ large, the store is slow or the human has not asked for it, do not run it.
612
+
613
+ **Done when:** the commit report shows `committed: true` and a rerun of the
614
+ bare command previews no effects (`effects[]` empty); read both in `data` of
615
+ the report.
144
616
 
145
617
  ## Upgraded repo
146
618
 
147
- After a repo moves to a newer canon, run `canon migrate --dry-run`, then
148
- `canon migrate`. Besides the layout, it compacts the ledger (moves every
149
- superseded version to `.canon/archive`, as `canon ledger compact` does) and
150
- re-pins the reviews written before 0.23, which do not count until then (the
151
- gate, `status` and `subject status` print one advisory naming it). Commit
152
- what it changes. In CI run it with full history (`fetch-depth: 0`).
619
+ After a repo moves to a newer canon, `canon status`, `canon gate check` and
620
+ `canon context` warn when they find 0.27-era state (the skill lock, a hook
621
+ command, a hook entry that still calls `gate task`) and put `canon migrate --json`
622
+ first in `meta.next`. Recover in two runnable steps, then refresh the skill:
623
+
624
+ ```bash
625
+ canon migrate
626
+ canon skills install
627
+ ```
628
+
629
+ 1. `canon migrate` previews and prints the `planDigest`; the preview's own
630
+ `meta.next` carries the next command with that digest filled in.
631
+ 2. `canon migrate --commit --plan-digest <digest from the preview>` applies
632
+ it: it moves the layout, rewrites canon's own hook commands and scripts,
633
+ compacts the ledger (moves every superseded version to `.canon/archive`,
634
+ as `canon ledger compact` does), re-pins the reviews written before 0.23
635
+ (which do not count until then; the gate, `status` and `subject move`
636
+ print one advisory naming it) and replaces an old full skill with the
637
+ stub. It backs up every file it rewrites under
638
+ `.canon/migrate-backup/<timestamp>/`, is safe to run again (a second run
639
+ finds nothing to move) and refuses uncommitted changes under a path it
640
+ moves: commit first. In CI run it with full history (`fetch-depth: 0`).
641
+ 3. `canon skills install` refreshes the stub and the scripts for the selected
642
+ harnesses; `canon skills check` reports a skill written by another canon
643
+ version (exit 1, `SKILLS_DRIFT`), `canon skills doctor` explains it.
644
+
645
+ Commit what it changes.
153
646
 
154
- `canon artifacts migrate --to <tier>` moves the local artifact store to an
155
- object store and removes the local blobs. It is the repo owner's decision,
156
- not a step of the loop: never run it yourself. If the repo is large, the
157
- store is slow or the human has not asked for it, ask the human first, and
158
- run it only on their answer (`--dry-run` previews it).
647
+ **Done when:** `canon migrate` reports nothing left to move, `canon skills
648
+ check` exits 0, and `canon status` and `canon gate check` no longer warn
649
+ about 0.27 state; read the first in `data` of `canon migrate --json`, the
650
+ others in `meta.warnings`.
159
651
 
160
- Reference: `reference/canon-subject.md`.
652
+ Reference: `canon skills show canon-subject`.