-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathtask-lifecycle.openapi.yaml
More file actions
3546 lines (3542 loc) · 123 KB
/
task-lifecycle.openapi.yaml
File metadata and controls
3546 lines (3542 loc) · 123 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: AgentRail Task Lifecycle API
version: 0.3.0
summary: Agent-first API for issue -> PR -> CI -> review -> ship
license:
name: AgentRail Source-Available License 1.1
description: |
Contract for agent-native developer workflow operations.
Response shapes are optimized for token efficiency and include `availableActions`
so agents can avoid follow-up calls to discover next steps.
Push delivery uses a shared event envelope across webhooks and event streams so
SDKs can consume one discriminated union regardless of transport.
servers:
- url: http://127.0.0.1:3000
description: Local source-available self-hosted server
- url: https://api.agentrail.app/v1
description: Future AgentRail Cloud API
security:
- bearerAuth: []
tags:
- name: Agent Auth
description: Agent API key lifecycle, least-privilege scopes, rate limits, and usage attribution.
- name: Operations
description: Operational endpoints for health checks and deployment verification.
- name: Providers
description: Provider-specific inbound integration surfaces behind stable AgentRail task contracts.
- name: Tasks
description: Pull-based task lifecycle operations for assigned work, review state, CI, and shipping.
- name: Task Events
description: Push-based task lifecycle delivery primitives for webhooks and event streams.
- name: Webhooks
description: Outbound webhook contracts emitted by AgentRail.
paths:
/health:
get:
tags: [Operations]
operationId: getHealth
summary: Get the service health snapshot
description: |
Returns an unauthenticated health payload for deployment checks and uptime
monitors. When `AGENTRAIL_PUBLIC_BASE_URL` includes a path prefix such as
`/v1`, the server accepts both `/health` and `{prefix}/health`.
security: []
responses:
'200':
description: Service is healthy and accepting traffic
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- status
- service
- publicBaseUrl
- pathPrefix
- time
- uptimeSeconds
properties:
status:
type: string
const: ok
service:
type: string
description: Stable service identifier for operational dashboards
publicBaseUrl:
type: string
format: uri
description: Canonical base URL advertised by the service
pathPrefix:
type:
- string
- 'null'
description: Optional public path prefix accepted by API routes
time:
type: string
format: date-time
uptimeSeconds:
type: integer
minimum: 0
examples:
cloud:
value:
status: ok
service: agentrail-service
publicBaseUrl: https://api.agentrail.app/v1
pathPrefix: /v1
time: '2026-05-04T14:54:17Z'
uptimeSeconds: 43
/agent-api-keys:
post:
tags: [Agent Auth]
operationId: createAgentApiKey
summary: Create an API key for one agent identity
description: |
Issues a scoped opaque bearer key for one agent identity.
Safe to retry with the same `Idempotency-Key` and identical request body.
Reusing the key with a different payload returns `409 conflict`.
The first bootstrap request MAY be unauthenticated only when it creates an
`auth:admin` key; later calls require an existing key with `auth:admin`.
The `apiKey` value is returned only by create and rotate responses.
parameters:
- $ref: '#/components/parameters/IdempotencyKeyHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AgentApiKeyCreateRequest'
examples:
ci_reader:
value:
agent:
id: agt_ci_reader
displayName: CI Reader
role: platform_ci
externalIdentities:
- provider: github
subject: agentrail-ci-reader
scopes: ['ci:read']
rateLimit:
windowSeconds: 60
maxRequests: 600
expiresAt: '2026-06-01T00:00:00Z'
responses:
'201':
description: Agent API key created
content:
application/json:
schema:
$ref: '#/components/schemas/AgentApiKeyResponse'
examples:
default:
value:
data:
id: akey_01JY52RRF5PAGHT5DCZXJ4N2DG
apiKey: ar_live_example_created_once
agent:
id: agt_ci_reader
displayName: CI Reader
role: platform_ci
externalIdentities:
- provider: github
subject: agentrail-ci-reader
scopes: ['ci:read']
rateLimit:
windowSeconds: 60
maxRequests: 600
status: active
createdAt: '2026-05-01T04:30:00Z'
expiresAt: '2026-06-01T00:00:00Z'
rotatedFromKeyId: null
availableActions: [rotate, view_usage]
availableActions: [rotate, view_usage]
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/InsufficientScope'
'429':
$ref: '#/components/responses/RateLimited'
'409':
description: Idempotency conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
idempotency_mismatch:
value:
error:
code: conflict
message: Idempotency-Key has already been used with a different request payload.
details:
idempotencyKey: agent-key-AGEA-7-v1
availableActions: [retry]
/agent-api-keys/{keyId}/rotate:
post:
tags: [Agent Auth]
operationId: rotateAgentApiKey
summary: Rotate one agent API key
description: |
Creates a replacement key for the same agent identity, scopes, and rate
limit, then immediately invalidates the previous key. Safe to retry with
the same `Idempotency-Key` and identical request body.
parameters:
- $ref: '#/components/parameters/AgentApiKeyIdPath'
- $ref: '#/components/parameters/IdempotencyKeyHeader'
requestBody:
required: false
content:
application/json:
schema:
$ref: '#/components/schemas/AgentApiKeyRotateRequest'
examples:
default:
value:
expiresAt: '2026-07-01T00:00:00Z'
responses:
'201':
description: Replacement key created
content:
application/json:
schema:
$ref: '#/components/schemas/AgentApiKeyResponse'
examples:
default:
value:
data:
id: akey_01JY52WNA3Z1W3HPJSK3V7S3M2
apiKey: ar_live_example_replacement
agent:
id: agt_ci_reader
displayName: CI Reader
role: platform_ci
externalIdentities:
- provider: github
subject: agentrail-ci-reader
scopes: ['ci:read']
rateLimit:
windowSeconds: 60
maxRequests: 600
status: active
createdAt: '2026-05-01T04:45:00Z'
expiresAt: '2026-07-01T00:00:00Z'
rotatedFromKeyId: akey_01JY52RRF5PAGHT5DCZXJ4N2DG
availableActions: [rotate, view_usage]
availableActions: [rotate, view_usage]
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/InsufficientScope'
'429':
$ref: '#/components/responses/RateLimited'
'409':
description: Key is inactive or idempotency payload changed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
inactive:
value:
error:
code: conflict
message: Agent API key is not active.
details:
keyId: akey_01JY52RRF5PAGHT5DCZXJ4N2DG
currentStatus: rotated
availableActions: [retry]
/agent-api-keys/{keyId}/usage:
get:
tags: [Agent Auth]
operationId: getAgentApiKeyUsage
summary: Get compact usage attribution for one agent API key
description: |
Returns bounded usage counters for a key so agents and operators can
attribute activity across tools without fetching logs. Requires
`usage:read`; `auth:admin` keys also satisfy this scope.
parameters:
- $ref: '#/components/parameters/AgentApiKeyIdPath'
responses:
'200':
description: Agent API key usage summary
content:
application/json:
schema:
$ref: '#/components/schemas/AgentApiKeyUsageResponse'
examples:
default:
value:
data:
keyId: akey_01JY52RRF5PAGHT5DCZXJ4N2DG
agent:
id: agt_ci_reader
displayName: CI Reader
role: platform_ci
externalIdentities:
- provider: github
subject: agentrail-ci-reader
status: active
lastUsedAt: '2026-05-01T04:32:12Z'
totals:
accepted: 42
denied: 1
byScope:
- scope: ci:read
count: 42
byOperation:
- operation: get_task_ci_status
count: 42
rateLimit:
windowSeconds: 60
maxRequests: 600
currentWindow:
startedAt: '2026-05-01T04:32:00Z'
resetAt: '2026-05-01T04:33:00Z'
used: 12
remaining: 588
availableActions: [rotate]
availableActions: [rotate]
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/InsufficientScope'
'429':
$ref: '#/components/responses/RateLimited'
/tasks/mine:
get:
tags: [Tasks]
operationId: listMyTasks
summary: List tasks assigned to the current agent
description: |
Returns the compact task list for the authenticated agent.
`agentrail doctor` uses this route as the final local onboarding
success gate after auth, profile, and routing bootstrap.
parameters:
- in: query
name: status
schema:
type: string
enum: [todo, in_progress, in_review, blocked]
description: Optional status filter
- in: query
name: limit
schema:
type: integer
minimum: 1
maximum: 100
default: 25
- in: query
name: cursor
schema:
type: string
description: Opaque pagination cursor
responses:
'200':
description: Task list
content:
application/json:
schema:
$ref: '#/components/schemas/TaskListResponse'
examples:
default:
value:
data:
- id: tsk_01JY4X8Q6J5Q3P7M0N2K3R4T5V
identifier: AGEA-2
title: Design Task Lifecycle API schema
status: in_progress
priority: critical
dueAt: null
updatedAt: '2026-05-01T02:48:05Z'
availableActions: [submit]
blocker: null
- id: tsk_01JY4X8Q6J5Q3P7M0N2K3R4T5W
identifier: AGEA-5
title: Implement GitHub adapter error mapping
status: todo
priority: high
dueAt: '2026-05-02T18:00:00Z'
updatedAt: '2026-05-01T01:22:11Z'
availableActions: [start]
blocker: null
page:
nextCursor: eyJvZmZzZXQiOjI1fQ
hasMore: true
availableActions: [fetch_next_page]
meta:
tokenBudgetHint: compact
'401':
$ref: '#/components/responses/Unauthorized'
/tasks/{id}:
get:
tags: [Tasks]
operationId: getTaskById
summary: Get full details for one task
parameters:
- $ref: '#/components/parameters/TaskIdPath'
responses:
'200':
description: Task details
content:
application/json:
schema:
$ref: '#/components/schemas/TaskDetailResponse'
examples:
default:
value:
data:
id: tsk_01JY4X8Q6J5Q3P7M0N2K3R4T5V
identifier: AGEA-2
title: Design Task Lifecycle API schema
description: Create OpenAPI 3.1 spec with six lifecycle endpoints and examples.
status: in_progress
priority: critical
assignee:
id: agt_cto
name: CTO
acceptanceCriteria:
- Endpoint contracts include request and response examples
- Happy-path tests for each endpoint
- Include availableActions on each response
links:
issue: https://github.com/oxnw/agentrail/issues/2
parentIssue: https://github.com/oxnw/agentrail/issues/1
context:
project: onboarding
goal: Validate agent-native software infrastructure in 14 days
updatedAt: '2026-05-01T02:48:05Z'
submissionId: null
prUrl: null
prNumber: null
branch: null
baseBranch: null
headSha: null
assigneeAgentId: agt_cto
triageQueueId: null
assignmentSource: null
routingDecisionId: null
routingReason: null
routingConfidence: null
availableActions: [submit, view_ci_status, view_review_feedback]
blocker: null
availableActions: [submit]
meta:
truncatedFields: []
tokenBudgetHint: standard
'404':
$ref: '#/components/responses/NotFound'
/tasks/{id}/blocker:
post:
tags: [Tasks]
operationId: blockTaskAwaitingUser
summary: Mark a task blocked awaiting user action
description: |
Records that an assigned agent cannot continue until the user takes an
explicit action. The task lifecycle status becomes `blocked`, while the
blocker payload explains the user action required and how the agent can
resume after resolution.
parameters:
- $ref: '#/components/parameters/TaskIdPath'
- $ref: '#/components/parameters/IdempotencyKeyHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TaskBlockerRequest'
examples:
missing_credentials:
value:
sourceRunId: run_01JY50DG4S5SJC48W0MVV8R3H2
sourceAgentId: agt_cto
reason: missing_github_credentials
actionRequired: Reconnect GitHub for the repository.
resumeInstructions: Resolve the blocker, then let AgentRail start a fresh run.
responses:
'202':
description: Task blocked awaiting user action
content:
application/json:
schema:
$ref: '#/components/schemas/TaskDetailResponse'
examples:
blocked:
value:
data:
id: tsk_01JY4X8Q6J5Q3P7M0N2K3R4T5V
identifier: AGEA-42
title: Repair GitHub integration
description: Continue the assigned task after GitHub credentials are restored.
status: blocked
priority: high
assignee:
id: agt_cto
name: CTO
acceptanceCriteria:
- GitHub credentials are available to the runner
links:
issue: https://github.com/oxnw/agentrail/issues/42
parentIssue: null
context:
project: onboarding
goal: Complete the managed runner setup flow
updatedAt: '2026-05-01T03:12:00Z'
submissionId: null
prUrl: null
prNumber: null
branch: null
baseBranch: null
headSha: null
assigneeAgentId: agt_cto
triageQueueId: null
assignmentSource: deterministic_rule
routingDecisionId: null
routingReason: null
routingConfidence: null
availableActions: [resolve_blocker]
blocker:
kind: awaiting_user
sourceRunId: run_01JY50DG4S5SJC48W0MVV8R3H2
sourceAgentId: agt_cto
reason: missing_github_credentials
actionRequired: Reconnect GitHub for the repository.
resumeInstructions: Resolve the blocker, then let AgentRail start a fresh run.
createdAt: '2026-05-01T02:48:05Z'
availableActions: [resolve_blocker]
meta:
truncatedFields: []
tokenBudgetHint: standard
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/Conflict'
/tasks/{id}/resolve-blocker:
post:
tags: [Tasks]
operationId: resolveTaskBlocker
summary: Resolve an awaiting-user blocker
description: |
Clears a task blocker after the user has completed the requested action.
The task returns to `todo` with `availableActions: [start]`; the previous
run remains `awaiting_user` for history and a later run starts fresh.
parameters:
- $ref: '#/components/parameters/TaskIdPath'
- $ref: '#/components/parameters/IdempotencyKeyHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TaskResolveBlockerRequest'
examples:
resolved:
value:
resolutionSummary: GitHub was reconnected for the repository.
responses:
'202':
description: Task blocker resolved
content:
application/json:
schema:
$ref: '#/components/schemas/TaskDetailResponse'
examples:
resolved:
value:
data:
id: tsk_01JY4X8Q6J5Q3P7M0N2K3R4T5V
identifier: AGEA-42
title: Repair GitHub integration
description: Continue the assigned task after GitHub credentials are restored.
status: todo
priority: high
assignee:
id: agt_cto
name: CTO
acceptanceCriteria:
- GitHub credentials are available to the runner
links:
issue: https://github.com/oxnw/agentrail/issues/42
parentIssue: null
context:
project: onboarding
goal: Complete the managed runner setup flow
updatedAt: '2026-05-01T03:12:00Z'
submissionId: null
prUrl: null
prNumber: null
branch: null
baseBranch: null
headSha: null
assigneeAgentId: agt_cto
triageQueueId: null
assignmentSource: deterministic_rule
routingDecisionId: null
routingReason: null
routingConfidence: null
availableActions: [start]
blocker: null
availableActions: [start]
meta:
truncatedFields: []
tokenBudgetHint: standard
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/Conflict'
/tasks/{id}/submit:
post:
tags: [Tasks]
operationId: submitTaskWork
summary: Submit work for review
description: |
By default, AgentRail asks the configured provider adapter to create or
reuse the pull request for this task. Deterministic local demos can use
`mode: artifact` with caller-supplied artifacts.
Safe to retry with the same `Idempotency-Key` and identical request body.
Reusing the key with a different payload returns `409 conflict`.
parameters:
- $ref: '#/components/parameters/TaskIdPath'
- $ref: '#/components/parameters/IdempotencyKeyHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TaskSubmitRequest'
examples:
adapter_managed:
summary: Adapter-managed PR creation
value:
summary: Implemented the assigned task and pushed commits to the task branch.
mode: adapter_managed
pullRequest:
title: Fix adapter-managed submit contract
draft: false
checks:
- name: sdk-contract
status: passed
notes: AgentRail should create or reuse the provider PR for this task.
artifact_demo:
summary: Placeholder local artifact
value:
summary: Submitted a placeholder local artifact.
mode: artifact
artifacts:
- type: pull_request
url: https://github.com/oxnw/agentrail/pull/42
- type: doc
url: https://github.com/oxnw/agentrail/blob/main/docs/api/task-lifecycle.openapi.yaml
checks:
- name: spec-lint
status: passed
notes: Use only for local demos without provider credentials.
responses:
'202':
description: Submission accepted and routed to review
content:
application/json:
schema:
$ref: '#/components/schemas/TaskSubmissionResponse'
examples:
default:
value:
data:
submissionId: sub_01JY4Y4A9P10G6EM7Q3JJ2M1A2
taskId: tsk_01JY4X8Q6J5Q3P7M0N2K3R4T5V
status: in_review
prUrl: https://github.com/oxnw/agentrail/pull/42
prNumber: 42
head: agentrail/task-42
base: main
headSha: abc123
action: created
idempotencyKey: submit-AGEA-2-v1
reviewRoute:
participants:
- id: agt_ceo
role: ceo
acceptedAt: '2026-05-01T03:01:11Z'
availableActions: [view_review_feedback, view_ci_status]
availableActions: [view_review_feedback]
'400':
$ref: '#/components/responses/ValidationError'
'404':
$ref: '#/components/responses/NotFound'
'409':
description: Task not in a submittable state
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
already_submitted:
value:
error:
code: conflict
message: Task is already in review.
details:
currentStatus: in_review
availableActions: [view_review_feedback]
idempotency_mismatch:
value:
error:
code: conflict
message: Idempotency-Key has already been used with a different request payload.
details:
idempotencyKey: submit-AGEA-2-v1
availableActions: [retry]
/tasks/{id}/ci-status:
get:
tags: [Tasks]
operationId: getTaskCiStatus
summary: Get CI summary for the task's latest submission
parameters:
- $ref: '#/components/parameters/TaskIdPath'
responses:
'200':
description: CI status
content:
application/json:
schema:
$ref: '#/components/schemas/TaskCiStatusResponse'
examples:
green:
value:
data:
taskId: tsk_01JY4X8Q6J5Q3P7M0N2K3R4T5V
submissionId: sub_01JY4Y4A9P10G6EM7Q3JJ2M1A2
overallStatus: passed
summary:
total: 2
passed: 2
failed: 0
running: 0
queued: 0
cancelled: 0
skipped: 0
workflows:
- name: CI
path: .github/workflows/ci.yml
status: passed
passed: 2
failed: 0
running: 0
queued: 0
cancelled: 0
skipped: 0
url: https://github.com/oxnw/agentrail/actions/runs/1201
checks:
- name: unit-tests
workflow: CI
status: passed
url: https://github.com/oxnw/agentrail/actions/runs/1201/job/11
durationSeconds: 42
failureCount: 0
- name: contract-tests
workflow: CI
status: passed
url: https://github.com/oxnw/agentrail/actions/runs/1201/job/12
durationSeconds: 18
failureCount: 0
failureSummaries: []
flakyHints: []
updatedAt: '2026-05-01T03:03:19Z'
availableActions: [view_review_feedback]
availableActions: [view_review_feedback]
meta:
tokenBudgetHint: compact
truncatedFields: []
failed:
value:
data:
taskId: tsk_01JY4X8Q6J5Q3P7M0N2K3R4T5V
submissionId: sub_01JY4Y4A9P10G6EM7Q3JJ2M1A2
overallStatus: failed
summary:
total: 3
passed: 1
failed: 1
running: 1
queued: 0
cancelled: 0
skipped: 0
workflows:
- name: CI
path: .github/workflows/ci.yml
status: failed
passed: 0
failed: 1
running: 1
queued: 0
cancelled: 0
skipped: 0
url: https://github.com/oxnw/agentrail/actions/runs/1201
- name: Lint
path: .github/workflows/lint.yml
status: passed
passed: 1
failed: 0
running: 0
queued: 0
cancelled: 0
skipped: 0
url: https://github.com/oxnw/agentrail/actions/runs/1202
checks:
- name: unit-tests
workflow: CI
status: failed
url: https://github.com/oxnw/agentrail/actions/runs/1201/job/11
durationSeconds: 42
failureCount: 1
- name: contract-tests
workflow: CI
status: running
url: https://github.com/oxnw/agentrail/actions/runs/1201/job/12
durationSeconds: null
failureCount: 0
- name: eslint
workflow: Lint
status: passed
url: https://github.com/oxnw/agentrail/actions/runs/1202/job/21
durationSeconds: 12
failureCount: 0
failureSummaries:
- checkName: unit-tests
workflow: CI
testName: GET /tasks/{id}/ci-status returns structured failures
file: test/ci-status-endpoint.test.js
line: 44
message: Expected status 200 but received 500
flakyHints:
- checkName: unit-tests
confidence: medium
reason: same check passed on a previous run for this head SHA
updatedAt: '2026-05-01T03:03:19Z'
availableActions: [retry_failed_checks, view_logs]
availableActions: [retry_failed_checks, view_logs]
meta:
tokenBudgetHint: standard
truncatedFields: []
'404':
$ref: '#/components/responses/NotFound'
'429':
description: GitHub Actions rate limit or secondary abuse limit reached
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
github_rate_limited:
value:
error:
code: ci_source_rate_limited
message: GitHub Actions CI source rejected the request.
details:
sourceStatus: 403
availableActions: [retry]
'502':
description: GitHub Actions source unavailable or authentication failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
github_auth_failed:
value:
error:
code: ci_source_auth_failed
message: GitHub Actions CI source rejected the request.
details:
sourceStatus: 401
availableActions: [retry]
/tasks/{id}/review-feedback:
get:
tags: [Tasks]
operationId: getTaskReviewFeedback
summary: Get latest reviewer feedback for task
parameters:
- $ref: '#/components/parameters/TaskIdPath'
responses:
'200':
description: Reviewer decision and comments
content:
application/json:
schema:
$ref: '#/components/schemas/TaskReviewFeedbackResponse'
examples:
changes_requested:
value:
data:
taskId: tsk_01JY4X8Q6J5Q3P7M0N2K3R4T5V
latestDecision:
outcome: changes_requested
reviewer:
id: agt_ceo
role: ceo
createdAt: '2026-05-01T03:05:40Z'
summary: Add explicit idempotency semantics to ship endpoint.
comments:
- id: cmt_01JY4YKTWSQCPVHCBD3MDYCR4A
authorRole: ceo
body: Include 409 behavior when ship is called before CI green.
severity: must_fix
availableActions: [fix]
availableActions: [fix]
'404':
$ref: '#/components/responses/NotFound'
/tasks/{id}/ship:
post:
tags: [Tasks]
operationId: shipTaskWork
summary: Trigger merge/deploy for an approved task
description: |
Safe to retry with the same `Idempotency-Key` and identical request body.
Reusing the key with a different payload returns `409 conflict`.
parameters:
- $ref: '#/components/parameters/TaskIdPath'
- $ref: '#/components/parameters/IdempotencyKeyHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TaskShipRequest'
examples:
default:
value:
mode: merge_and_deploy
targetEnvironment: production
expectedHeadSha: b5bc7f86b9ad94f4f18f83d28bdf3e27a31e53a0
responses:
'202':
description: Ship operation accepted
content:
application/json:
schema:
$ref: '#/components/schemas/TaskShipResponse'
examples:
default:
value:
data:
taskId: tsk_01JY4X8Q6J5Q3P7M0N2K3R4T5V
operationId: shp_01JY4YP2N9PTDP8PHV7ZV8B7XS
status: queued
queuedAt: '2026-05-01T03:12:02Z'
availableActions: [view_ci_status]
availableActions: [view_ci_status]
'400':
$ref: '#/components/responses/ValidationError'
'404':
$ref: '#/components/responses/NotFound'
'409':
description: Task is not shippable
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
ci_not_green:
value:
error:
code: conflict
message: Task cannot be shipped until CI is green and review is approved.
details:
currentStatus: in_review
ciStatus: running
reviewStatus: approved
availableActions: [view_ci_status]
idempotency_mismatch:
value:
error:
code: conflict
message: Idempotency-Key has already been used with a different request payload.
details:
idempotencyKey: ship-AGEA-2-v1
availableActions: [retry]
/event-subscriptions:
get:
tags: [Task Events]
operationId: listEventSubscriptions
summary: List AgentRail event subscriptions
description: |
Lists durable event subscriptions for operational visibility.
Requires a key with `webhooks:read`; creating or disabling
subscriptions still requires `webhooks:write`.
responses:
'200':
description: Event subscriptions listed
content:
application/json:
schema:
$ref: '#/components/schemas/EventSubscriptionListResponse'
examples:
default:
value:
data:
- id: evsub_01JY5046P0GQF33KKV80M0X19A
url: https://agents.example.com/webhooks/task-events
eventTypes: [task.awaiting_user, task.updated, task.reviewed, task.shipped]
filters:
taskIds: