feat: MACP Phase 1 — Core Protocol Implementation (#9)

This commit was merged in pull request #9.
This commit is contained in:
2026-03-28 01:39:26 +00:00
parent 24496cea01
commit 28392914a7
19 changed files with 1724 additions and 53 deletions

View File

@@ -22,8 +22,11 @@
"task.assigned",
"task.started",
"task.progress",
"task.gated",
"task.completed",
"task.failed",
"task.escalated",
"task.retry.scheduled",
"rail.check.started",
"rail.check.passed",
"rail.check.failed"
@@ -37,8 +40,10 @@
"enum": [
"pending",
"running",
"gated",
"completed",
"failed"
"failed",
"escalated"
]
},
"timestamp": {
@@ -50,7 +55,8 @@
"enum": [
"controller",
"worker",
"quality-gate"
"quality-gate",
"dispatcher"
]
},
"message": {

View File

@@ -0,0 +1,119 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://mosaicstack.dev/schemas/orchestrator/result.schema.json",
"title": "MACP Task Result",
"type": "object",
"required": [
"task_id",
"status",
"completed_at"
],
"properties": {
"task_id": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"completed",
"failed",
"escalated"
]
},
"completed_at": {
"type": "string",
"format": "date-time"
},
"failed_at": {
"type": [
"string",
"null"
],
"format": "date-time"
},
"exit_code": {
"type": [
"integer",
"null"
]
},
"attempt": {
"type": "integer"
},
"max_attempts": {
"type": "integer"
},
"runtime": {
"type": "string"
},
"dispatch": {
"type": "string"
},
"worktree": {
"type": [
"string",
"null"
]
},
"branch": {
"type": [
"string",
"null"
]
},
"pr": {
"type": [
"string",
"null"
]
},
"summary": {
"type": "string",
"description": "Human-readable summary of what the worker did"
},
"files_changed": {
"type": "array",
"items": {
"type": "string"
}
},
"gate_results": {
"type": "array",
"items": {
"type": "object",
"properties": {
"command": {
"type": "string"
},
"exit_code": {
"type": "integer"
},
"type": {
"type": "string",
"enum": [
"mechanical",
"ai-review",
"ci-pipeline"
]
}
}
}
},
"error": {
"type": [
"string",
"null"
]
},
"escalation_reason": {
"type": [
"string",
"null"
]
},
"metadata": {
"type": "object"
}
},
"additionalProperties": true
}

View File

@@ -23,14 +23,85 @@
"enum": [
"pending",
"running",
"gated",
"completed",
"failed"
"failed",
"escalated"
]
},
"type": {
"type": "string",
"enum": [
"coding",
"deploy",
"research",
"review",
"documentation",
"infrastructure"
],
"description": "Task type - determines dispatch strategy and gate requirements"
},
"dispatch": {
"type": "string",
"enum": [
"yolo",
"acp",
"exec"
],
"description": "Execution backend: yolo=mosaic yolo (full system), acp=OpenClaw sessions_spawn (sandboxed), exec=direct shell"
},
"runtime": {
"type": "string",
"description": "Preferred worker runtime, e.g. codex, claude, opencode"
},
"worktree": {
"type": "string",
"description": "Path to git worktree for this task, e.g. ~/src/repo-worktrees/task-042"
},
"branch": {
"type": "string",
"description": "Git branch name for this task"
},
"brief_path": {
"type": "string",
"description": "Path to markdown task brief relative to repo root"
},
"result_path": {
"type": "string",
"description": "Path to JSON result file relative to .mosaic/orchestrator/"
},
"issue": {
"type": "string",
"description": "Issue reference (e.g. #42)"
},
"pr": {
"type": [
"string",
"null"
],
"description": "PR number/URL once opened"
},
"depends_on": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of task IDs this task depends on"
},
"max_attempts": {
"type": "integer",
"minimum": 1,
"default": 1
},
"attempts": {
"type": "integer",
"minimum": 0,
"default": 0
},
"timeout_seconds": {
"type": "integer",
"description": "Override default timeout for this task"
},
"command": {
"type": "string",
"description": "Worker command to execute for this task"