@brightbeamai/chap-coordinator-mcp 0.2.12 → 0.2.13

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.cjs CHANGED
@@ -39,17 +39,37 @@ var TASK_ID = {
39
39
  type: "string",
40
40
  description: "Task identifier returned by chap.task.create."
41
41
  };
42
+ 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.`;
42
43
  var ROUTING_HINTS = {
43
44
  type: "object",
44
- description: "Optional signals for the routing/1.0 profile.",
45
+ 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.",
45
46
  properties: {
46
- criticality: { type: "string", enum: ["low", "medium", "high", "critical"] },
47
- deadline: { type: "string", description: "ISO 8601 timestamp." },
48
- risk_tier: { type: "string" },
49
- max_cost_usd: { type: "number" }
47
+ criticality: {
48
+ type: "string",
49
+ enum: ["low", "medium", "high", "critical"],
50
+ 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."
51
+ },
52
+ 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." },
53
+ 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." },
54
+ max_cost_usd: { type: "string", description: `Budget ceiling for this task in US dollars. ${decimalStringNote("12.50")} No built-in policy reads it.` }
50
55
  },
51
56
  additionalProperties: true
52
57
  };
58
+ var COMMENT = {
59
+ type: "string",
60
+ description: "The reviewer's note on this decision. Recorded in the audit entry for the decision."
61
+ };
62
+ var TAGS = {
63
+ type: "array",
64
+ items: { type: "string" },
65
+ 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."
66
+ };
67
+ var ARTEFACT_DIGEST = {
68
+ type: "string",
69
+ pattern: "^sha256:[0-9a-f]{64}$",
70
+ 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."
71
+ };
72
+ 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.";
53
73
  var SCHEMAS = {
54
74
  "chap.workspace.create": {
55
75
  type: "object",
@@ -58,10 +78,20 @@ var SCHEMAS = {
58
78
  profiles: {
59
79
  type: "array",
60
80
  items: { type: "string" },
61
- description: "Profile identifiers to enable, e.g. ['core/1.0', 'review/1.0']."
81
+ 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."
82
+ },
83
+ mode: {
84
+ type: "string",
85
+ enum: ["shadow", "trial", "production"],
86
+ default: "trial",
87
+ 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."
62
88
  },
63
- mode: { type: "string", enum: ["shadow", "trial", "production"], default: "trial" },
64
- mode_ceiling: { type: "string", enum: ["shadow", "trial", "production"], default: "production" }
89
+ mode_ceiling: {
90
+ type: "string",
91
+ enum: ["shadow", "trial", "production"],
92
+ default: "production",
93
+ 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."
94
+ }
65
95
  },
66
96
  additionalProperties: false
67
97
  },
@@ -74,7 +104,11 @@ var SCHEMAS = {
74
104
  type: "object",
75
105
  properties: {
76
106
  workspace: WORKSPACE_ID,
77
- profiles: { type: "array", items: { type: "string" } }
107
+ profiles: {
108
+ type: "array",
109
+ items: { type: "string" },
110
+ 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."
111
+ }
78
112
  },
79
113
  required: ["workspace", "profiles"]
80
114
  },
@@ -83,9 +117,13 @@ var SCHEMAS = {
83
117
  properties: {
84
118
  workspace: WORKSPACE_ID,
85
119
  from: PARTICIPANT_URI,
86
- type: { type: "string", enum: ["human", "agent", "service", "group", "workspace"] },
87
- role: { type: "string", description: "Operator-defined role, e.g. 'reviewer' or 'drafter'." },
88
- display_name: { type: "string" }
120
+ type: {
121
+ type: "string",
122
+ enum: ["human", "agent", "service", "group", "workspace"],
123
+ 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."
124
+ },
125
+ 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." },
126
+ display_name: { type: "string", description: "Human-readable name for interfaces. Not used in authorisation." }
89
127
  },
90
128
  required: ["workspace", "from", "type"]
91
129
  },
@@ -98,12 +136,25 @@ var SCHEMAS = {
98
136
  type: "object",
99
137
  properties: {
100
138
  workspace: WORKSPACE_ID,
101
- from: { ...PARTICIPANT_URI, description: "Delegator URI." },
102
- kind: { type: "string", description: "Task kind, e.g. 'draft_response' or 'review'." },
103
- assignee: { ...PARTICIPANT_URI, description: "Who the task is assigned to. Must be a workspace member." },
139
+ from: { ...PARTICIPANT_URI, description: "The delegator. Must be a workspace member." },
140
+ kind: { type: "string", description: "Task kind, e.g. 'draft_response' or 'review'. Free text; the coordinator records it without interpreting it." },
141
+ 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." },
104
142
  input: { type: "object", description: "Task-specific input payload.", additionalProperties: true },
105
143
  routing_hints: ROUTING_HINTS,
106
- mode: { type: "string", enum: ["shadow", "trial", "production"] }
144
+ mode: {
145
+ type: "string",
146
+ enum: ["shadow", "trial", "production"],
147
+ description: "Mode for this task, defaulting to the workspace mode. A mode above the workspace ceiling is refused with -32040."
148
+ },
149
+ review_required: {
150
+ type: "boolean",
151
+ 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."
152
+ },
153
+ 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." },
154
+ idempotency_key: {
155
+ type: "string",
156
+ 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."
157
+ }
107
158
  },
108
159
  required: ["workspace", "from", "kind", "assignee", "input"]
109
160
  },
@@ -113,8 +164,12 @@ var SCHEMAS = {
113
164
  workspace: WORKSPACE_ID,
114
165
  from: PARTICIPANT_URI,
115
166
  task_id: TASK_ID,
116
- state: { type: "string", enum: ["in_progress", "review_requested", "declined", "paused", "cancelled", "completed"] },
117
- progress_note: { type: "string" }
167
+ state: {
168
+ type: "string",
169
+ enum: ["in_progress", "review_requested", "declined", "paused", "cancelled", "completed"],
170
+ 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 task marked review_required cannot be moved to 'completed' here: submit the output with chap.task.complete, which opens the review."
171
+ },
172
+ progress_note: { type: "string", description: "Short note on what changed, kept in the task's history." }
118
173
  },
119
174
  required: ["workspace", "from", "task_id", "state"]
120
175
  },
@@ -124,8 +179,8 @@ var SCHEMAS = {
124
179
  workspace: WORKSPACE_ID,
125
180
  from: PARTICIPANT_URI,
126
181
  task_id: TASK_ID,
127
- output: { description: "The task's output artefact. Pass as a JSON object or array, not a JSON-encoded string." },
128
- confidence: { type: "number", description: "Self-reported confidence (0-1), where supported." },
182
+ output: { description: `The task's output artefact. ${STRUCTURED_PAYLOAD_NOTE}` },
183
+ confidence: { type: "string", description: `Self-reported confidence in the output, between 0 and 1. ${decimalStringNote("0.86")}` },
129
184
  routing_hints: ROUTING_HINTS
130
185
  },
131
186
  required: ["workspace", "from", "task_id"]
@@ -136,17 +191,19 @@ var SCHEMAS = {
136
191
  workspace: WORKSPACE_ID,
137
192
  range: {
138
193
  type: "object",
194
+ description: "Sequence window to return. Omit for the whole log.",
139
195
  properties: {
140
- from_seq: { type: "integer", description: "Start sequence number (inclusive)." },
141
- to_seq: { type: "integer", description: "End sequence number (exclusive)." }
196
+ from_seq: { type: "integer", description: "Start sequence number, inclusive." },
197
+ to_seq: { type: "integer", description: "End sequence number, exclusive." }
142
198
  }
143
199
  },
144
200
  filter: {
145
201
  type: "object",
202
+ description: "Narrows the entries returned. Conditions combine with AND, and are applied within the sequence window rather than before it.",
146
203
  properties: {
147
- method: { type: "string" },
148
- from: { type: "string" },
149
- task_id: { type: "string" }
204
+ method: { type: "string", description: "Return only entries for this CHAP method, e.g. 'decide.override'. Matched in full, without the 'chap.' tool-name prefix." },
205
+ from: { type: "string", description: "Return only entries whose actor is this participant URI." },
206
+ task_id: { type: "string", description: "Return only entries about this task." }
150
207
  }
151
208
  }
152
209
  },
@@ -163,15 +220,16 @@ var SCHEMAS = {
163
220
  task_id: TASK_ID,
164
221
  to: {
165
222
  oneOf: [PARTICIPANT_URI, { type: "array", items: PARTICIPANT_URI }],
166
- description: "One or more reviewers. A single URI string, or a JSON array of URI strings (not a JSON-encoded string)."
223
+ 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."
167
224
  },
168
225
  rule: {
169
226
  type: "string",
170
227
  enum: ["any_one_approves", "all_approve", "quorum:2", "quorum:3"],
171
- default: "any_one_approves"
228
+ default: "any_one_approves",
229
+ 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."
172
230
  },
173
- artefact: { description: "The draft being submitted for review. Pass as a JSON object or array, not a JSON-encoded string." },
174
- deadline: { type: "string" }
231
+ 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.` },
232
+ 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." }
175
233
  },
176
234
  required: ["workspace", "from", "task_id", "to", "artefact"]
177
235
  },
@@ -181,13 +239,9 @@ var SCHEMAS = {
181
239
  workspace: WORKSPACE_ID,
182
240
  from: PARTICIPANT_URI,
183
241
  task_id: TASK_ID,
184
- approved_artefact_digest: {
185
- type: "string",
186
- pattern: "^sha256:[0-9a-f]{64}$",
187
- 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."
188
- },
189
- comment: { type: "string" },
190
- tags: { type: "array", items: { type: "string" } }
242
+ approved_artefact_digest: ARTEFACT_DIGEST,
243
+ comment: COMMENT,
244
+ tags: TAGS
191
245
  },
192
246
  required: ["workspace", "from", "task_id"]
193
247
  },
@@ -197,47 +251,49 @@ var SCHEMAS = {
197
251
  workspace: WORKSPACE_ID,
198
252
  from: PARTICIPANT_URI,
199
253
  task_id: TASK_ID,
200
- approved_artefact_digest: {
201
- type: "string",
202
- pattern: "^sha256:[0-9a-f]{64}$",
203
- 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."
204
- },
205
- comment: { type: "string" },
206
- tags: { type: "array", items: { type: "string" } },
207
- request_revision: { type: "boolean", description: "If true, task returns to in_progress instead of declined." }
254
+ approved_artefact_digest: ARTEFACT_DIGEST,
255
+ comment: COMMENT,
256
+ tags: TAGS,
257
+ request_revision: { type: "boolean", description: "When true the task returns to 'in_progress' rather than 'declined', so the assignee can revise and resubmit." }
208
258
  },
209
259
  required: ["workspace", "from", "task_id"]
210
260
  },
211
261
  "chap.decide.override": {
212
262
  type: "object",
213
263
  properties: {
214
- approved_artefact_digest: {
215
- type: "string",
216
- pattern: "^sha256:[0-9a-f]{64}$",
217
- 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."
218
- },
264
+ approved_artefact_digest: ARTEFACT_DIGEST,
219
265
  workspace: WORKSPACE_ID,
220
266
  from: PARTICIPANT_URI,
221
267
  task_id: TASK_ID,
222
268
  diff: {
223
269
  type: "array",
224
- description: "RFC 6902 JSON Patch operations applied to the artefact under review.",
270
+ 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.",
225
271
  items: {
226
272
  type: "object",
227
273
  properties: {
228
- op: { type: "string", enum: ["add", "replace", "remove", "copy", "move", "test"] },
229
- path: { type: "string" },
230
- value: {},
231
- from: { type: "string" }
274
+ op: { type: "string", enum: ["add", "replace", "remove", "copy", "move", "test"], description: "The patch operation to apply." },
275
+ path: { type: "string", description: "JSON Pointer into the artefact, e.g. '/body' or '/items/0/severity'." },
276
+ value: { description: "The new value, for add, replace and test." },
277
+ from: { type: "string", description: "Source JSON Pointer, for copy and move." }
232
278
  },
233
279
  required: ["op", "path"]
234
280
  }
235
281
  },
236
- rationale: { type: "string", description: "Why the override was applied. Required for the structured-override audit trail." },
237
- tags: { type: "array", items: { type: "string" } },
238
- policy_refs: { type: "array", items: { type: "string" } },
239
- logical_id: { type: "string" },
240
- intent_preserved: { type: "boolean" }
282
+ 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." },
283
+ tags: TAGS,
284
+ policy_refs: {
285
+ type: "array",
286
+ items: { type: "string" },
287
+ description: "Identifiers of the policies or guidelines this correction applies, e.g. ['policy:no-delivery-promises']. Recorded in the audit entry."
288
+ },
289
+ logical_id: {
290
+ type: "string",
291
+ description: "Caller-chosen identifier for the item being decided, stable across revisions and overrides of the same underlying content. Recorded in the audit entry."
292
+ },
293
+ intent_preserved: {
294
+ type: "boolean",
295
+ description: "True when the edit refines the decision the draft was making, false when it substitutes a different one. Recorded in the audit entry."
296
+ }
241
297
  },
242
298
  required: ["workspace", "from", "task_id", "diff", "rationale"]
243
299
  },
@@ -247,8 +303,12 @@ var SCHEMAS = {
247
303
  workspace: WORKSPACE_ID,
248
304
  from: PARTICIPANT_URI,
249
305
  task_id: TASK_ID,
250
- reason: { type: "string" },
251
- category: { type: "string", enum: ["conflict_of_interest", "insufficient_context", "out_of_scope", "other"] }
306
+ reason: { type: "string", description: "Why this reviewer is standing aside. Recorded in the audit entry." },
307
+ category: {
308
+ type: "string",
309
+ enum: ["conflict_of_interest", "insufficient_context", "out_of_scope", "other"],
310
+ description: "The kind of abstention. Recorded in the audit entry."
311
+ }
252
312
  },
253
313
  required: ["workspace", "from", "task_id", "reason"]
254
314
  },
@@ -257,13 +317,14 @@ var SCHEMAS = {
257
317
  properties: {
258
318
  workspace: WORKSPACE_ID,
259
319
  from: PARTICIPANT_URI,
260
- original_task_id: TASK_ID,
320
+ 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." },
261
321
  new_task: {
262
322
  type: "object",
323
+ description: "The successor task to open for the escalation target.",
263
324
  properties: {
264
- kind: { type: "string" },
265
- assignee: PARTICIPANT_URI,
266
- input: { type: "object", additionalProperties: true }
325
+ kind: { type: "string", description: "Task kind for the successor. Defaults to the original's kind." },
326
+ assignee: { ...PARTICIPANT_URI, description: "Who the escalation goes to. Must be a workspace member." },
327
+ 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." }
267
328
  },
268
329
  required: ["assignee"]
269
330
  }
@@ -280,15 +341,27 @@ var SCHEMAS = {
280
341
  from: PARTICIPANT_URI,
281
342
  task_id: TASK_ID,
282
343
  to: { type: "array", items: PARTICIPANT_URI, description: "Who is being asked." },
283
- question: { type: "string" },
344
+ question: { type: "string", description: "The question being put. A whisper is answered on its own, without the recipient opening the task." },
284
345
  options: {
285
346
  type: "array",
286
- items: { type: "object", properties: { id: { type: "string" }, label: { type: "string" } }, required: ["id"] },
287
- description: "Optional multiple-choice options. If present, answer_option must be one of these ids."
347
+ items: {
348
+ type: "object",
349
+ properties: {
350
+ id: { type: "string", description: "Stable identifier that an answer refers to." },
351
+ label: { type: "string", description: "What the option says to the person answering." }
352
+ },
353
+ required: ["id"]
354
+ },
355
+ description: "Multiple-choice options. When present, an answer must name one of these ids in answer_option; any other id is refused with -32022."
288
356
  },
289
- deadline_ms: { type: "integer", description: "Time-to-live in milliseconds from now." },
290
- default_if_lapsed: { description: "Value applied if the whisper lapses without an answer." },
291
- urgency: { type: "string", enum: ["low", "medium", "high"], default: "low" }
357
+ 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." },
358
+ 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." },
359
+ urgency: {
360
+ type: "string",
361
+ enum: ["low", "medium", "high"],
362
+ default: "low",
363
+ description: "How urgent the question is. Recorded and passed on to the client; it does not change the deadline or the lapse behaviour."
364
+ }
292
365
  },
293
366
  required: ["workspace", "from", "task_id", "to", "question", "deadline_ms", "default_if_lapsed"]
294
367
  },
@@ -297,10 +370,10 @@ var SCHEMAS = {
297
370
  properties: {
298
371
  workspace: WORKSPACE_ID,
299
372
  from: PARTICIPANT_URI,
300
- whisper_id: { type: "string" },
301
- answer_option: { type: "string", description: "Option id (required when the whisper has options)." },
302
- answer: { type: "string", description: "Free-text answer (when no options)." },
303
- comment: { type: "string" }
373
+ 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." },
374
+ answer_option: { type: "string", description: "The id of the chosen option. Required when the whisper carried options." },
375
+ answer: { type: "string", description: "Free-text answer, for a whisper with no options." },
376
+ comment: { type: "string", description: "Anything else the answerer wants recorded alongside the answer." }
304
377
  },
305
378
  required: ["workspace", "from", "whisper_id"]
306
379
  },
@@ -312,16 +385,16 @@ var SCHEMAS = {
312
385
  properties: {
313
386
  workspace: WORKSPACE_ID,
314
387
  from: PARTICIPANT_URI,
315
- to: { type: "array", items: PARTICIPANT_URI, description: "Deliberation participants." },
388
+ to: { type: "array", items: PARTICIPANT_URI, description: "The participants entitled to vote. A vote from anyone else is refused with -32030." },
316
389
  task_id: TASK_ID,
317
390
  rule: {
318
391
  type: "string",
319
- description: "Voting rule. Examples: any_one_approves, all_approve, quorum:N, weighted_vote:T, weighted_vote_with_veto:T."
392
+ 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."
320
393
  },
321
- question: { type: "string" },
322
- weights: { type: "object", additionalProperties: { type: "number" }, description: "Voter -> weight map (for weighted rules)." },
323
- veto: { type: "object", additionalProperties: { type: "boolean" }, description: "Voter -> can-veto map." },
324
- deadline: { type: "string" }
394
+ question: { type: "string", description: "What the group is deciding. State it so that a yea or a nay is unambiguous." },
395
+ 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." },
396
+ 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." },
397
+ 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." }
325
398
  },
326
399
  required: ["workspace", "from", "to", "rule"]
327
400
  },
@@ -330,8 +403,8 @@ var SCHEMAS = {
330
403
  properties: {
331
404
  workspace: WORKSPACE_ID,
332
405
  from: PARTICIPANT_URI,
333
- deliberation_id: { type: "string" },
334
- comment: { type: "string" }
406
+ deliberation_id: { type: "string", description: "Identifier returned by chap.deliberate.open. A closed deliberation is refused with -32032." },
407
+ 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." }
335
408
  },
336
409
  required: ["workspace", "from", "deliberation_id", "comment"]
337
410
  },
@@ -340,11 +413,11 @@ var SCHEMAS = {
340
413
  properties: {
341
414
  workspace: WORKSPACE_ID,
342
415
  from: PARTICIPANT_URI,
343
- deliberation_id: { type: "string" },
344
- vote: { type: "string", enum: ["yea", "nay", "abstain"] },
345
- weight: { type: "number" },
346
- comment: { type: "string" },
347
- veto_invoked: { type: "boolean" }
416
+ 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." },
417
+ 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." },
418
+ weight: { type: "integer", description: "Recorded with the vote. The tally uses the weights map given at chap.deliberate.open, not this value." },
419
+ comment: { type: "string", description: "Why the vote went this way. Recorded with it." },
420
+ 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." }
348
421
  },
349
422
  required: ["workspace", "from", "deliberation_id", "vote"]
350
423
  },
@@ -353,7 +426,7 @@ var SCHEMAS = {
353
426
  properties: {
354
427
  workspace: WORKSPACE_ID,
355
428
  from: PARTICIPANT_URI,
356
- deliberation_id: { type: "string" }
429
+ 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." }
357
430
  },
358
431
  required: ["workspace", "from", "deliberation_id"]
359
432
  },
@@ -365,23 +438,24 @@ var SCHEMAS = {
365
438
  properties: {
366
439
  workspace: WORKSPACE_ID,
367
440
  from: PARTICIPANT_URI,
368
- to: { type: "string", description: "Recipient (URI or 'group:...')." },
441
+ 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." },
369
442
  tasks: {
370
443
  type: "array",
444
+ 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.",
371
445
  items: {
372
446
  type: "object",
373
447
  properties: {
374
448
  task_id: TASK_ID,
375
- title: { type: "string" },
376
- status_summary: { type: "string" },
377
- next_action: { type: "string" },
378
- blockers: { type: "array", items: { type: "string" } }
449
+ title: { type: "string", description: "Short label for the task." },
450
+ status_summary: { type: "string", description: "Where the work has reached, and what has already been tried." },
451
+ next_action: { type: "string", description: "What the recipient should do first." },
452
+ blockers: { type: "array", items: { type: "string" }, description: "What is preventing progress, if anything." }
379
453
  },
380
454
  required: ["task_id"]
381
455
  }
382
456
  },
383
- summary: { type: "string" },
384
- context_links: { type: "array", items: { type: "string" } }
457
+ summary: { type: "string", description: "Covering note for the handover as a whole, above the per-task detail." },
458
+ context_links: { type: "array", items: { type: "string" }, description: "URLs to threads, tickets or documents the recipient will need." }
385
459
  },
386
460
  required: ["workspace", "from", "to", "tasks"]
387
461
  },
@@ -390,9 +464,9 @@ var SCHEMAS = {
390
464
  properties: {
391
465
  workspace: WORKSPACE_ID,
392
466
  from: PARTICIPANT_URI,
393
- handoff_id: { type: "string" },
394
- accepted_task_ids: { type: "array", items: TASK_ID, description: "If omitted, all proposed tasks are accepted." },
395
- comment: { type: "string" }
467
+ handoff_id: { type: "string", description: "Identifier returned by chap.handoff.propose. A handoff already accepted or declined is refused with -32051." },
468
+ accepted_task_ids: { type: "array", items: TASK_ID, description: "Which of the proposed tasks are being accepted. If omitted, all of them are." },
469
+ comment: { type: "string", description: "Anything the recipient wants recorded when taking the work on." }
396
470
  },
397
471
  required: ["workspace", "from", "handoff_id"]
398
472
  },
@@ -401,9 +475,9 @@ var SCHEMAS = {
401
475
  properties: {
402
476
  workspace: WORKSPACE_ID,
403
477
  from: PARTICIPANT_URI,
404
- handoff_id: { type: "string" },
405
- reason: { type: "string" },
406
- suggested_target: PARTICIPANT_URI
478
+ handoff_id: { type: "string", description: "Identifier returned by chap.handoff.propose. A handoff already accepted or declined is refused with -32051." },
479
+ reason: { type: "string", description: "Why the handover is refused. Recorded so the proposer can route it elsewhere." },
480
+ suggested_target: { ...PARTICIPANT_URI, description: "Who should take it instead, if the decliner knows." }
407
481
  },
408
482
  required: ["workspace", "from", "handoff_id"]
409
483
  },
@@ -415,11 +489,20 @@ var SCHEMAS = {
415
489
  properties: {
416
490
  workspace: WORKSPACE_ID,
417
491
  from: PARTICIPANT_URI,
418
- 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 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."
497
+ },
419
498
  task_id: TASK_ID,
420
- participant_uri: PARTICIPANT_URI,
421
- in_flight_policy: { type: "string", enum: ["allow_to_complete", "interrupt"] },
422
- reason: { type: "string" }
499
+ participant_uri: { ...PARTICIPANT_URI, description: "Whose work to pause, when scope is 'participant'. Must be a workspace member." },
500
+ in_flight_policy: {
501
+ type: "string",
502
+ enum: ["allow_to_complete", "interrupt"],
503
+ 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."
504
+ },
505
+ reason: { type: "string", description: "Why the pause was applied. Recorded in the audit entry." }
423
506
  },
424
507
  required: ["workspace", "from"]
425
508
  },
@@ -428,9 +511,14 @@ var SCHEMAS = {
428
511
  properties: {
429
512
  workspace: WORKSPACE_ID,
430
513
  from: PARTICIPANT_URI,
431
- scope: { type: "string", enum: ["task", "participant", "workspace"], default: "task" },
514
+ scope: {
515
+ type: "string",
516
+ enum: ["task", "participant", "workspace"],
517
+ default: "task",
518
+ description: "What the resume applies to. 'task' returns a paused task to 'in_progress'; 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."
519
+ },
432
520
  task_id: TASK_ID,
433
- participant_uri: PARTICIPANT_URI
521
+ participant_uri: { ...PARTICIPANT_URI, description: "Whose work to resume, when scope is 'participant'. Must be a workspace member." }
434
522
  },
435
523
  required: ["workspace", "from"]
436
524
  },
@@ -439,8 +527,8 @@ var SCHEMAS = {
439
527
  properties: {
440
528
  workspace: WORKSPACE_ID,
441
529
  from: PARTICIPANT_URI,
442
- task_id: TASK_ID,
443
- reason: { type: "string" }
530
+ task_id: { ...TASK_ID, description: "The task to cancel. A task that is completed, declined, cancelled or superseded is refused with -32061." },
531
+ reason: { type: "string", description: "Why the task was cancelled. Recorded in the audit entry." }
444
532
  },
445
533
  required: ["workspace", "from", "task_id"]
446
534
  },
@@ -449,8 +537,8 @@ var SCHEMAS = {
449
537
  properties: {
450
538
  workspace: WORKSPACE_ID,
451
539
  from: PARTICIPANT_URI,
452
- label: { type: "string" },
453
- include: { type: "array", items: { type: "string" }, description: "Aspects to snapshot, e.g. ['members', 'open_tasks', 'mode_ceiling']." }
540
+ 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." },
541
+ 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." }
454
542
  },
455
543
  required: ["workspace", "from"]
456
544
  },
@@ -459,9 +547,9 @@ var SCHEMAS = {
459
547
  properties: {
460
548
  workspace: WORKSPACE_ID,
461
549
  from: PARTICIPANT_URI,
462
- to_snapshot_artefact_id: { type: "string" },
463
- what_to_restore: { type: "array", items: { type: "string" } },
464
- reason: { type: "string" }
550
+ to_snapshot_artefact_id: { type: "string", description: "Artefact id returned by chap.control.snapshot. An id with no matching snapshot is refused with -32062." },
551
+ 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." },
552
+ reason: { type: "string", description: "Why the rollback was performed. The rollback is itself an audit entry; earlier entries are not rewritten." }
465
553
  },
466
554
  required: ["workspace", "from", "to_snapshot_artefact_id"]
467
555
  },
@@ -470,17 +558,18 @@ var SCHEMAS = {
470
558
  properties: {
471
559
  workspace: WORKSPACE_ID,
472
560
  from: PARTICIPANT_URI,
473
- task_id: TASK_ID,
561
+ task_id: { ...TASK_ID, description: "The task being replaced. It moves to 'superseded' and is linked to the successor rather than deleted." },
474
562
  successor_task: {
475
563
  type: "object",
564
+ description: "The replacement task.",
476
565
  properties: {
477
- kind: { type: "string" },
478
- assignee: PARTICIPANT_URI,
479
- input: { type: "object", additionalProperties: true }
566
+ kind: { type: "string", description: "Task kind for the successor. Required." },
567
+ assignee: { ...PARTICIPANT_URI, description: "Who takes the replacement on. Defaults to the superseded task's assignee, and must be a workspace member." },
568
+ input: { type: "object", additionalProperties: true, description: "Input payload for the successor. Defaults to an empty object." }
480
569
  },
481
570
  required: ["kind"]
482
571
  },
483
- reason: { type: "string" }
572
+ reason: { type: "string", description: "Why the original is being replaced. Recorded in the audit entry." }
484
573
  },
485
574
  required: ["workspace", "from", "task_id", "successor_task"]
486
575
  },
@@ -489,8 +578,12 @@ var SCHEMAS = {
489
578
  properties: {
490
579
  workspace: WORKSPACE_ID,
491
580
  from: PARTICIPANT_URI,
492
- new_ceiling: { type: "string", enum: ["shadow", "trial", "production"] },
493
- reason: { type: "string" }
581
+ new_ceiling: {
582
+ type: "string",
583
+ enum: ["shadow", "trial", "production"],
584
+ 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."
585
+ },
586
+ reason: { type: "string", description: "Why the ceiling is being changed. Recorded in the audit entry." }
494
587
  },
495
588
  required: ["workspace", "from", "new_ceiling"]
496
589
  },
@@ -503,7 +596,7 @@ var SCHEMAS = {
503
596
  workspace: WORKSPACE_ID,
504
597
  from: PARTICIPANT_URI,
505
598
  task_id: TASK_ID,
506
- candidates: { type: "array", items: PARTICIPANT_URI, description: "Candidate assignees." }
599
+ candidates: { type: "array", items: PARTICIPANT_URI, description: "Candidate assignees. An empty list is refused with -32513. Candidates that are not workspace members are dropped, and if none remain the call is refused with -32510. The default policy selects the first remaining candidate; an operator-supplied routing policy may select on any basis." }
507
600
  },
508
601
  required: ["workspace", "from", "task_id", "candidates"]
509
602
  },
@@ -515,7 +608,7 @@ var SCHEMAS = {
515
608
  task_id: TASK_ID,
516
609
  artefact_routing_hints: {
517
610
  type: "object",
518
- description: "Per-artefact signals like confidence, model_id, cost_consumed_usd.",
611
+ 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".`,
519
612
  additionalProperties: true
520
613
  }
521
614
  },
@@ -527,7 +620,7 @@ var SCHEMAS = {
527
620
  workspace: WORKSPACE_ID,
528
621
  from: PARTICIPANT_URI,
529
622
  task_id: TASK_ID,
530
- default_escalation_target: PARTICIPANT_URI
623
+ 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." }
531
624
  },
532
625
  required: ["workspace", "from", "task_id"]
533
626
  },
@@ -539,8 +632,8 @@ var SCHEMAS = {
539
632
  properties: {
540
633
  workspace: WORKSPACE_ID,
541
634
  from: PARTICIPANT_URI,
542
- old_kid: { type: "string" },
543
- new_jwk: { type: "object", additionalProperties: true }
635
+ 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." },
636
+ 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." }
544
637
  },
545
638
  required: ["workspace", "from", "old_kid", "new_jwk"]
546
639
  },
@@ -549,9 +642,9 @@ var SCHEMAS = {
549
642
  properties: {
550
643
  workspace: WORKSPACE_ID,
551
644
  from: PARTICIPANT_URI,
552
- target_uri: PARTICIPANT_URI,
553
- kid: { type: "string" },
554
- reason: { type: "string" }
645
+ 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." },
646
+ 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." },
647
+ reason: { type: "string", description: "Why the key was revoked, e.g. 'laptop lost'. Recorded on the key and in the audit entry." }
555
648
  },
556
649
  required: ["workspace", "from", "target_uri", "kid"]
557
650
  },
@@ -565,12 +658,13 @@ var SCHEMAS = {
565
658
  from: PARTICIPANT_URI,
566
659
  range: {
567
660
  type: "object",
661
+ description: "Sequence window to anchor. Omit to submit the whole chain.",
568
662
  properties: {
569
- from_seq: { type: "integer" },
570
- to_seq: { type: "integer" }
663
+ from_seq: { type: "integer", description: "Start sequence number, inclusive." },
664
+ to_seq: { type: "integer", description: "End sequence number, exclusive." }
571
665
  }
572
666
  },
573
- issuer: { type: "string" }
667
+ 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." }
574
668
  },
575
669
  required: ["workspace"]
576
670
  },
@@ -579,7 +673,7 @@ var SCHEMAS = {
579
673
  properties: {
580
674
  workspace: WORKSPACE_ID,
581
675
  from: PARTICIPANT_URI,
582
- receipt: { type: "object", additionalProperties: true }
676
+ 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." }
583
677
  },
584
678
  required: ["workspace", "receipt"]
585
679
  },