monarchic-agent-protocol 0.1.14 → 0.1.16
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.
- checksums.yaml +4 -4
- data/README.md +325 -24
- data/schemas/v1/agent_role.json +4 -1
- data/schemas/v1/artifact.json +18 -0
- data/schemas/v1/dataset_ref.json +2 -13
- data/schemas/v1/eval_result.json +1 -5
- data/schemas/v1/event.json +15 -42
- data/schemas/v1/execution_receipt.json +69 -0
- data/schemas/v1/experiment_spec.json +3 -16
- data/schemas/v1/failure_class.json +46 -0
- data/schemas/v1/failure_detail.json +33 -0
- data/schemas/v1/gate_result.json +16 -16
- data/schemas/v1/google.protobuf.Struct.schema.json +7 -0
- data/schemas/v1/monarchic.agent_protocol.v1.DatasetRef.schema.json +9 -0
- data/schemas/v1/monarchic.agent_protocol.v1.DeliveryContract.schema.json +9 -0
- data/schemas/v1/monarchic.agent_protocol.v1.EvalResult.schema.json +9 -0
- data/schemas/v1/monarchic.agent_protocol.v1.ExperimentSpec.schema.json +9 -0
- data/schemas/v1/monarchic.agent_protocol.v1.ObjectiveSpec.schema.json +9 -0
- data/schemas/v1/monarchic.agent_protocol.v1.RunContext.schema.json +9 -0
- data/schemas/v1/monarchic_agent_protocol.proto +995 -16
- data/schemas/v1/objective_spec.json +4 -15
- data/schemas/v1/plan.json +55 -0
- data/schemas/v1/plan_provenance.json +25 -0
- data/schemas/v1/plan_status.json +17 -0
- data/schemas/v1/plan_step.json +31 -0
- data/schemas/v1/provenance.json +1 -8
- data/schemas/v1/role_provenance.json +22 -0
- data/schemas/v1/run_outcome.json +388 -0
- data/schemas/v1/schema.json +54 -5
- data/schemas/v1/task.json +42 -21
- data/src/ruby/monarchic_agent_protocol_pb.rb +78 -2
- metadata +18 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e7b63bb50073c69581ec50c46f45c5c8baee323dc3e4c7141bfec77d3e9fb19a
|
|
4
|
+
data.tar.gz: 9e711e198686fd9e8f36210918b187150af4b06080d259ebb1ce4addb4bbdc43
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5063ed88f2e4159f01801f12301723b6614d5d22ddf22198e56838c551253d47a735175e6e6fa2f4610e85cc2b59f3e481a450bd05a9164a42018ee35bbdc38b
|
|
7
|
+
data.tar.gz: 75a5b45df12e375dd2a0ca9b3a911f6239582901e097398ee4ff44c40567785cea72505c00623eb8f87959d48d7c4f233c1888acbf4bd514f2dcc3f1397c69e9
|
data/README.md
CHANGED
|
@@ -32,6 +32,7 @@ Install the published package for your language, then use the generated bindings
|
|
|
32
32
|
|
|
33
33
|
- Rust: `examples/rust/task.rs`
|
|
34
34
|
- TypeScript: `examples/ts/task.ts`
|
|
35
|
+
- JSON (non-protobuf): `examples/json/objective_spec.minimal.json`
|
|
35
36
|
- Protobuf C++: `examples/proto/cpp/task.cpp`
|
|
36
37
|
- Protobuf Java: `examples/proto/java/TaskExample.java`
|
|
37
38
|
- Protobuf Kotlin: `examples/proto/kotlin/TaskExample.kt`
|
|
@@ -42,12 +43,56 @@ Install the published package for your language, then use the generated bindings
|
|
|
42
43
|
- Protobuf Dart: `examples/proto/dart/task.dart`
|
|
43
44
|
- Protobuf Rust: `examples/proto/rust/task.rs`
|
|
44
45
|
|
|
46
|
+
### Non-protobuf language support
|
|
47
|
+
|
|
48
|
+
For languages that do not use protobuf bindings, exchange protocol objects as JSON and validate payloads against the versioned schemas before handoff.
|
|
49
|
+
|
|
50
|
+
- Canonical JSON example for non-protobuf consumers: `examples/json/objective_spec.minimal.json`
|
|
51
|
+
- Validate a typed payload against a specific schema: `bash scripts/validate-protocol-json.sh schemas/v1/objective_spec.json schemas/fixtures/valid/objective_spec.minimal.json`
|
|
52
|
+
- Validate the canonical non-protobuf JSON example: `bash scripts/validate-protocol-json.sh schemas/v1/objective_spec.json examples/json/objective_spec.minimal.json`
|
|
53
|
+
|
|
54
|
+
Project-state contract fixtures used by the shell verification suite live under `fixtures/project-state/`, not the repo root.
|
|
55
|
+
|
|
45
56
|
### Versioning
|
|
46
57
|
|
|
47
58
|
- Protocol versions live under `schemas/v1/`.
|
|
48
59
|
- Each v1 object requires `version: "v1"`.
|
|
49
60
|
- New versions must be added under a new directory (e.g. `schemas/v2/`) without changing existing v1 files.
|
|
50
61
|
|
|
62
|
+
### Client boundary contracts
|
|
63
|
+
|
|
64
|
+
The Rust crate also exposes a frozen client-boundary surface under `monarchic_agent_protocol::client_boundary`.
|
|
65
|
+
|
|
66
|
+
Frozen v1 client-boundary types:
|
|
67
|
+
|
|
68
|
+
- `Intent`
|
|
69
|
+
- `Plan`
|
|
70
|
+
- `PlanStep`
|
|
71
|
+
- `ExecutionReceipt`
|
|
72
|
+
- `VerificationReceipt`
|
|
73
|
+
- `ReviewDecision`
|
|
74
|
+
- `RerunScope`
|
|
75
|
+
- `BlockedOutcome`
|
|
76
|
+
- `ArtifactDescriptor`
|
|
77
|
+
|
|
78
|
+
Canonical JSON fixtures for these contracts live under `fixtures/client_boundary/v1/`.
|
|
79
|
+
Legacy runtime compatibility fixtures live under `fixtures/client_boundary/v0/`.
|
|
80
|
+
|
|
81
|
+
### Durable authority contracts
|
|
82
|
+
|
|
83
|
+
The Rust crate also exposes a frozen durable-authority surface under `monarchic_agent_protocol::durable_authority`.
|
|
84
|
+
|
|
85
|
+
Frozen v1 durable-authority types:
|
|
86
|
+
|
|
87
|
+
- `FencingToken`
|
|
88
|
+
- `Lease`
|
|
89
|
+
- `RunLifecycleState`
|
|
90
|
+
- `StepLifecycleState`
|
|
91
|
+
- `LeaseRejectionReason`
|
|
92
|
+
- `RecoveryEvent`
|
|
93
|
+
|
|
94
|
+
Canonical JSON fixtures for these contracts live under `fixtures/durable_authority/v1/`.
|
|
95
|
+
|
|
51
96
|
### Schema summary
|
|
52
97
|
|
|
53
98
|
JSON Schema files are generated from the protobuf definitions. Do not edit them by hand.
|
|
@@ -58,7 +103,16 @@ Schema files live under `schemas/v1/`:
|
|
|
58
103
|
- `schemas/v1/artifact.json`
|
|
59
104
|
- `schemas/v1/event.json`
|
|
60
105
|
- `schemas/v1/gate_result.json`
|
|
106
|
+
- `schemas/v1/failure_class.json`
|
|
107
|
+
- `schemas/v1/plan_status.json`
|
|
108
|
+
- `schemas/v1/failure_detail.json`
|
|
109
|
+
- `schemas/v1/role_provenance.json`
|
|
110
|
+
- `schemas/v1/plan_provenance.json`
|
|
111
|
+
- `schemas/v1/plan_step.json`
|
|
112
|
+
- `schemas/v1/plan.json`
|
|
113
|
+
- `schemas/v1/execution_receipt.json`
|
|
61
114
|
- `schemas/v1/run_context.json`
|
|
115
|
+
- `schemas/v1/run_outcome.json`
|
|
62
116
|
- `schemas/v1/delivery_contract.json`
|
|
63
117
|
- `schemas/v1/agent_role.json`
|
|
64
118
|
- `schemas/v1/dataset_ref.json`
|
|
@@ -79,6 +133,14 @@ All schemas allow additional properties for forward compatibility.
|
|
|
79
133
|
- `schemas/v1/artifact.json`
|
|
80
134
|
- `schemas/v1/event.json`
|
|
81
135
|
- `schemas/v1/gate_result.json`
|
|
136
|
+
- `schemas/v1/failure_class.json`
|
|
137
|
+
- `schemas/v1/plan_status.json`
|
|
138
|
+
- `schemas/v1/failure_detail.json`
|
|
139
|
+
- `schemas/v1/role_provenance.json`
|
|
140
|
+
- `schemas/v1/plan_provenance.json`
|
|
141
|
+
- `schemas/v1/plan_step.json`
|
|
142
|
+
- `schemas/v1/plan.json`
|
|
143
|
+
- `schemas/v1/execution_receipt.json`
|
|
82
144
|
- `schemas/v1/run_context.json`
|
|
83
145
|
- `schemas/v1/dataset_ref.json`
|
|
84
146
|
- `schemas/v1/experiment_spec.json`
|
|
@@ -87,6 +149,53 @@ All schemas allow additional properties for forward compatibility.
|
|
|
87
149
|
- `schemas/v1/provenance.json`
|
|
88
150
|
|
|
89
151
|
`schemas/v1/agent_role.json` is a shared schema used by `task.json`.
|
|
152
|
+
`schemas/v1/failure_class.json` is a shared schema used by `event.json` and `gate_result.json`.
|
|
153
|
+
|
|
154
|
+
### TaskMessage and TaskMessageAck
|
|
155
|
+
|
|
156
|
+
These types define the shared contract for orchestrator-mediated runner
|
|
157
|
+
communication.
|
|
158
|
+
|
|
159
|
+
They are intended for:
|
|
160
|
+
|
|
161
|
+
- durable handoff messages between active tasks
|
|
162
|
+
- clarification requests and responses
|
|
163
|
+
- blocker notices
|
|
164
|
+
- artifact-ready notifications
|
|
165
|
+
- explicit acknowledgement state
|
|
166
|
+
|
|
167
|
+
They are not intended to imply direct peer-to-peer runner transport. The
|
|
168
|
+
protocol defines the message shape, but routing, persistence, and delivery are
|
|
169
|
+
owned by the orchestrator.
|
|
170
|
+
|
|
171
|
+
`TaskMessage` carries:
|
|
172
|
+
|
|
173
|
+
- sender and recipient task ids
|
|
174
|
+
- message kind
|
|
175
|
+
- optional subject/body
|
|
176
|
+
- referenced artifact ids
|
|
177
|
+
- optional reply chaining
|
|
178
|
+
- acknowledgement requirement
|
|
179
|
+
|
|
180
|
+
`TaskMessageAck` records recipient acknowledgement state separately so mailbox
|
|
181
|
+
delivery can remain append-only and auditable.
|
|
182
|
+
|
|
183
|
+
Recommended acknowledgement semantics:
|
|
184
|
+
|
|
185
|
+
- `received`: the recipient has seen the message in its inbox
|
|
186
|
+
- `accepted`: the recipient accepts the request and plans to act on it
|
|
187
|
+
- `rejected`: the recipient explicitly declines or cannot act on it
|
|
188
|
+
- `resolved`: the recipient completed the requested follow-up or supplied the
|
|
189
|
+
final response
|
|
190
|
+
|
|
191
|
+
Recommended routing semantics:
|
|
192
|
+
|
|
193
|
+
- message ids should be unique within one run
|
|
194
|
+
- sender and recipient should be tasks from the same run
|
|
195
|
+
- `reply_to`, when present, should reference an earlier message id from the
|
|
196
|
+
same run log
|
|
197
|
+
- `requires_ack=true` should imply at least one corresponding
|
|
198
|
+
`TaskMessageAck` record from the recipient
|
|
90
199
|
|
|
91
200
|
### AgentRole
|
|
92
201
|
|
|
@@ -99,6 +208,7 @@ Enum values:
|
|
|
99
208
|
- `reviewer`
|
|
100
209
|
- `security`
|
|
101
210
|
- `ops`
|
|
211
|
+
- `publisher`
|
|
102
212
|
|
|
103
213
|
Example:
|
|
104
214
|
|
|
@@ -108,6 +218,78 @@ Example:
|
|
|
108
218
|
}
|
|
109
219
|
```
|
|
110
220
|
|
|
221
|
+
### PipelineSpec
|
|
222
|
+
|
|
223
|
+
Represents a planned pipeline before execution.
|
|
224
|
+
|
|
225
|
+
Required fields:
|
|
226
|
+
|
|
227
|
+
- `version`: `"v1"`
|
|
228
|
+
- `pipeline_id`: stable identifier
|
|
229
|
+
- `objective`: human-readable campaign or pipeline objective
|
|
230
|
+
- `project_key`: member/project scope identifier
|
|
231
|
+
- `tasks`: ordered `PipelineTask[]`
|
|
232
|
+
|
|
233
|
+
This is the shared planning shape that bootstrap generation, orchestration
|
|
234
|
+
validation, and UI preview should converge on.
|
|
235
|
+
|
|
236
|
+
Current shared planning fields now include:
|
|
237
|
+
|
|
238
|
+
- `PipelineSpec`
|
|
239
|
+
- `PipelineTask`
|
|
240
|
+
- `TaskDependency`
|
|
241
|
+
- `SkillRef`
|
|
242
|
+
- `RoleDefinition`
|
|
243
|
+
- `ResolvedRoleBundle`
|
|
244
|
+
|
|
245
|
+
These are available in the protobuf and language bindings even where the checked-in
|
|
246
|
+
JSON Schema index has not yet been expanded to cover each planning helper type.
|
|
247
|
+
|
|
248
|
+
### RoleDefinition and ResolvedRoleBundle
|
|
249
|
+
|
|
250
|
+
These types provide the shared contract between:
|
|
251
|
+
|
|
252
|
+
- role catalogs in `monarchic-agent-roles`
|
|
253
|
+
- orchestration-time validation
|
|
254
|
+
- runner-time execution bundles
|
|
255
|
+
|
|
256
|
+
`RoleDefinition` describes a canonical role, its capabilities, and its declared
|
|
257
|
+
skill requirements. `ResolvedRoleBundle` is the runtime handoff shape that can
|
|
258
|
+
pair a concrete role definition with the resolved skills and rendered template
|
|
259
|
+
path used for one task execution.
|
|
260
|
+
|
|
261
|
+
### Canonical Pipeline Layout
|
|
262
|
+
|
|
263
|
+
`PipelineSpec` and `PipelineTask` are now the canonical role-aware planning
|
|
264
|
+
layout across the stack.
|
|
265
|
+
|
|
266
|
+
For compatibility, older minimal pipeline files may still only carry:
|
|
267
|
+
|
|
268
|
+
- `pipeline_id`
|
|
269
|
+
- `tasks[].id`
|
|
270
|
+
- `tasks[].task`
|
|
271
|
+
|
|
272
|
+
But once a pipeline opts into the role-aware contract by declaring any of:
|
|
273
|
+
|
|
274
|
+
- `objective`
|
|
275
|
+
- `project_key`
|
|
276
|
+
- `tasks[].role`
|
|
277
|
+
- `tasks[].goal`
|
|
278
|
+
- `tasks[].required_skills`
|
|
279
|
+
|
|
280
|
+
the intended canonical shape is:
|
|
281
|
+
|
|
282
|
+
- `PipelineSpec.objective`: required, non-empty
|
|
283
|
+
- `PipelineSpec.project_key`: required, non-empty
|
|
284
|
+
- `PipelineTask.role`: required, non-empty
|
|
285
|
+
- `PipelineTask.goal`: required, non-empty
|
|
286
|
+
- `PipelineTask.required_skills`: optional list of `SkillRef`, but when present it
|
|
287
|
+
must be internally well-formed and deduplicated
|
|
288
|
+
|
|
289
|
+
This is the contract `monarch` should generate, `monarchic-orchestrator` should
|
|
290
|
+
validate, and `monarchic-runner` should ultimately execute through resolved role
|
|
291
|
+
bundles.
|
|
292
|
+
|
|
111
293
|
### Task
|
|
112
294
|
|
|
113
295
|
Represents work assigned to an agent.
|
|
@@ -125,7 +307,6 @@ Optional fields:
|
|
|
125
307
|
- `constraints`: free-form object
|
|
126
308
|
- `gates_required`: list of gate names to run (ex: `["qa", "security"]`)
|
|
127
309
|
- `run_context`: `RunContext`
|
|
128
|
-
- `delivery_contract`: typed acceptance and risk contract for autonomous delivery loops
|
|
129
310
|
- `objective_spec`: objective scoring contract for deterministic outcome evaluation
|
|
130
311
|
- `experiment_spec`: typed experiment design contract for deterministic in silico runs
|
|
131
312
|
|
|
@@ -244,6 +425,7 @@ Optional fields:
|
|
|
244
425
|
- `message`: human-readable details
|
|
245
426
|
- `provenance`: typed runtime/source hashes for event attribution
|
|
246
427
|
- `eval_results`: optional metric snapshot payloads
|
|
428
|
+
- `failure_class`: typed failure taxonomy payload for machine-actionable triage
|
|
247
429
|
|
|
248
430
|
Example:
|
|
249
431
|
|
|
@@ -271,6 +453,7 @@ Required fields:
|
|
|
271
453
|
Optional fields:
|
|
272
454
|
|
|
273
455
|
- `reason`: short explanation
|
|
456
|
+
- `failure_class`: typed failure taxonomy payload for deterministic failure routing
|
|
274
457
|
- `evidence`: free-form object with supporting data
|
|
275
458
|
|
|
276
459
|
Example:
|
|
@@ -288,6 +471,126 @@ Example:
|
|
|
288
471
|
}
|
|
289
472
|
```
|
|
290
473
|
|
|
474
|
+
### FailureClass
|
|
475
|
+
|
|
476
|
+
Typed taxonomy payload for classifying protocol failures.
|
|
477
|
+
|
|
478
|
+
Required fields:
|
|
479
|
+
|
|
480
|
+
- `category`: `validation`, `dependency`, `environment`, `timeout`, `conflict`, `permission`, `resource`, `internal`, or `unknown`
|
|
481
|
+
- `code`: stable machine-readable failure code
|
|
482
|
+
- `retryable`: whether automated retry is expected to be useful
|
|
483
|
+
|
|
484
|
+
Optional fields include `detail`, `scope`, `source`, and `next_action`.
|
|
485
|
+
|
|
486
|
+
### PlanStatus
|
|
487
|
+
|
|
488
|
+
Plan lifecycle status used for typed execution plans and receipts.
|
|
489
|
+
|
|
490
|
+
Allowed values:
|
|
491
|
+
|
|
492
|
+
- `unspecified`
|
|
493
|
+
- `draft`
|
|
494
|
+
- `planned`
|
|
495
|
+
- `executing`
|
|
496
|
+
- `complete`
|
|
497
|
+
- `bounded`
|
|
498
|
+
- `failed`
|
|
499
|
+
- `cancelled`
|
|
500
|
+
- `unknown`
|
|
501
|
+
|
|
502
|
+
### FailureDetail
|
|
503
|
+
|
|
504
|
+
Failure detail attached to a plan or receipt.
|
|
505
|
+
|
|
506
|
+
Required fields:
|
|
507
|
+
|
|
508
|
+
- `class`: one of `validation`, `execution`, `agent`, `infra`, `policy`, or `unknown`
|
|
509
|
+
- `code`: machine-readable failure code
|
|
510
|
+
- `message`: operator-readable failure message
|
|
511
|
+
|
|
512
|
+
Optional fields:
|
|
513
|
+
|
|
514
|
+
- `details`: bounded extension object with implementation diagnostics
|
|
515
|
+
|
|
516
|
+
### RoleProvenance
|
|
517
|
+
|
|
518
|
+
Role metadata for deterministic role-template binding.
|
|
519
|
+
|
|
520
|
+
Required fields:
|
|
521
|
+
|
|
522
|
+
- `role_name`
|
|
523
|
+
- `template_hash`
|
|
524
|
+
- `render_hash`
|
|
525
|
+
|
|
526
|
+
### PlanProvenance
|
|
527
|
+
|
|
528
|
+
Generation metadata for a plan and policy context.
|
|
529
|
+
|
|
530
|
+
Required fields:
|
|
531
|
+
|
|
532
|
+
- `generated_by`
|
|
533
|
+
- `generated_at_ms`
|
|
534
|
+
|
|
535
|
+
Optional fields:
|
|
536
|
+
|
|
537
|
+
- `policy_profile`
|
|
538
|
+
- `role`
|
|
539
|
+
|
|
540
|
+
### PlanStep
|
|
541
|
+
|
|
542
|
+
Execution step in a plan, with dependency and template fields.
|
|
543
|
+
|
|
544
|
+
Required fields:
|
|
545
|
+
|
|
546
|
+
- `step_id`
|
|
547
|
+
- `description`
|
|
548
|
+
- `task_template`
|
|
549
|
+
|
|
550
|
+
Optional fields:
|
|
551
|
+
|
|
552
|
+
- `depends_on`
|
|
553
|
+
- `failure`
|
|
554
|
+
|
|
555
|
+
### Plan
|
|
556
|
+
|
|
557
|
+
Canonical plan contract.
|
|
558
|
+
|
|
559
|
+
Required fields:
|
|
560
|
+
|
|
561
|
+
- `contract_version`: required contract tag (for now `"v1"`)
|
|
562
|
+
- `plan_id`
|
|
563
|
+
- `objective`
|
|
564
|
+
- `status`
|
|
565
|
+
- `created_at_ms`
|
|
566
|
+
- `updated_at_ms`
|
|
567
|
+
- `provenance`
|
|
568
|
+
- `steps`
|
|
569
|
+
|
|
570
|
+
Optional fields:
|
|
571
|
+
|
|
572
|
+
- `run_id`
|
|
573
|
+
|
|
574
|
+
### ExecutionReceipt
|
|
575
|
+
|
|
576
|
+
Deterministic execution contract for a run.
|
|
577
|
+
|
|
578
|
+
Required fields:
|
|
579
|
+
|
|
580
|
+
- `contract_version`: required contract tag (for now `"v1"`)
|
|
581
|
+
- `run_id`
|
|
582
|
+
- `plan_id`
|
|
583
|
+
- `plan_hash`
|
|
584
|
+
- `task_hashes`
|
|
585
|
+
- `artifact_hashes`
|
|
586
|
+
- `outcome_hash`
|
|
587
|
+
- `status`
|
|
588
|
+
- `generated_at_ms`
|
|
589
|
+
|
|
590
|
+
Optional fields:
|
|
591
|
+
|
|
592
|
+
- `failure`
|
|
593
|
+
|
|
291
594
|
### DatasetRef
|
|
292
595
|
|
|
293
596
|
Reference to a dataset used by an experiment or output artifact.
|
|
@@ -352,10 +655,7 @@ Required fields:
|
|
|
352
655
|
|
|
353
656
|
Optional fields include dataset hashes/references and command/task/pipeline hashes.
|
|
354
657
|
|
|
355
|
-
|
|
356
|
-
### Language bindings
|
|
357
|
-
|
|
358
|
-
#### Rust
|
|
658
|
+
## Rust
|
|
359
659
|
|
|
360
660
|
The crate lives at the repo root with sources under `src/rust/lib.rs`.
|
|
361
661
|
|
|
@@ -366,6 +666,7 @@ let task = Task {
|
|
|
366
666
|
version: PROTOCOL_VERSION.to_string(),
|
|
367
667
|
task_id: "task-123".to_string(),
|
|
368
668
|
role: AgentRole::Dev as i32,
|
|
669
|
+
role_id: "dev".to_string(),
|
|
369
670
|
goal: "Implement protocol".to_string(),
|
|
370
671
|
inputs: None,
|
|
371
672
|
constraints: None,
|
|
@@ -400,7 +701,11 @@ github.com/monarchic-ai/monarchic-agent-protocol/src/go
|
|
|
400
701
|
|
|
401
702
|
#### Protobuf
|
|
402
703
|
|
|
403
|
-
The v1 protobuf schema lives at `schemas/v1/monarchic_agent_protocol.proto`.
|
|
704
|
+
The v1 protobuf schema lives at `schemas/v1/monarchic_agent_protocol.proto`. Its portable object messages mirror the JSON schema and use `google.protobuf.Struct` for free-form objects (`inputs`, `constraints`, `evidence`, `extensions`). Additional JSON properties should be stored in the `extensions` field on each message.
|
|
705
|
+
|
|
706
|
+
The protobuf file also contains transport-only service definitions for machine-to-machine control-plane RPC, starting with `RunnerControlService`. Those protobuf-only contracts cover registration, heartbeats, lease acquisition, lease renewal, lease resume, step progress/outcome reporting, and cancellation acknowledgement, and they are not mirrored into the JSON schema index.
|
|
707
|
+
|
|
708
|
+
The Rust crate published from this repository currently exports protobuf message types. Runtime repositories that need gRPC client/server bindings should generate transport stubs from the canonical proto with their chosen toolchain, such as `tonic-build`.
|
|
404
709
|
|
|
405
710
|
Language packages are published per registry. Use the registry package for your language instead of generating local outputs.
|
|
406
711
|
|
|
@@ -439,11 +744,15 @@ Dart sources live under `src/dart`.
|
|
|
439
744
|
- `nix develop` provides Rust, Node, jq, Python `jsonschema`, and `protoc`.
|
|
440
745
|
- `nix flake check` validates JSON schemas, protobuf codegen, and package imports (PyPI + Rust + npm + Go).
|
|
441
746
|
- JSON Schema test: `scripts/test-json-schema.sh`.
|
|
747
|
+
- Language-agnostic schema validation helper: `scripts/validate-protocol-json.sh`.
|
|
748
|
+
- Language-agnostic schema validator regression test: `scripts/test-validate-protocol-json.sh`.
|
|
442
749
|
- Pre-commit schema JSON parse check: `scripts/pre-commit-schema-json-parse.sh`.
|
|
443
750
|
- Pre-commit schema parse smoke test: `scripts/test-pre-commit-schema-json-parse.sh`.
|
|
444
751
|
- Schema edit changelog: `schemas/SCHEMA_CHANGELOG.md`.
|
|
445
752
|
- Schema changelog format test: `scripts/test-schema-changelog-format.sh`.
|
|
446
753
|
- README schema index coverage test: `scripts/test-readme-schema-index-coverage.sh`.
|
|
754
|
+
- README examples coverage test: `scripts/test-readme-examples-coverage.sh`.
|
|
755
|
+
- README/examples examples synchronization test: `scripts/test-readme-examples-sync.sh`.
|
|
447
756
|
- Protobuf codegen test (all languages): `scripts/test-proto.sh`.
|
|
448
757
|
- Protobuf availability smoke test: `scripts/test-proto-availability-smoke.sh`.
|
|
449
758
|
- Protobuf codegen (write to `src/<lang>`): `scripts/generate-proto.sh`.
|
|
@@ -451,28 +760,20 @@ Dart sources live under `src/dart`.
|
|
|
451
760
|
- JSON Schema regeneration only: `scripts/generate-json-schema.sh`.
|
|
452
761
|
- JSON Schema generation requires `protoc-gen-jsonschema` (install with `go install github.com/chrusty/protoc-gen-jsonschema/cmd/protoc-gen-jsonschema@latest`).
|
|
453
762
|
|
|
454
|
-
Use the Nix apps (preferred) or the scripts directly:
|
|
455
|
-
|
|
456
|
-
- `nix run .#generate-proto` (`scripts/generate-proto.sh`): regenerate protobuf outputs into `src/<lang>`.
|
|
457
|
-
- `nix run .#generate-json-schema` (`scripts/generate-json-schema.sh`): regenerate JSON Schemas from the protobuf source.
|
|
458
|
-
- `nix run .#update-local-hashes` (`scripts/update-local-hashes.sh`): refresh hashes for local build inputs.
|
|
459
|
-
- `nix run .#update-version -- <version>` (`scripts/update-version.sh`): bump version across manifests and tags (expects `vX.Y.Z` input).
|
|
460
|
-
- `nix run .#update-registry-hashes` (`scripts/update-registry-hashes.sh`): refresh hashes for published registries (npm, crates, PyPI, RubyGems, NuGet, JitPack, GitHub source).
|
|
461
|
-
|
|
462
|
-
For every schema change, generate protobuf outputs and update local hashes.
|
|
463
|
-
|
|
464
|
-
For every release, tag the commit, update versions, push, and update registry hashes *after pushing*.
|
|
465
|
-
|
|
466
763
|
### Schema validation workflow
|
|
467
764
|
|
|
468
765
|
1. Run full schema lint and semantic checks: `bash scripts/lint-schemas.sh`.
|
|
469
766
|
2. Run direct schema fixture checks: `bash scripts/test-json-schema.sh`.
|
|
470
|
-
3. Validate
|
|
471
|
-
4. Verify
|
|
472
|
-
5.
|
|
473
|
-
6. Verify
|
|
474
|
-
|
|
475
|
-
|
|
767
|
+
3. Validate language-agnostic payloads through JSON schema: `bash scripts/validate-protocol-json.sh schemas/v1/objective_spec.json schemas/fixtures/valid/objective_spec.minimal.json`.
|
|
768
|
+
4. Verify schema validator behavior is deterministic: `bash scripts/test-validate-protocol-json.sh`.
|
|
769
|
+
5. Validate staged schema JSON before commit: `bash scripts/pre-commit-schema-json-parse.sh`.
|
|
770
|
+
6. Verify pre-commit checker behavior is deterministic: `bash scripts/test-pre-commit-schema-json-parse.sh`.
|
|
771
|
+
7. Verify schema changelog entry format: `bash scripts/test-schema-changelog-format.sh`.
|
|
772
|
+
8. Verify README schema index coverage stays aligned: `bash scripts/test-readme-schema-index-coverage.sh`.
|
|
773
|
+
9. Verify README examples coverage for non-protobuf and protobuf paths: `bash scripts/test-readme-examples-coverage.sh`.
|
|
774
|
+
10. Verify README and examples/README example entries stay synchronized: `bash scripts/test-readme-examples-sync.sh`.
|
|
775
|
+
|
|
776
|
+
## Nix packages
|
|
476
777
|
|
|
477
778
|
- `packages.default`: Rust crate for protocol types
|
|
478
779
|
- `packages.rs-lib`: Rust crate for protocol types (local)
|
data/schemas/v1/agent_role.json
CHANGED
data/schemas/v1/artifact.json
CHANGED
|
@@ -72,6 +72,24 @@
|
|
|
72
72
|
"version": {
|
|
73
73
|
"default": "",
|
|
74
74
|
"type": "string"
|
|
75
|
+
},
|
|
76
|
+
"provenance": {
|
|
77
|
+
"$ref": "provenance.json"
|
|
78
|
+
},
|
|
79
|
+
"dataset_refs": {
|
|
80
|
+
"type": "array",
|
|
81
|
+
"items": {
|
|
82
|
+
"$ref": "dataset_ref.json"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"eval_results": {
|
|
86
|
+
"type": "array",
|
|
87
|
+
"items": {
|
|
88
|
+
"$ref": "eval_result.json"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"experiment_spec": {
|
|
92
|
+
"$ref": "experiment_spec.json"
|
|
75
93
|
}
|
|
76
94
|
},
|
|
77
95
|
"title": "Artifact",
|
data/schemas/v1/dataset_ref.json
CHANGED
|
@@ -4,11 +4,7 @@
|
|
|
4
4
|
"title": "DatasetRef",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"additionalProperties": true,
|
|
7
|
-
"required": [
|
|
8
|
-
"dataset_id",
|
|
9
|
-
"sha256",
|
|
10
|
-
"format"
|
|
11
|
-
],
|
|
7
|
+
"required": ["dataset_id", "sha256", "format"],
|
|
12
8
|
"properties": {
|
|
13
9
|
"dataset_id": {
|
|
14
10
|
"type": "string"
|
|
@@ -25,14 +21,7 @@
|
|
|
25
21
|
},
|
|
26
22
|
"split": {
|
|
27
23
|
"type": "string",
|
|
28
|
-
"enum": [
|
|
29
|
-
"train",
|
|
30
|
-
"validation",
|
|
31
|
-
"test",
|
|
32
|
-
"holdout",
|
|
33
|
-
"reference",
|
|
34
|
-
"other"
|
|
35
|
-
]
|
|
24
|
+
"enum": ["train", "validation", "test", "holdout", "reference", "other"]
|
|
36
25
|
},
|
|
37
26
|
"size_bytes": {
|
|
38
27
|
"type": "integer",
|
data/schemas/v1/eval_result.json
CHANGED
data/schemas/v1/event.json
CHANGED
|
@@ -1,60 +1,33 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "monarchic.
|
|
2
|
+
"$id": "https://monarchic.ai/schema/v1/event.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"title": "Event",
|
|
5
|
+
"type": "object",
|
|
4
6
|
"additionalProperties": true,
|
|
5
|
-
"
|
|
6
|
-
"^(evalResults)$": {
|
|
7
|
-
"items": {
|
|
8
|
-
"$ref": "monarchic.agent_protocol.v1.EvalResult.schema.json"
|
|
9
|
-
},
|
|
10
|
-
"type": "array"
|
|
11
|
-
},
|
|
12
|
-
"^(eventType)$": {
|
|
13
|
-
"default": "",
|
|
14
|
-
"type": "string"
|
|
15
|
-
},
|
|
16
|
-
"^(taskId)$": {
|
|
17
|
-
"default": "",
|
|
18
|
-
"type": "string"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
7
|
+
"required": ["version", "event_type", "timestamp", "task_id", "status"],
|
|
21
8
|
"properties": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
"type": "array"
|
|
9
|
+
"version": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"const": "v1"
|
|
27
12
|
},
|
|
28
13
|
"event_type": {
|
|
29
|
-
"default": "",
|
|
30
14
|
"type": "string"
|
|
31
15
|
},
|
|
32
|
-
"
|
|
33
|
-
"
|
|
16
|
+
"timestamp": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"format": "date-time"
|
|
34
19
|
},
|
|
35
|
-
"
|
|
20
|
+
"task_id": {
|
|
36
21
|
"type": "string"
|
|
37
22
|
},
|
|
38
|
-
"provenance": {
|
|
39
|
-
"$ref": "monarchic.agent_protocol.v1.Provenance.schema.json"
|
|
40
|
-
},
|
|
41
23
|
"status": {
|
|
42
|
-
"default": "",
|
|
43
24
|
"type": "string"
|
|
44
25
|
},
|
|
45
|
-
"
|
|
46
|
-
"default": "",
|
|
47
|
-
"type": "string"
|
|
48
|
-
},
|
|
49
|
-
"timestamp": {
|
|
50
|
-
"default": "",
|
|
26
|
+
"message": {
|
|
51
27
|
"type": "string"
|
|
52
28
|
},
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"type": "string"
|
|
29
|
+
"failure_class": {
|
|
30
|
+
"$ref": "failure_class.json"
|
|
56
31
|
}
|
|
57
|
-
}
|
|
58
|
-
"title": "Event",
|
|
59
|
-
"type": "object"
|
|
32
|
+
}
|
|
60
33
|
}
|