va-agent-protocol 0.1.0
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/LICENSE +21 -0
- package/README.md +558 -0
- package/bin/va-orchestrate.mjs +153 -0
- package/dist/adapter/agent-adapter.d.ts +79 -0
- package/dist/adapter/agent-adapter.d.ts.map +1 -0
- package/dist/adapter/agent-adapter.js +36 -0
- package/dist/adapter/agent-adapter.js.map +1 -0
- package/dist/adapter/codex-adapter.d.ts +54 -0
- package/dist/adapter/codex-adapter.d.ts.map +1 -0
- package/dist/adapter/codex-adapter.js +409 -0
- package/dist/adapter/codex-adapter.js.map +1 -0
- package/dist/adapter/va-auto-pilot-adapter.d.ts +51 -0
- package/dist/adapter/va-auto-pilot-adapter.d.ts.map +1 -0
- package/dist/adapter/va-auto-pilot-adapter.js +275 -0
- package/dist/adapter/va-auto-pilot-adapter.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestrator/orchestrator.d.ts +101 -0
- package/dist/orchestrator/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/orchestrator.js +452 -0
- package/dist/orchestrator/orchestrator.js.map +1 -0
- package/dist/orchestrator/registry.d.ts +39 -0
- package/dist/orchestrator/registry.d.ts.map +1 -0
- package/dist/orchestrator/registry.js +62 -0
- package/dist/orchestrator/registry.js.map +1 -0
- package/dist/orchestrator/scheduler.d.ts +66 -0
- package/dist/orchestrator/scheduler.d.ts.map +1 -0
- package/dist/orchestrator/scheduler.js +155 -0
- package/dist/orchestrator/scheduler.js.map +1 -0
- package/dist/test/orchestrator-enqueue.test.d.ts +2 -0
- package/dist/test/orchestrator-enqueue.test.d.ts.map +1 -0
- package/dist/test/orchestrator-enqueue.test.js +64 -0
- package/dist/test/orchestrator-enqueue.test.js.map +1 -0
- package/dist/test/orchestrator-lifecycle.test.d.ts +2 -0
- package/dist/test/orchestrator-lifecycle.test.d.ts.map +1 -0
- package/dist/test/orchestrator-lifecycle.test.js +227 -0
- package/dist/test/orchestrator-lifecycle.test.js.map +1 -0
- package/dist/test/scheduler.test.d.ts +2 -0
- package/dist/test/scheduler.test.d.ts.map +1 -0
- package/dist/test/scheduler.test.js +140 -0
- package/dist/test/scheduler.test.js.map +1 -0
- package/dist/types/index.d.ts +209 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +45 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/logger.d.ts +17 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +21 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +61 -0
- package/schemas/agent-capability.schema.json +99 -0
- package/schemas/evidence.schema.json +201 -0
- package/schemas/lifecycle.schema.json +80 -0
- package/schemas/message.schema.json +181 -0
- package/schemas/task-unit.schema.json +137 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://va-agent-protocol.dev/schemas/evidence.schema.json",
|
|
4
|
+
"title": "Evidence",
|
|
5
|
+
"description": "Proof of task completion. CLI-first: evidence must be machine-verifiable, not self-certified.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["taskId", "status"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"taskId": { "type": "string" },
|
|
11
|
+
"status": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"enum": ["completed", "failed", "blocked"]
|
|
14
|
+
},
|
|
15
|
+
"artifacts": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"items": { "$ref": "#/$defs/Artifact" },
|
|
18
|
+
"default": [],
|
|
19
|
+
"description": "What was produced."
|
|
20
|
+
},
|
|
21
|
+
"gateResults": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": { "$ref": "#/$defs/GateResult" },
|
|
24
|
+
"default": [],
|
|
25
|
+
"description": "Results of quality gate commands."
|
|
26
|
+
},
|
|
27
|
+
"verification": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "Human-readable summary of what was verified and how."
|
|
30
|
+
},
|
|
31
|
+
"failureDetail": {
|
|
32
|
+
"$ref": "#/$defs/FailureDetail",
|
|
33
|
+
"description": "Present when status is 'failed'. Structured failure metadata for pitfall learning."
|
|
34
|
+
},
|
|
35
|
+
"blockReason": {
|
|
36
|
+
"$ref": "#/$defs/BlockReason",
|
|
37
|
+
"description": "Present when status is 'blocked'. What external input is needed."
|
|
38
|
+
},
|
|
39
|
+
"outputs": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"additionalProperties": true,
|
|
42
|
+
"description": "Structured outputs produced by this task. Keys should match outputContract.keys if declared. Downstream tasks can reference these via inputs[].fromTask."
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"$defs": {
|
|
46
|
+
"Artifact": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"required": ["type", "description"],
|
|
49
|
+
"additionalProperties": false,
|
|
50
|
+
"properties": {
|
|
51
|
+
"type": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"enum": ["file", "commit", "report", "diff", "log"],
|
|
54
|
+
"description": "Kind of artifact produced."
|
|
55
|
+
},
|
|
56
|
+
"path": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"description": "File path or commit SHA."
|
|
59
|
+
},
|
|
60
|
+
"description": { "type": "string" }
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"GateResult": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"required": ["gate", "passed"],
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"properties": {
|
|
68
|
+
"gate": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"description": "Gate name (e.g., 'typecheck', 'lint', 'unit-tests', 'style-consistency')."
|
|
71
|
+
},
|
|
72
|
+
"type": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"enum": ["command", "model-evaluation"],
|
|
75
|
+
"default": "command",
|
|
76
|
+
"description": "Gate type. 'command' = CLI command with exit code. 'model-evaluation' = agent/model-as-judge with score."
|
|
77
|
+
},
|
|
78
|
+
"command": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"description": "Exact CLI command that was run. Required for type='command'."
|
|
81
|
+
},
|
|
82
|
+
"exitCode": {
|
|
83
|
+
"type": "integer",
|
|
84
|
+
"description": "Process exit code. For type='command'."
|
|
85
|
+
},
|
|
86
|
+
"passed": {
|
|
87
|
+
"type": "boolean",
|
|
88
|
+
"description": "Whether the gate passed."
|
|
89
|
+
},
|
|
90
|
+
"output": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"description": "Captured stdout/stderr (may be truncated)."
|
|
93
|
+
},
|
|
94
|
+
"durationMs": {
|
|
95
|
+
"type": "integer",
|
|
96
|
+
"description": "How long the gate took to run."
|
|
97
|
+
},
|
|
98
|
+
"evaluator": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"description": "Agent or model ID that performed the evaluation. For type='model-evaluation'."
|
|
101
|
+
},
|
|
102
|
+
"score": {
|
|
103
|
+
"type": "number",
|
|
104
|
+
"minimum": 0,
|
|
105
|
+
"maximum": 1,
|
|
106
|
+
"description": "Evaluation score (0.0–1.0). For type='model-evaluation'."
|
|
107
|
+
},
|
|
108
|
+
"threshold": {
|
|
109
|
+
"type": "number",
|
|
110
|
+
"minimum": 0,
|
|
111
|
+
"maximum": 1,
|
|
112
|
+
"description": "Score threshold for passing. score >= threshold → passed."
|
|
113
|
+
},
|
|
114
|
+
"softThreshold": {
|
|
115
|
+
"type": "number",
|
|
116
|
+
"minimum": 0,
|
|
117
|
+
"maximum": 1,
|
|
118
|
+
"description": "Score between softThreshold and threshold is a 'warning' — not a hard fail. Below softThreshold is a hard fail. Orchestrator can route warnings to blocked (human review) instead of failed (retry)."
|
|
119
|
+
},
|
|
120
|
+
"severity": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"enum": ["error", "warning"],
|
|
123
|
+
"description": "When passed=false: 'error' means hard fail (retry), 'warning' means soft fail (consider blocked for human review). Orchestrator decides based on softThreshold."
|
|
124
|
+
},
|
|
125
|
+
"rationale": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"description": "Human-readable explanation of the evaluation result. For type='model-evaluation'."
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"FailureDetail": {
|
|
132
|
+
"type": "object",
|
|
133
|
+
"required": ["failureType", "attempted", "hypothesis"],
|
|
134
|
+
"additionalProperties": false,
|
|
135
|
+
"properties": {
|
|
136
|
+
"failureType": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"enum": ["gate", "acceptance", "review", "timeout", "crash", "unknown"]
|
|
139
|
+
},
|
|
140
|
+
"attempted": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"description": "What was tried."
|
|
143
|
+
},
|
|
144
|
+
"hypothesis": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"description": "Why it probably failed."
|
|
147
|
+
},
|
|
148
|
+
"missingContext": {
|
|
149
|
+
"type": "string",
|
|
150
|
+
"description": "What information was absent."
|
|
151
|
+
},
|
|
152
|
+
"dimensions": {
|
|
153
|
+
"type": "object",
|
|
154
|
+
"additionalProperties": {
|
|
155
|
+
"$ref": "#/$defs/DimensionFeedback"
|
|
156
|
+
},
|
|
157
|
+
"description": "Per-dimension breakdown of the failure. Each key is a dimension name (e.g., 'vocabulary', 'tone', 'structure'). Enables targeted retry — the next attempt can focus on the specific dimensions that failed."
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"DimensionFeedback": {
|
|
162
|
+
"type": "object",
|
|
163
|
+
"required": ["status"],
|
|
164
|
+
"additionalProperties": false,
|
|
165
|
+
"properties": {
|
|
166
|
+
"score": {
|
|
167
|
+
"type": "number",
|
|
168
|
+
"minimum": 0,
|
|
169
|
+
"maximum": 1,
|
|
170
|
+
"description": "Dimension score (0.0–1.0)."
|
|
171
|
+
},
|
|
172
|
+
"status": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"enum": ["ok", "mismatch", "missing"],
|
|
175
|
+
"description": "Whether this dimension passed, mismatched, or was absent."
|
|
176
|
+
},
|
|
177
|
+
"detail": {
|
|
178
|
+
"type": "string",
|
|
179
|
+
"description": "Specific feedback on this dimension."
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"BlockReason": {
|
|
184
|
+
"type": "object",
|
|
185
|
+
"required": ["type", "description"],
|
|
186
|
+
"additionalProperties": false,
|
|
187
|
+
"properties": {
|
|
188
|
+
"type": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"enum": ["human-decision", "external-resource", "dependency", "permission"],
|
|
191
|
+
"description": "Why the task is blocked."
|
|
192
|
+
},
|
|
193
|
+
"description": { "type": "string" },
|
|
194
|
+
"requiredAction": {
|
|
195
|
+
"type": "string",
|
|
196
|
+
"description": "What needs to happen to unblock."
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://va-agent-protocol.dev/schemas/lifecycle.schema.json",
|
|
4
|
+
"title": "TaskLifecycle",
|
|
5
|
+
"description": "State machine for task execution. Defines valid states and transitions.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"$defs": {
|
|
8
|
+
"TaskState": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"enum": ["pending", "running", "completed", "failed", "blocked", "cancelled"],
|
|
11
|
+
"description": "pending: queued, not yet dispatched. running: execution in progress. completed: all acceptance criteria met with evidence. failed: execution failed (may retry). blocked: needs external input (human or dependency). cancelled: terminated by orchestrator."
|
|
12
|
+
},
|
|
13
|
+
"ValidTransitions": {
|
|
14
|
+
"description": "Allowed state transitions. Any transition not listed here is invalid.",
|
|
15
|
+
"type": "object",
|
|
16
|
+
"properties": {
|
|
17
|
+
"pending": { "const": ["running", "cancelled"] },
|
|
18
|
+
"running": { "const": ["completed", "failed", "blocked", "cancelled"] },
|
|
19
|
+
"blocked": { "const": ["running", "failed", "cancelled"] },
|
|
20
|
+
"completed": { "const": [] },
|
|
21
|
+
"failed": { "const": ["running"] },
|
|
22
|
+
"cancelled": { "const": [] }
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"StateTransition": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"required": ["from", "to", "timestamp"],
|
|
28
|
+
"additionalProperties": false,
|
|
29
|
+
"properties": {
|
|
30
|
+
"from": { "$ref": "#/$defs/TaskState" },
|
|
31
|
+
"to": { "$ref": "#/$defs/TaskState" },
|
|
32
|
+
"timestamp": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"format": "date-time"
|
|
35
|
+
},
|
|
36
|
+
"reason": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "Why this transition happened."
|
|
39
|
+
},
|
|
40
|
+
"actor": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"description": "Who triggered the transition (agent ID, 'orchestrator', or 'human')."
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"TaskExecution": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"required": ["taskId", "correlationId", "currentState", "transitions"],
|
|
49
|
+
"additionalProperties": false,
|
|
50
|
+
"properties": {
|
|
51
|
+
"taskId": { "type": "string" },
|
|
52
|
+
"correlationId": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"description": "Unique ID for this execution attempt. A task may have multiple executions (retries)."
|
|
55
|
+
},
|
|
56
|
+
"agentId": { "type": "string" },
|
|
57
|
+
"currentState": { "$ref": "#/$defs/TaskState" },
|
|
58
|
+
"attempt": {
|
|
59
|
+
"type": "integer",
|
|
60
|
+
"minimum": 1,
|
|
61
|
+
"default": 1,
|
|
62
|
+
"description": "Which retry attempt this is."
|
|
63
|
+
},
|
|
64
|
+
"transitions": {
|
|
65
|
+
"type": "array",
|
|
66
|
+
"items": { "$ref": "#/$defs/StateTransition" },
|
|
67
|
+
"description": "Ordered history of state transitions."
|
|
68
|
+
},
|
|
69
|
+
"startedAt": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"format": "date-time"
|
|
72
|
+
},
|
|
73
|
+
"completedAt": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"format": "date-time"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://va-agent-protocol.dev/schemas/message.schema.json",
|
|
4
|
+
"title": "ProtocolMessage",
|
|
5
|
+
"description": "Envelope format for all orchestrator <-> agent communication. Every interaction is a message.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["protocol", "version", "type", "timestamp", "correlationId", "payload"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"protocol": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"const": "va-agent-protocol",
|
|
13
|
+
"description": "Protocol identifier. Always 'va-agent-protocol'."
|
|
14
|
+
},
|
|
15
|
+
"version": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
18
|
+
"description": "Protocol version (semver)."
|
|
19
|
+
},
|
|
20
|
+
"type": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"enum": ["dispatch", "accepted", "progress", "completed", "failed", "blocked", "cancel"],
|
|
23
|
+
"description": "Message type. dispatch/cancel: orchestrator->agent. accepted/progress/completed/failed/blocked: agent->orchestrator."
|
|
24
|
+
},
|
|
25
|
+
"timestamp": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"format": "date-time",
|
|
28
|
+
"description": "ISO-8601 timestamp."
|
|
29
|
+
},
|
|
30
|
+
"correlationId": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "Ties all messages for one task execution together."
|
|
33
|
+
},
|
|
34
|
+
"sourceId": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "ID of the sender (agent ID or 'orchestrator')."
|
|
37
|
+
},
|
|
38
|
+
"payload": {
|
|
39
|
+
"description": "Type-specific content. Schema depends on message type.",
|
|
40
|
+
"oneOf": [
|
|
41
|
+
{ "$ref": "#/$defs/DispatchPayload" },
|
|
42
|
+
{ "$ref": "#/$defs/AcceptedPayload" },
|
|
43
|
+
{ "$ref": "#/$defs/ProgressPayload" },
|
|
44
|
+
{ "$ref": "#/$defs/CompletedPayload" },
|
|
45
|
+
{ "$ref": "#/$defs/FailedPayload" },
|
|
46
|
+
{ "$ref": "#/$defs/BlockedPayload" },
|
|
47
|
+
{ "$ref": "#/$defs/CancelPayload" }
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"$defs": {
|
|
52
|
+
"DispatchPayload": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"required": ["task"],
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"properties": {
|
|
57
|
+
"task": {
|
|
58
|
+
"$ref": "task-unit.schema.json",
|
|
59
|
+
"description": "The task to execute."
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"AcceptedPayload": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"required": ["taskId"],
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"properties": {
|
|
68
|
+
"taskId": { "type": "string" },
|
|
69
|
+
"estimatedCapabilities": {
|
|
70
|
+
"type": "array",
|
|
71
|
+
"items": { "type": "string" },
|
|
72
|
+
"description": "What capabilities the agent will use for this task."
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"ProgressPayload": {
|
|
77
|
+
"type": "object",
|
|
78
|
+
"required": ["taskId"],
|
|
79
|
+
"additionalProperties": false,
|
|
80
|
+
"properties": {
|
|
81
|
+
"taskId": { "type": "string" },
|
|
82
|
+
"phase": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"description": "Current execution phase (agent-defined, e.g., 'implementing', 'reviewing', 'testing')."
|
|
85
|
+
},
|
|
86
|
+
"summary": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "Brief status update."
|
|
89
|
+
},
|
|
90
|
+
"completionEstimate": {
|
|
91
|
+
"type": "number",
|
|
92
|
+
"minimum": 0,
|
|
93
|
+
"maximum": 1,
|
|
94
|
+
"description": "0.0 to 1.0 progress estimate. Optional and advisory only."
|
|
95
|
+
},
|
|
96
|
+
"logs": {
|
|
97
|
+
"type": "array",
|
|
98
|
+
"items": { "$ref": "#/$defs/ProgressLog" },
|
|
99
|
+
"description": "Structured log entries from the agent's execution."
|
|
100
|
+
},
|
|
101
|
+
"data": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"additionalProperties": true,
|
|
104
|
+
"description": "Key-value data the agent wants to expose to the orchestrator/UI."
|
|
105
|
+
},
|
|
106
|
+
"agentId": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"description": "The agent currently handling this task (populated by orchestrator)."
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"CompletedPayload": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"required": ["evidence"],
|
|
115
|
+
"additionalProperties": false,
|
|
116
|
+
"properties": {
|
|
117
|
+
"evidence": {
|
|
118
|
+
"$ref": "evidence.schema.json",
|
|
119
|
+
"description": "Proof of completion."
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"FailedPayload": {
|
|
124
|
+
"type": "object",
|
|
125
|
+
"required": ["evidence"],
|
|
126
|
+
"additionalProperties": false,
|
|
127
|
+
"properties": {
|
|
128
|
+
"evidence": {
|
|
129
|
+
"$ref": "evidence.schema.json",
|
|
130
|
+
"description": "Failure details with structured metadata."
|
|
131
|
+
},
|
|
132
|
+
"retryable": {
|
|
133
|
+
"type": "boolean",
|
|
134
|
+
"default": true,
|
|
135
|
+
"description": "Whether the orchestrator should retry."
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"BlockedPayload": {
|
|
140
|
+
"type": "object",
|
|
141
|
+
"required": ["evidence"],
|
|
142
|
+
"additionalProperties": false,
|
|
143
|
+
"properties": {
|
|
144
|
+
"evidence": {
|
|
145
|
+
"$ref": "evidence.schema.json",
|
|
146
|
+
"description": "Block reason details."
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"ProgressLog": {
|
|
151
|
+
"type": "object",
|
|
152
|
+
"required": ["timestamp", "level", "message"],
|
|
153
|
+
"additionalProperties": false,
|
|
154
|
+
"properties": {
|
|
155
|
+
"timestamp": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"format": "date-time",
|
|
158
|
+
"description": "ISO-8601 timestamp of the log entry."
|
|
159
|
+
},
|
|
160
|
+
"level": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"enum": ["info", "warn", "error", "debug"],
|
|
163
|
+
"description": "Log severity level."
|
|
164
|
+
},
|
|
165
|
+
"message": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"description": "Log message content."
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"CancelPayload": {
|
|
172
|
+
"type": "object",
|
|
173
|
+
"required": ["taskId"],
|
|
174
|
+
"additionalProperties": false,
|
|
175
|
+
"properties": {
|
|
176
|
+
"taskId": { "type": "string" },
|
|
177
|
+
"reason": { "type": "string" }
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://va-agent-protocol.dev/schemas/task-unit.schema.json",
|
|
4
|
+
"title": "TaskUnit",
|
|
5
|
+
"description": "Universal task contract. Defines WHAT to achieve, never HOW. The atomic unit of work in va-agent-protocol.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["id", "objective", "acceptanceCriteria"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"id": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "Unique task identifier. Format is adapter-specific (e.g., 'AP-001' for va-auto-pilot)."
|
|
13
|
+
},
|
|
14
|
+
"objective": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "What must be achieved. Goal-level description, not implementation steps."
|
|
17
|
+
},
|
|
18
|
+
"constraints": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"items": { "type": "string" },
|
|
21
|
+
"default": [],
|
|
22
|
+
"description": "Hard limits that must hold throughout execution. Violations are automatic failures."
|
|
23
|
+
},
|
|
24
|
+
"acceptanceCriteria": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": { "type": "string" },
|
|
27
|
+
"minItems": 1,
|
|
28
|
+
"description": "Machine-verifiable conditions. Each should map to a deterministic check (CLI command, test, assertion)."
|
|
29
|
+
},
|
|
30
|
+
"context": {
|
|
31
|
+
"$ref": "#/$defs/TaskContext",
|
|
32
|
+
"description": "Input context provided to the agent."
|
|
33
|
+
},
|
|
34
|
+
"priority": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"enum": ["P0", "P1", "P2", "P3"],
|
|
37
|
+
"default": "P1",
|
|
38
|
+
"description": "P0=blocking/critical, P1=high, P2=medium, P3=optimization/nice-to-have."
|
|
39
|
+
},
|
|
40
|
+
"dependsOn": {
|
|
41
|
+
"type": "array",
|
|
42
|
+
"items": { "type": "string" },
|
|
43
|
+
"default": [],
|
|
44
|
+
"description": "Task IDs that must complete before this task can start."
|
|
45
|
+
},
|
|
46
|
+
"timeout": {
|
|
47
|
+
"type": "integer",
|
|
48
|
+
"minimum": 0,
|
|
49
|
+
"description": "Maximum execution time in milliseconds. 0 or absent means no timeout."
|
|
50
|
+
},
|
|
51
|
+
"inputs": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"additionalProperties": {
|
|
54
|
+
"oneOf": [
|
|
55
|
+
{ "$ref": "#/$defs/InputRef" },
|
|
56
|
+
{}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"description": "Named inputs for this task. Values are either static (any JSON value) or references to outputs from dependency tasks (InputRef)."
|
|
60
|
+
},
|
|
61
|
+
"outputContract": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"properties": {
|
|
65
|
+
"keys": {
|
|
66
|
+
"type": "array",
|
|
67
|
+
"items": { "type": "string" },
|
|
68
|
+
"description": "Output keys this task promises to produce (stored in evidence.outputs)."
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"description": "Declares what structured outputs this task will produce."
|
|
72
|
+
},
|
|
73
|
+
"metadata": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"additionalProperties": true,
|
|
76
|
+
"description": "Adapter-specific or user-defined metadata. Protocol does not inspect this."
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"$defs": {
|
|
80
|
+
"InputRef": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"required": ["fromTask", "outputKey"],
|
|
83
|
+
"additionalProperties": false,
|
|
84
|
+
"properties": {
|
|
85
|
+
"fromTask": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"description": "Task ID to read output from. Must be in dependsOn."
|
|
88
|
+
},
|
|
89
|
+
"outputKey": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"description": "Key in the source task's evidence.outputs to read."
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"description": "Reference to an output from a dependency task. Resolved by the orchestrator before dispatch."
|
|
95
|
+
},
|
|
96
|
+
"TaskContext": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"additionalProperties": false,
|
|
99
|
+
"properties": {
|
|
100
|
+
"codebaseRoot": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"description": "Absolute path to the working directory for this task."
|
|
103
|
+
},
|
|
104
|
+
"files": {
|
|
105
|
+
"type": "array",
|
|
106
|
+
"items": { "type": "string" },
|
|
107
|
+
"description": "Relevant file paths (relative to codebaseRoot)."
|
|
108
|
+
},
|
|
109
|
+
"history": {
|
|
110
|
+
"type": "array",
|
|
111
|
+
"items": { "type": "string" },
|
|
112
|
+
"description": "Prior relevant decisions, context, or notes."
|
|
113
|
+
},
|
|
114
|
+
"pitfalls": {
|
|
115
|
+
"type": "array",
|
|
116
|
+
"items": { "$ref": "#/$defs/Pitfall" },
|
|
117
|
+
"description": "Known failure patterns from previous attempts."
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"Pitfall": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"required": ["id", "failureType", "attempted", "hypothesis"],
|
|
124
|
+
"additionalProperties": false,
|
|
125
|
+
"properties": {
|
|
126
|
+
"id": { "type": "string" },
|
|
127
|
+
"failureType": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"enum": ["gate", "acceptance", "review", "timeout", "crash", "unknown"]
|
|
130
|
+
},
|
|
131
|
+
"attempted": { "type": "string" },
|
|
132
|
+
"hypothesis": { "type": "string" },
|
|
133
|
+
"missingContext": { "type": "string" }
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|