monarchic-agent-protocol 0.1.15 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4801d875e1da1deb2b027141f245e2ff1f3c325893c5b1c03fd091e680c89652
4
- data.tar.gz: d2cf9a6e1b0dffdef3979f5862f704622dd87aa3c64721c35b746fefc39045c5
3
+ metadata.gz: e7b63bb50073c69581ec50c46f45c5c8baee323dc3e4c7141bfec77d3e9fb19a
4
+ data.tar.gz: 9e711e198686fd9e8f36210918b187150af4b06080d259ebb1ce4addb4bbdc43
5
5
  SHA512:
6
- metadata.gz: 25ac118fd8a512b2208c6c096bdbf63eff81fc3addf365b4e8f86606fbb151164185e200185e08249d4b630b22b1dd8c8df8ddc45514b81b8479537c5862ea2d
7
- data.tar.gz: 6ae5a3cc87278132d49bf4ad26a4bb900640a090444b47e63dc1ed41b76e3d1647d0356dce88d177483dfa9b884f7e9a8fa33357e461e1202e144944375746c3
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,6 +103,14 @@ 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`
62
115
  - `schemas/v1/run_outcome.json`
63
116
  - `schemas/v1/delivery_contract.json`
@@ -80,12 +133,69 @@ All schemas allow additional properties for forward compatibility.
80
133
  - `schemas/v1/artifact.json`
81
134
  - `schemas/v1/event.json`
82
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`
83
144
  - `schemas/v1/run_context.json`
84
- - `schemas/v1/run_outcome.json`
145
+ - `schemas/v1/dataset_ref.json`
146
+ - `schemas/v1/experiment_spec.json`
147
+ - `schemas/v1/objective_spec.json`
148
+ - `schemas/v1/eval_result.json`
149
+ - `schemas/v1/provenance.json`
85
150
 
86
151
  `schemas/v1/agent_role.json` is a shared schema used by `task.json`.
87
- `schemas/v1/dataset_ref.json`, `schemas/v1/experiment_spec.json`, `schemas/v1/objective_spec.json`,
88
- `schemas/v1/eval_result.json`, and `schemas/v1/provenance.json` are referenced by top-level schemas.
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
89
199
 
90
200
  ### AgentRole
91
201
 
@@ -98,6 +208,7 @@ Enum values:
98
208
  - `reviewer`
99
209
  - `security`
100
210
  - `ops`
211
+ - `publisher`
101
212
 
102
213
  Example:
103
214
 
@@ -107,6 +218,78 @@ Example:
107
218
  }
108
219
  ```
109
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
+
110
293
  ### Task
111
294
 
112
295
  Represents work assigned to an agent.
@@ -124,7 +307,6 @@ Optional fields:
124
307
  - `constraints`: free-form object
125
308
  - `gates_required`: list of gate names to run (ex: `["qa", "security"]`)
126
309
  - `run_context`: `RunContext`
127
- - `delivery_contract`: typed acceptance and risk contract for autonomous delivery loops
128
310
  - `objective_spec`: objective scoring contract for deterministic outcome evaluation
129
311
  - `experiment_spec`: typed experiment design contract for deterministic in silico runs
130
312
 
@@ -243,6 +425,7 @@ Optional fields:
243
425
  - `message`: human-readable details
244
426
  - `provenance`: typed runtime/source hashes for event attribution
245
427
  - `eval_results`: optional metric snapshot payloads
428
+ - `failure_class`: typed failure taxonomy payload for machine-actionable triage
246
429
 
247
430
  Example:
248
431
 
@@ -270,6 +453,7 @@ Required fields:
270
453
  Optional fields:
271
454
 
272
455
  - `reason`: short explanation
456
+ - `failure_class`: typed failure taxonomy payload for deterministic failure routing
273
457
  - `evidence`: free-form object with supporting data
274
458
 
275
459
  Example:
@@ -287,21 +471,125 @@ Example:
287
471
  }
288
472
  ```
289
473
 
290
- ### RunOutcome
474
+ ### FailureClass
291
475
 
292
- Typed summary contract for objective/cost/risk decisions captured at the end of a run.
476
+ Typed taxonomy payload for classifying protocol failures.
293
477
 
294
478
  Required fields:
295
479
 
296
- - `version`: `"v1"`
297
- - `task_id`: task identifier
298
- - `objective_decision`: objective decision label
299
- - `cost_decision`: cost decision label
300
- - `risk_decision`: risk decision label
301
- - `final_decision`: aggregate decision label
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`.
302
485
 
303
- Optional fields include `run_id`, `objective_metric`, `objective_score`, cost budget metrics,
304
- risk detail fields, `summary`, and `evidence`.
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`
305
593
 
306
594
  ### DatasetRef
307
595
 
@@ -367,10 +655,7 @@ Required fields:
367
655
 
368
656
  Optional fields include dataset hashes/references and command/task/pipeline hashes.
369
657
 
370
-
371
- ### Language bindings
372
-
373
- #### Rust
658
+ ## Rust
374
659
 
375
660
  The crate lives at the repo root with sources under `src/rust/lib.rs`.
376
661
 
@@ -381,6 +666,7 @@ let task = Task {
381
666
  version: PROTOCOL_VERSION.to_string(),
382
667
  task_id: "task-123".to_string(),
383
668
  role: AgentRole::Dev as i32,
669
+ role_id: "dev".to_string(),
384
670
  goal: "Implement protocol".to_string(),
385
671
  inputs: None,
386
672
  constraints: None,
@@ -415,7 +701,11 @@ github.com/monarchic-ai/monarchic-agent-protocol/src/go
415
701
 
416
702
  #### Protobuf
417
703
 
418
- The v1 protobuf schema lives at `schemas/v1/monarchic_agent_protocol.proto`. It mirrors the JSON schema and uses `google.protobuf.Struct` for free-form objects (`inputs`, `constraints`, `evidence`, `extensions`). Additional JSON properties should be stored in the `extensions` field on each message.
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`.
419
709
 
420
710
  Language packages are published per registry. Use the registry package for your language instead of generating local outputs.
421
711
 
@@ -454,11 +744,15 @@ Dart sources live under `src/dart`.
454
744
  - `nix develop` provides Rust, Node, jq, Python `jsonschema`, and `protoc`.
455
745
  - `nix flake check` validates JSON schemas, protobuf codegen, and package imports (PyPI + Rust + npm + Go).
456
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`.
457
749
  - Pre-commit schema JSON parse check: `scripts/pre-commit-schema-json-parse.sh`.
458
750
  - Pre-commit schema parse smoke test: `scripts/test-pre-commit-schema-json-parse.sh`.
459
751
  - Schema edit changelog: `schemas/SCHEMA_CHANGELOG.md`.
460
752
  - Schema changelog format test: `scripts/test-schema-changelog-format.sh`.
461
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`.
462
756
  - Protobuf codegen test (all languages): `scripts/test-proto.sh`.
463
757
  - Protobuf availability smoke test: `scripts/test-proto-availability-smoke.sh`.
464
758
  - Protobuf codegen (write to `src/<lang>`): `scripts/generate-proto.sh`.
@@ -466,28 +760,20 @@ Dart sources live under `src/dart`.
466
760
  - JSON Schema regeneration only: `scripts/generate-json-schema.sh`.
467
761
  - JSON Schema generation requires `protoc-gen-jsonschema` (install with `go install github.com/chrusty/protoc-gen-jsonschema/cmd/protoc-gen-jsonschema@latest`).
468
762
 
469
- Use the Nix apps (preferred) or the scripts directly:
470
-
471
- - `nix run .#generate-proto` (`scripts/generate-proto.sh`): regenerate protobuf outputs into `src/<lang>`.
472
- - `nix run .#generate-json-schema` (`scripts/generate-json-schema.sh`): regenerate JSON Schemas from the protobuf source.
473
- - `nix run .#update-local-hashes` (`scripts/update-local-hashes.sh`): refresh hashes for local build inputs.
474
- - `nix run .#update-version -- <version>` (`scripts/update-version.sh`): bump version across manifests and tags (expects `vX.Y.Z` input).
475
- - `nix run .#update-registry-hashes` (`scripts/update-registry-hashes.sh`): refresh hashes for published registries (npm, crates, PyPI, RubyGems, NuGet, JitPack, GitHub source).
476
-
477
- For every schema change, generate protobuf outputs and update local hashes.
478
-
479
- For every release, tag the commit, update versions, push, and update registry hashes *after pushing*.
480
-
481
763
  ### Schema validation workflow
482
764
 
483
765
  1. Run full schema lint and semantic checks: `bash scripts/lint-schemas.sh`.
484
766
  2. Run direct schema fixture checks: `bash scripts/test-json-schema.sh`.
485
- 3. Validate staged schema JSON before commit: `bash scripts/pre-commit-schema-json-parse.sh`.
486
- 4. Verify pre-commit checker behavior is deterministic: `bash scripts/test-pre-commit-schema-json-parse.sh`.
487
- 5. Verify schema changelog entry format: `bash scripts/test-schema-changelog-format.sh`.
488
- 6. Verify README schema index coverage stays aligned: `bash scripts/test-readme-schema-index-coverage.sh`.
489
-
490
- ### Nix packages
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
491
777
 
492
778
  - `packages.default`: Rust crate for protocol types
493
779
  - `packages.rs-lib`: Rust crate for protocol types (local)
@@ -10,6 +10,9 @@
10
10
  "qa",
11
11
  "reviewer",
12
12
  "security",
13
- "ops"
13
+ "ops",
14
+ "publisher",
15
+ "researcher",
16
+ "verification"
14
17
  ]
15
18
  }
@@ -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",
@@ -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",
@@ -4,11 +4,7 @@
4
4
  "title": "EvalResult",
5
5
  "type": "object",
6
6
  "additionalProperties": true,
7
- "required": [
8
- "metric",
9
- "value",
10
- "passed"
11
- ],
7
+ "required": ["metric", "value", "passed"],
12
8
  "properties": {
13
9
  "metric": {
14
10
  "type": "string"
@@ -1,60 +1,33 @@
1
1
  {
2
- "$id": "monarchic.agent_protocol.v1.Event.schema.json",
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
- "patternProperties": {
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
- "eval_results": {
23
- "items": {
24
- "$ref": "monarchic.agent_protocol.v1.EvalResult.schema.json"
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
- "extensions": {
33
- "$ref": "google.protobuf.Struct.schema.json"
16
+ "timestamp": {
17
+ "type": "string",
18
+ "format": "date-time"
34
19
  },
35
- "message": {
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
- "task_id": {
46
- "default": "",
47
- "type": "string"
48
- },
49
- "timestamp": {
50
- "default": "",
26
+ "message": {
51
27
  "type": "string"
52
28
  },
53
- "version": {
54
- "default": "",
55
- "type": "string"
29
+ "failure_class": {
30
+ "$ref": "failure_class.json"
56
31
  }
57
- },
58
- "title": "Event",
59
- "type": "object"
32
+ }
60
33
  }