register_task_schema
Registers an immutable JSON Schema that defines the required result shape for task completion, enabling validation of agent-submitted completion reports.
Instructions
Register a reusable, immutable JSON Schema that gates task completion (v2.10 — safety).
When to use: define the PROOF shape a completing agent must satisfy — e.g. a completion report requiring {ci_status:'green', tests_passed, summary}. A requester attaches the schema id to a task via post_task's schema_id; the assignee's update_task(action='complete', result=...) is then validated against it. Built-ins ship_pong_v1 / audit_verdict_v1 / merge_ready_v1 are auto-registered on init.
Behavior: the document is meta-validated + hardened (no $ref/$dynamicRef/$recursiveRef/$data) BEFORE ajv compiles it (a registered schema is compiled, so it is an attack surface). Schemas are IMMUTABLE — re-registering an id is refused; bump the version id. Auth: requires the manage_schemas capability.
Returns: { success: true, id, created_by, created_at, note }.
Errors: SCHEMA_MISMATCH (invalid/forbidden schema document), ALREADY_EXISTS (id already registered), CAP_DENIED, AUTH_FAILED, VALIDATION.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Schema id, name-as-version (e.g. 'ship_pong_v1'). Immutable once registered. | |
| agent_name | Yes | Registering agent name | |
| agent_token | No | Your agent token (from register_agent response). Optional here — also resolvable from RELAY_AGENT_TOKEN env or X-Agent-Token header. | |
| json_schema | Yes | The JSON Schema document (object). Meta-validated + hardened before compile; $ref/$dynamicRef/$recursiveRef/$data are rejected. |