@journeykit/canon 0.27.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 +107 -69
  12. package/dist/skills/reference/canon-inventory.md +23 -15
  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 +65 -39
  22. package/dist/skills/reference/canon-subject.md +116 -79
  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
@@ -1,14 +1,23 @@
1
1
  ---
2
2
  name: canon
3
- description: Use for every build, implement, add-a-feature, change-a-feature or fix request in a repo that has canon.yaml, including sites, apps and games; prefer it there over generic site, app or game builder skills. Runs canon's working loop (brief, subject, scenarios with failure paths, units, implement, evidence, independent review, status transition) split by role (planner, implementer, reviewer, orchestrator), and routes to the canon CLI reference for setup, specs, gates, storage, ingestion, retrieval and reports.
3
+ description: Use for every build, implement, add-a-feature, change-a-feature or fix request in a repo that has canon.yaml, including sites, apps and games; prefer it there over generic site, app or game builder skills. Runs canon's working loop (brief, subject, scenarios with failure paths, units, implement, evidence, independent review, status transition) split by role (planner, implementer, reviewer, orchestrator). The full guide is `canon skills show canon`.
4
4
  ---
5
5
 
6
6
  # Canon
7
7
 
8
- Features in this repo are managed with canon. This skill is the shared core:
9
- the loop, how to drive the CLI, and how to find your role. What each role
10
- does lives in `reference/role-<role>.md`; the CLI manual lives in
11
- `reference/canon-*.md` and `canon <command> --help`.
8
+ Features in this repo are managed with canon. This is the shared core guide:
9
+ the loop, how to drive the CLI, and how to find your role. The guide is built
10
+ into the `canon` binary, so it always matches the version you run:
11
+
12
+ - `canon skills show canon` prints this guide.
13
+ - `canon skills show <name>` prints one topic or role guide (the table at the
14
+ end lists every name); `canon skills show canon --full` prints this guide
15
+ followed by every topic.
16
+ - Your role guide's **Commands** block lists every option of every leaf the
17
+ role uses. Ask `canon schema <command>` (or `--help`) only for a leaf it does
18
+ not list, or after a `USAGE` refusal. Never guess an option name.
19
+
20
+ The `SKILL.md` your harness loaded is only a stub that sends you here.
12
21
 
13
22
  ## The working loop
14
23
 
@@ -24,8 +33,10 @@ a feature, a one-line request included. A human is needed once per scope:
24
33
  answer until you report: the brief is that report. The one answer
25
34
  approves the brief and the policy, `.canon/policy.yaml`, which is what
26
35
  the gate grades the work against. The human may also approve it on the `canon dashboard` briefs page; you never use that form.
27
- Record it only from the human's answer:
28
- `canon brief approve --change-id <slug> --by <the human> --note "<their words>"`.
36
+ The human records the answer, never you:
37
+ `canon brief approve <slug> --approver <their name> --note "<their words>"`
38
+ refuses every agent role (`HUMAN_ONLY`). Report that exact call, slug filled in, and
39
+ wait; never remove or unset your role (`env -u CANON_ROLE`, dropping `--as`) to run it yourself.
29
40
  Never edit the policy to make the gate pass: a policy that differs from
30
41
  the approved one fails closed (`POLICY_CHANGED_SINCE_APPROVAL`, not
31
42
  waivable); stop and ask the human. A brief edited after its
@@ -35,59 +46,96 @@ a feature, a one-line request included. A human is needed once per scope:
35
46
  - **Approval is scoped.** Evidence for a scenario needs the approval of the
36
47
  changes its `@flow:<change>.<F-id>` tags name, so a new unapproved change
37
48
  on a live subject waits on its own scenarios only; `change new` and
38
- `subject adopt` warn when the subject is live. `canon subject unadopt
39
- <change> --subject-id <id>` takes a draft change back off (refused once
40
- approved). The subject's scope is its newest adopted change, walking back
41
- past pending drafts (brief not approved, no scenario of the subject tagged
42
- `@flow:<change>.*`): reopen, evidence and ship read the newest approved or
43
- tagged change, and the transition prints one line naming every draft set
44
- aside; a draft a scenario is tagged for blocks until it is approved. → `reference/canon-subject.md`
49
+ `subject adopt` warn when the subject is live. `canon subject unadopt <subject-id> --change-id <change>`
50
+ takes a draft change back off (refused once approved). The subject's scope
51
+ is its newest adopted change, walking back past pending drafts (brief not
52
+ approved, no scenario of the subject tagged `@flow:<change>.*`): reopen,
53
+ evidence and ship read the newest approved or tagged change, and the
54
+ transition prints one line naming every draft set aside; a draft a scenario
55
+ is tagged for blocks until it is approved. `canon skills show canon-subject`
45
56
  - **Inside an approved scope, never stop for a human.** Fixes, follow-ups,
46
57
  review rounds and re-reviews stay in the approved change (never
47
58
  `canon change new`: a new change is a new scope) and go straight on: scenario,
48
59
  implement, evidence, independent review. A follow-up that adds or changes
49
60
  a step of the brief edits the brief: that is a scope change and needs a
50
61
  new answer. A follow-up on a shipped subject reopens it
51
- (`canon subject status <id> --to verifying --reason "<why>"`); a fix
52
- closed `fixed`, and an approved chore, then need the whole suite evidenced
53
- again (`evidence add --all-scenarios`, for a chore after its approval)
54
- before it ships, and a chore also needs one change-level review
55
- (`review add --change-id <slug>`).
62
+ (`canon subject move <id> --to verifying --reason "<why>"`); a fix
63
+ closed `fixed`, and an approved chore, then need evidence again for every
64
+ scenario whose code changed (see "Evidence follows the code" below) before
65
+ it ships, and a chore also needs one change-level review
66
+ (`canon review change <slug>`).
56
67
  - When no human can answer one of the brief's questions, write your
57
68
  assumption into the brief's Questions and assumptions, build on it, and say
58
69
  so in your report. That covers the brief's questions and work inside an
59
70
  approved scope, never the approval itself.
60
71
 
61
- 1. **Brief.** The planner writes the PRD brief (`.canon/changes/<slug>/brief.md`), checks it with `canon brief check`, and stops for the human. → `reference/role-planner.md`
62
- 2. **Subject.** `canon subject new`, then `canon change new` (`--kind chore` for work that alters no behavior); the change writes the brief skeleton. → `reference/role-planner.md`
63
- 3. **Scenarios.** `canon scenario new --flow <F-id> --case <case>` per behavior of a flow step, failure paths (`--case failure`) included. → `reference/role-implementer.md`
72
+ 1. **Brief.** The planner writes the PRD brief (`.canon/changes/<slug>/brief.md`), checks it with `canon brief check`, and stops for the human. `canon skills show role-planner`
73
+ 2. **Subject.** `canon subject new`, then `canon change new` (`--change-kind chore` for work that alters no behavior); the change writes the brief skeleton. `canon skills show role-planner`
74
+ 3. **Scenarios.** `canon scenario new --flow <F-id> --case <case>` per behavior of a flow step, failure paths (`--case failure`) included; many at once with `--input` (below). `canon skills show role-implementer`
64
75
  4. **Units.** Split the work; one unit is one flow step's slice with a named verify command, and each unit has its own actor id and session id, passed on everything it records. A unit never attests another unit's work.
65
- 5. **Implement.** Code with tests named by scenario id (`game.run.01: …`). → `reference/role-implementer.md`
66
- 6. **Evidence.** `canon evidence add` binds the test run to its scenarios. → `reference/role-implementer.md`
67
- 7. **Independent review.** A different session, a separate process with its own session id, that can run the checks it signs off, records `canon finding add` and `canon review add`. Every change. → `reference/role-reviewer.md`
68
- 8. **Transition.** `canon subject status <id> --to <state>` along `proposed → specced → building → verifying → shipped`, with `canon gate check` clean; fix a refused guard rather than overriding it. → `reference/role-orchestrator.md`
76
+ 5. **Implement.** Code with tests named by scenario id (`game.run.01: …`). `canon skills show role-implementer`
77
+ 6. **Evidence.** `canon evidence add` binds the test run to its scenarios; one `--input` array records many at once. `canon skills show role-implementer`
78
+ 7. **Independent review.** A different session, a separate process with its own session id, that can run the checks it signs off, records `canon finding add` and `canon review scenario`. Every change. `canon skills show role-reviewer`
79
+ 8. **Transition.** `canon subject move <id> --to <state>` along `proposed → specced → building → verifying → shipped`, with `canon gate check` clean; fix a refused guard rather than overriding it. `canon skills show role-orchestrator`
80
+
81
+ **Done when:** `canon gate check` exits 0 with no violations, `canon subject show <id>` reports status `shipped`, and `canon status` names no next step for the subject (a human step left in `meta.next` is the one thing you report instead of doing).
69
82
 
70
83
  Every write command says whether the record is final (`written directly`,
71
84
  or `staged and promoted in this run`) or staged; only a staged record
72
85
  needs `canon gate promote`, and only `write.promote: manual` leaves one.
73
86
 
87
+ ### Commits and uncommitted code
88
+
89
+ Records that are about code take `--rev <REV>`: any git revision (`HEAD~1`,
90
+ a branch, a tag, a short sha), default `HEAD`, so you never copy a sha out of
91
+ git. `finding add` also takes `--resolution-rev` (default HEAD when the
92
+ finding is `fixed`) and `--introduced-rev` (no default: say where the defect
93
+ came from). Evidence, a review or a finding of uncommitted work is allowed,
94
+ never refused: the record carries `codeTree` (the git tree id of the code the
95
+ command saw: `.canon/`, the spec roots and the `code.exclude` globs are left
96
+ out, so editing a `.feature` file or a brief never changes it) and
97
+ `worktreeDirty`. The commit made from a working tree has the same `codeTree`
98
+ the record carries, so a review of a working tree survives the commit made
99
+ from it; a review is judged by what it pins (the scenario and what its
100
+ evidence says), never by the commit or the code tree. Outside a git work
101
+ tree, or in a repo with no commits, a command that needs a commit refuses
102
+ `NO_COMMIT`.
103
+
104
+ ### Evidence follows the code
105
+
106
+ After a chore approval or a reopen, a scenario whose latest evidence was
107
+ recorded on the current `codeTree` needs nothing new: a docs-only chore then
108
+ needs its change-level review alone. What counts as code is `code.exclude` in
109
+ `canon.yaml` (globs, default `docs/**` and `*.md`). When code did change,
110
+ `canon status`, `meta.next` and the refusal hint lead with one batch over
111
+ every report, for example
112
+ `canon evidence add --all-scenarios --report junit:a.xml --report junit:b.xml --role implementer`
113
+ (with the real report paths, and `--project-id <id>` when the repo has several
114
+ spec roots), never a loop per scenario. With a `--report`, `--class` defaults
115
+ to `test-run` and `--ref` to the report paths, and the bound cases decide the
116
+ verdict: any failed case `divergent`, a skipped one and none failed
117
+ `not-applicable`, else `faithful`.
118
+
119
+ ### State
120
+
74
121
  The ledger is latest-only. It holds the current record of each key; writing a
75
122
  newer version moves what it supersedes to `.canon/archive`, and `status`,
76
123
  `gate check`, the guards and `query` read the ledger only. Earlier versions
77
- are one flag away: `canon query --kind <k> --history`. A ledger written
124
+ are one flag away: `canon query --kind evidence --history`. A ledger written
78
125
  before 0.23, or one whose move was interrupted, is brought to one file per
79
126
  key by `canon ledger compact` (`canon migrate` runs it). A record binds only
80
127
  what its own write names: evidence carries nothing forward from an earlier
81
128
  record, and a review stays current while the verdict and checks of the
82
- evidence it saw are unchanged.
129
+ evidence it saw are unchanged and the code tree is the one it saw.
83
130
 
84
131
  Where artifact bytes live is the repo's choice: `canon.yaml`'s `artifact_store:`
85
132
  block defaults to the local, git-tracked `.canon/artifacts/sha256/`, or names
86
- an object-store tier, in which case `evidence add`, `review add` and
87
- `evidence vault` upload by digest and keep nothing locally. The gate and
88
- `canon artifacts verify [--full]` ask the store and refuse, never pass, when
89
- it cannot be reached. Moving an existing store with `canon artifacts migrate`
90
- is the repo owner's decision, not a step of the loop.
133
+ an object-store tier, in which case `evidence add`, `review scenario`, `review change` and
134
+ `artifacts store` upload by digest and keep nothing locally. The gate and
135
+ `canon artifacts verify` (`--full` re-hashes every blob) ask the store and
136
+ refuse, never pass, when it cannot be reached. Moving an existing store with
137
+ `canon artifacts move --tier <tier>` is the repo owner's decision, not a step
138
+ of the loop.
91
139
 
92
140
  ## Know your role
93
141
 
@@ -96,52 +144,122 @@ canon cannot detect a role; you declare it. Pass `--as <role>` or set
96
144
  variable, and an unknown value is refused (`UNKNOWN_ROLE`).
97
145
 
98
146
  - **A role is set, or you were spawned as one:** load only
99
- `reference/role-<role>.md` and do that role's steps. `canon status`,
100
- `meta.next` and `canon schema` then show only your role's steps and
101
- commands, and count the others in `waitingOn`. Do not load another role's
102
- reference.
147
+ `canon skills show role-<role>` and do that role's steps. `canon status`
148
+ and `meta.next` then show only your role's steps, and count the others in
149
+ `waitingOn`; `canon schema --as <role>` lists only your role's commands.
150
+ Do not load another role's guide.
103
151
  - **No role (one agent doing everything):** follow `canon status` and load
104
- each role reference as its phase starts: planner for steps 1–2,
152
+ each role guide as its phase starts: planner for steps 1–2,
105
153
  implementer for 3–6, reviewer for 7 (in a separate session), orchestrator
106
154
  for 8.
107
155
 
108
156
  A role is guidance, not enforcement: `--role` on `evidence add` and
109
- `review add` defaults to it.
157
+ `review scenario` defaults to it. `CANON_ROLE` never filters or fails
158
+ `canon schema`, `canon context` or `canon skills show`; only `--as` filters.
110
159
 
111
160
  ## Driving the CLI
112
161
 
113
162
  - Start a session with `canon status`: where each subject stands and the next
114
163
  commands. After that, do not call it only to learn the next step: every
115
- write returns `meta.next` (`[{command, why, actor, role}]`), the same steps
116
- `status` would give, narrowed to what the write touched. `actor: human`
164
+ write returns `meta.next` (`[{command, argv, why, actor, role}]`), the same
165
+ steps `status` would give, narrowed to what the write touched. `actor: human`
117
166
  marks a step only the human takes.
118
- - Your role reference's **Commands** block (`reference/role-<role>.md`) is
119
- your complete command set. Run `canon schema <command> --json` only for a
167
+ - Your role guide's **Commands** block (`canon skills show role-<role>`) is
168
+ your complete command set, every option of every leaf included. Run `canon schema <command> --json` only for a
120
169
  command it does not list, or after a `USAGE` refusal (read `error.field`
121
- and `expected` first). `canon schema` alone lists every command.
122
- - Pass `--json` and read stdout as one document. On failure it is
123
- `{"error":{"code","message","hint","retryable","field","expected"}}`: branch
124
- on `error.code`, fix the option `field` names using the `expected` values,
125
- and follow `error.hint`. Every refusal carries a concrete `hint`: follow
126
- it. The codes are stable; `canon schema --errors --json` lists them.
170
+ and `error.expected` first). `canon schema` alone lists every command.
171
+ - Pass `--json` and read stdout as one document, nothing on stderr. Success is
172
+ `{"ok":true,"data":…,"meta":…}`; failure is
173
+ `{"ok":false,"error":{…},"meta":…}` (a check that fails keeps its report in
174
+ `data`). `meta` carries `command`, `schemaVersion`, `canonVersion`, `next`,
175
+ `warnings` and, for a repeated write that changed nothing, `unchanged: true`.
176
+ On failure branch on `error.code`, fix the option `error.field` names
177
+ using the `error.expected` values (`field` is an option name, or a JSON
178
+ pointer such as `/items/2/scenarioId` into an `--input` document), and
179
+ follow `error.hint`: every refusal carries a working invocation. The codes
180
+ are stable; `canon schema --errors --json` lists them and
181
+ `canon schema --error <CODE>` explains one.
182
+ - **Exit codes:** 0 ok; 1 the command's own finding (a failed check, a
183
+ violation, or `unverifiable` when nothing was examined); 2 refused (usage,
184
+ `CONFIG_MISSING`, an id or file that does not exist, an invalid argument).
185
+ A refusal leaves the tree unchanged.
186
+ - Repeating a write is safe: a record that already exists with identical
187
+ content is reported `unchanged` (`meta.unchanged`), not duplicated.
127
188
  - Flags that name an id are spelled `--<noun>-id` everywhere (`--change-id`,
128
189
  `--project-id`, `--subject-id`, `--scenario-id`, `--actor-id`,
129
- `--session-id`), and `--kind` values carry no `_record` suffix
130
- (`--kind evidence`).
190
+ `--session-id`), the primary object of a command is its operand
191
+ (`canon subject move <id> --to verifying`, `canon change new <slug>`), and
192
+ `--kind` values carry no `_record` suffix (`--kind evidence`).
131
193
  - `canon status` sends the planner to write the brief while `brief check`
132
194
  has blockers; the human stop appears only when the brief is clean and
133
195
  unapproved.
134
196
  - Page long lists with `--limit <n>` and `--cursor <nextCursor>` (`--all`
135
197
  for everything), and project fields with `--fields a,b` (`status`, `export`,
136
- `query`, `finding list`, `divergence status`, `context`).
137
- - `canon purge` deletes only in two steps: `--plan` prints the removal set
138
- and a `planDigest`; then `--confirm <planDigest>`.
198
+ `query`, `finding list`, `divergence list`, `context`).
199
+ - `--override-reason <text>` is the only way to proceed past a waivable
200
+ refusal; it is recorded, echoed in `data.overrides[]` and listed by `status`
201
+ for the human. There is no `--force`. `brief approve`, `policy approve` and
202
+ `divergence accept` are human-only and refuse every agent role: report the
203
+ exact call, ids filled in, and wait; never unset your role to run one.
139
204
 
140
- ## Command reference
205
+ ### Many records at once: `--input`
141
206
 
142
- Load only the reference the current step needs.
207
+ Every write leaf takes `--input` instead of flags: inline JSON, a file, or `-`
208
+ for stdin. The keys are the option names in camelCase, and `operands` holds
209
+ the positional arguments. An object is one invocation; a JSON array (or NDJSON
210
+ from a file or stdin) is a batch, run in order and answered with
211
+ `data.items[]` (`index`, `status` of `written`, `unchanged`, `failed` or
212
+ `skipped`, and that element's `data` or `error`). A batch is validated whole
213
+ before anything is written: an invalid element writes nothing and exits 2,
214
+ `error.field` pointing at `/items/<i>/<key>`; a write that fails stops there
215
+ (exit 1) and re-running the same batch reports the finished elements
216
+ `unchanged`. A typo in a key is refused (`INPUT_UNKNOWN_FIELD`), never dropped.
217
+ `canon schema <command> --json` shows the leaf's input schema and an example.
143
218
 
144
- ### Setup and provider projection
219
+ ```text
220
+ canon scenario new --input '[{"operands":["auth.login.01"],"title":"Logs in","case":"happy"},{"operands":["auth.login.02"],"title":"Wrong password","case":"failure"}]'
221
+ canon evidence add --input '[{"scenarioId":"auth.login.01","class":"test-run","ref":"npm test","role":"implementer"},{"scenarioId":"auth.login.02","class":"test-run","ref":"npm test","role":"implementer"}]'
222
+ canon finding add --input '[{"changeId":"add-login","round":1,"seq":1,"severity":"note","actorId":"reviewer-1","summary":"Token is logged"},{"changeId":"add-login","round":1,"seq":2,"severity":"blocker","actorId":"reviewer-1","summary":"No rate limit"}]'
223
+ ```
224
+
225
+ `--input` never carries `--commit` or `--plan-digest`, and the destructive
226
+ leaves below take one object only.
227
+
228
+ ### Preview, then `--commit`
229
+
230
+ The five commands that delete or rewrite existing data (`canon purge`,
231
+ `canon tier age`, `canon ledger compact`, `canon artifacts move`,
232
+ `canon migrate`) act in two steps. The bare run previews: it writes nothing,
233
+ exits 0 and prints the effects and a `planDigest`. Read the effects, then act
234
+ with `--commit --plan-digest <planDigest>`. It refuses (`PLAN_CHANGED`) when
235
+ the plan differs from the one you previewed, so run the preview again. Appends
236
+ and state transitions (`gate promote`, `subject move`) run directly. Where a
237
+ preview helps elsewhere (`init`, `skills install`, `export`, `inventory sync`,
238
+ `subject adopt`, …) `--dry-run` validates fully and writes nothing.
239
+
240
+ ```bash
241
+ canon purge --kind session --before 2026-01-01
242
+ ```
243
+
244
+ ## Upgrading a repo from 0.27
245
+
246
+ 0.28 changed the CLI grammar with no aliases: an old spelling fails with exit 2
247
+ and an `error.hint` naming the replacement. `canon status`, `canon gate check`
248
+ and `canon context` warn when the repo holds 0.27-era state and put
249
+ `canon migrate --json` first in `meta.next`. Then:
250
+
251
+ 1. `canon migrate` previews and prints the `planDigest`.
252
+ 2. `canon migrate --commit --plan-digest <digest>` with that digest applies it.
253
+ It moves the layout, rewrites canon's own hooks and scripts, compacts the
254
+ ledger, replaces an old full skill with the stub, and backs up every file it
255
+ rewrites under `.canon/migrate-backup/`. It refuses uncommitted changes
256
+ under a path it moves.
257
+ 3. `canon skills install` refreshes the stub and the scripts; `canon skills check`
258
+ confirms them.
259
+
260
+ **Done when:** `canon migrate` reports nothing left to move, `canon skills check` exits 0, and `canon status` and `canon gate check` no longer warn about 0.27 state.
261
+
262
+ ## Setup and provider projection
145
263
 
146
264
  ```bash
147
265
  canon init # canon.yaml, starter policy (--policy light|standard|strict, default strict; see canon-policy), AGENTS.md block, commented plans examples
@@ -152,40 +270,78 @@ canon skills check # read-only drift check; exit 1 (SK
152
270
  canon skills doctor # diagnostics, incl. a stray canon projection for an unselected provider and a projection a formatter rewrote, and `orphan:` lines for projected files the bundle no longer ships; never deletes user files
153
271
  ```
154
272
 
273
+ `install` writes, per selected harness, a short `SKILL.md` stub (this file's
274
+ frontmatter plus a pointer to `canon skills show canon`) and the `scripts/**`
275
+ sidecars; the guides themselves are not copied, they come from the binary.
276
+ Claude gets `.claude/skills/canon/`, Codex `.agents/skills/canon/`, OMP
277
+ `.omp/skills/canon/`, Pi `.pi/skills/canon/` (the retrieve script is a sidecar,
278
+ not an installed hook). `check` reports a stub written by another canon
279
+ version; `install` rewrites it. The harness list lives in `canon.yaml` as
280
+ `skills: { providers: [...] }`; change it with `canon skills install --providers=<list>`,
281
+ never by assuming a default.
282
+
155
283
  `install` and `doctor` end with `owned-paths:`, the globs of every path
156
284
  canon writes. Add them to the repo's formatter and linter ignore lists; a
157
285
  formatter that rewrites a projection or a ledger record makes canon read
158
286
  drift (`doctor` reports it as `formatter-rewritten` and names the entry to
159
287
  add). Specs, `policy.yaml` and the changes are written by hand and are not
160
- on the list. The harness list lives in `canon.yaml` as
161
- `skills: { providers: [...] }`; change it with `canon skills install --providers=<list>`,
162
- never by assuming a default. The projection is a read-only copy: Claude
163
- `.claude/skills/canon/`, Codex `.agents/skills/canon/`, OMP
164
- `.omp/skills/canon/`, Pi `.pi/skills/canon/`, each with `reference/**` and
165
- `scripts/**` sidecars (the retrieve script is a sidecar, not an installed hook).
166
-
167
- ### Route by task
168
-
169
- - **Fix a bug:** the approved change if there is one, else the planner (`canon change new`); first a failing run of the scenario (`canon scenario new --case failure`, then `canon evidence add`), then the fix. `reference/role-implementer.md`.
170
- - **Add or change a feature:** `canon subject new`, `canon change new`, then the brief. `reference/role-planner.md`.
171
- - **Pure refactor, dependency, build, CI or infra:** `canon change new <slug> --subject-id <id> --kind chore`; data or interface changes are not chores. `reference/role-planner.md`.
172
- - **Review someone's change:** `CANON_ROLE=reviewer`, `canon brief check --change-id <slug>`. `reference/role-reviewer.md`.
173
- - **Resume:** `canon status --json`, then follow `meta.next`. `reference/role-orchestrator.md`.
174
- - **Plan more work on a live subject:** `canon change new <slug> --subject-id <id>` (it warns until the brief is approved; `canon subject unadopt` parks a draft). `reference/canon-subject.md`, `reference/role-planner.md`.
175
- - **Upgrade canon in a repo:** `canon migrate --dry-run`. `reference/role-orchestrator.md`.
176
- - **Your role's steps:** `reference/role-planner.md`, `role-implementer.md`, `role-reviewer.md`, `role-orchestrator.md`.
177
- - **Where the repo stands, subjects and changes:** `reference/canon-subject.md` (`canon status`, `canon subject new|adopt|status`, `canon change new`).
178
- - **Write or reorganize `.feature` specs:** `reference/canon-authoring.md` before editing; use the scaffold.
179
- - **Fields, enums, policy bindings:** `reference/canon-context.md` and `reference/canon-vocab.md`.
180
- - **Replayable run inputs / versioned prompts:** `reference/canon-context.md`, then `canon context-pack new|show|verify` and `canon prompt add|show` with repository-relative JSON manifests.
181
- - **Validate or index specs:** `reference/canon-fmt.md` and `reference/canon-inventory.md`.
182
- - **Evidence, gates, imported-plan task checkboxes, hooks:** `reference/canon-gate.md`.
183
- - **Findings and reviews:** `reference/canon-review.md`.
184
- - **Ingest artifacts, sessions or plans:** `reference/canon-artifact-ingest.md`, `canon-session-ingest.md`, or `canon-plan-import.md`.
185
- - **Storage, policy, plugins, strategy learning:** `reference/canon-storage.md`, `canon-policy.md`, `canon-plugins.md`, or `canon-learn.md`.
186
- - **Dispatch guidance:** `reference/canon-retrieve.md`; load `scripts/canon-retrieve-pre-dispatch.sh` when wiring hooks.
187
- - **Reports and dashboards:** `reference/canon-report-dashboard.md`.
188
-
189
- ### Safety contract
190
-
191
- `canon status`, `canon format <root>`, `canon skills check`, and `canon gate check` are read-only. Do not hand-edit generated reports, provenance lines, locks, or task evidence. Inspect `canon context` before authoring typed artifacts, and treat every failure class as actionable evidence rather than bypassing the gate.
288
+ on the list.
289
+
290
+ **Done when:** `canon skills check` exits 0 and `canon skills doctor` lists no `orphan:`, `stray:` or `outdated:` line.
291
+
292
+ ## Route by task
293
+
294
+ - **Fix a bug:** the approved change if there is one, else the planner (`canon change new`); first a failing run of the scenario (`canon scenario new --case failure`, then `canon evidence add`), then the fix. `canon skills show role-implementer`.
295
+ - **Add or change a feature:** `canon subject new`, `canon change new`, then the brief. `canon skills show role-planner`.
296
+ - **Pure refactor, dependency, build, CI or infra:** `canon change new <slug> --subject-id <id> --change-kind chore`; data or interface changes are not chores. `canon skills show role-planner`.
297
+ - **Review someone's change:** `CANON_ROLE=reviewer`, `canon brief check <slug>`. `canon skills show role-reviewer`.
298
+ - **Resume:** `canon status --json`, then follow `meta.next`. `canon skills show role-orchestrator`.
299
+ - **Plan more work on a live subject:** `canon change new <slug> --subject-id <id>` (it warns until the brief is approved; `canon subject unadopt` parks a draft). `canon skills show canon-subject`, `canon skills show role-planner`.
300
+ - **Upgrade canon in a repo:** `canon migrate` (previews), then `canon migrate --commit --plan-digest <digest>`, then `canon skills install`. See "Upgrading a repo from 0.27" above and `canon skills show role-orchestrator`.
301
+
302
+ **Done when:** you have named your role and loaded its guide, and `canon status --json` lists your next step in `meta.next`.
303
+
304
+ ## Safety contract
305
+
306
+ `canon status`, `canon format`, `canon skills check`, `canon skills show` and
307
+ `canon gate check` do not change the repo's records. Do not hand-edit generated
308
+ reports, provenance lines, locks, or task evidence. Inspect `canon context`
309
+ before authoring typed artifacts, and treat every failure class as actionable
310
+ evidence rather than bypassing the gate.
311
+
312
+ ## Guides: `canon skills show <name>`
313
+
314
+ Every name below is a guide built into the binary. Load only the one the
315
+ current step needs.
316
+
317
+ | Name | What it is for |
318
+ | --- | --- |
319
+ | `canon` | This core guide: the loop, driving the CLI, routing. |
320
+ | `role-planner` | Planner steps 1–2: subject, change, PRD brief, the human stop. |
321
+ | `role-implementer` | Implementer steps 3–6: scenarios, units, code, evidence. |
322
+ | `role-reviewer` | Reviewer step 7: findings and signed reviews in a separate session. |
323
+ | `role-orchestrator` | Orchestrator step 8: dispatch, transitions, resuming, upgrading. |
324
+ | `brief-shape` | Brief pass: the structure `canon brief check` expects. |
325
+ | `brief-clarify` | Brief pass: turn open points into questions a human answers in one reply. |
326
+ | `brief-harden` | Brief pass: make flow and step detail agree, with failure paths. |
327
+ | `brief-align` | Brief pass: scenarios cover the brief's flow and the brief still says what they prove. |
328
+ | `brief-polish` | Brief pass: make the brief readable once (clears `prose.*` advisories). |
329
+ | `canon-subject` | Status, subjects and changes: `canon subject new|adopt|show|move`, `canon change new`. |
330
+ | `canon-authoring` | Write or reorganize `.feature` specs; the scaffold. |
331
+ | `canon-context` | `canon context`: fields, enums, policy bindings, context packs and prompts. |
332
+ | `canon-vocab` | Typed authoring vocabulary and the handoff template. |
333
+ | `canon-fmt` | `canon format`: validate a spec or artifact corpus. |
334
+ | `canon-inventory` | `canon inventory sync`: index specs into scenario records. |
335
+ | `canon-gate` | Evidence, gates, task checkboxes, hooks. |
336
+ | `canon-review` | Findings and reviews. |
337
+ | `canon-artifact-ingest` | `canon ingest records`: artifacts into verdict trajectories. |
338
+ | `canon-session-ingest` | `canon ingest sessions`: agent transcripts into session records. |
339
+ | `canon-plan-import` | `canon ingest plans`: plan state into change and task records. |
340
+ | `canon-storage` | Storage rungs, tiers, retention, export, purge. |
341
+ | `canon-policy` | The policy and the CEL expressions behind it. |
342
+ | `canon-plugins` | Plugin overlays on core records. |
343
+ | `canon-learn` | Strategy memory: promote, approve, roll back. |
344
+ | `canon-retrieve` | Dispatch-time guidance (`canon retrieve`); `scripts/canon-retrieve-pre-dispatch.sh` is the hook sidecar. |
345
+ | `canon-report-dashboard` | `canon report build|check|snapshot` and `canon dashboard`. |
346
+
347
+ **Done when:** `canon skills show <name>` prints the guide you needed; a name that is not in the table is a usage error (exit 2) whose `error.expected` lists the valid ones.
@@ -29,9 +29,11 @@ A chore adds no scenarios and has no flow: this pass does not apply to it.
29
29
 
30
30
  `canon brief check` no longer lists the coverage rules; `canon status` shows every step with a failure scenario.
31
31
 
32
+ **Done when:** `canon brief check <slug> --json` lists neither `brief.flow-uncovered` nor `brief.flow-no-failure` (read `data.findings[]`), and `canon status` shows each flow step with a scenario and a failure scenario.
33
+
32
34
  ## Next
33
35
 
34
- Implement, evidence and review (loop steps 5 to 7). If the brief had to change, the human answers again.
36
+ Implement, evidence and review (loop steps 5 to 7). If the brief had to change, the human answers again with `canon brief approve` (theirs; agent roles are refused).
35
37
 
36
38
  ## Invariants (every brief pass)
37
39
 
@@ -39,4 +41,4 @@ Implement, evidence and review (loop steps 5 to 7). If the brief had to change,
39
41
  - Explaining writes nothing. Asked what a finding means or what a pass would do, answer in chat and leave the brief untouched.
40
42
  - No pass requires another as a prerequisite. Run the one the findings or the human point at, in any order.
41
43
  - A pass closes only the findings it rechecked: rerun `canon brief check` after the edit and report a finding as closed only when it is gone from that run. Never claim a rule you did not rerun.
42
- - Write in the brief's language (detected from the text; `language:` in `canon.yaml` overrides it). Edits touch `.canon/changes/<slug>/brief.md` only. A brief edited after approval is not approved: it needs a new human answer and `canon brief approve` again.
44
+ - Write in the brief's language (detected from the text; `language:` in `canon.yaml` overrides it). Edits touch `.canon/changes/<slug>/brief.md` only. A brief edited after approval is not approved: it needs a new human answer and the human's `canon brief approve` again (agent roles are refused).
@@ -1,8 +1,8 @@
1
1
  # Brief pass: clarify
2
2
 
3
3
  Turn what is unresolved into questions a human can answer in one reply, and
4
- make every assumption explicit. Run it when `canon brief` says lines under
5
- the questions section are still open, or the request left a decision the
4
+ make every assumption explicit. Run it when `canon brief show` names lines under
5
+ the questions section that are still open, or the request left a decision the
6
6
  brief quietly made.
7
7
 
8
8
  ## Scope
@@ -27,11 +27,13 @@ brief that decides something the request did not say.
27
27
 
28
28
  ## Verify
29
29
 
30
- Every open line is a question with a proposed default or a stated assumption. `canon brief check` still has no blockers (the pass changes no structure). `canon brief` still counts the lines left open, and those go in the report to the human, not away.
30
+ Every open line is a question with a proposed default or a stated assumption. `canon brief check` still has no blockers (the pass changes no structure). `canon brief show` still counts the lines left open, and those go in the report to the human, not away.
31
+
32
+ **Done when:** `canon brief check <slug>` exits 0 and every open line under Questions and assumptions is a question with a proposed default or a stated assumption; read the count of lines left open in the `clarify` step of `canon brief show <slug> --json` (it is absent when none are open) and put it in the report to the human.
31
33
 
32
34
  ## Next
33
35
 
34
- `harden` if the flow changed; otherwise report to the human, who answers the questions with the approval.
36
+ `harden` if the flow changed; otherwise report to the human, who answers the questions and approves (`canon brief approve` is theirs; agent roles are refused).
35
37
 
36
38
  ## Invariants (every brief pass)
37
39
 
@@ -39,4 +41,4 @@ Every open line is a question with a proposed default or a stated assumption. `c
39
41
  - Explaining writes nothing. Asked what a finding means or what a pass would do, answer in chat and leave the brief untouched.
40
42
  - No pass requires another as a prerequisite. Run the one the findings or the human point at, in any order.
41
43
  - A pass closes only the findings it rechecked: rerun `canon brief check` after the edit and report a finding as closed only when it is gone from that run. Never claim a rule you did not rerun.
42
- - Write in the brief's language (detected from the text; `language:` in `canon.yaml` overrides it). Edits touch `.canon/changes/<slug>/brief.md` only. A brief edited after approval is not approved: it needs a new human answer and `canon brief approve` again.
44
+ - Write in the brief's language (detected from the text; `language:` in `canon.yaml` overrides it). Edits touch `.canon/changes/<slug>/brief.md` only. A brief edited after approval is not approved: it needs a new human answer and the human's `canon brief approve` again (agent roles are refused).
@@ -30,9 +30,11 @@ brief has none of them: harden its Invariants and Checks instead.
30
30
 
31
31
  `canon brief check` no longer lists `brief.flow-duplicate-id` or `brief.detail-mismatch`; every flow id has a detail subheading and an acceptance line with a failure path.
32
32
 
33
+ **Done when:** `canon brief check <slug> --json` lists neither `brief.flow-duplicate-id` nor `brief.detail-mismatch` (read `data.findings[]`) and every flow id has a detail subheading and an acceptance line with a failure path.
34
+
33
35
  ## Next
34
36
 
35
- `align` once scenarios exist; `polish` for prose; otherwise report to the human.
37
+ `align` (`canon skills show brief-align`) once scenarios exist; `polish` (`canon skills show brief-polish`) for prose; otherwise report to the human.
36
38
 
37
39
  ## Invariants (every brief pass)
38
40
 
@@ -40,4 +42,4 @@ brief has none of them: harden its Invariants and Checks instead.
40
42
  - Explaining writes nothing. Asked what a finding means or what a pass would do, answer in chat and leave the brief untouched.
41
43
  - No pass requires another as a prerequisite. Run the one the findings or the human point at, in any order.
42
44
  - A pass closes only the findings it rechecked: rerun `canon brief check` after the edit and report a finding as closed only when it is gone from that run. Never claim a rule you did not rerun.
43
- - Write in the brief's language (detected from the text; `language:` in `canon.yaml` overrides it). Edits touch `.canon/changes/<slug>/brief.md` only. A brief edited after approval is not approved: it needs a new human answer and `canon brief approve` again.
45
+ - Write in the brief's language (detected from the text; `language:` in `canon.yaml` overrides it). Edits touch `.canon/changes/<slug>/brief.md` only. A brief edited after approval is not approved: it needs a new human answer and the human's `canon brief approve` again (agent roles are refused).
@@ -99,7 +99,7 @@ and the result.
99
99
  ### `prose.paragraph-length`
100
100
 
101
101
  Normative sections. Catches a paragraph of more than five sentences. Fix: the
102
- compression pass in `role-planner.md`: keep the sentences that state a
102
+ compression pass in `canon skills show role-planner`: keep the sentences that state a
103
103
  condition, an action, a result or a number; make three or more parallel
104
104
  items a list; delete or move the rest.
105
105
 
@@ -199,7 +199,7 @@ states the measured value and the budget. Section budgets (ko / en
199
199
  characters): Intent 400 / 700, Outcome 500 / 900, Flow 800 / 1500, Detail
200
200
  2500 / 3500, Acceptance 1000 / 1800, Questions 800 / 1200, Invariants and
201
201
  Checks 800 / 1500 each (Out of scope has none); whole brief 4000 / 6000. Fix: the
202
- compression pass in `role-planner.md`: delete sentences that restate another
202
+ compression pass in `canon skills show role-planner`: delete sentences that restate another
203
203
  section, turn parallel items into a list or table, move assumptions to
204
204
  Questions and assumptions and a not-doing list to Out of scope. A brief this
205
205
  long usually says several things twice. A waiver for the whole-brief budget
@@ -216,7 +216,7 @@ uses the section key `brief`.
216
216
  ## The loop
217
217
 
218
218
  1. Fix the mode problems above, then the findings, section by section.
219
- 2. Run `canon brief check --change-id <slug> --json`.
219
+ 2. Run `canon brief check <slug> --json`: the findings are in `data.findings[]`.
220
220
  3. Repeat until no advisory remains, or each remaining one is waived with a reason.
221
221
  4. Stop and report to the human, in the brief's language. Do not loop further: a clean run says nothing about whether the brief is good, only that these counts are within budget.
222
222
 
@@ -232,9 +232,11 @@ uses the section key `brief`.
232
232
 
233
233
  `canon brief check` no longer lists the `prose.*` findings you rewrote, or lists them as waived with a reason; no blockers appeared.
234
234
 
235
+ **Done when:** `canon brief check <slug> --json` lists no `prose.*` finding (read `data.findings[]`) except those waived with a reason (`data.waivers[]`), and `data.counts` shows no blocker.
236
+
235
237
  ## Next
236
238
 
237
- Report to the human and `canon brief approve` from their answer.
239
+ Report to the human, who approves with `canon brief approve` (theirs; agent roles are refused).
238
240
 
239
241
  ## Invariants (every brief pass)
240
242
 
@@ -242,4 +244,4 @@ Report to the human and `canon brief approve` from their answer.
242
244
  - Explaining writes nothing. Asked what a finding means or what a pass would do, answer in chat and leave the brief untouched.
243
245
  - No pass requires another as a prerequisite. Run the one the findings or the human point at, in any order.
244
246
  - A pass closes only the findings it rechecked: rerun `canon brief check` after the edit and report a finding as closed only when it is gone from that run. Never claim a rule you did not rerun.
245
- - Write in the brief's language (detected from the text, or `language:` in `canon.yaml` when set). Edits touch `.canon/changes/<slug>/brief.md` only. A brief edited after approval is not approved: it needs a new human answer and `canon brief approve` again.
247
+ - Write in the brief's language (detected from the text, or `language:` in `canon.yaml` when set). Edits touch `.canon/changes/<slug>/brief.md` only. A brief edited after approval is not approved: it needs a new human answer and the human's `canon brief approve` again (agent roles are refused).
@@ -34,9 +34,11 @@ marker, never by heading text.
34
34
 
35
35
  `canon brief check` reports none of the rules above. Report only the ones it no longer lists.
36
36
 
37
+ **Done when:** `canon brief check <slug> --json` lists none of the rules above (read `data.findings[]`); report only the ones it no longer lists.
38
+
37
39
  ## Next
38
40
 
39
- `clarify` if the Questions section still has open lines; `harden` if flow and detail disagree; otherwise report to the human and `canon brief approve` from their answer.
41
+ `clarify` if the Questions section still has open lines; `harden` if flow and detail disagree; otherwise report to the human, who approves with `canon brief approve` (theirs; agent roles are refused).
40
42
 
41
43
  ## Invariants (every brief pass)
42
44
 
@@ -44,4 +46,4 @@ marker, never by heading text.
44
46
  - Explaining writes nothing. Asked what a finding means or what a pass would do, answer in chat and leave the brief untouched.
45
47
  - No pass requires another as a prerequisite. Run the one the findings or the human point at, in any order.
46
48
  - A pass closes only the findings it rechecked: rerun `canon brief check` after the edit and report a finding as closed only when it is gone from that run. Never claim a rule you did not rerun.
47
- - Write in the brief's language (detected from the text; `language:` in `canon.yaml` overrides it). Edits touch `.canon/changes/<slug>/brief.md` only. A brief edited after approval is not approved: it needs a new human answer and `canon brief approve` again.
49
+ - Write in the brief's language (detected from the text; `language:` in `canon.yaml` overrides it). Edits touch `.canon/changes/<slug>/brief.md` only. A brief edited after approval is not approved: it needs a new human answer and the human's `canon brief approve` again (agent roles are refused).