Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions schemas/public_api/api.intents.create.request.v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,58 @@
"type": "string",
"maxLength": 2000
},
"task_type": {
"type": "string",
"description": "Semantic type of the human task. Determines the expected interaction pattern.",
"enum": [
"approval",
"review",
"clarification",
"provide_data",
"attach_file",
"manual_action",
"confirmation",
"validate_real_world",
"validate_output",
"assignment",
"delegation",
"reroute",
"override",
"escalate"
]
},
"allowed_outcomes": {
"type": "array",
"description": "Permitted values for outcome in task_result. If set, resume will be rejected if outcome is not in this list.",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"minItems": 1,
"maxItems": 20
},
"required_comment": {
"type": "boolean",
"description": "When true, task_result.comment must be non-empty for the resume to be accepted.",
"default": false
},
"assignees": {
"type": "array",
"description": "Email addresses or org_member_ids of humans who may respond to this task.",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 383
},
"minItems": 1,
"maxItems": 20
},
"evidence_required": {
"type": "boolean",
"description": "When true, task_result must include a non-empty data.evidence field.",
"default": false
},
"form_schema": {
"type": "object",
"description": "JSON Schema (draft 2020-12) for validating task_result submitted by the human.",
Expand Down
11 changes: 11 additions & 0 deletions schemas/public_api/api.intents.resolve.response.v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@
null
]
},
"pending_with": {
"type": [
"object",
"null"
],
"properties": {
"type": { "type": "string" },
"ref": { "type": "string" },
"name": { "type": "string" }
}
},
"handler": {
"type": [
"string",
Expand Down
32 changes: 32 additions & 0 deletions tests/test_schema_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,38 @@ def test_human_task_field_present(self):
def test_defs_has_human_task_spec(self):
assert "HumanTaskSpec" in self.schema.get("$defs", {})

def test_human_task_spec_has_task_type(self):
spec = self.schema["$defs"]["HumanTaskSpec"]["properties"]
assert "task_type" in spec
assert spec["task_type"]["type"] == "string"
assert "approval" in spec["task_type"]["enum"]

def test_human_task_spec_task_type_includes_v1_priorities(self):
task_types = self.schema["$defs"]["HumanTaskSpec"]["properties"]["task_type"]["enum"]
for t in ["approval", "review", "clarification", "manual_action", "confirmation",
"assignment", "override"]:
assert t in task_types, f"Missing v1 priority task type: {t}"

def test_human_task_spec_has_allowed_outcomes(self):
spec = self.schema["$defs"]["HumanTaskSpec"]["properties"]
assert "allowed_outcomes" in spec
assert spec["allowed_outcomes"]["type"] == "array"

def test_human_task_spec_has_required_comment(self):
spec = self.schema["$defs"]["HumanTaskSpec"]["properties"]
assert "required_comment" in spec
assert spec["required_comment"]["type"] == "boolean"

def test_human_task_spec_has_assignees(self):
spec = self.schema["$defs"]["HumanTaskSpec"]["properties"]
assert "assignees" in spec
assert spec["assignees"]["type"] == "array"

def test_human_task_spec_has_evidence_required(self):
spec = self.schema["$defs"]["HumanTaskSpec"]["properties"]
assert "evidence_required" in spec
assert spec["evidence_required"]["type"] == "boolean"


# ---------------------------------------------------------------------------
# Group 4: api.intents.create.response — TIMED_OUT in status
Expand Down
Loading