@agentproto/corpus-cli 0.10.0 → 0.10.1
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-15/draft/WORKFLOW.schema.json +19 -2
- package/dist/specs/resources/aip-16/draft/IO.schema.json +4 -0
- package/dist/specs/resources/aip-44/draft/ACP.schema.json +3 -1
- 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/package.json +4 -4
|
@@ -274,11 +274,16 @@
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
]
|
|
277
|
+
},
|
|
278
|
+
"cacheable": {
|
|
279
|
+
"type": "boolean",
|
|
280
|
+
"description": "Cache this step's output under the run's cacheKey; only its resolved `inputs` are hashed (not `context`/secrets). Default false."
|
|
277
281
|
}
|
|
278
282
|
}
|
|
279
283
|
},
|
|
280
284
|
"stepBranch": {
|
|
281
285
|
"type": "object",
|
|
286
|
+
"description": "Conditional routing over LATER SIBLINGS of this step (forward-only: every `next`/`default`/`join` names a later step in the same list). Arms are EXCLUSIVE: sorted by position, the arm targets partition the siblings after the branch into arm bodies — an arm's body is its target step up to (not including) the next arm's target, and the last arm's body runs up to the join. Exactly one body runs (the first arm whose `when` holds, else `default`'s), then execution continues at the join; every step from the join on runs once whichever arm was taken. Steps of the arms not taken are reported `skipped` (AIP-58 `step.skipped`), never silently absent and never `done`.",
|
|
282
287
|
"required": ["kind", "branches"],
|
|
283
288
|
"properties": {
|
|
284
289
|
"kind": { "const": "branch" },
|
|
@@ -290,11 +295,23 @@
|
|
|
290
295
|
"required": ["when", "next"],
|
|
291
296
|
"properties": {
|
|
292
297
|
"when": { "type": "string" },
|
|
293
|
-
"next": { "type": "string" }
|
|
298
|
+
"next": { "type": "string", "description": "Id of the later sibling that starts this arm's body." }
|
|
294
299
|
}
|
|
295
300
|
}
|
|
296
301
|
},
|
|
297
|
-
"default": {
|
|
302
|
+
"default": {
|
|
303
|
+
"type": "string",
|
|
304
|
+
"description": "Id of the later sibling that starts the arm taken when no `when` holds. Omitted ⇒ a no-match runs the siblings between the branch and its first arm target (none when the first target is the very next step), then continues at the join."
|
|
305
|
+
},
|
|
306
|
+
"join": {
|
|
307
|
+
"type": "string",
|
|
308
|
+
"description": "Id of the later sibling where execution resumes after the chosen arm — it MUST come after every arm target. Omitted ⇒ the step right after the last arm's target (so the last arm's body is exactly its target step); declare `join` to give the last arm several steps."
|
|
309
|
+
},
|
|
310
|
+
"fallthrough": {
|
|
311
|
+
"type": "boolean",
|
|
312
|
+
"default": false,
|
|
313
|
+
"description": "Legacy, discouraged. `true` restores the pre-exclusive semantics: the chosen target runs AND every sibling after it in document order (so taking an earlier arm also runs every later arm), and a no-match without `default` continues at the next sibling. Incompatible with `join`."
|
|
314
|
+
}
|
|
298
315
|
}
|
|
299
316
|
},
|
|
300
317
|
"stepParallel": {
|
|
@@ -43,6 +43,10 @@
|
|
|
43
43
|
"contentType": {
|
|
44
44
|
"description": "Informational MIME type. Hosts MAY surface in audit logs / UIs.",
|
|
45
45
|
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"required": {
|
|
48
|
+
"description": "outputsFiles only (AIP-58 amendment): missing when the producing step finishes MUST fail the run { code: \"missing-artifact\" } (AIP-58 section 4/10). Absent or false is advisory only -- a host MAY warn but MUST NOT fail the run.",
|
|
49
|
+
"type": "boolean"
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
},
|
|
@@ -108,7 +108,9 @@
|
|
|
108
108
|
"properties": {
|
|
109
109
|
"name": { "type": "string" },
|
|
110
110
|
"transport": { "enum": ["stdio", "http", "sse"] },
|
|
111
|
-
"ref": { "type": "string" }
|
|
111
|
+
"ref": { "type": "string" },
|
|
112
|
+
"args": { "type": "array", "items": { "type": "string" }, "description": "stdio only: argv passed to the `ref` command." },
|
|
113
|
+
"env": { "type": "object", "additionalProperties": { "type": "string" }, "description": "stdio only: extra environment for the launched server." }
|
|
112
114
|
}
|
|
113
115
|
}
|
|
114
116
|
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "V3",
|
|
3
|
+
"title": "Agent turn ends, required artifact absent -> failed missing-artifact",
|
|
4
|
+
"rule": "specs/aip-58.mdx section 3 Outcome rule + section 4 Run workspace",
|
|
5
|
+
"manifestExcerpt": {
|
|
6
|
+
"kind": "workflow",
|
|
7
|
+
"id": "pricing-brief",
|
|
8
|
+
"outputsFiles": {
|
|
9
|
+
"brief": { "path": "./briefs/<runId>.md", "required": true }
|
|
10
|
+
},
|
|
11
|
+
"steps": [
|
|
12
|
+
{ "id": "draft", "kind": "agent", "prompt": "Write the brief and save it to the declared output path." }
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"runCreate": {
|
|
16
|
+
"kind": "workflow",
|
|
17
|
+
"ref": { "id": "pricing-brief", "version": "1.0.0" },
|
|
18
|
+
"input": { "productUrl": "https://example.com/pricing" }
|
|
19
|
+
},
|
|
20
|
+
"agentTurnResult": {
|
|
21
|
+
"finalMessage": "Done -- I've drafted the brief in my response above.",
|
|
22
|
+
"outputsFilesProduced": []
|
|
23
|
+
},
|
|
24
|
+
"expected": {
|
|
25
|
+
"terminalState": "failed",
|
|
26
|
+
"error": { "code": "missing-artifact", "stepId": "draft" },
|
|
27
|
+
"events": [
|
|
28
|
+
"run.created",
|
|
29
|
+
"run.started",
|
|
30
|
+
"step.started",
|
|
31
|
+
"step.failed",
|
|
32
|
+
"run.failed"
|
|
33
|
+
],
|
|
34
|
+
"notes": [
|
|
35
|
+
"The agent's turn ended with a plausible-sounding final message, but the declared-required 'brief' outputsFiles key never materialized under scratch/ -- the outcome rule fails the step regardless of how the turn read.",
|
|
36
|
+
"This is the vector for AIP-16's outputsFiles.<key>.required amendment: with required absent or false, the same scenario would be a warning and the step would still be evaluated on structured output alone."
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "V4",
|
|
3
|
+
"title": "Host restart mid-step -> failed host-interrupted; a durably suspended run survives",
|
|
4
|
+
"rule": "specs/aip-58.mdx section 2 State machine -- host restart",
|
|
5
|
+
"scenarios": [
|
|
6
|
+
{
|
|
7
|
+
"label": "A -- plain running run, no suspend record",
|
|
8
|
+
"before": { "status": "running", "steps": [{ "stepId": "parse", "status": "running" }] },
|
|
9
|
+
"hostEvent": "process restart / reload",
|
|
10
|
+
"expected": {
|
|
11
|
+
"terminalState": "failed",
|
|
12
|
+
"error": { "code": "host-interrupted" },
|
|
13
|
+
"events": ["run.failed"],
|
|
14
|
+
"notes": ["No prior suspend record existed for this run, so it is not eligible for the durable-suspend carve-out -- it is marked failed on reload."]
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"label": "B -- durably suspended run",
|
|
19
|
+
"before": {
|
|
20
|
+
"status": "suspended",
|
|
21
|
+
"steps": [{ "stepId": "draft", "status": "suspended" }],
|
|
22
|
+
"suspendRecord": { "stepId": "draft", "reason": "input-required", "since": "2026-09-25T10:00:14Z" }
|
|
23
|
+
},
|
|
24
|
+
"hostEvent": "process restart / reload",
|
|
25
|
+
"expected": {
|
|
26
|
+
"terminalState": null,
|
|
27
|
+
"statusAfterReload": "suspended",
|
|
28
|
+
"events": [],
|
|
29
|
+
"notes": [
|
|
30
|
+
"The run's durable suspend record survives the restart untouched -- no run.failed event is emitted, and the run stays exactly as it was.",
|
|
31
|
+
"A subsequent run.resume against the re-registered pending entry still resolves. This MUST hold regardless of which step kind (kind: \"approval\" or kind: \"suspend\") produced the suspension -- AIP-15 rule 7, as amended 2026-09-25, requires durable persistence for both identically; the reference runner already persists and re-registers both (awaitingApproval / awaitingSuspend)."
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "V5",
|
|
3
|
+
"title": "Two concurrent runs of the same workflow -> disjoint workspaces, no shared-path write before publish",
|
|
4
|
+
"rule": "specs/aip-58.mdx section 4 Run workspace -- \"Two runs MUST NEVER share a workspace\" + the deferred-publish model",
|
|
5
|
+
"manifestExcerpt": {
|
|
6
|
+
"kind": "workflow",
|
|
7
|
+
"id": "pricing-brief",
|
|
8
|
+
"outputsFiles": {
|
|
9
|
+
"brief": { "path": "./briefs/latest.md", "required": true }
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"runCreate": [
|
|
13
|
+
{
|
|
14
|
+
"kind": "workflow",
|
|
15
|
+
"ref": { "id": "pricing-brief", "version": "1.0.0" },
|
|
16
|
+
"input": { "productUrl": "https://example.com/pricing-a" }
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"kind": "workflow",
|
|
20
|
+
"ref": { "id": "pricing-brief", "version": "1.0.0" },
|
|
21
|
+
"input": { "productUrl": "https://example.com/pricing-b" }
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"note_on_manifest": "outputsFiles.brief.path is deliberately a FIXED path with no <runId>/<isoDate> interpolation -- './briefs/latest.md' -- the exact shape that raced under plain AIP-16. This is the case the deferred-publish model exists for; V5 under interpolated paths would not exercise the bug at all.",
|
|
25
|
+
"expected": {
|
|
26
|
+
"runIds": ["run_A", "run_B"],
|
|
27
|
+
"workspaces": {
|
|
28
|
+
"run_A": "<runsRoot>/run_A/",
|
|
29
|
+
"run_B": "<runsRoot>/run_B/"
|
|
30
|
+
},
|
|
31
|
+
"duringExecution": {
|
|
32
|
+
"sharedPathWritten": false,
|
|
33
|
+
"notes": [
|
|
34
|
+
"At no point while either run is 'running' does the file at the shared workspace path './briefs/latest.md' get created, truncated, or modified by either run -- outputsFiles.brief syncs ONLY to each run's own <runsRoot>/<runId>/artifacts/brief per section 4's sync-target override.",
|
|
35
|
+
"Reading './briefs/latest.md' at any timestamp strictly between both runs' startedAt and both runs' endedAt MUST show either its pre-existing content or absence -- never partial or run-attributable content from run_A or run_B."
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"artifactsAfterBothSucceed": {
|
|
39
|
+
"run_A.artifacts": [
|
|
40
|
+
{ "key": "brief", "path": "artifacts/brief", "stepId": "save" }
|
|
41
|
+
],
|
|
42
|
+
"run_B.artifacts": [
|
|
43
|
+
{ "key": "brief", "path": "artifacts/brief", "stepId": "save" }
|
|
44
|
+
],
|
|
45
|
+
"invariant": "run_A.artifacts[0]'s absolute location (<runsRoot>/run_A/artifacts/brief) and run_B.artifacts[0]'s (<runsRoot>/run_B/artifacts/brief) are disjoint paths, even though both entries carry the identical relative key/path/stepId -- disjointness is a property of the run-scoped root, not of the ArtifactEntry fields themselves."
|
|
46
|
+
},
|
|
47
|
+
"terminalStates": { "run_A": "succeeded", "run_B": "succeeded" },
|
|
48
|
+
"afterExplicitPublish": {
|
|
49
|
+
"scenario": "run.publish { runId: run_B, artifactKey: 'brief' } called after run_B succeeds, no explicit 'to' given",
|
|
50
|
+
"result": "./briefs/latest.md now holds run_B's brief content; a run.published event appears in run_B's event log naming { artifactKey: 'brief', to: './briefs/latest.md' }",
|
|
51
|
+
"notes": [
|
|
52
|
+
"run_A's own artifacts/brief is untouched by run_B's publish -- publish only ever writes to the shared destination, never to another run's workspace.",
|
|
53
|
+
"Had run_A also published to the same default destination (before or after run_B), the shared path reflects whichever publish happened last -- last-publish-wins is an explicit, observable act attributable to a specific run.publish call, never an accidental race between two runs finishing."
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"notes": [
|
|
57
|
+
"This is the exact failure the Motivation cites: two runs overwriting each other's files. Before this vector's extension, a naive reading of AIP-16 alone could still let both runs' outputsFiles.brief sync to './briefs/latest.md' unconditionally at run end, racing on whichever finished last -- the deferred-publish model (section 4) is what actually closes it, not merely giving each run its own <runId>."
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "V6",
|
|
3
|
+
"title": "Run whose owner died -> failed orphaned",
|
|
4
|
+
"rule": "specs/aip-58.mdx section 2 State machine -- \"A running run MUST have a live owner\"",
|
|
5
|
+
"manifestExcerpt": {
|
|
6
|
+
"kind": "app",
|
|
7
|
+
"id": "youtube-transcriber"
|
|
8
|
+
},
|
|
9
|
+
"runCreate": {
|
|
10
|
+
"kind": "app",
|
|
11
|
+
"ref": { "id": "youtube-transcriber", "version": "0.1.0" },
|
|
12
|
+
"input": { "videoUrl": "https://example.com/watch?v=abc123" }
|
|
13
|
+
},
|
|
14
|
+
"timeline": [
|
|
15
|
+
{ "t": "T0", "event": "run.create", "status": "running", "leaseHeldBy": "worker-7", "leaseExpiresAt": "T0+30s" },
|
|
16
|
+
{ "t": "T0+5s", "event": "worker-7 process killed (no clean shutdown, no host restart)" },
|
|
17
|
+
{ "t": "T0+30s", "event": "lease expires, no renewal observed" },
|
|
18
|
+
{ "t": "T0+31s", "event": "host liveness check detects expired lease with no live owner" }
|
|
19
|
+
],
|
|
20
|
+
"expected": {
|
|
21
|
+
"terminalState": "failed",
|
|
22
|
+
"error": { "code": "orphaned" },
|
|
23
|
+
"events": ["run.failed"],
|
|
24
|
+
"notes": [
|
|
25
|
+
"No host restart occurred in this scenario -- only worker-7 died. A host that only marks running runs failed on its OWN restart (the reference implementation's current behaviour) does not catch this case; the lease/heartbeat check is what does.",
|
|
26
|
+
"This is the vector for the '~25 app runs stuck running for weeks, several with 0 sessions' evidence in the Motivation."
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "V7",
|
|
3
|
+
"title": "Replay from step 3 -> new run, steps 1-2 reused from journal",
|
|
4
|
+
"rule": "specs/aip-58.mdx section 6 Journal -- run.replay",
|
|
5
|
+
"originalRun": {
|
|
6
|
+
"runId": "run_orig",
|
|
7
|
+
"status": "succeeded",
|
|
8
|
+
"steps": [
|
|
9
|
+
{ "stepId": "fetch", "status": "succeeded" },
|
|
10
|
+
{ "stepId": "parse", "status": "succeeded" },
|
|
11
|
+
{ "stepId": "draft", "status": "succeeded" },
|
|
12
|
+
{ "stepId": "save", "status": "succeeded" }
|
|
13
|
+
],
|
|
14
|
+
"journal": [
|
|
15
|
+
{ "stepId": "fetch", "attempt": 1, "inputHash": "h1", "status": "succeeded" },
|
|
16
|
+
{ "stepId": "parse", "attempt": 1, "inputHash": "h2", "status": "succeeded" },
|
|
17
|
+
{ "stepId": "draft", "attempt": 1, "inputHash": "h3", "status": "succeeded" },
|
|
18
|
+
{ "stepId": "save", "attempt": 1, "inputHash": "h4", "status": "succeeded" }
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"runReplay": { "of": "run_orig", "fromStep": "draft" },
|
|
22
|
+
"expected": {
|
|
23
|
+
"newRunId": "run_replay (!= run_orig)",
|
|
24
|
+
"rootRunId": "run_replay",
|
|
25
|
+
"parentRunId": null,
|
|
26
|
+
"steps": [
|
|
27
|
+
{ "stepId": "fetch", "status": "succeeded", "sourcedFrom": "journal:run_orig attempt 1", "reExecuted": false },
|
|
28
|
+
{ "stepId": "parse", "status": "succeeded", "sourcedFrom": "journal:run_orig attempt 1", "reExecuted": false },
|
|
29
|
+
{ "stepId": "draft", "status": "pending", "reExecuted": true },
|
|
30
|
+
{ "stepId": "save", "status": "pending", "reExecuted": true }
|
|
31
|
+
],
|
|
32
|
+
"events": [
|
|
33
|
+
"run.created",
|
|
34
|
+
"run.started",
|
|
35
|
+
"step.succeeded",
|
|
36
|
+
"step.succeeded",
|
|
37
|
+
"step.started",
|
|
38
|
+
"..."
|
|
39
|
+
],
|
|
40
|
+
"notes": [
|
|
41
|
+
"run_orig is untouched -- still 'succeeded', still immutable. run_replay is a new, independent run whose run.created event's data names { replayOf: { runId: 'run_orig', fromStep: 'draft' } } -- there is no 'replayOf' field on the Run resource itself.",
|
|
42
|
+
"'fetch' and 'parse' report status succeeded with no corresponding step.started/step.output pair re-executed in run_replay's own event log for those two steps -- their journaled output from run_orig is copied forward instead.",
|
|
43
|
+
"'draft' onward re-executes fresh against the new run's own workspace."
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "V8",
|
|
3
|
+
"title": "Turn ends with a question in plain text, no explicit signal -> failed missing-output, hinted",
|
|
4
|
+
"rule": "specs/aip-58.mdx section 3 Outcome rule -- a heuristic MAY only annotate a hint, never produce suspended",
|
|
5
|
+
"manifestExcerpt": {
|
|
6
|
+
"kind": "workflow",
|
|
7
|
+
"id": "pricing-brief",
|
|
8
|
+
"steps": [
|
|
9
|
+
{
|
|
10
|
+
"id": "draft",
|
|
11
|
+
"kind": "agent",
|
|
12
|
+
"prompt": "Write a one-page pricing brief for these tiers: $steps.parse.tiers",
|
|
13
|
+
"outputSchema": { "type": "object", "properties": { "brief": { "type": "string" } }, "required": ["brief"] }
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"runCreate": {
|
|
18
|
+
"kind": "workflow",
|
|
19
|
+
"ref": { "id": "pricing-brief", "version": "1.0.0" },
|
|
20
|
+
"input": { "productUrl": "https://example.com/pricing" }
|
|
21
|
+
},
|
|
22
|
+
"agentTurn": {
|
|
23
|
+
"finalMessage": "What tone should the brief use -- formal or casual?",
|
|
24
|
+
"toolCall": null,
|
|
25
|
+
"protocolAwaitingInputEvent": false
|
|
26
|
+
},
|
|
27
|
+
"expected": {
|
|
28
|
+
"terminalState": "failed",
|
|
29
|
+
"stepId": "draft",
|
|
30
|
+
"stepStatus": "failed",
|
|
31
|
+
"error": { "code": "missing-output", "stepId": "draft" },
|
|
32
|
+
"hint": "possible-input-request",
|
|
33
|
+
"events": [
|
|
34
|
+
"run.created",
|
|
35
|
+
"run.started",
|
|
36
|
+
"step.started",
|
|
37
|
+
"step.failed",
|
|
38
|
+
"run.failed"
|
|
39
|
+
],
|
|
40
|
+
"notes": [
|
|
41
|
+
"The final message is textually identical to V2's -- a question about tone. The outcome differs because V2's step made an explicit run.requestInput call and this one didn't; a host is NOT permitted to read the two turns identically just because their prose matches.",
|
|
42
|
+
"A host MAY set StepRecord.hint = 'possible-input-request' after pattern-matching the trailing question mark, purely as a triage aid for a human reading the failed run. The hint MUST NOT change stepStatus/terminalState -- a conformance check that flips this vector's expected terminalState to 'suspended' on the basis of the hint is testing a non-conforming host.",
|
|
43
|
+
"No step.suspended or run.suspended event may appear anywhere in this run's event log.",
|
|
44
|
+
"manifestExcerpt.steps[0] declares an outputSchema (added locally, ahead of agentproto/agentproto#39 / branch aip58-vacuous-contract, which makes the same addition upstream and amends section 3 to say explicitly that a step declaring no contract at all has a vacuous contract and always succeeds on turn end -- which would make this vector inapplicable as written without one). Re-running `pnpm sync-specs` after that PR merges will re-vendor this file from the real source; this edit is expected to become a no-op at that point."
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentproto/corpus-cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "@agentproto/corpus-cli — the `corpus` binary. Validate, lint, and operate an AIP-10 corpus workspace from the command line. Local-topology host for @agentproto/corpus — pair with a local backing engine (qdrant docker / gbrain) for a fully offline corpus runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentproto",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"gray-matter": "^4.0.3",
|
|
53
53
|
"unpdf": "~1.8.1",
|
|
54
54
|
"zod": "^4.6.5",
|
|
55
|
-
"@agentproto/cli-exec": "0.1.1",
|
|
56
55
|
"@agentproto/batch": "0.2.2",
|
|
57
|
-
"@agentproto/
|
|
58
|
-
"@agentproto/corpus
|
|
56
|
+
"@agentproto/cli-exec": "0.1.1",
|
|
57
|
+
"@agentproto/corpus": "0.8.1",
|
|
58
|
+
"@agentproto/corpus-presets": "0.2.13"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/node": "^25.9.5",
|