@brightbeamai/chap-coordinator-mcp 0.2.12 → 0.3.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.
package/dist/schemas.js CHANGED
@@ -11,17 +11,37 @@ var TASK_ID = {
11
11
  type: "string",
12
12
  description: "Task identifier returned by chap.task.create."
13
13
  };
14
+ var decimalStringNote = (example) => `Written as a decimal string, e.g. "${example}". CHAP canonicalisation accepts integers only, so a JSON number with a fractional part is refused with -32602.`;
14
15
  var ROUTING_HINTS = {
15
16
  type: "object",
16
- description: "Optional signals for the routing/1.0 profile.",
17
+ description: "Signals recorded on the task and read by the routing/1.0 methods: task.route, review.depth and escalate.auto. Recording a hint has no effect on its own; it is consulted only when one of those methods is called.",
17
18
  properties: {
18
- criticality: { type: "string", enum: ["low", "medium", "high", "critical"] },
19
- deadline: { type: "string", description: "ISO 8601 timestamp." },
20
- risk_tier: { type: "string" },
21
- max_cost_usd: { type: "number" }
19
+ criticality: {
20
+ type: "string",
21
+ enum: ["low", "medium", "high", "critical"],
22
+ description: "How costly a wrong answer would be. The default review-depth policy reads it: 'critical' gives a full review, and 'high' with confidence below 0.7 does the same. The default assignee policy does not read it."
23
+ },
24
+ deadline: { type: "string", description: "When the work is needed by, as an ISO 8601 timestamp. Recorded on the task; the coordinator does not act on it." },
25
+ risk_tier: { type: "string", description: "Operator-defined risk band, e.g. 'regulated' or 'internal'. No built-in policy reads it; it is available to an operator-supplied routing policy." },
26
+ max_cost_usd: { type: "string", description: `Budget ceiling for this task in US dollars. ${decimalStringNote("12.50")} No built-in policy reads it.` }
22
27
  },
23
28
  additionalProperties: true
24
29
  };
30
+ var COMMENT = {
31
+ type: "string",
32
+ description: "The reviewer's note on this decision. Recorded in the audit entry for the decision."
33
+ };
34
+ var TAGS = {
35
+ type: "array",
36
+ items: { type: "string" },
37
+ description: "Workspace-defined labels for this decision, e.g. ['tone', 'unsupported-claim']. Recorded in the audit entry. chap.audit.read does not filter on tags, so grouping by tag is done by the reader."
38
+ };
39
+ var ARTEFACT_DIGEST = {
40
+ type: "string",
41
+ pattern: "^sha256:[0-9a-f]{64}$",
42
+ description: "Optional. SHA-256 over the JCS canonicalisation of the artefact under review, in the form `sha256:<hex>`. When present it binds the decision to the exact content reviewed, and a mismatch is refused with -32074."
43
+ };
44
+ var STRUCTURED_PAYLOAD_NOTE = "Pass a JSON object or array. A JSON-encoded string is parsed back to the structured value before dispatch, so patches in chap.decide.override apply against a real object.";
25
45
  var SCHEMAS = {
26
46
  "chap.workspace.create": {
27
47
  type: "object",
@@ -30,10 +50,20 @@ var SCHEMAS = {
30
50
  profiles: {
31
51
  type: "array",
32
52
  items: { type: "string" },
33
- description: "Profile identifiers to enable, e.g. ['core/1.0', 'review/1.0']."
53
+ description: "Profile identifiers to enable, e.g. ['core/1.0', 'review/1.0']. Recorded on the workspace. Two profiles change behaviour by being present: modes/1.0, under which a trial-mode task requires review, and audit-scitt/1.0, which turns on the hash-linked chain."
54
+ },
55
+ mode: {
56
+ type: "string",
57
+ enum: ["shadow", "trial", "production"],
58
+ default: "trial",
59
+ description: "Default mode for tasks created here. Under modes/1.0 a trial-mode task has review_required set to true whatever the caller passes. 'shadow' and 'production' are recorded on the task and carry no further behaviour in this implementation."
34
60
  },
35
- mode: { type: "string", enum: ["shadow", "trial", "production"], default: "trial" },
36
- mode_ceiling: { type: "string", enum: ["shadow", "trial", "production"], default: "production" }
61
+ mode_ceiling: {
62
+ type: "string",
63
+ enum: ["shadow", "trial", "production"],
64
+ default: "production",
65
+ description: "Highest mode a task in this workspace may request. A task.create above the ceiling is refused with -32040. The ceiling can be changed afterwards with chap.control.set_mode_ceiling."
66
+ }
37
67
  },
38
68
  additionalProperties: false
39
69
  },
@@ -46,7 +76,11 @@ var SCHEMAS = {
46
76
  type: "object",
47
77
  properties: {
48
78
  workspace: WORKSPACE_ID,
49
- profiles: { type: "array", items: { type: "string" } }
79
+ profiles: {
80
+ type: "array",
81
+ items: { type: "string" },
82
+ description: "The complete profile set to enable, replacing the current one. Adding audit-scitt/1.0 to a workspace that already has entries leaves those entries unchained and outside chain verification."
83
+ }
50
84
  },
51
85
  required: ["workspace", "profiles"]
52
86
  },
@@ -55,9 +89,13 @@ var SCHEMAS = {
55
89
  properties: {
56
90
  workspace: WORKSPACE_ID,
57
91
  from: PARTICIPANT_URI,
58
- type: { type: "string", enum: ["human", "agent", "service", "group", "workspace"] },
59
- role: { type: "string", description: "Operator-defined role, e.g. 'reviewer' or 'drafter'." },
60
- display_name: { type: "string" }
92
+ type: {
93
+ type: "string",
94
+ enum: ["human", "agent", "service", "group", "workspace"],
95
+ description: "The kind of participant. Only members of type 'human' are eligible for the review that chap.task.complete opens on a task marked review_required, and a completion with no eligible human is refused with -32011."
96
+ },
97
+ role: { type: "string", description: "Operator-defined role, e.g. 'reviewer' or 'drafter'. One value is read by the coordinator: 'admin' permits revoking another member's key." },
98
+ display_name: { type: "string", description: "Human-readable name for interfaces. Not used in authorisation." }
61
99
  },
62
100
  required: ["workspace", "from", "type"]
63
101
  },
@@ -70,12 +108,25 @@ var SCHEMAS = {
70
108
  type: "object",
71
109
  properties: {
72
110
  workspace: WORKSPACE_ID,
73
- from: { ...PARTICIPANT_URI, description: "Delegator URI." },
74
- kind: { type: "string", description: "Task kind, e.g. 'draft_response' or 'review'." },
75
- assignee: { ...PARTICIPANT_URI, description: "Who the task is assigned to. Must be a workspace member." },
111
+ from: { ...PARTICIPANT_URI, description: "The delegator. Must be a workspace member." },
112
+ kind: { type: "string", description: "Task kind, e.g. 'draft_response' or 'review'. Free text; the coordinator records it without interpreting it." },
113
+ assignee: { ...PARTICIPANT_URI, description: "Who the task is assigned to. Must be a workspace member, and must not be paused: assigning to a paused member is refused with -32063." },
76
114
  input: { type: "object", description: "Task-specific input payload.", additionalProperties: true },
77
115
  routing_hints: ROUTING_HINTS,
78
- mode: { type: "string", enum: ["shadow", "trial", "production"] }
116
+ mode: {
117
+ type: "string",
118
+ enum: ["shadow", "trial", "production"],
119
+ description: "Mode for this task, defaulting to the workspace mode. A mode above the workspace ceiling is refused with -32040."
120
+ },
121
+ review_required: {
122
+ type: "boolean",
123
+ description: "When true, chap.task.complete opens a review instead of completing: the output becomes the artefact under review, and the task reaches 'completed' only on a reviewer decision. chap.task.update cannot complete such a task. Under modes/1.0 a trial-mode task has this set to true whatever is passed here."
124
+ },
125
+ deadline: { type: "string", description: "When the task is due, as an ISO 8601 timestamp. Recorded on the task; the coordinator does not act on it." },
126
+ idempotency_key: {
127
+ type: "string",
128
+ description: "Caller-chosen key for safe retries. A second create carrying a key already seen in this workspace returns the original task and records nothing further. The workspace retains the 10,000 most recent keys."
129
+ }
79
130
  },
80
131
  required: ["workspace", "from", "kind", "assignee", "input"]
81
132
  },
@@ -85,8 +136,12 @@ var SCHEMAS = {
85
136
  workspace: WORKSPACE_ID,
86
137
  from: PARTICIPANT_URI,
87
138
  task_id: TASK_ID,
88
- state: { type: "string", enum: ["in_progress", "review_requested", "declined", "paused", "cancelled", "completed"] },
89
- progress_note: { type: "string" }
139
+ state: {
140
+ type: "string",
141
+ enum: ["in_progress", "declined", "cancelled", "completed"],
142
+ description: "The state to move the task to. Only the transitions in SPECIFICATION.md 8.1 are legal from the task's current state; others are refused with -32602. A review opens with chap.review.request, or with chap.task.complete on a task that requires one, so 'review_requested' is not a target here. A task marked review_required cannot be moved to 'completed' here: submit the output with chap.task.complete, which opens the review."
143
+ },
144
+ progress_note: { type: "string", description: "Short note on what changed, kept in the task's history." }
90
145
  },
91
146
  required: ["workspace", "from", "task_id", "state"]
92
147
  },
@@ -96,8 +151,8 @@ var SCHEMAS = {
96
151
  workspace: WORKSPACE_ID,
97
152
  from: PARTICIPANT_URI,
98
153
  task_id: TASK_ID,
99
- output: { description: "The task's output artefact. Pass as a JSON object or array, not a JSON-encoded string." },
100
- confidence: { type: "number", description: "Self-reported confidence (0-1), where supported." },
154
+ output: { description: `The task's output artefact. ${STRUCTURED_PAYLOAD_NOTE}` },
155
+ confidence: { type: "string", description: `Self-reported confidence in the output, between 0 and 1. ${decimalStringNote("0.86")}` },
101
156
  routing_hints: ROUTING_HINTS
102
157
  },
103
158
  required: ["workspace", "from", "task_id"]
@@ -108,17 +163,24 @@ var SCHEMAS = {
108
163
  workspace: WORKSPACE_ID,
109
164
  range: {
110
165
  type: "object",
166
+ description: "Sequence window to return. Omit for the whole log.",
111
167
  properties: {
112
- from_seq: { type: "integer", description: "Start sequence number (inclusive)." },
113
- to_seq: { type: "integer", description: "End sequence number (exclusive)." }
168
+ from_seq: { type: "integer", description: "Start sequence number, inclusive." },
169
+ to_seq: { type: "integer", description: "End sequence number, exclusive." }
114
170
  }
115
171
  },
116
172
  filter: {
117
173
  type: "object",
174
+ description: "Narrows the entries returned. Conditions combine with AND, and are applied within the sequence window rather than before it.",
118
175
  properties: {
119
- method: { type: "string" },
120
- from: { type: "string" },
121
- task_id: { type: "string" }
176
+ method: { type: "string", description: "Return only entries for this CHAP method, e.g. 'decide.override'. Matched in full, without the 'chap.' tool-name prefix." },
177
+ from: { type: "string", description: "Return only entries whose actor is this participant URI." },
178
+ task_id: { type: "string", description: "Return only entries about this task." },
179
+ outcome: {
180
+ type: "string",
181
+ enum: ["accepted", "refused"],
182
+ description: "Return only accepted calls, or only the refused attempts the coordinator recorded. Omit for both."
183
+ }
122
184
  }
123
185
  }
124
186
  },
@@ -135,15 +197,16 @@ var SCHEMAS = {
135
197
  task_id: TASK_ID,
136
198
  to: {
137
199
  oneOf: [PARTICIPANT_URI, { type: "array", items: PARTICIPANT_URI }],
138
- description: "One or more reviewers. A single URI string, or a JSON array of URI strings (not a JSON-encoded string)."
200
+ description: "One or more reviewers, as a single URI string or an array of URI strings. Only a workspace member can go on to decide, so a review addressed elsewhere cannot be closed by its recipient."
139
201
  },
140
202
  rule: {
141
203
  type: "string",
142
204
  enum: ["any_one_approves", "all_approve", "quorum:2", "quorum:3"],
143
- default: "any_one_approves"
205
+ default: "any_one_approves",
206
+ description: "How many of the addressed reviewers must approve before the task completes. quorum:N is accepted for any N of 1 or more. The rule is fixed once the review is open: a later request naming a different one is refused with -32014. Omitting it on a later request leaves the rule alone, which is how reviewers are added to an open review."
144
207
  },
145
- artefact: { description: "The draft being submitted for review. Pass as a JSON object or array, not a JSON-encoded string." },
146
- deadline: { type: "string" }
208
+ artefact: { description: `The draft being submitted for review. ${STRUCTURED_PAYLOAD_NOTE} Re-requesting with the same artefact widens the reviewer set; a different artefact on an open review is refused with -32014.` },
209
+ deadline: { type: "string", description: "When the review is needed by, as an ISO 8601 timestamp. Recorded on the review; the coordinator does not act on it." }
147
210
  },
148
211
  required: ["workspace", "from", "task_id", "to", "artefact"]
149
212
  },
@@ -153,13 +216,9 @@ var SCHEMAS = {
153
216
  workspace: WORKSPACE_ID,
154
217
  from: PARTICIPANT_URI,
155
218
  task_id: TASK_ID,
156
- approved_artefact_digest: {
157
- type: "string",
158
- pattern: "^sha256:[0-9a-f]{64}$",
159
- description: "Optional. SHA-256 over the JCS canonicalisation of the artefact under review, as `sha256:<hex>`. Binds the decision to the exact content reviewed; refused with -32074 on mismatch."
160
- },
161
- comment: { type: "string" },
162
- tags: { type: "array", items: { type: "string" } }
219
+ approved_artefact_digest: ARTEFACT_DIGEST,
220
+ comment: COMMENT,
221
+ tags: TAGS
163
222
  },
164
223
  required: ["workspace", "from", "task_id"]
165
224
  },
@@ -169,47 +228,49 @@ var SCHEMAS = {
169
228
  workspace: WORKSPACE_ID,
170
229
  from: PARTICIPANT_URI,
171
230
  task_id: TASK_ID,
172
- approved_artefact_digest: {
173
- type: "string",
174
- pattern: "^sha256:[0-9a-f]{64}$",
175
- description: "Optional. SHA-256 over the JCS canonicalisation of the artefact under review, as `sha256:<hex>`. Binds the decision to the exact content reviewed; refused with -32074 on mismatch."
176
- },
177
- comment: { type: "string" },
178
- tags: { type: "array", items: { type: "string" } },
179
- request_revision: { type: "boolean", description: "If true, task returns to in_progress instead of declined." }
231
+ approved_artefact_digest: ARTEFACT_DIGEST,
232
+ comment: COMMENT,
233
+ tags: TAGS,
234
+ request_revision: { type: "boolean", description: "When true the task returns to 'in_progress' rather than 'declined', so the assignee can revise and resubmit." }
180
235
  },
181
236
  required: ["workspace", "from", "task_id"]
182
237
  },
183
238
  "chap.decide.override": {
184
239
  type: "object",
185
240
  properties: {
186
- approved_artefact_digest: {
187
- type: "string",
188
- pattern: "^sha256:[0-9a-f]{64}$",
189
- description: "Optional. SHA-256 over the JCS canonicalisation of the artefact under review, as `sha256:<hex>`. Binds the decision to the exact content reviewed; refused with -32074 on mismatch."
190
- },
241
+ approved_artefact_digest: ARTEFACT_DIGEST,
191
242
  workspace: WORKSPACE_ID,
192
243
  from: PARTICIPANT_URI,
193
244
  task_id: TASK_ID,
194
245
  diff: {
195
246
  type: "array",
196
- description: "RFC 6902 JSON Patch operations applied to the artefact under review.",
247
+ description: "RFC 6902 JSON Patch operations applied to the artefact under review. The patched artefact becomes the task output; a patch that does not apply is refused with -32012.",
197
248
  items: {
198
249
  type: "object",
199
250
  properties: {
200
- op: { type: "string", enum: ["add", "replace", "remove", "copy", "move", "test"] },
201
- path: { type: "string" },
202
- value: {},
203
- from: { type: "string" }
251
+ op: { type: "string", enum: ["add", "replace", "remove", "copy", "move", "test"], description: "The patch operation to apply." },
252
+ path: { type: "string", description: "JSON Pointer into the artefact, e.g. '/body' or '/items/0/severity'." },
253
+ value: { description: "The new value, for add, replace and test." },
254
+ from: { type: "string", description: "Source JSON Pointer, for copy and move." }
204
255
  },
205
256
  required: ["op", "path"]
206
257
  }
207
258
  },
208
- rationale: { type: "string", description: "Why the override was applied. Required for the structured-override audit trail." },
209
- tags: { type: "array", items: { type: "string" } },
210
- policy_refs: { type: "array", items: { type: "string" } },
211
- logical_id: { type: "string" },
212
- intent_preserved: { type: "boolean" }
259
+ rationale: { type: "string", description: "Why the correction was made. Required on every override and recorded in the audit entry, since the diff shows what changed but not why." },
260
+ tags: TAGS,
261
+ policy_refs: {
262
+ type: "array",
263
+ items: { type: "string" },
264
+ description: "Identifiers of the policies or guidelines this correction applies, e.g. ['policy:no-delivery-promises']. Recorded in the audit entry."
265
+ },
266
+ logical_id: {
267
+ type: "string",
268
+ description: "Caller-chosen identifier for the item being decided, stable across revisions and overrides of the same underlying content. Recorded in the audit entry."
269
+ },
270
+ intent_preserved: {
271
+ type: "boolean",
272
+ description: "True when the edit refines the decision the draft was making, false when it substitutes a different one. Recorded in the audit entry."
273
+ }
213
274
  },
214
275
  required: ["workspace", "from", "task_id", "diff", "rationale"]
215
276
  },
@@ -219,8 +280,12 @@ var SCHEMAS = {
219
280
  workspace: WORKSPACE_ID,
220
281
  from: PARTICIPANT_URI,
221
282
  task_id: TASK_ID,
222
- reason: { type: "string" },
223
- category: { type: "string", enum: ["conflict_of_interest", "insufficient_context", "out_of_scope", "other"] }
283
+ reason: { type: "string", description: "Why this reviewer is standing aside. Recorded in the audit entry." },
284
+ category: {
285
+ type: "string",
286
+ enum: ["conflict_of_interest", "insufficient_context", "out_of_scope", "other"],
287
+ description: "The kind of abstention. Recorded in the audit entry."
288
+ }
224
289
  },
225
290
  required: ["workspace", "from", "task_id", "reason"]
226
291
  },
@@ -229,13 +294,15 @@ var SCHEMAS = {
229
294
  properties: {
230
295
  workspace: WORKSPACE_ID,
231
296
  from: PARTICIPANT_URI,
232
- original_task_id: TASK_ID,
297
+ original_task_id: { ...TASK_ID, description: "The task being escalated. It moves to 'escalated' and is linked to the successor. A completed, cancelled or superseded task cannot be escalated." },
233
298
  new_task: {
234
299
  type: "object",
300
+ description: "The successor task to open for the escalation target.",
235
301
  properties: {
236
- kind: { type: "string" },
237
- assignee: PARTICIPANT_URI,
238
- input: { type: "object", additionalProperties: true }
302
+ kind: { type: "string", description: "Task kind for the successor. Defaults to the original's kind." },
303
+ assignee: { ...PARTICIPANT_URI, description: "Who the escalation goes to. Must be a workspace member who is not paused: a paused assignee is refused with -32063." },
304
+ input: { type: "object", additionalProperties: true, description: "Input payload for the successor. It defaults to an empty object rather than the original's input, so anything the new assignee needs has to be restated here." },
305
+ mode: { type: "string", enum: ["shadow", "trial", "production"], description: "Mode for the successor, defaulting to the original's. A mode above the workspace's current ceiling is refused with -32040, so after the ceiling is lowered a task is escalated by naming a mode within it." }
239
306
  },
240
307
  required: ["assignee"]
241
308
  }
@@ -252,15 +319,27 @@ var SCHEMAS = {
252
319
  from: PARTICIPANT_URI,
253
320
  task_id: TASK_ID,
254
321
  to: { type: "array", items: PARTICIPANT_URI, description: "Who is being asked." },
255
- question: { type: "string" },
322
+ question: { type: "string", description: "The question being put. A whisper is answered on its own, without the recipient opening the task." },
256
323
  options: {
257
324
  type: "array",
258
- items: { type: "object", properties: { id: { type: "string" }, label: { type: "string" } }, required: ["id"] },
259
- description: "Optional multiple-choice options. If present, answer_option must be one of these ids."
325
+ items: {
326
+ type: "object",
327
+ properties: {
328
+ id: { type: "string", description: "Stable identifier that an answer refers to." },
329
+ label: { type: "string", description: "What the option says to the person answering." }
330
+ },
331
+ required: ["id"]
332
+ },
333
+ description: "Multiple-choice options. When present, an answer must name one of these ids in answer_option; any other id is refused with -32022."
260
334
  },
261
- deadline_ms: { type: "integer", description: "Time-to-live in milliseconds from now." },
262
- default_if_lapsed: { description: "Value applied if the whisper lapses without an answer." },
263
- urgency: { type: "string", enum: ["low", "medium", "high"], default: "low" }
335
+ deadline_ms: { type: "integer", description: "How long the whisper stays open, in milliseconds from now. Once it passes, the whisper lapses and default_if_lapsed is applied." },
336
+ default_if_lapsed: { description: "The value applied if the deadline passes with no answer. Required, so that a lapsed whisper still has a defined outcome." },
337
+ urgency: {
338
+ type: "string",
339
+ enum: ["low", "medium", "high"],
340
+ default: "low",
341
+ description: "How urgent the question is. Recorded and passed on to the client; it does not change the deadline or the lapse behaviour."
342
+ }
264
343
  },
265
344
  required: ["workspace", "from", "task_id", "to", "question", "deadline_ms", "default_if_lapsed"]
266
345
  },
@@ -269,10 +348,10 @@ var SCHEMAS = {
269
348
  properties: {
270
349
  workspace: WORKSPACE_ID,
271
350
  from: PARTICIPANT_URI,
272
- whisper_id: { type: "string" },
273
- answer_option: { type: "string", description: "Option id (required when the whisper has options)." },
274
- answer: { type: "string", description: "Free-text answer (when no options)." },
275
- comment: { type: "string" }
351
+ whisper_id: { type: "string", description: "Identifier returned by chap.whisper.ask. A whisper that has already been answered is refused with -32020, and one past its deadline with -32021." },
352
+ answer_option: { type: "string", description: "The id of the chosen option. Required when the whisper carried options." },
353
+ answer: { type: "string", description: "Free-text answer, for a whisper with no options." },
354
+ comment: { type: "string", description: "Anything else the answerer wants recorded alongside the answer." }
276
355
  },
277
356
  required: ["workspace", "from", "whisper_id"]
278
357
  },
@@ -284,16 +363,16 @@ var SCHEMAS = {
284
363
  properties: {
285
364
  workspace: WORKSPACE_ID,
286
365
  from: PARTICIPANT_URI,
287
- to: { type: "array", items: PARTICIPANT_URI, description: "Deliberation participants." },
366
+ to: { type: "array", items: PARTICIPANT_URI, description: "The participants entitled to vote. A vote from anyone else is refused with -32030." },
288
367
  task_id: TASK_ID,
289
368
  rule: {
290
369
  type: "string",
291
- description: "Voting rule. Examples: any_one_approves, all_approve, quorum:N, weighted_vote:T, weighted_vote_with_veto:T."
370
+ description: "How the outcome is decided when the deliberation closes: any_one_approves, all_approve, quorum:N, weighted_vote:T or weighted_vote_with_veto:T. An unrecognised rule is refused at open with -32033."
292
371
  },
293
- question: { type: "string" },
294
- weights: { type: "object", additionalProperties: { type: "number" }, description: "Voter -> weight map (for weighted rules)." },
295
- veto: { type: "object", additionalProperties: { type: "boolean" }, description: "Voter -> can-veto map." },
296
- deadline: { type: "string" }
372
+ question: { type: "string", description: "What the group is deciding. State it so that a yea or a nay is unambiguous." },
373
+ weights: { type: "object", additionalProperties: { type: "integer" }, description: "Voter to weight map, read by the weighted rules. A voter with no entry counts as 1. Weights must be integers: a JSON number with a fractional part is refused with -32602." },
374
+ veto: { type: "object", additionalProperties: { type: "boolean" }, description: "Voter to can-veto map. A veto is honoured only under weighted_vote_with_veto, and only from a voter listed true here." },
375
+ deadline: { type: "string", description: "When voting is intended to close, as an ISO 8601 timestamp. Recorded on the deliberation; closing is done by chap.deliberate.close and the coordinator does not close on the deadline." }
297
376
  },
298
377
  required: ["workspace", "from", "to", "rule"]
299
378
  },
@@ -302,8 +381,8 @@ var SCHEMAS = {
302
381
  properties: {
303
382
  workspace: WORKSPACE_ID,
304
383
  from: PARTICIPANT_URI,
305
- deliberation_id: { type: "string" },
306
- comment: { type: "string" }
384
+ deliberation_id: { type: "string", description: "Identifier returned by chap.deliberate.open. A closed deliberation is refused with -32032." },
385
+ comment: { type: "string", description: "The contribution to record. Comments are kept with the deliberation and in the audit log, so the reasoning survives the vote." }
307
386
  },
308
387
  required: ["workspace", "from", "deliberation_id", "comment"]
309
388
  },
@@ -312,11 +391,11 @@ var SCHEMAS = {
312
391
  properties: {
313
392
  workspace: WORKSPACE_ID,
314
393
  from: PARTICIPANT_URI,
315
- deliberation_id: { type: "string" },
316
- vote: { type: "string", enum: ["yea", "nay", "abstain"] },
317
- weight: { type: "number" },
318
- comment: { type: "string" },
319
- veto_invoked: { type: "boolean" }
394
+ deliberation_id: { type: "string", description: "Identifier returned by chap.deliberate.open. A closed deliberation is refused with -32032, and a second vote from the same voter with -32031." },
395
+ vote: { type: "string", enum: ["yea", "nay", "abstain"], description: "This voter's position. An abstention is recorded but counts as neither a yea nor a nay, so under all_approve or quorum:N it withholds the approval those rules need." },
396
+ weight: { type: "integer", description: "Recorded with the vote. The tally uses the weights map given at chap.deliberate.open, not this value." },
397
+ comment: { type: "string", description: "Why the vote went this way. Recorded with it." },
398
+ veto_invoked: { type: "boolean", description: "Blocks the outcome regardless of the tally. Honoured only under weighted_vote_with_veto, and only when the voter is listed true in the veto map given at open." }
320
399
  },
321
400
  required: ["workspace", "from", "deliberation_id", "vote"]
322
401
  },
@@ -325,7 +404,7 @@ var SCHEMAS = {
325
404
  properties: {
326
405
  workspace: WORKSPACE_ID,
327
406
  from: PARTICIPANT_URI,
328
- deliberation_id: { type: "string" }
407
+ deliberation_id: { type: "string", description: "Identifier returned by chap.deliberate.open. Closing computes the outcome from the votes cast; closing an already closed deliberation returns the outcome unchanged." }
329
408
  },
330
409
  required: ["workspace", "from", "deliberation_id"]
331
410
  },
@@ -337,23 +416,24 @@ var SCHEMAS = {
337
416
  properties: {
338
417
  workspace: WORKSPACE_ID,
339
418
  from: PARTICIPANT_URI,
340
- to: { type: "string", description: "Recipient (URI or 'group:...')." },
419
+ to: { type: "string", description: "Recipient, as a participant URI or a group URI such as 'group:support-team'. A recipient who is not a workspace member is refused with -32052." },
341
420
  tasks: {
342
421
  type: "array",
422
+ description: "The work being handed over, one entry per task. Every task must currently be assigned to the proposer; otherwise the proposal is refused with -32050.",
343
423
  items: {
344
424
  type: "object",
345
425
  properties: {
346
426
  task_id: TASK_ID,
347
- title: { type: "string" },
348
- status_summary: { type: "string" },
349
- next_action: { type: "string" },
350
- blockers: { type: "array", items: { type: "string" } }
427
+ title: { type: "string", description: "Short label for the task." },
428
+ status_summary: { type: "string", description: "Where the work has reached, and what has already been tried." },
429
+ next_action: { type: "string", description: "What the recipient should do first." },
430
+ blockers: { type: "array", items: { type: "string" }, description: "What is preventing progress, if anything." }
351
431
  },
352
432
  required: ["task_id"]
353
433
  }
354
434
  },
355
- summary: { type: "string" },
356
- context_links: { type: "array", items: { type: "string" } }
435
+ summary: { type: "string", description: "Covering note for the handover as a whole, above the per-task detail." },
436
+ context_links: { type: "array", items: { type: "string" }, description: "URLs to threads, tickets or documents the recipient will need." }
357
437
  },
358
438
  required: ["workspace", "from", "to", "tasks"]
359
439
  },
@@ -362,9 +442,9 @@ var SCHEMAS = {
362
442
  properties: {
363
443
  workspace: WORKSPACE_ID,
364
444
  from: PARTICIPANT_URI,
365
- handoff_id: { type: "string" },
366
- accepted_task_ids: { type: "array", items: TASK_ID, description: "If omitted, all proposed tasks are accepted." },
367
- comment: { type: "string" }
445
+ handoff_id: { type: "string", description: "Identifier returned by chap.handoff.propose. A handoff already accepted or declined is refused with -32051." },
446
+ accepted_task_ids: { type: "array", items: TASK_ID, description: "Which of the proposed tasks are being accepted. If omitted, all of them are." },
447
+ comment: { type: "string", description: "Anything the recipient wants recorded when taking the work on." }
368
448
  },
369
449
  required: ["workspace", "from", "handoff_id"]
370
450
  },
@@ -373,9 +453,9 @@ var SCHEMAS = {
373
453
  properties: {
374
454
  workspace: WORKSPACE_ID,
375
455
  from: PARTICIPANT_URI,
376
- handoff_id: { type: "string" },
377
- reason: { type: "string" },
378
- suggested_target: PARTICIPANT_URI
456
+ handoff_id: { type: "string", description: "Identifier returned by chap.handoff.propose. A handoff already accepted or declined is refused with -32051." },
457
+ reason: { type: "string", description: "Why the handover is refused. Recorded so the proposer can route it elsewhere." },
458
+ suggested_target: { ...PARTICIPANT_URI, description: "Who should take it instead, if the decliner knows." }
379
459
  },
380
460
  required: ["workspace", "from", "handoff_id"]
381
461
  },
@@ -387,11 +467,20 @@ var SCHEMAS = {
387
467
  properties: {
388
468
  workspace: WORKSPACE_ID,
389
469
  from: PARTICIPANT_URI,
390
- scope: { type: "string", enum: ["task", "participant", "workspace"], default: "task" },
470
+ scope: {
471
+ type: "string",
472
+ enum: ["task", "participant", "workspace"],
473
+ default: "task",
474
+ description: "What the pause applies to. 'task' moves one task to 'paused'; a task that is completed, declined, cancelled or superseded is refused with -32061. 'participant' stops new tasks being assigned to that member and leaves their existing work running. 'workspace' refuses every method except workspace.create, workspace.describe, control.resume, audit.read, participant.join and participant.leave."
475
+ },
391
476
  task_id: TASK_ID,
392
- participant_uri: PARTICIPANT_URI,
393
- in_flight_policy: { type: "string", enum: ["allow_to_complete", "interrupt"] },
394
- reason: { type: "string" }
477
+ participant_uri: { ...PARTICIPANT_URI, description: "Whose work to pause, when scope is 'participant'. Must be a workspace member." },
478
+ in_flight_policy: {
479
+ type: "string",
480
+ enum: ["allow_to_complete", "interrupt"],
481
+ description: "Recorded with the request, and echoed back when scope is 'participant'. The coordinator does not act on it: under either value, work already under way is left alone."
482
+ },
483
+ reason: { type: "string", description: "Why the pause was applied. Recorded in the audit entry." }
395
484
  },
396
485
  required: ["workspace", "from"]
397
486
  },
@@ -400,9 +489,14 @@ var SCHEMAS = {
400
489
  properties: {
401
490
  workspace: WORKSPACE_ID,
402
491
  from: PARTICIPANT_URI,
403
- scope: { type: "string", enum: ["task", "participant", "workspace"], default: "task" },
492
+ scope: {
493
+ type: "string",
494
+ enum: ["task", "participant", "workspace"],
495
+ default: "task",
496
+ description: "What the resume applies to. 'task' returns a paused task to the state it held at the pause; a task that is not paused is refused with -32061. 'participant' allows that member to be assigned tasks again. 'workspace' returns the workspace to active."
497
+ },
404
498
  task_id: TASK_ID,
405
- participant_uri: PARTICIPANT_URI
499
+ participant_uri: { ...PARTICIPANT_URI, description: "Whose work to resume, when scope is 'participant'. Must be a workspace member." }
406
500
  },
407
501
  required: ["workspace", "from"]
408
502
  },
@@ -411,8 +505,8 @@ var SCHEMAS = {
411
505
  properties: {
412
506
  workspace: WORKSPACE_ID,
413
507
  from: PARTICIPANT_URI,
414
- task_id: TASK_ID,
415
- reason: { type: "string" }
508
+ task_id: { ...TASK_ID, description: "The task to cancel. A task that is completed, declined, cancelled or superseded is refused with -32061." },
509
+ reason: { type: "string", description: "Why the task was cancelled. Recorded in the audit entry." }
416
510
  },
417
511
  required: ["workspace", "from", "task_id"]
418
512
  },
@@ -421,8 +515,8 @@ var SCHEMAS = {
421
515
  properties: {
422
516
  workspace: WORKSPACE_ID,
423
517
  from: PARTICIPANT_URI,
424
- label: { type: "string" },
425
- include: { type: "array", items: { type: "string" }, description: "Aspects to snapshot, e.g. ['members', 'open_tasks', 'mode_ceiling']." }
518
+ label: { type: "string", description: "Name for this snapshot, recorded on the artefact. chap.control.rollback identifies a snapshot by its artefact id, not by label." },
519
+ include: { type: "array", items: { type: "string" }, description: "Which aspects of the workspace to capture. Recognised values are 'members', 'open_tasks', 'mode_ceiling', 'policy' and 'audit'. Defaults to members, open_tasks and mode_ceiling." }
426
520
  },
427
521
  required: ["workspace", "from"]
428
522
  },
@@ -431,9 +525,9 @@ var SCHEMAS = {
431
525
  properties: {
432
526
  workspace: WORKSPACE_ID,
433
527
  from: PARTICIPANT_URI,
434
- to_snapshot_artefact_id: { type: "string" },
435
- what_to_restore: { type: "array", items: { type: "string" } },
436
- reason: { type: "string" }
528
+ to_snapshot_artefact_id: { type: "string", description: "Artefact id returned by chap.control.snapshot. An id with no matching snapshot is refused with -32062." },
529
+ what_to_restore: { type: "array", items: { type: "string" }, description: "Which captured aspects to apply. Only 'mode_ceiling' and 'members' are restored; the others are held in the snapshot and not reapplied. Restoring members resets role and scopes on members still present, and does not re-add members who have left. Defaults to the snapshot's include list." },
530
+ reason: { type: "string", description: "Why the rollback was performed. The rollback is itself an audit entry; earlier entries are not rewritten." }
437
531
  },
438
532
  required: ["workspace", "from", "to_snapshot_artefact_id"]
439
533
  },
@@ -442,17 +536,20 @@ var SCHEMAS = {
442
536
  properties: {
443
537
  workspace: WORKSPACE_ID,
444
538
  from: PARTICIPANT_URI,
445
- task_id: TASK_ID,
539
+ task_id: { ...TASK_ID, description: "The task being replaced. It moves to 'superseded' and is linked to the successor rather than deleted." },
446
540
  successor_task: {
447
541
  type: "object",
542
+ description: "The replacement task.",
448
543
  properties: {
449
- kind: { type: "string" },
450
- assignee: PARTICIPANT_URI,
451
- input: { type: "object", additionalProperties: true }
544
+ kind: { type: "string", description: "Task kind for the successor. Required." },
545
+ assignee: { ...PARTICIPANT_URI, description: "Who takes the replacement on. Defaults to the superseded task's assignee, and must be a workspace member who is not paused." },
546
+ input: { type: "object", additionalProperties: true, description: "Input payload for the successor. Defaults to an empty object." },
547
+ mode: { type: "string", enum: ["shadow", "trial", "production"], description: "Mode for the successor, defaulting to the superseded task's. A mode above the workspace's current ceiling is refused with -32040." },
548
+ review_required: { type: "boolean", description: "Whether completing the successor needs a reviewer decision. A successor of a task that requires review requires it whatever is passed here, and under modes/1.0 so does a trial-mode successor." }
452
549
  },
453
550
  required: ["kind"]
454
551
  },
455
- reason: { type: "string" }
552
+ reason: { type: "string", description: "Why the original is being replaced. Recorded in the audit entry." }
456
553
  },
457
554
  required: ["workspace", "from", "task_id", "successor_task"]
458
555
  },
@@ -461,8 +558,12 @@ var SCHEMAS = {
461
558
  properties: {
462
559
  workspace: WORKSPACE_ID,
463
560
  from: PARTICIPANT_URI,
464
- new_ceiling: { type: "string", enum: ["shadow", "trial", "production"] },
465
- reason: { type: "string" }
561
+ new_ceiling: {
562
+ type: "string",
563
+ enum: ["shadow", "trial", "production"],
564
+ description: "The highest mode tasks in this workspace may request from now on. Existing tasks keep the mode they were created with. Where the coordinator is configured to enforce step-up authentication this method is one of the privileged ones and a call without step-up is refused with -32402."
565
+ },
566
+ reason: { type: "string", description: "Why the ceiling is being changed. Recorded in the audit entry." }
466
567
  },
467
568
  required: ["workspace", "from", "new_ceiling"]
468
569
  },
@@ -475,7 +576,7 @@ var SCHEMAS = {
475
576
  workspace: WORKSPACE_ID,
476
577
  from: PARTICIPANT_URI,
477
578
  task_id: TASK_ID,
478
- candidates: { type: "array", items: PARTICIPANT_URI, description: "Candidate assignees." }
579
+ candidates: { type: "array", items: PARTICIPANT_URI, description: "Candidate assignees. An empty list is refused with -32513. The default policy takes the first candidate that is a workspace member and is not paused, and refuses the call with -32510 when there is none. An operator-supplied routing policy may select on any basis; a choice that is not a member is refused with -32510, and one who is paused with -32063." }
479
580
  },
480
581
  required: ["workspace", "from", "task_id", "candidates"]
481
582
  },
@@ -487,7 +588,7 @@ var SCHEMAS = {
487
588
  task_id: TASK_ID,
488
589
  artefact_routing_hints: {
489
590
  type: "object",
490
- description: "Per-artefact signals like confidence, model_id, cost_consumed_usd.",
591
+ description: `Per-artefact signals such as confidence, model_id and cost_consumed_usd, merged over the task's routing_hints for this call. The default policy reads criticality and confidence. If the merged set is empty the call is refused with -32514. Fractional values are written as decimal strings, e.g. "confidence": "0.86".`,
491
592
  additionalProperties: true
492
593
  }
493
594
  },
@@ -499,7 +600,7 @@ var SCHEMAS = {
499
600
  workspace: WORKSPACE_ID,
500
601
  from: PARTICIPANT_URI,
501
602
  task_id: TASK_ID,
502
- default_escalation_target: PARTICIPANT_URI
603
+ default_escalation_target: { ...PARTICIPANT_URI, description: "Who to escalate to when the policy decides to escalate and names no target of its own. It must be a workspace member or a group URI; if the policy escalates with no usable target the call is refused with -32516." }
503
604
  },
504
605
  required: ["workspace", "from", "task_id"]
505
606
  },
@@ -511,8 +612,8 @@ var SCHEMAS = {
511
612
  properties: {
512
613
  workspace: WORKSPACE_ID,
513
614
  from: PARTICIPANT_URI,
514
- old_kid: { type: "string" },
515
- new_jwk: { type: "object", additionalProperties: true }
615
+ old_kid: { type: "string", description: "Key id being retired. It is given a valid_until timestamp and stays in the member's key history, so signatures made before the rotation still verify. A key id that is unknown is refused with -32071, and one already revoked with -32072." },
616
+ new_jwk: { type: "object", additionalProperties: true, description: "The replacement public key as a JWK. It must carry a 'kid'. Whether the request itself has to be signed with the old key is decided at dispatch, and only where the coordinator is configured to require signatures." }
516
617
  },
517
618
  required: ["workspace", "from", "old_kid", "new_jwk"]
518
619
  },
@@ -521,9 +622,9 @@ var SCHEMAS = {
521
622
  properties: {
522
623
  workspace: WORKSPACE_ID,
523
624
  from: PARTICIPANT_URI,
524
- target_uri: PARTICIPANT_URI,
525
- kid: { type: "string" },
526
- reason: { type: "string" }
625
+ target_uri: { ...PARTICIPANT_URI, description: "Whose key is being revoked. Revoking another member's key requires the caller to hold the role 'admin'; otherwise the call is refused with -32011." },
626
+ kid: { type: "string", description: "Key id to revoke. It is marked revoked with a timestamp and a reason, and signatures presented with it are refused from then on. A key id that is unknown is refused with -32071." },
627
+ reason: { type: "string", description: "Why the key was revoked, e.g. 'laptop lost'. Recorded on the key and in the audit entry." }
527
628
  },
528
629
  required: ["workspace", "from", "target_uri", "kid"]
529
630
  },
@@ -537,12 +638,13 @@ var SCHEMAS = {
537
638
  from: PARTICIPANT_URI,
538
639
  range: {
539
640
  type: "object",
641
+ description: "Sequence window to anchor. Omit to submit the whole chain.",
540
642
  properties: {
541
- from_seq: { type: "integer" },
542
- to_seq: { type: "integer" }
643
+ from_seq: { type: "integer", description: "Start sequence number, inclusive." },
644
+ to_seq: { type: "integer", description: "End sequence number, exclusive." }
543
645
  }
544
646
  },
545
- issuer: { type: "string" }
647
+ issuer: { type: "string", description: "Issuer identifier placed on each SCITT signed statement, naming who vouches for the chain. Defaults to 'service:coordinator'. Where no submitter is configured the statements are returned unsigned for the deployment to submit out of band." }
546
648
  },
547
649
  required: ["workspace"]
548
650
  },
@@ -551,7 +653,7 @@ var SCHEMAS = {
551
653
  properties: {
552
654
  workspace: WORKSPACE_ID,
553
655
  from: PARTICIPANT_URI,
554
- receipt: { type: "object", additionalProperties: true }
656
+ receipt: { type: "object", additionalProperties: true, description: "The SCITT receipt to check, as returned by the transparency service. Verification is delegated to a hook supplied by the deployment, and fails closed with -32082 where no hook is configured." }
555
657
  },
556
658
  required: ["workspace", "receipt"]
557
659
  },