@agentproto/corpus-cli 0.10.0 → 0.10.2
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/dist/specs/resources/aip-14/draft/TOOL.schema.json +1 -1
- package/dist/specs/resources/aip-15/draft/WORKFLOW.schema.json +59 -47
- package/dist/specs/resources/aip-16/draft/IO.schema.json +4 -0
- package/dist/specs/resources/aip-18/draft/COLLECTION.schema.json +128 -7
- package/dist/specs/resources/aip-36/draft/SANDBOX.schema.json +13 -0
- package/dist/specs/resources/aip-41/draft/ROUTINE.schema.json +21 -2
- package/dist/specs/resources/aip-42/draft/AGENT.schema.json +1 -1
- package/dist/specs/resources/aip-44/draft/ACP.schema.json +3 -1
- package/dist/specs/resources/aip-47/draft/ROLE.schema.json +1 -1
- package/dist/specs/resources/aip-49/draft/ASSET.schema.json +232 -0
- package/dist/specs/resources/aip-50/draft/AUTH.schema.json +114 -0
- package/dist/specs/resources/aip-53/draft/APP.schema.json +211 -0
- package/dist/specs/resources/aip-54/draft/REF.schema.json +1 -1
- package/dist/specs/resources/aip-54/draft/WS-REF.schema.json +46 -0
- package/dist/specs/resources/aip-55/draft/PRODUCT.schema.json +172 -38
- package/dist/specs/resources/aip-58/draft/event.schema.json +55 -0
- package/dist/specs/resources/aip-58/draft/journal-entry.schema.json +47 -0
- package/dist/specs/resources/aip-58/draft/run.schema.json +164 -0
- package/dist/specs/resources/aip-58/draft/vectors/README.md +18 -0
- package/dist/specs/resources/aip-58/draft/vectors/v1-invalid-input.json +31 -0
- package/dist/specs/resources/aip-58/draft/vectors/v2-suspended-input-required.json +51 -0
- package/dist/specs/resources/aip-58/draft/vectors/v3-missing-artifact.json +39 -0
- package/dist/specs/resources/aip-58/draft/vectors/v4-host-restart.json +36 -0
- package/dist/specs/resources/aip-58/draft/vectors/v5-disjoint-workspaces.json +60 -0
- package/dist/specs/resources/aip-58/draft/vectors/v6-orphaned.json +29 -0
- package/dist/specs/resources/aip-58/draft/vectors/v7-replay.json +46 -0
- package/dist/specs/resources/aip-58/draft/vectors/v8-heuristic-not-suspend.json +47 -0
- package/dist/specs/resources/aip-62/draft/ATTESTATION.schema.json +184 -0
- package/dist/specs/resources/aip-62/draft/REVIEW-PACK.schema.json +70 -0
- package/dist/specs/resources/aip-62/draft/REVIEW.schema.json +180 -0
- package/dist/specs/resources/aip-7/draft/GOVERNANCE.schema.json +147 -1
- package/dist/specs/resources/{aip-52/draft → pending/harness}/HARNESS.schema.json +1 -1
- package/package.json +4 -4
- package/dist/specs/resources/aip-52/draft/ADAPTER.md +0 -193
- package/dist/specs/resources/aip-54/draft/REF.md +0 -89
- package/dist/specs/resources/aip-55/draft/PRODUCT.md +0 -143
|
@@ -2,40 +2,94 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://agentproto.sh/schemas/aip-55/PRODUCT.schema.json",
|
|
4
4
|
"title": "product/v1 frontmatter (AIP-55)",
|
|
5
|
-
"description": "Validates the YAML frontmatter portion of an AIP-55 PRODUCT.md
|
|
5
|
+
"description": "Validates the YAML frontmatter portion of an AIP-55 PRODUCT.md \u2014 a pricing CAPABILITY attached to any referenced AIP artifact. The target is addressed by an AIP-54 ref/v1 (aip:// URI in string contexts); the target AIP needs zero pricing awareness. Price models: 'one-time', 'prepaid-pool', 'pay-per-call'. Minor units are normative. billingRail is projection config, never the source of truth.",
|
|
6
6
|
"$defs": {
|
|
7
7
|
"price": {
|
|
8
8
|
"oneOf": [
|
|
9
9
|
{
|
|
10
10
|
"type": "object",
|
|
11
|
-
"required": [
|
|
11
|
+
"required": [
|
|
12
|
+
"model",
|
|
13
|
+
"amountMinor",
|
|
14
|
+
"currency"
|
|
15
|
+
],
|
|
12
16
|
"additionalProperties": false,
|
|
13
17
|
"properties": {
|
|
14
|
-
"model": {
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
"model": {
|
|
19
|
+
"const": "one-time",
|
|
20
|
+
"description": "Single payment for perpetual access."
|
|
21
|
+
},
|
|
22
|
+
"amountMinor": {
|
|
23
|
+
"type": "integer",
|
|
24
|
+
"minimum": 0,
|
|
25
|
+
"description": "Amount in MINOR units of the currency (cents for usd). Minor units are normative \u2014 major-unit floats are the x100 bug class."
|
|
26
|
+
},
|
|
27
|
+
"currency": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"pattern": "^[a-z]{3}$",
|
|
30
|
+
"description": "ISO-4217 lowercase, e.g. 'usd'."
|
|
31
|
+
}
|
|
17
32
|
}
|
|
18
33
|
},
|
|
19
34
|
{
|
|
20
35
|
"type": "object",
|
|
21
|
-
"required": [
|
|
36
|
+
"required": [
|
|
37
|
+
"model",
|
|
38
|
+
"unitPriceMinor",
|
|
39
|
+
"currency",
|
|
40
|
+
"grantUnits"
|
|
41
|
+
],
|
|
22
42
|
"additionalProperties": false,
|
|
23
43
|
"properties": {
|
|
24
|
-
"model": {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
44
|
+
"model": {
|
|
45
|
+
"const": "prepaid-pool",
|
|
46
|
+
"description": "Buy a pool of meter units up front; consumption draws the pool down. Pool STATE is host-side on every rail \u2014 the rail only initiates the top-up payment."
|
|
47
|
+
},
|
|
48
|
+
"unitPriceMinor": {
|
|
49
|
+
"type": "integer",
|
|
50
|
+
"minimum": 0,
|
|
51
|
+
"description": "Price per unit in minor units of the currency."
|
|
52
|
+
},
|
|
53
|
+
"currency": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"pattern": "^[a-z]{3}$"
|
|
56
|
+
},
|
|
57
|
+
"grantUnits": {
|
|
58
|
+
"type": "integer",
|
|
59
|
+
"minimum": 1,
|
|
60
|
+
"description": "Meter units granted per purchase. Unit semantics are declared by the host, not the spec; if a wallet asset backs the pool, units MUST be minor units of that asset's `decimals` (AIP-49)."
|
|
61
|
+
}
|
|
28
62
|
}
|
|
29
63
|
},
|
|
30
64
|
{
|
|
31
65
|
"type": "object",
|
|
32
|
-
"required": [
|
|
66
|
+
"required": [
|
|
67
|
+
"model",
|
|
68
|
+
"unitPriceMinor",
|
|
69
|
+
"currency",
|
|
70
|
+
"meter"
|
|
71
|
+
],
|
|
33
72
|
"additionalProperties": false,
|
|
34
73
|
"properties": {
|
|
35
|
-
"model": {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
74
|
+
"model": {
|
|
75
|
+
"const": "pay-per-call",
|
|
76
|
+
"description": "Post-paid metering: each unit consumed is billed."
|
|
77
|
+
},
|
|
78
|
+
"unitPriceMinor": {
|
|
79
|
+
"type": "integer",
|
|
80
|
+
"minimum": 0,
|
|
81
|
+
"description": "Price per meter unit in minor units."
|
|
82
|
+
},
|
|
83
|
+
"currency": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"pattern": "^[a-z]{3}$"
|
|
86
|
+
},
|
|
87
|
+
"meter": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"minLength": 1,
|
|
90
|
+
"maxLength": 96,
|
|
91
|
+
"description": "Host-declared meter id, e.g. 'agent-call', 'tokens-1k', 'sandbox-hour'. Open vocabulary; hosts SHOULD namespace host-specific meters."
|
|
92
|
+
}
|
|
39
93
|
}
|
|
40
94
|
}
|
|
41
95
|
]
|
|
@@ -44,60 +98,140 @@
|
|
|
44
98
|
"oneOf": [
|
|
45
99
|
{
|
|
46
100
|
"type": "object",
|
|
47
|
-
"required": [
|
|
101
|
+
"required": [
|
|
102
|
+
"rail"
|
|
103
|
+
],
|
|
48
104
|
"additionalProperties": false,
|
|
49
105
|
"properties": {
|
|
50
|
-
"rail": {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
106
|
+
"rail": {
|
|
107
|
+
"const": "stripe"
|
|
108
|
+
},
|
|
109
|
+
"productId": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"description": "Stripe Product id \u2014 a CACHE of the last projection, never the source of truth for the price."
|
|
112
|
+
},
|
|
113
|
+
"priceId": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"description": "Stripe Price id."
|
|
116
|
+
},
|
|
117
|
+
"meterId": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"description": "Stripe Meter id \u2014 REQUIRED when price.model is 'pay-per-call'; Stripe meters are created out-of-band and cannot be derived from the Price id."
|
|
120
|
+
},
|
|
121
|
+
"recurrence": {
|
|
122
|
+
"enum": [
|
|
123
|
+
"month",
|
|
124
|
+
"year",
|
|
125
|
+
"week",
|
|
126
|
+
"day"
|
|
127
|
+
],
|
|
128
|
+
"description": "Billing recurrence for metered prices. Absent = per-unit without period."
|
|
129
|
+
}
|
|
55
130
|
}
|
|
56
131
|
},
|
|
57
132
|
{
|
|
58
133
|
"type": "object",
|
|
59
|
-
"required": [
|
|
134
|
+
"required": [
|
|
135
|
+
"rail"
|
|
136
|
+
],
|
|
60
137
|
"additionalProperties": false,
|
|
61
138
|
"properties": {
|
|
62
|
-
"rail": {
|
|
63
|
-
|
|
64
|
-
|
|
139
|
+
"rail": {
|
|
140
|
+
"const": "autumn"
|
|
141
|
+
},
|
|
142
|
+
"featureId": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"description": "Autumn feature id. Autumn natively models both metered usage and prepaid credit grants, so prepaid-pool and pay-per-call both project onto one featureId."
|
|
145
|
+
},
|
|
146
|
+
"grantId": {
|
|
147
|
+
"type": "string",
|
|
148
|
+
"description": "Autumn credit-grant id for prepaid-pool products, if distinct from featureId."
|
|
149
|
+
}
|
|
65
150
|
}
|
|
66
151
|
},
|
|
67
152
|
{
|
|
68
153
|
"type": "object",
|
|
69
|
-
"required": [
|
|
154
|
+
"required": [
|
|
155
|
+
"rail"
|
|
156
|
+
],
|
|
70
157
|
"additionalProperties": false,
|
|
71
158
|
"properties": {
|
|
72
|
-
"rail": {
|
|
159
|
+
"rail": {
|
|
160
|
+
"const": "tbd",
|
|
161
|
+
"description": "Commerce shape decided, provider not chosen yet."
|
|
162
|
+
}
|
|
73
163
|
}
|
|
74
164
|
},
|
|
75
165
|
{
|
|
76
166
|
"type": "object",
|
|
77
|
-
"required": [
|
|
167
|
+
"required": [
|
|
168
|
+
"rail"
|
|
169
|
+
],
|
|
78
170
|
"additionalProperties": true,
|
|
79
171
|
"properties": {
|
|
80
|
-
"rail": {
|
|
172
|
+
"rail": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"pattern": "^[a-z][a-z0-9-]*$",
|
|
175
|
+
"not": {
|
|
176
|
+
"enum": [
|
|
177
|
+
"stripe",
|
|
178
|
+
"autumn",
|
|
179
|
+
"tbd"
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
"description": "Vendor-specific rail. Rail-specific config lives under namespaced keys; unknown rails MUST be tolerated by hosts that only consume the price union."
|
|
183
|
+
}
|
|
81
184
|
}
|
|
82
185
|
}
|
|
83
186
|
]
|
|
84
187
|
}
|
|
85
188
|
},
|
|
86
189
|
"type": "object",
|
|
87
|
-
"required": [
|
|
190
|
+
"required": [
|
|
191
|
+
"schema",
|
|
192
|
+
"id",
|
|
193
|
+
"on",
|
|
194
|
+
"price"
|
|
195
|
+
],
|
|
88
196
|
"additionalProperties": false,
|
|
89
197
|
"properties": {
|
|
90
|
-
"schema": {
|
|
91
|
-
|
|
92
|
-
|
|
198
|
+
"schema": {
|
|
199
|
+
"const": "product/v1",
|
|
200
|
+
"description": "Doctype discriminator."
|
|
201
|
+
},
|
|
202
|
+
"id": {
|
|
203
|
+
"type": "string",
|
|
204
|
+
"pattern": "^[a-z][a-z0-9-]*$",
|
|
205
|
+
"minLength": 2,
|
|
206
|
+
"maxLength": 96,
|
|
207
|
+
"description": "Stable kebab-case pricing-capability id."
|
|
208
|
+
},
|
|
209
|
+
"kind": {
|
|
210
|
+
"const": "pricing",
|
|
211
|
+
"description": "Capability kind. AIP-55 is a capability; other capability kinds may exist under the capability/v1 pattern without their own AIP."
|
|
212
|
+
},
|
|
93
213
|
"on": {
|
|
94
214
|
"$ref": "https://agentproto.sh/schemas/aip-54/REF.schema.json",
|
|
95
|
-
"description": "The referenced artifact this pricing attaches to (AIP-54 ref/v1). String contexts use the aip:// URI form, e.g. 'aip://
|
|
215
|
+
"description": "The referenced artifact this pricing attaches to (AIP-54 ref/v1). String contexts use the aip:// URI form, e.g. 'aip://53/book-companion@1.2.0'. The target AIP needs zero pricing awareness; hosts MUST refuse when the ref does not resolve."
|
|
216
|
+
},
|
|
217
|
+
"title": {
|
|
218
|
+
"type": "string",
|
|
219
|
+
"minLength": 1,
|
|
220
|
+
"maxLength": 200,
|
|
221
|
+
"description": "Human-readable display name, e.g. a checkout label."
|
|
222
|
+
},
|
|
223
|
+
"description": {
|
|
224
|
+
"type": "string",
|
|
225
|
+
"minLength": 1,
|
|
226
|
+
"maxLength": 2000
|
|
227
|
+
},
|
|
228
|
+
"price": {
|
|
229
|
+
"$ref": "#/$defs/price",
|
|
230
|
+
"description": "The source of truth for what is charged. billingRail is projection config; a generator derives Stripe Prices / Autumn features FROM this."
|
|
231
|
+
},
|
|
232
|
+
"billingRail": {
|
|
233
|
+
"$ref": "#/$defs/billingRail"
|
|
96
234
|
},
|
|
97
|
-
"title": { "type": "string", "minLength": 1, "maxLength": 200, "description": "Human-readable display name, e.g. a checkout label." },
|
|
98
|
-
"description": { "type": "string", "minLength": 1, "maxLength": 2000 },
|
|
99
|
-
"price": { "$ref": "#/$defs/price", "description": "The source of truth for what is charged. billingRail is projection config; a generator derives Stripe Prices / Autumn features FROM this." },
|
|
100
|
-
"billingRail": { "$ref": "#/$defs/billingRail" },
|
|
101
235
|
"metadata": {
|
|
102
236
|
"type": "object",
|
|
103
237
|
"additionalProperties": true,
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://agentproto.sh/schemas/aip-58/event.schema.json",
|
|
4
|
+
"title": "RunEvent (AIP-58)",
|
|
5
|
+
"description": "One envelope in a run's append-only event log — the only interface a UI or supervisor needs (§5 Event log). Types extend the AIP-37 vocabulary.",
|
|
6
|
+
"$ref": "#/$defs/runEvent",
|
|
7
|
+
"$defs": {
|
|
8
|
+
"eventType": {
|
|
9
|
+
"description": "step.skipped marks a step in an untaken AIP-15 branch arm — terminal, the step never starts in this run; its data carries { reason: \"branch-not-taken\", branchId }.",
|
|
10
|
+
"type": "string",
|
|
11
|
+
"enum": [
|
|
12
|
+
"run.created",
|
|
13
|
+
"run.started",
|
|
14
|
+
"run.suspended",
|
|
15
|
+
"run.resumed",
|
|
16
|
+
"run.succeeded",
|
|
17
|
+
"run.failed",
|
|
18
|
+
"run.cancelled",
|
|
19
|
+
"run.published",
|
|
20
|
+
"step.started",
|
|
21
|
+
"step.output",
|
|
22
|
+
"step.artifact",
|
|
23
|
+
"step.suspended",
|
|
24
|
+
"step.resumed",
|
|
25
|
+
"step.succeeded",
|
|
26
|
+
"step.failed",
|
|
27
|
+
"step.skipped",
|
|
28
|
+
"step.spend"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"runEvent": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"required": ["seq", "ts", "runId", "type", "data"],
|
|
34
|
+
"additionalProperties": false,
|
|
35
|
+
"properties": {
|
|
36
|
+
"seq": {
|
|
37
|
+
"description": "Monotonic within this run, starting at 1.",
|
|
38
|
+
"type": "integer",
|
|
39
|
+
"minimum": 1
|
|
40
|
+
},
|
|
41
|
+
"ts": { "type": "string", "format": "date-time" },
|
|
42
|
+
"runId": { "type": "string", "minLength": 1 },
|
|
43
|
+
"stepId": {
|
|
44
|
+
"description": "Present on every step.* event; absent on run.* events.",
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"type": { "$ref": "#/$defs/eventType" },
|
|
48
|
+
"data": {
|
|
49
|
+
"description": "Per-type payload. Shape is informative and host-specific beyond the fields this AIP names elsewhere (e.g. run.failed's data carries the RunError; step.spend's data carries the Spend). Not further constrained here.",
|
|
50
|
+
"type": "object"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://agentproto.sh/schemas/aip-58/journal-entry.schema.json",
|
|
4
|
+
"title": "JournalEntry (AIP-58)",
|
|
5
|
+
"description": "One step attempt in a run's per-step journal (§6 Journal). Enables crash-resume, run.replay, and cache hits for pure/idempotent contracts.",
|
|
6
|
+
"$ref": "#/$defs/journalEntry",
|
|
7
|
+
"$defs": {
|
|
8
|
+
"runStatus": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"enum": ["pending", "running", "succeeded", "failed", "suspended", "cancelled"]
|
|
11
|
+
},
|
|
12
|
+
"spend": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"required": ["amount", "currency"],
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"properties": {
|
|
17
|
+
"amount": { "type": "number" },
|
|
18
|
+
"currency": { "type": "string", "minLength": 1 },
|
|
19
|
+
"unit": { "type": "string" }
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"journalEntry": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"required": ["stepId", "attempt", "inputHash", "input", "output", "status", "startedAt"],
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"properties": {
|
|
27
|
+
"stepId": { "type": "string", "minLength": 1 },
|
|
28
|
+
"attempt": {
|
|
29
|
+
"description": "1-based — a step retried under a retry policy has one entry per attempt.",
|
|
30
|
+
"type": "integer",
|
|
31
|
+
"minimum": 1
|
|
32
|
+
},
|
|
33
|
+
"inputHash": {
|
|
34
|
+
"description": "Hash of the resolved step input, used as the cache-hit key alongside contract id + version + driver.",
|
|
35
|
+
"type": "string",
|
|
36
|
+
"minLength": 1
|
|
37
|
+
},
|
|
38
|
+
"input": {},
|
|
39
|
+
"output": {},
|
|
40
|
+
"status": { "$ref": "#/$defs/runStatus" },
|
|
41
|
+
"startedAt": { "type": "string", "format": "date-time" },
|
|
42
|
+
"endedAt": { "type": "string", "format": "date-time" },
|
|
43
|
+
"spend": { "$ref": "#/$defs/spend" }
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://agentproto.sh/schemas/aip-58/run.schema.json",
|
|
4
|
+
"title": "Run (AIP-58)",
|
|
5
|
+
"description": "The run resource: the single object every AIP that executes something (a WORKFLOW.md step graph, an APP.md invocation, a ROUTINE.md fire, a bare tool call) produces one instance of. See specs/aip-58.mdx §1.",
|
|
6
|
+
"$ref": "#/$defs/run",
|
|
7
|
+
"$defs": {
|
|
8
|
+
"runKind": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"enum": ["workflow", "app", "routine", "tool"]
|
|
11
|
+
},
|
|
12
|
+
"runStatus": {
|
|
13
|
+
"description": "Shared by Run.status and every StepRecord.status. terminal = succeeded|failed|cancelled; suspended is NOT terminal (§2 State machine).",
|
|
14
|
+
"type": "string",
|
|
15
|
+
"enum": ["pending", "running", "succeeded", "failed", "suspended", "cancelled"]
|
|
16
|
+
},
|
|
17
|
+
"runRef": {
|
|
18
|
+
"description": "What runs, pinned to exact content so a replay is unambiguous.",
|
|
19
|
+
"type": "object",
|
|
20
|
+
"required": ["id"],
|
|
21
|
+
"additionalProperties": false,
|
|
22
|
+
"properties": {
|
|
23
|
+
"id": { "type": "string", "minLength": 1 },
|
|
24
|
+
"version": { "type": "string" },
|
|
25
|
+
"contentSha": {
|
|
26
|
+
"description": "sha256 of the referenced manifest's content, when the host loaded it from a file.",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"runError": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"required": ["code", "message"],
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"properties": {
|
|
37
|
+
"code": { "type": "string", "minLength": 1 },
|
|
38
|
+
"message": { "type": "string" },
|
|
39
|
+
"stepId": { "type": "string" },
|
|
40
|
+
"cause": {}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"spend": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"required": ["amount", "currency"],
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"properties": {
|
|
48
|
+
"amount": { "type": "number" },
|
|
49
|
+
"currency": { "type": "string", "minLength": 1 },
|
|
50
|
+
"unit": { "type": "string" }
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"artifactEntry": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"required": ["key", "path", "sha256", "size", "stepId"],
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"properties": {
|
|
58
|
+
"key": { "type": "string", "minLength": 1 },
|
|
59
|
+
"path": {
|
|
60
|
+
"description": "Relative to the run workspace root (§4 Run workspace).",
|
|
61
|
+
"type": "string",
|
|
62
|
+
"minLength": 1
|
|
63
|
+
},
|
|
64
|
+
"sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
65
|
+
"size": { "type": "integer", "minimum": 0 },
|
|
66
|
+
"contentType": { "type": "string" },
|
|
67
|
+
"stepId": { "type": "string", "minLength": 1 }
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"stepDriver": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"required": ["kind"],
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"properties": {
|
|
75
|
+
"kind": { "type": "string", "minLength": 1 },
|
|
76
|
+
"adapter": { "type": "string" },
|
|
77
|
+
"model": { "type": "string" },
|
|
78
|
+
"sessionId": {
|
|
79
|
+
"description": "The AIP-46 session id, when this step is agent-backed.",
|
|
80
|
+
"type": "string"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"stepRecord": {
|
|
85
|
+
"type": "object",
|
|
86
|
+
"required": ["stepId", "status"],
|
|
87
|
+
"additionalProperties": false,
|
|
88
|
+
"properties": {
|
|
89
|
+
"stepId": { "type": "string", "minLength": 1 },
|
|
90
|
+
"status": {
|
|
91
|
+
"description": "A run status, or — for a step only — 'skipped': the step sits in an untaken AIP-15 branch arm and will not run in this run (terminal; announced by a step.skipped event).",
|
|
92
|
+
"anyOf": [{ "$ref": "#/$defs/runStatus" }, { "const": "skipped" }]
|
|
93
|
+
},
|
|
94
|
+
"driver": { "$ref": "#/$defs/stepDriver" },
|
|
95
|
+
"startedAt": { "type": "string", "format": "date-time" },
|
|
96
|
+
"endedAt": { "type": "string", "format": "date-time" },
|
|
97
|
+
"output": {},
|
|
98
|
+
"suspend": {
|
|
99
|
+
"description": "Present when status is 'suspended' — set from the explicit signal (run.requestInput's arguments, or the AIP-46 awaiting-input event's payload) that produced it. See spec section 3 Outcome rule.",
|
|
100
|
+
"type": "object",
|
|
101
|
+
"required": ["reason"],
|
|
102
|
+
"additionalProperties": false,
|
|
103
|
+
"properties": {
|
|
104
|
+
"reason": { "type": "string", "minLength": 1 },
|
|
105
|
+
"prompt": { "type": "string" },
|
|
106
|
+
"schema": {
|
|
107
|
+
"description": "JSON Schema the eventual resume payload must validate against.",
|
|
108
|
+
"type": "object"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"error": { "$ref": "#/$defs/runError" },
|
|
113
|
+
"hint": {
|
|
114
|
+
"description": "Advisory only, never load-bearing — a host's heuristic read of a FAILED step's final message (e.g. 'possible-input-request'). MUST NOT influence status; see spec section 3 Outcome rule.",
|
|
115
|
+
"type": "string"
|
|
116
|
+
},
|
|
117
|
+
"spend": { "$ref": "#/$defs/spend" }
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"run": {
|
|
121
|
+
"type": "object",
|
|
122
|
+
"required": [
|
|
123
|
+
"runId", "kind", "ref", "input", "rootRunId", "status",
|
|
124
|
+
"steps", "createdAt", "runner", "artifacts"
|
|
125
|
+
],
|
|
126
|
+
"additionalProperties": false,
|
|
127
|
+
"properties": {
|
|
128
|
+
"runId": { "type": "string", "minLength": 1 },
|
|
129
|
+
"kind": { "$ref": "#/$defs/runKind" },
|
|
130
|
+
"ref": { "$ref": "#/$defs/runRef" },
|
|
131
|
+
"input": {},
|
|
132
|
+
"parentRunId": { "type": "string" },
|
|
133
|
+
"rootRunId": {
|
|
134
|
+
"description": "Self (equal to runId) when this run has no parent.",
|
|
135
|
+
"type": "string",
|
|
136
|
+
"minLength": 1
|
|
137
|
+
},
|
|
138
|
+
"status": { "$ref": "#/$defs/runStatus" },
|
|
139
|
+
"steps": {
|
|
140
|
+
"type": "array",
|
|
141
|
+
"items": { "$ref": "#/$defs/stepRecord" }
|
|
142
|
+
},
|
|
143
|
+
"createdAt": { "type": "string", "format": "date-time" },
|
|
144
|
+
"startedAt": { "type": "string", "format": "date-time" },
|
|
145
|
+
"endedAt": { "type": "string", "format": "date-time" },
|
|
146
|
+
"runner": {
|
|
147
|
+
"type": "object",
|
|
148
|
+
"required": ["hostId"],
|
|
149
|
+
"additionalProperties": false,
|
|
150
|
+
"properties": {
|
|
151
|
+
"hostId": { "type": "string", "minLength": 1 }
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"spend": { "$ref": "#/$defs/spend" },
|
|
155
|
+
"output": {},
|
|
156
|
+
"artifacts": {
|
|
157
|
+
"type": "array",
|
|
158
|
+
"items": { "$ref": "#/$defs/artifactEntry" }
|
|
159
|
+
},
|
|
160
|
+
"error": { "$ref": "#/$defs/runError" }
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# vectors/ — AIP-58 conformance cases
|
|
2
|
+
|
|
3
|
+
Seven JSON fixtures, one per case named in `specs/aip-58.mdx`'s "Resources
|
|
4
|
+
to add" list. Each file carries a trimmed manifest excerpt, the `run.create`
|
|
5
|
+
input, and the expected terminal state + event sequence a conforming host
|
|
6
|
+
MUST produce. These are fixtures for a conformance-test harness to load,
|
|
7
|
+
not executable tests themselves — this AIP does not mandate a test runner.
|
|
8
|
+
|
|
9
|
+
| File | Case |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `v1-invalid-input.json` | Required input missing → rejected / `failed invalid-input`, no step ran. |
|
|
12
|
+
| `v2-suspended-input-required.json` | Agent step invokes `run.requestInput` (the explicit signal) → step + run `suspended input-required`. |
|
|
13
|
+
| `v3-missing-artifact.json` | Agent turn ends, required artifact absent → `failed missing-artifact`. |
|
|
14
|
+
| `v4-host-restart.json` | Host restart mid-step → `failed host-interrupted`; a durably suspended run survives (both `kind: "approval"` and `kind: "suspend"`, per AIP-15 rule 7 as amended). |
|
|
15
|
+
| `v5-disjoint-workspaces.json` | Two concurrent runs of the same workflow → disjoint workspaces; neither writes the shared `outputsFiles` path before an explicit `run.publish`. |
|
|
16
|
+
| `v6-orphaned.json` | Run whose owner died → `failed orphaned`. |
|
|
17
|
+
| `v7-replay.json` | Replay from step 3 → new run, steps 1–2 reused from journal. |
|
|
18
|
+
| `v8-heuristic-not-suspend.json` | Turn ends with a question in plain text, no explicit signal → `failed missing-output` with `hint: "possible-input-request"`, never `suspended`. |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "V1",
|
|
3
|
+
"title": "Required input missing → rejected",
|
|
4
|
+
"rule": "specs/aip-58.mdx §3 Outcome rule — “Invalid or missing required input”",
|
|
5
|
+
"manifestExcerpt": {
|
|
6
|
+
"kind": "workflow",
|
|
7
|
+
"id": "pricing-brief",
|
|
8
|
+
"inputs": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": { "productUrl": { "type": "string", "format": "uri" } },
|
|
11
|
+
"required": ["productUrl"]
|
|
12
|
+
},
|
|
13
|
+
"steps": [{ "id": "fetch", "kind": "tool", "tool": "pricing-snapshot" }]
|
|
14
|
+
},
|
|
15
|
+
"runCreate": {
|
|
16
|
+
"kind": "workflow",
|
|
17
|
+
"ref": { "id": "pricing-brief", "version": "1.0.0" },
|
|
18
|
+
"input": {}
|
|
19
|
+
},
|
|
20
|
+
"expected": {
|
|
21
|
+
"runCreateOutcome": "either rejects the call outright, or persists a terminal run — both conforming",
|
|
22
|
+
"terminalState": "failed",
|
|
23
|
+
"error": { "code": "invalid-input" },
|
|
24
|
+
"stepsExecuted": [],
|
|
25
|
+
"events": ["run.created", "run.failed"],
|
|
26
|
+
"notes": [
|
|
27
|
+
"No step.started event MUST appear anywhere in the log — the host MUST reject before dispatching the first step.",
|
|
28
|
+
"run.started MUST NOT appear — the run never entered the running state."
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "V2",
|
|
3
|
+
"title": "Agent step invokes run.requestInput -> suspended input-required",
|
|
4
|
+
"rule": "specs/aip-58.mdx section 3 Outcome rule -- explicit signal only",
|
|
5
|
+
"manifestExcerpt": {
|
|
6
|
+
"kind": "workflow",
|
|
7
|
+
"id": "pricing-brief",
|
|
8
|
+
"steps": [
|
|
9
|
+
{ "id": "draft", "kind": "agent", "prompt": "Write a one-page pricing brief for these tiers: $steps.parse.tiers" }
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"runCreate": {
|
|
13
|
+
"kind": "workflow",
|
|
14
|
+
"ref": { "id": "pricing-brief", "version": "1.0.0" },
|
|
15
|
+
"input": { "productUrl": "https://example.com/pricing" }
|
|
16
|
+
},
|
|
17
|
+
"agentTurn": {
|
|
18
|
+
"toolCall": {
|
|
19
|
+
"operation": "run.requestInput",
|
|
20
|
+
"args": {
|
|
21
|
+
"stepId": "draft",
|
|
22
|
+
"prompt": "What tone should the brief use -- formal or casual?",
|
|
23
|
+
"schema": { "type": "object", "properties": { "tone": { "enum": ["formal", "casual"] } }, "required": ["tone"] }
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"turnEndsAfterToolCall": true
|
|
27
|
+
},
|
|
28
|
+
"expected": {
|
|
29
|
+
"terminalState": "suspended",
|
|
30
|
+
"stepId": "draft",
|
|
31
|
+
"stepStatus": "suspended",
|
|
32
|
+
"stepSuspend": {
|
|
33
|
+
"reason": "input-required",
|
|
34
|
+
"prompt": "What tone should the brief use -- formal or casual?",
|
|
35
|
+
"schema": { "type": "object", "properties": { "tone": { "enum": ["formal", "casual"] } }, "required": ["tone"] }
|
|
36
|
+
},
|
|
37
|
+
"events": [
|
|
38
|
+
"run.created",
|
|
39
|
+
"run.started",
|
|
40
|
+
"step.started",
|
|
41
|
+
"step.suspended",
|
|
42
|
+
"run.suspended"
|
|
43
|
+
],
|
|
44
|
+
"notes": [
|
|
45
|
+
"The suspend outcome exists BECAUSE the step explicitly called run.requestInput -- not because the turn's final text happened to read as a question. Contrast with V8, where the text alone is not enough.",
|
|
46
|
+
"run.status MUST be 'suspended', never 'succeeded' -- the turn ending is not itself success.",
|
|
47
|
+
"A subsequent run.resume { runId, stepId: 'draft', payload: { tone: 'formal' } } re-enters the step; payload MUST validate against stepSuspend.schema before the transition happens, and may still reach 'succeeded'.",
|
|
48
|
+
"A resume payload that fails schema validation (e.g. { tone: 'sarcastic' }) MUST be rejected without transitioning the run out of 'suspended'."
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|