CHAP Coordinator

v0.3.5
io.github.BrightbeamAI/chap Checked 2 hours ago Published 22 days ago

Auditable records of human decisions over AI agent work.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

chap.workspace.describe Describe workspace

Report the current state of a workspace: its members, enabled profiles, audit length, and task and override counts.

ParameterTypeDescription
workspace *stringWorkspace identifier, e.g. 'wsp_techcorp_support'.

chap.task.create Create task

Create a task: a unit of work assigned to one participant. Set review_required to make completion depend on a reviewer decision rather than on the assignee. Returns a task_id that the rest of the lifecycle takes. Supplying idempotency_key is what makes a retry safe: a repeat carrying a key already seen returns the original task, while a repeat without one creates a second task. Assigning to a paused member is refused.

ParameterTypeDescription
assignee *stringWho the task is assigned to. Must be a workspace member, and must not be paused: assigning to a paused member is refused with -32063.
input *objectTask-specific input payload.
kind *stringTask kind, e.g. 'draft_response' or 'review'. Free text; the coordinator records it without interpreting it.
workspace *stringWorkspace identifier, e.g. 'wsp_techcorp_support'.
deadlinestringWhen the task is due, as an ISO 8601 timestamp. Recorded on the task; the coordinator does not act on it.
fromstringThis server acts as agent:assistant: it fills this in, and refuses a call that names anyone else.
idempotency_keystringCaller-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 ke…
modestringMode for this task, defaulting to the workspace mode. A mode above the workspace ceiling is refused with -32040.
review_requiredbooleanWhen 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…
routing_hintsobjectSignals 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…

chap.task.update Change task state

Move a task to a new state. Only the transitions in the specification's lifecycle table are accepted, and a task that requires review cannot be completed here. A task whose review no decision has closed, or a successor that carries one on, is not declined (-32602).

ParameterTypeDescription
state *stringThe 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 ch…
task_id *stringTask identifier returned by chap.task.create.
workspace *stringWorkspace identifier, e.g. 'wsp_techcorp_support'.
fromstringThis server acts as agent:assistant: it fills this in, and refuses a call that names anyone else.
progress_notestringShort note on what changed, kept in the task's history.

chap.task.complete Submit task output

Submit a task's output. A task that requires review does not complete: the output is held as the artefact under review, the task moves to review_requested, and a reviewer decision completes it. Any other task completes immediately.

ParameterTypeDescription
task_id *stringTask identifier returned by chap.task.create.
workspace *stringWorkspace identifier, e.g. 'wsp_techcorp_support'.
confidencestringSelf-reported confidence in the output, between 0 and 1. Written as a decimal string, e.g. "0.86". CHAP canonicalisation accepts integers only, so a JSON number with a fractional part is refused with…
fromstringThis server acts as agent:assistant: it fills this in, and refuses a call that names anyone else.
outputThe task's output artefact. 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.
routing_hintsobjectSignals 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…

chap.audit.read Read audit log

Read entries from a workspace's audit log, optionally within a sequence range and filtered by method, sender, task or outcome. This is the query surface for everything the workspace has recorded, decisions and overrides included. An accepted call is under 'envelope'. A refused attempt the coordinator recorded, such as a decision by someone the review was not addressed to, is under 'request' with an 'outcome' giving the error code, and it did not take effect. Reads only: it records nothing, so it never appears in its own output. Entries come back as recorded, without aggregation, so grouping th…

ParameterTypeDescription
workspace *stringWorkspace identifier, e.g. 'wsp_techcorp_support'.
filterobjectNarrows the entries returned. Conditions combine with AND, and are applied within the sequence window rather than before it.
rangeobjectSequence window to return. Omit for the whole log.

chap.review.acknowledge Acknowledge review

Say that this reviewer has begun the open review on a task, before deciding it. The call is recorded, so the audit log shows when each reviewer took the review up as well as when they decided. It decides nothing: the review stays open and the acknowledgement counts towards no rule. Only someone who may decide the review may send it, and anyone else is refused with -32011. A task with no open review is refused with -32010, and a second acknowledgement from the same reviewer in the same round with -32602. Returns requested_at, the time the round opened, which names it.

ParameterTypeDescription
task_id *stringTask identifier returned by chap.task.create.
workspace *stringWorkspace identifier, e.g. 'wsp_techcorp_support'.
fromstringThis server acts as agent:assistant: it fills this in, and refuses a call that names anyone else.

chap.decide.approve Approve

Approve the artefact under review as it stands. Only a reviewer the review was addressed to may decide, and anyone else is refused with -32011. The task completes once the review's rule is satisfied, so under all_approve or quorum:N an approval may leave the review open awaiting others. Use chap.decide.override instead to accept a corrected version.

ParameterTypeDescription
task_id *stringTask identifier returned by chap.task.create.
workspace *stringWorkspace identifier, e.g. 'wsp_techcorp_support'.
approved_artefact_digeststringOptional. 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 wi…
commentstringThe reviewer's note on this decision. Recorded in the audit entry for the decision.
fromstringThis server acts as agent:assistant: it fills this in, and refuses a call that names anyone else.
tagsarrayWorkspace-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.

chap.decide.reject Reject

Reject the artefact under review. The task is declined, or returns to in_progress when request_revision is set, which is the choice between ending the work and sending it back. Only a reviewer the review was addressed to may decide. Use chap.decide.override instead to correct the artefact and accept it rather than refuse it.

ParameterTypeDescription
task_id *stringTask identifier returned by chap.task.create.
workspace *stringWorkspace identifier, e.g. 'wsp_techcorp_support'.
approved_artefact_digeststringOptional. 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 wi…
commentstringThe reviewer's note on this decision. Recorded in the audit entry for the decision.
fromstringThis server acts as agent:assistant: it fills this in, and refuses a call that names anyone else.
request_revisionbooleanWhen true the task returns to 'in_progress' rather than 'declined', so the assignee can revise and resubmit.
tagsarrayWorkspace-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.

chap.decide.override Override with a correction

Correct the artefact under review with an RFC 6902 JSON Patch and accept the result. The patch, the rationale and any tags are recorded together, so the audit log holds what was changed and why, rather than only that the work was not accepted as written.

ParameterTypeDescription
diff *arrayRFC 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.
rationale *stringWhy the correction was made. Required on every override and recorded in the audit entry, since the diff shows what changed but not why.
task_id *stringTask identifier returned by chap.task.create.
workspace *stringWorkspace identifier, e.g. 'wsp_techcorp_support'.
approved_artefact_digeststringOptional. 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 wi…
fromstringThis server acts as agent:assistant: it fills this in, and refuses a call that names anyone else.
intent_preservedbooleanTrue when the edit refines the decision the draft was making, false when it substitutes a different one. Recorded in the audit entry.
logical_idstringCaller-chosen identifier for the item being decided, stable across revisions and overrides of the same underlying content. Recorded in the audit entry.
policy_refsarrayIdentifiers of the policies or guidelines this correction applies, e.g. ['policy:no-delivery-promises']. Recorded in the audit entry.
tagsarrayWorkspace-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.

chap.whisper.ask Ask a whisper

Put one question to one or more participants, with a deadline and a default. If the deadline passes unanswered the default applies, so a task is never blocked waiting on a reply.

ParameterTypeDescription
deadline_ms *integerHow long the whisper stays open, in milliseconds from now. Once it passes, the whisper lapses and default_if_lapsed is applied.
default_if_lapsed *The value applied if the deadline passes with no answer. Required, so that a lapsed whisper still has a defined outcome.
question *stringThe question being put. A whisper is answered on its own, without the recipient opening the task.
task_id *stringTask identifier returned by chap.task.create.
to *arrayWho is being asked.
workspace *stringWorkspace identifier, e.g. 'wsp_techcorp_support'.
fromstringThis server acts as agent:assistant: it fills this in, and refuses a call that names anyone else.
optionsarrayMultiple-choice options. When present, an answer must name one of these ids in answer_option; any other id is refused with -32022.
urgencystringHow urgent the question is. Recorded and passed on to the client; it does not change the deadline or the lapse behaviour.

chap.audit.verify_chain Verify audit chain

Replay a workspace's prev-hash chain. Only status verified with ok true means the log was checked and is intact. Status not_evaluated with ok false means part of the log was never checked, so its integrity is unknown and must not be reported as verified; entries_unchecked says how much. An error means the chain is broken or absent.

ParameterTypeDescription
workspace *stringWorkspace identifier, e.g. 'wsp_techcorp_support'.
fromstringThis server acts as agent:assistant: it fills this in, and refuses a call that names anyone else.