@culture.dev/agents 0.15.3 → 0.16.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/README.md +22 -0
- package/dist/contract-schemas/api.json +73 -15
- package/dist/contract-schemas/branches.json +163 -0
- package/dist/contract-schemas/capabilities.json +133 -6
- package/dist/contract-schemas/common.json +9 -3
- package/dist/contract-schemas/control-action.json +91 -14
- package/dist/contract-schemas/error.json +189 -48
- package/dist/contract-schemas/event.json +185 -2
- package/dist/contract-schemas/run.json +111 -4
- package/dist/contract-schemas/version.json +2 -2
- package/dist/src/contract/generated/branches.d.ts +34 -0
- package/dist/src/contract/generated/branches.js +3 -0
- package/dist/src/contract/generated/branches.js.map +1 -0
- package/dist/src/contract/generated/capabilities.d.ts +39 -7
- package/dist/src/contract/generated/common.d.ts +5 -3
- package/dist/src/contract/generated/control-action.d.ts +30 -11
- package/dist/src/contract/generated/error.d.ts +31 -7
- package/dist/src/contract/generated/event.d.ts +57 -8
- package/dist/src/contract/generated/index.d.ts +37 -12
- package/dist/src/contract/generated/run.d.ts +23 -5
- package/dist/src/contract/generated/version.d.ts +2 -2
- package/dist/src/contract/ids.d.ts +6 -3
- package/dist/src/contract/ids.js +5 -2
- package/dist/src/contract/ids.js.map +1 -1
- package/dist/src/contract/index.d.ts +1 -1
- package/dist/src/contract/index.js +1 -1
- package/dist/src/contract/index.js.map +1 -1
- package/dist/src/daemon/branch-routes.d.ts +13 -0
- package/dist/src/daemon/branch-routes.js +41 -0
- package/dist/src/daemon/branch-routes.js.map +1 -0
- package/dist/src/daemon/daemon.js +10 -2
- package/dist/src/daemon/daemon.js.map +1 -1
- package/dist/src/daemon/harness-catalog.d.ts +6 -0
- package/dist/src/daemon/harness-catalog.js +20 -0
- package/dist/src/daemon/harness-catalog.js.map +1 -1
- package/dist/src/daemon/limits.d.ts +31 -0
- package/dist/src/daemon/limits.js +61 -0
- package/dist/src/daemon/limits.js.map +1 -0
- package/dist/src/daemon/main.d.ts +10 -0
- package/dist/src/daemon/main.js +161 -41
- package/dist/src/daemon/main.js.map +1 -1
- package/dist/src/daemon/ports.d.ts +21 -11
- package/dist/src/daemon/routes.d.ts +3 -0
- package/dist/src/daemon/routes.js +26 -5
- package/dist/src/daemon/routes.js.map +1 -1
- package/dist/src/daemon/secrets.d.ts +24 -0
- package/dist/src/daemon/secrets.js +52 -0
- package/dist/src/daemon/secrets.js.map +1 -0
- package/dist/src/daemon/submitter.d.ts +9 -0
- package/dist/src/daemon/submitter.js +23 -0
- package/dist/src/daemon/submitter.js.map +1 -0
- package/dist/src/harness/claude-code/index.js +1 -1
- package/dist/src/harness/claude-code/index.js.map +1 -1
- package/dist/src/harness/common/capabilities.d.ts +26 -2
- package/dist/src/harness/common/capabilities.js +31 -6
- package/dist/src/harness/common/capabilities.js.map +1 -1
- package/dist/src/harness/common/guard.d.ts +2 -1
- package/dist/src/harness/common/guard.js +6 -0
- package/dist/src/harness/common/guard.js.map +1 -1
- package/dist/src/harness/common/run-driver.d.ts +6 -1
- package/dist/src/harness/common/run-driver.js +20 -3
- package/dist/src/harness/common/run-driver.js.map +1 -1
- package/dist/src/harness/common/sandbox-workspace.d.ts +5 -1
- package/dist/src/harness/common/sandbox-workspace.js +12 -3
- package/dist/src/harness/common/sandbox-workspace.js.map +1 -1
- package/dist/src/harness/common/types.d.ts +8 -0
- package/dist/src/harness/config.d.ts +5 -0
- package/dist/src/harness/config.js +7 -3
- package/dist/src/harness/config.js.map +1 -1
- package/dist/src/harness/index.js +2 -2
- package/dist/src/harness/index.js.map +1 -1
- package/dist/src/harness/opencode/index.js +1 -1
- package/dist/src/harness/opencode/index.js.map +1 -1
- package/dist/src/harness/stub/backend.d.ts +3 -0
- package/dist/src/harness/stub/backend.js +50 -1
- package/dist/src/harness/stub/backend.js.map +1 -1
- package/dist/src/harness/stub/index.d.ts +7 -1
- package/dist/src/harness/stub/index.js +10 -2
- package/dist/src/harness/stub/index.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/publish/config.d.ts +25 -0
- package/dist/src/publish/config.js +47 -0
- package/dist/src/publish/config.js.map +1 -0
- package/dist/src/publish/envelope.d.ts +61 -0
- package/dist/src/publish/envelope.js +109 -0
- package/dist/src/publish/envelope.js.map +1 -0
- package/dist/src/publish/index.d.ts +22 -0
- package/dist/src/publish/index.js +35 -0
- package/dist/src/publish/index.js.map +1 -0
- package/dist/src/publish/log-tail.d.ts +31 -0
- package/dist/src/publish/log-tail.js +172 -0
- package/dist/src/publish/log-tail.js.map +1 -0
- package/dist/src/publish/publisher.d.ts +34 -0
- package/dist/src/publish/publisher.js +207 -0
- package/dist/src/publish/publisher.js.map +1 -0
- package/dist/src/publish/transport.d.ts +14 -0
- package/dist/src/publish/transport.js +69 -0
- package/dist/src/publish/transport.js.map +1 -0
- package/dist/src/runs/admission.d.ts +27 -0
- package/dist/src/runs/admission.js +97 -0
- package/dist/src/runs/admission.js.map +1 -0
- package/dist/src/runs/answer.d.ts +24 -0
- package/dist/src/runs/answer.js +99 -0
- package/dist/src/runs/answer.js.map +1 -0
- package/dist/src/runs/base-commit.d.ts +6 -0
- package/dist/src/runs/base-commit.js +23 -0
- package/dist/src/runs/base-commit.js.map +1 -0
- package/dist/src/runs/branches.d.ts +23 -0
- package/dist/src/runs/branches.js +115 -0
- package/dist/src/runs/branches.js.map +1 -0
- package/dist/src/runs/control.d.ts +12 -4
- package/dist/src/runs/control.js +14 -6
- package/dist/src/runs/control.js.map +1 -1
- package/dist/src/runs/gateway.d.ts +25 -0
- package/dist/src/runs/gateway.js +122 -0
- package/dist/src/runs/gateway.js.map +1 -0
- package/dist/src/runs/keys.d.ts +21 -0
- package/dist/src/runs/keys.js +50 -0
- package/dist/src/runs/keys.js.map +1 -0
- package/dist/src/runs/limits.d.ts +15 -0
- package/dist/src/runs/limits.js +37 -0
- package/dist/src/runs/limits.js.map +1 -0
- package/dist/src/runs/ports.d.ts +3 -0
- package/dist/src/runs/ports.js.map +1 -1
- package/dist/src/runs/reattach.d.ts +37 -0
- package/dist/src/runs/reattach.js +70 -0
- package/dist/src/runs/reattach.js.map +1 -0
- package/dist/src/runs/scan.d.ts +11 -6
- package/dist/src/runs/scan.js +12 -15
- package/dist/src/runs/scan.js.map +1 -1
- package/dist/src/runs/service.d.ts +57 -7
- package/dist/src/runs/service.js +160 -95
- package/dist/src/runs/service.js.map +1 -1
- package/dist/src/runs/submit.d.ts +34 -0
- package/dist/src/runs/submit.js +92 -0
- package/dist/src/runs/submit.js.map +1 -0
- package/dist/src/sandbox/host-command.js +5 -1
- package/dist/src/sandbox/host-command.js.map +1 -1
- package/dist/src/sandbox/run-sandbox.d.ts +8 -2
- package/dist/src/sandbox/run-sandbox.js +10 -3
- package/dist/src/sandbox/run-sandbox.js.map +1 -1
- package/dist/src/store/derive.js +3 -0
- package/dist/src/store/derive.js.map +1 -1
- package/dist/src/store/entries.d.ts +29 -0
- package/dist/src/store/entries.js +41 -0
- package/dist/src/store/entries.js.map +1 -0
- package/dist/src/store/event-log.d.ts +3 -3
- package/dist/src/store/event-log.js +2 -2
- package/dist/src/store/event-log.js.map +1 -1
- package/dist/src/store/files.d.ts +4 -0
- package/dist/src/store/files.js +4 -0
- package/dist/src/store/files.js.map +1 -1
- package/dist/src/store/idempotency.d.ts +79 -0
- package/dist/src/store/idempotency.js +281 -0
- package/dist/src/store/idempotency.js.map +1 -0
- package/dist/src/store/index.d.ts +8 -0
- package/dist/src/store/index.js +5 -0
- package/dist/src/store/index.js.map +1 -1
- package/dist/src/store/questions.d.ts +40 -0
- package/dist/src/store/questions.js +90 -0
- package/dist/src/store/questions.js.map +1 -0
- package/dist/src/store/retention.d.ts +13 -0
- package/dist/src/store/retention.js +74 -0
- package/dist/src/store/retention.js.map +1 -0
- package/dist/src/store/run-store.d.ts +4 -0
- package/dist/src/store/run-store.js +20 -4
- package/dist/src/store/run-store.js.map +1 -1
- package/dist/src/store/startup.d.ts +9 -0
- package/dist/src/store/startup.js +92 -0
- package/dist/src/store/startup.js.map +1 -0
- package/dist/src/store/summary.d.ts +7 -0
- package/dist/src/store/summary.js +126 -0
- package/dist/src/store/summary.js.map +1 -0
- package/dist/src/store/version.d.ts +10 -0
- package/dist/src/store/version.js +46 -0
- package/dist/src/store/version.js.map +1 -0
- package/dist/src/trace/config.d.ts +31 -0
- package/dist/src/trace/config.js +69 -0
- package/dist/src/trace/config.js.map +1 -0
- package/dist/src/trace/follower.d.ts +20 -0
- package/dist/src/trace/follower.js +196 -0
- package/dist/src/trace/follower.js.map +1 -0
- package/dist/src/trace/index.d.ts +21 -0
- package/dist/src/trace/index.js +42 -0
- package/dist/src/trace/index.js.map +1 -0
- package/dist/src/trace/otlp.d.ts +11 -0
- package/dist/src/trace/otlp.js +52 -0
- package/dist/src/trace/otlp.js.map +1 -0
- package/dist/src/trace/spans.d.ts +28 -0
- package/dist/src/trace/spans.js +120 -0
- package/dist/src/trace/spans.js.map +1 -0
- package/dist/src/worker/answer.d.ts +29 -0
- package/dist/src/worker/answer.js +53 -0
- package/dist/src/worker/answer.js.map +1 -0
- package/dist/src/worker/asking.d.ts +22 -0
- package/dist/src/worker/asking.js +21 -0
- package/dist/src/worker/asking.js.map +1 -0
- package/dist/src/worker/control.d.ts +7 -1
- package/dist/src/worker/control.js +22 -10
- package/dist/src/worker/control.js.map +1 -1
- package/dist/src/worker/delivery.d.ts +2 -2
- package/dist/src/worker/delivery.js +1 -1
- package/dist/src/worker/delivery.js.map +1 -1
- package/dist/src/worker/driver.d.ts +46 -1
- package/dist/src/worker/fake-driver.d.ts +35 -1
- package/dist/src/worker/fake-driver.js +45 -0
- package/dist/src/worker/fake-driver.js.map +1 -1
- package/dist/src/worker/main.js +4 -1
- package/dist/src/worker/main.js.map +1 -1
- package/dist/src/worker/questions.d.ts +67 -0
- package/dist/src/worker/questions.js +152 -0
- package/dist/src/worker/questions.js.map +1 -0
- package/dist/src/worker/run-loop.d.ts +19 -1
- package/dist/src/worker/run-loop.js +91 -25
- package/dist/src/worker/run-loop.js.map +1 -1
- package/dist/src/worker/spawn.d.ts +9 -1
- package/dist/src/worker/spawn.js +12 -3
- package/dist/src/worker/spawn.js.map +1 -1
- package/package.json +3 -2
- package/policy/profiles/culture-agents-claude-subscription.yaml +1 -1
- package/policy/profiles/culture-agents-local-gateway.yaml +1 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"$ref": "#/$defs/action_record",
|
|
7
7
|
"$defs": {
|
|
8
8
|
"action_kind": {
|
|
9
|
-
"description": "Control actions against an existing run. pause
|
|
9
|
+
"description": "Control actions against an existing run. pause and resume are deferred: always refused with `unsupported` in this API version.",
|
|
10
10
|
"enum": [
|
|
11
11
|
"steer",
|
|
12
12
|
"cancel",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
"submit_request": {
|
|
102
|
-
"description": "Body of POST /v1/runs. Optional fields are omitted, never null. Setting `session_id` asks for `continue_session` and setting `parent_run_id` asks for `delegate`; both are refused with `unsupported` in this API version
|
|
102
|
+
"description": "Body of POST /v1/runs. Optional fields are omitted, never null. Setting `session_id` asks for `continue_session` and setting `parent_run_id` asks for `delegate`; both are refused with `unsupported` in this API version. An `agent_id` whose node is not the core's node asks for `placement`, which is refused with `unsupported` until part two builds it (planned). No field of this request sets the run's `submitter` or `base_commit`.",
|
|
103
103
|
"type": "object",
|
|
104
104
|
"additionalProperties": false,
|
|
105
105
|
"required": [
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
}
|
|
142
142
|
},
|
|
143
143
|
"submit_response": {
|
|
144
|
-
"description": "
|
|
144
|
+
"description": "Response of POST /v1/runs. For a new run it is in state `queued` and its worker's PID, event log and cursor are on disk. When `replayed` is true the idempotency key matched an earlier submit: nothing was created and `run` is that first run as it is now.",
|
|
145
145
|
"type": "object",
|
|
146
146
|
"additionalProperties": false,
|
|
147
147
|
"required": [
|
|
@@ -149,15 +149,69 @@
|
|
|
149
149
|
],
|
|
150
150
|
"properties": {
|
|
151
151
|
"run": {
|
|
152
|
-
"$ref": "run.json"
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
"$ref": "run.json"
|
|
153
|
+
},
|
|
154
|
+
"replayed": {
|
|
155
|
+
"description": "True when the request repeated an earlier submit with the same idempotency key. Omitted otherwise.",
|
|
156
|
+
"type": "boolean"
|
|
157
|
+
},
|
|
158
|
+
"warnings": {
|
|
159
|
+
"description": "Things the caller should know about a run that was admitted all the same. Omitted when there are none.",
|
|
160
|
+
"type": "array",
|
|
161
|
+
"minItems": 1,
|
|
162
|
+
"items": {
|
|
163
|
+
"$ref": "#/$defs/warning"
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"if": {
|
|
168
|
+
"required": [
|
|
169
|
+
"replayed"
|
|
170
|
+
],
|
|
171
|
+
"properties": {
|
|
172
|
+
"replayed": {
|
|
173
|
+
"const": true
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"else": {
|
|
178
|
+
"properties": {
|
|
179
|
+
"run": {
|
|
180
|
+
"properties": {
|
|
181
|
+
"state": {
|
|
182
|
+
"const": "queued"
|
|
183
|
+
}
|
|
156
184
|
}
|
|
157
185
|
}
|
|
158
186
|
}
|
|
159
187
|
}
|
|
160
188
|
},
|
|
189
|
+
"warning": {
|
|
190
|
+
"description": "One warning on an admitted submit.",
|
|
191
|
+
"type": "object",
|
|
192
|
+
"additionalProperties": false,
|
|
193
|
+
"required": [
|
|
194
|
+
"code",
|
|
195
|
+
"signal",
|
|
196
|
+
"message"
|
|
197
|
+
],
|
|
198
|
+
"properties": {
|
|
199
|
+
"code": {
|
|
200
|
+
"description": "signal_unknown: an admission signal could not be read or was stale, and a local submit was admitted without it.",
|
|
201
|
+
"enum": [
|
|
202
|
+
"signal_unknown"
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
"signal": {
|
|
206
|
+
"$ref": "capabilities.json#/$defs/signal_name"
|
|
207
|
+
},
|
|
208
|
+
"message": {
|
|
209
|
+
"type": "string",
|
|
210
|
+
"minLength": 1,
|
|
211
|
+
"maxLength": 2000
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
},
|
|
161
215
|
"steer_request": {
|
|
162
216
|
"description": "Body of POST /v1/runs/{run_id}/steer: a mid-run instruction delivered to the harness as user input.",
|
|
163
217
|
"type": "object",
|
|
@@ -232,33 +286,52 @@
|
|
|
232
286
|
}
|
|
233
287
|
},
|
|
234
288
|
"answer_request": {
|
|
235
|
-
"description": "Body of POST /v1/runs/{run_id}/answer
|
|
289
|
+
"description": "Body of POST /v1/runs/{run_id}/answer: the answer to one pending question of the run. For a `question`, give `answer`, `choice_ids` or both. For an `approval`, give `decision`; `answer` is then an optional reason the harness shows the model. The core checks the answer against the question (README: operator questions).",
|
|
236
290
|
"type": "object",
|
|
237
291
|
"additionalProperties": false,
|
|
238
292
|
"required": [
|
|
239
293
|
"caller",
|
|
240
|
-
"question_id"
|
|
241
|
-
"answer"
|
|
294
|
+
"question_id"
|
|
242
295
|
],
|
|
243
296
|
"properties": {
|
|
244
297
|
"caller": {
|
|
245
298
|
"$ref": "common.json#/$defs/principal"
|
|
246
299
|
},
|
|
247
300
|
"question_id": {
|
|
248
|
-
"
|
|
249
|
-
"minLength": 1,
|
|
250
|
-
"maxLength": 128
|
|
301
|
+
"$ref": "common.json#/$defs/question_id"
|
|
251
302
|
},
|
|
252
303
|
"answer": {
|
|
253
304
|
"$ref": "common.json#/$defs/text"
|
|
254
305
|
},
|
|
306
|
+
"choice_ids": {
|
|
307
|
+
"$ref": "#/$defs/choice_ids"
|
|
308
|
+
},
|
|
309
|
+
"decision": {
|
|
310
|
+
"$ref": "#/$defs/decision"
|
|
311
|
+
},
|
|
255
312
|
"idempotency_key": {
|
|
256
313
|
"$ref": "common.json#/$defs/idempotency_key"
|
|
257
314
|
}
|
|
258
315
|
}
|
|
259
316
|
},
|
|
317
|
+
"decision": {
|
|
318
|
+
"description": "The answer to an approval: whether the waiting action may run.",
|
|
319
|
+
"enum": [
|
|
320
|
+
"approve",
|
|
321
|
+
"deny"
|
|
322
|
+
]
|
|
323
|
+
},
|
|
324
|
+
"choice_ids": {
|
|
325
|
+
"description": "Choices picked from the question's `choices`, by id.",
|
|
326
|
+
"type": "array",
|
|
327
|
+
"minItems": 1,
|
|
328
|
+
"maxItems": 50,
|
|
329
|
+
"items": {
|
|
330
|
+
"$ref": "event.json#/$defs/choice_id"
|
|
331
|
+
}
|
|
332
|
+
},
|
|
260
333
|
"accepted_response": {
|
|
261
|
-
"description": "202 response of steer and
|
|
334
|
+
"description": "202 response of steer, cancel and answer: the recorded, accepted action. When `replayed` is true the idempotency key matched an earlier request against this run: nothing was delivered again and `action` is the first one.",
|
|
262
335
|
"type": "object",
|
|
263
336
|
"additionalProperties": false,
|
|
264
337
|
"required": [
|
|
@@ -272,6 +345,10 @@
|
|
|
272
345
|
"const": "accepted"
|
|
273
346
|
}
|
|
274
347
|
}
|
|
348
|
+
},
|
|
349
|
+
"replayed": {
|
|
350
|
+
"description": "True when the request repeated an earlier one with the same idempotency key. Omitted otherwise.",
|
|
351
|
+
"type": "boolean"
|
|
275
352
|
}
|
|
276
353
|
}
|
|
277
354
|
}
|
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
"invalid",
|
|
20
20
|
"denied",
|
|
21
21
|
"not_found",
|
|
22
|
-
"busy",
|
|
23
22
|
"conflict",
|
|
23
|
+
"limit_reached",
|
|
24
|
+
"admission_held",
|
|
24
25
|
"unsupported",
|
|
25
26
|
"incompatible_version",
|
|
26
27
|
"unavailable",
|
|
@@ -61,19 +62,33 @@
|
|
|
61
62
|
"description": "The run the error concerns, when there is one. Required for conflict.",
|
|
62
63
|
"$ref": "common.json#/$defs/run_id"
|
|
63
64
|
},
|
|
64
|
-
"active_run_id": {
|
|
65
|
-
"description": "busy only: the active run holding the repository.",
|
|
66
|
-
"$ref": "common.json#/$defs/run_id"
|
|
67
|
-
},
|
|
68
|
-
"repo": {
|
|
69
|
-
"description": "busy only: the canonical repository path that is busy.",
|
|
70
|
-
"$ref": "common.json#/$defs/repo_path"
|
|
71
|
-
},
|
|
72
65
|
"client_api_version": {
|
|
73
66
|
"$ref": "common.json#/$defs/api_version"
|
|
74
67
|
},
|
|
75
68
|
"server_api_version": {
|
|
76
69
|
"$ref": "common.json#/$defs/api_version"
|
|
70
|
+
},
|
|
71
|
+
"idempotency_key": {
|
|
72
|
+
"description": "conflict only: present when the conflict is an idempotency key that was already used with a different request. `run_id` is then the run the key belongs to.",
|
|
73
|
+
"$ref": "common.json#/$defs/idempotency_key"
|
|
74
|
+
},
|
|
75
|
+
"question_id": {
|
|
76
|
+
"description": "The question the error concerns, when there is one (for example a second answer to one question).",
|
|
77
|
+
"$ref": "common.json#/$defs/question_id"
|
|
78
|
+
},
|
|
79
|
+
"limit": {
|
|
80
|
+
"description": "limit_reached only: the configured limit that refused the submit.",
|
|
81
|
+
"$ref": "#/$defs/limit"
|
|
82
|
+
},
|
|
83
|
+
"signal": {
|
|
84
|
+
"description": "admission_held only: the admission signal that held the submit, as the core read it.",
|
|
85
|
+
"$ref": "#/$defs/held_signal"
|
|
86
|
+
},
|
|
87
|
+
"retry_after_ms": {
|
|
88
|
+
"description": "unavailable only (optional): the core expects the same request to work after about this many milliseconds, for example while it reattaches to the run's worker after a restart.",
|
|
89
|
+
"type": "integer",
|
|
90
|
+
"minimum": 0,
|
|
91
|
+
"maximum": 600000
|
|
77
92
|
}
|
|
78
93
|
},
|
|
79
94
|
"allOf": [
|
|
@@ -106,45 +121,6 @@
|
|
|
106
121
|
}
|
|
107
122
|
}
|
|
108
123
|
},
|
|
109
|
-
{
|
|
110
|
-
"if": {
|
|
111
|
-
"required": [
|
|
112
|
-
"code"
|
|
113
|
-
],
|
|
114
|
-
"properties": {
|
|
115
|
-
"code": {
|
|
116
|
-
"const": "busy"
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
"then": {
|
|
121
|
-
"required": [
|
|
122
|
-
"active_run_id",
|
|
123
|
-
"repo"
|
|
124
|
-
],
|
|
125
|
-
"properties": {
|
|
126
|
-
"retryable": {
|
|
127
|
-
"const": true
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
"else": {
|
|
132
|
-
"not": {
|
|
133
|
-
"anyOf": [
|
|
134
|
-
{
|
|
135
|
-
"required": [
|
|
136
|
-
"active_run_id"
|
|
137
|
-
]
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
"required": [
|
|
141
|
-
"repo"
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
124
|
{
|
|
149
125
|
"if": {
|
|
150
126
|
"required": [
|
|
@@ -262,8 +238,173 @@
|
|
|
262
238
|
}
|
|
263
239
|
}
|
|
264
240
|
}
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"if": {
|
|
244
|
+
"required": [
|
|
245
|
+
"code"
|
|
246
|
+
],
|
|
247
|
+
"properties": {
|
|
248
|
+
"code": {
|
|
249
|
+
"const": "limit_reached"
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"then": {
|
|
254
|
+
"required": [
|
|
255
|
+
"limit"
|
|
256
|
+
],
|
|
257
|
+
"properties": {
|
|
258
|
+
"retryable": {
|
|
259
|
+
"const": true
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"else": {
|
|
264
|
+
"not": {
|
|
265
|
+
"required": [
|
|
266
|
+
"limit"
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"if": {
|
|
273
|
+
"required": [
|
|
274
|
+
"code"
|
|
275
|
+
],
|
|
276
|
+
"properties": {
|
|
277
|
+
"code": {
|
|
278
|
+
"const": "admission_held"
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"then": {
|
|
283
|
+
"required": [
|
|
284
|
+
"signal"
|
|
285
|
+
],
|
|
286
|
+
"properties": {
|
|
287
|
+
"retryable": {
|
|
288
|
+
"const": true
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
"else": {
|
|
293
|
+
"not": {
|
|
294
|
+
"required": [
|
|
295
|
+
"signal"
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"if": {
|
|
302
|
+
"required": [
|
|
303
|
+
"code"
|
|
304
|
+
],
|
|
305
|
+
"properties": {
|
|
306
|
+
"code": {
|
|
307
|
+
"const": "conflict"
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"else": {
|
|
312
|
+
"not": {
|
|
313
|
+
"required": [
|
|
314
|
+
"idempotency_key"
|
|
315
|
+
]
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"if": {
|
|
321
|
+
"required": [
|
|
322
|
+
"idempotency_key"
|
|
323
|
+
]
|
|
324
|
+
},
|
|
325
|
+
"then": {
|
|
326
|
+
"properties": {
|
|
327
|
+
"retryable": {
|
|
328
|
+
"const": false
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"if": {
|
|
335
|
+
"required": [
|
|
336
|
+
"code"
|
|
337
|
+
],
|
|
338
|
+
"properties": {
|
|
339
|
+
"code": {
|
|
340
|
+
"const": "unavailable"
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
"else": {
|
|
345
|
+
"not": {
|
|
346
|
+
"required": [
|
|
347
|
+
"retry_after_ms"
|
|
348
|
+
]
|
|
349
|
+
}
|
|
350
|
+
}
|
|
265
351
|
}
|
|
266
352
|
]
|
|
353
|
+
},
|
|
354
|
+
"limit": {
|
|
355
|
+
"description": "A limit the operator configured on this core, as it stood when it refused a submit. Nothing is queued: the caller retries later or submits elsewhere.",
|
|
356
|
+
"type": "object",
|
|
357
|
+
"additionalProperties": false,
|
|
358
|
+
"required": [
|
|
359
|
+
"name",
|
|
360
|
+
"value",
|
|
361
|
+
"active"
|
|
362
|
+
],
|
|
363
|
+
"properties": {
|
|
364
|
+
"name": {
|
|
365
|
+
"$ref": "capabilities.json#/$defs/limit_name"
|
|
366
|
+
},
|
|
367
|
+
"value": {
|
|
368
|
+
"description": "The configured maximum number of active runs.",
|
|
369
|
+
"type": "integer",
|
|
370
|
+
"minimum": 1
|
|
371
|
+
},
|
|
372
|
+
"active": {
|
|
373
|
+
"description": "How many runs counted against the limit when the submit was refused.",
|
|
374
|
+
"type": "integer",
|
|
375
|
+
"minimum": 0
|
|
376
|
+
},
|
|
377
|
+
"repo": {
|
|
378
|
+
"description": "runs_per_repository only: the canonical repository path the limit was reached for.",
|
|
379
|
+
"$ref": "common.json#/$defs/repo_path"
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
"held_signal": {
|
|
384
|
+
"description": "An admission signal that held a submit on this core's host, as it stood when the core refused it (planned, part two). Nothing is queued: the caller retries later or submits to another host.",
|
|
385
|
+
"type": "object",
|
|
386
|
+
"additionalProperties": false,
|
|
387
|
+
"required": [
|
|
388
|
+
"name",
|
|
389
|
+
"state",
|
|
390
|
+
"observed_at"
|
|
391
|
+
],
|
|
392
|
+
"properties": {
|
|
393
|
+
"name": {
|
|
394
|
+
"$ref": "capabilities.json#/$defs/signal_name"
|
|
395
|
+
},
|
|
396
|
+
"state": {
|
|
397
|
+
"description": "hold: the signal says not to start new work. unknown: the signal is missing or stale, which refuses a submit from another host (a local submit is admitted with a warning instead).",
|
|
398
|
+
"enum": [
|
|
399
|
+
"hold",
|
|
400
|
+
"unknown"
|
|
401
|
+
]
|
|
402
|
+
},
|
|
403
|
+
"observed_at": {
|
|
404
|
+
"description": "The time the signal's publisher stamped on the reading, or null when there is no reading.",
|
|
405
|
+
"$ref": "common.json#/$defs/nullable_timestamp"
|
|
406
|
+
}
|
|
407
|
+
}
|
|
267
408
|
}
|
|
268
409
|
}
|
|
269
410
|
}
|
|
@@ -42,6 +42,12 @@
|
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
"$ref": "#/$defs/error_data"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"$ref": "#/$defs/question_data"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"$ref": "#/$defs/answer_data"
|
|
45
51
|
}
|
|
46
52
|
]
|
|
47
53
|
}
|
|
@@ -141,6 +147,44 @@
|
|
|
141
147
|
}
|
|
142
148
|
}
|
|
143
149
|
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"if": {
|
|
153
|
+
"required": [
|
|
154
|
+
"kind"
|
|
155
|
+
],
|
|
156
|
+
"properties": {
|
|
157
|
+
"kind": {
|
|
158
|
+
"const": "run.question"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"then": {
|
|
163
|
+
"properties": {
|
|
164
|
+
"data": {
|
|
165
|
+
"$ref": "#/$defs/question_data"
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"if": {
|
|
172
|
+
"required": [
|
|
173
|
+
"kind"
|
|
174
|
+
],
|
|
175
|
+
"properties": {
|
|
176
|
+
"kind": {
|
|
177
|
+
"const": "run.answer"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"then": {
|
|
182
|
+
"properties": {
|
|
183
|
+
"data": {
|
|
184
|
+
"$ref": "#/$defs/answer_data"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
144
188
|
}
|
|
145
189
|
],
|
|
146
190
|
"$defs": {
|
|
@@ -150,7 +194,9 @@
|
|
|
150
194
|
"run.output",
|
|
151
195
|
"run.control",
|
|
152
196
|
"run.refused",
|
|
153
|
-
"run.error"
|
|
197
|
+
"run.error",
|
|
198
|
+
"run.question",
|
|
199
|
+
"run.answer"
|
|
154
200
|
]
|
|
155
201
|
},
|
|
156
202
|
"state_data": {
|
|
@@ -219,7 +265,7 @@
|
|
|
219
265
|
}
|
|
220
266
|
},
|
|
221
267
|
"control_data": {
|
|
222
|
-
"description": "A
|
|
268
|
+
"description": "A steer or cancel that was accepted and delivered to the worker. An accepted answer is a `run.answer` event instead.",
|
|
223
269
|
"type": "object",
|
|
224
270
|
"additionalProperties": false,
|
|
225
271
|
"required": [
|
|
@@ -231,6 +277,12 @@
|
|
|
231
277
|
"properties": {
|
|
232
278
|
"outcome": {
|
|
233
279
|
"const": "accepted"
|
|
280
|
+
},
|
|
281
|
+
"kind": {
|
|
282
|
+
"enum": [
|
|
283
|
+
"steer",
|
|
284
|
+
"cancel"
|
|
285
|
+
]
|
|
234
286
|
}
|
|
235
287
|
}
|
|
236
288
|
}
|
|
@@ -282,6 +334,137 @@
|
|
|
282
334
|
}
|
|
283
335
|
}
|
|
284
336
|
},
|
|
337
|
+
"question": {
|
|
338
|
+
"description": "A question a run asks its operator, normalized from what the harness raised. `text`, `choices` and `tool` come from the harness and are untrusted data. The run waits for the answer; nothing else is held for it.",
|
|
339
|
+
"type": "object",
|
|
340
|
+
"additionalProperties": false,
|
|
341
|
+
"required": [
|
|
342
|
+
"id",
|
|
343
|
+
"kind",
|
|
344
|
+
"text",
|
|
345
|
+
"choices",
|
|
346
|
+
"free_text",
|
|
347
|
+
"multiple",
|
|
348
|
+
"answer_by"
|
|
349
|
+
],
|
|
350
|
+
"properties": {
|
|
351
|
+
"id": {
|
|
352
|
+
"$ref": "common.json#/$defs/question_id"
|
|
353
|
+
},
|
|
354
|
+
"kind": {
|
|
355
|
+
"description": "question: the harness asks for information, answered with choices or free text. approval: the harness asks whether it may take one action, answered with a decision.",
|
|
356
|
+
"enum": [
|
|
357
|
+
"question",
|
|
358
|
+
"approval"
|
|
359
|
+
]
|
|
360
|
+
},
|
|
361
|
+
"text": {
|
|
362
|
+
"description": "What is asked. For an approval, a description of the action that waits.",
|
|
363
|
+
"$ref": "common.json#/$defs/text"
|
|
364
|
+
},
|
|
365
|
+
"choices": {
|
|
366
|
+
"description": "The answers the harness offers, in its order. Empty when it offers none.",
|
|
367
|
+
"type": "array",
|
|
368
|
+
"maxItems": 50,
|
|
369
|
+
"items": {
|
|
370
|
+
"$ref": "#/$defs/choice"
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
"free_text": {
|
|
374
|
+
"description": "Whether an answer in the caller's own words is accepted.",
|
|
375
|
+
"type": "boolean"
|
|
376
|
+
},
|
|
377
|
+
"multiple": {
|
|
378
|
+
"description": "Whether more than one choice may be given.",
|
|
379
|
+
"type": "boolean"
|
|
380
|
+
},
|
|
381
|
+
"tool": {
|
|
382
|
+
"description": "approval only (optional): the name of the tool that waits for the decision.",
|
|
383
|
+
"type": "string",
|
|
384
|
+
"minLength": 1,
|
|
385
|
+
"maxLength": 200
|
|
386
|
+
},
|
|
387
|
+
"answer_by": {
|
|
388
|
+
"description": "When this question's own time limit passes, on the executing core's clock. After it the run ends `unanswered`.",
|
|
389
|
+
"$ref": "common.json#/$defs/timestamp"
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
"choice": {
|
|
394
|
+
"type": "object",
|
|
395
|
+
"additionalProperties": false,
|
|
396
|
+
"required": [
|
|
397
|
+
"id",
|
|
398
|
+
"label"
|
|
399
|
+
],
|
|
400
|
+
"properties": {
|
|
401
|
+
"id": {
|
|
402
|
+
"$ref": "#/$defs/choice_id"
|
|
403
|
+
},
|
|
404
|
+
"label": {
|
|
405
|
+
"type": "string",
|
|
406
|
+
"minLength": 1,
|
|
407
|
+
"maxLength": 500
|
|
408
|
+
},
|
|
409
|
+
"description": {
|
|
410
|
+
"type": "string",
|
|
411
|
+
"maxLength": 2000
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
"choice_id": {
|
|
416
|
+
"description": "Identifies one choice within its question.",
|
|
417
|
+
"type": "string",
|
|
418
|
+
"minLength": 1,
|
|
419
|
+
"maxLength": 128
|
|
420
|
+
},
|
|
421
|
+
"question_data": {
|
|
422
|
+
"description": "A question was asked and the run now waits for its answer. It is written to the log before the run starts waiting.",
|
|
423
|
+
"type": "object",
|
|
424
|
+
"additionalProperties": false,
|
|
425
|
+
"required": [
|
|
426
|
+
"question"
|
|
427
|
+
],
|
|
428
|
+
"properties": {
|
|
429
|
+
"question": {
|
|
430
|
+
"$ref": "#/$defs/question"
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
"answer_data": {
|
|
435
|
+
"description": "An answer was accepted and delivered into the run. At most one per question. `answer` is the caller's own words and is untrusted data.",
|
|
436
|
+
"type": "object",
|
|
437
|
+
"additionalProperties": false,
|
|
438
|
+
"required": [
|
|
439
|
+
"question_id",
|
|
440
|
+
"action"
|
|
441
|
+
],
|
|
442
|
+
"properties": {
|
|
443
|
+
"question_id": {
|
|
444
|
+
"$ref": "common.json#/$defs/question_id"
|
|
445
|
+
},
|
|
446
|
+
"action": {
|
|
447
|
+
"$ref": "control-action.json#/$defs/action_record",
|
|
448
|
+
"properties": {
|
|
449
|
+
"kind": {
|
|
450
|
+
"const": "answer"
|
|
451
|
+
},
|
|
452
|
+
"outcome": {
|
|
453
|
+
"const": "accepted"
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
"decision": {
|
|
458
|
+
"$ref": "control-action.json#/$defs/decision"
|
|
459
|
+
},
|
|
460
|
+
"choice_ids": {
|
|
461
|
+
"$ref": "control-action.json#/$defs/choice_ids"
|
|
462
|
+
},
|
|
463
|
+
"answer": {
|
|
464
|
+
"$ref": "common.json#/$defs/text"
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
},
|
|
285
468
|
"event_page": {
|
|
286
469
|
"description": "Response of GET /v1/runs/{run_id}/events (non-streaming logs).",
|
|
287
470
|
"type": "object",
|