monarchic-agent-protocol 0.1.9 → 0.1.11
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/LICENSE +204 -0
- data/README.md +215 -26
- data/schemas/v1/artifact.json +62 -12
- data/schemas/v1/dataset_ref.json +45 -0
- data/schemas/v1/delivery_contract.json +78 -0
- data/schemas/v1/eval_result.json +39 -0
- data/schemas/v1/event.json +43 -13
- data/schemas/v1/experiment_spec.json +79 -0
- data/schemas/v1/gate_result.json +16 -13
- data/schemas/v1/monarchic_agent_protocol.proto +99 -1
- data/schemas/v1/objective_spec.json +62 -0
- data/schemas/v1/provenance.json +69 -0
- data/schemas/v1/run_context.json +23 -17
- data/schemas/v1/task.json +89 -23
- data/src/ruby/monarchic_agent_protocol_pb.rb +8 -1
- metadata +11 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cba36e0ed8b43fde2b501bfb05bf424459128adbce8a0ab53ec1c761fb45f49d
|
|
4
|
+
data.tar.gz: 96755712648c855dc46950dc0c2ec35972a14a26898bf07362a125a0c80108aa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ee38e87b721fee0f61fbf468fe94f7a2a2e86c0caa1f1c0f3a771ce595ea831ccf907cf4b4438c0fbbef2bef43c0a915a2682277bbaec17eb473d5b793b48094
|
|
7
|
+
data.tar.gz: 2b9e26dca896bfe4330c16633d8fc964b838d319786b3243d63400cea5cbc8e30e8f8ba11089d6d812b8fb4900f3083a71bc577c5bb38c5df04036ffdcada3dd
|
data/LICENSE
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are covered by
|
|
74
|
+
this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this
|
|
77
|
+
license document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this
|
|
92
|
+
license document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
|
166
|
+
|
|
167
|
+
7. Disclaimer of Warranty.
|
|
168
|
+
|
|
169
|
+
THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY
|
|
170
|
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
171
|
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT
|
|
172
|
+
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
|
|
173
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
174
|
+
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
|
175
|
+
PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE
|
|
176
|
+
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
|
177
|
+
CORRECTION.
|
|
178
|
+
|
|
179
|
+
8. Limitation of Liability.
|
|
180
|
+
|
|
181
|
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
182
|
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
|
|
183
|
+
CONVEYS THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
|
184
|
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
|
|
185
|
+
ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT
|
|
186
|
+
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES
|
|
187
|
+
SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO
|
|
188
|
+
OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY
|
|
189
|
+
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
190
|
+
|
|
191
|
+
9. Accepting Warranty or Additional Liability.
|
|
192
|
+
|
|
193
|
+
While redistributing the Library, you may choose to offer, and charge
|
|
194
|
+
a fee for, acceptance of support, warranty, indemnity, or other
|
|
195
|
+
liability obligations and/or rights consistent with this License.
|
|
196
|
+
However, in accepting such obligations, you may act only on your own
|
|
197
|
+
behalf and on your sole responsibility, not on behalf of any other
|
|
198
|
+
copyright holder, and only if you agree to indemnify, defend, and
|
|
199
|
+
hold each copyright holder harmless for any liability incurred by, or
|
|
200
|
+
claims asserted against, such copyright holder by reason of your
|
|
201
|
+
accepting any such warranty or additional liability.
|
|
202
|
+
|
|
203
|
+
END OF TERMS AND CONDITIONS
|
|
204
|
+
|
data/README.md
CHANGED
|
@@ -1,20 +1,56 @@
|
|
|
1
1
|
# Monarchic AI Protocol
|
|
2
2
|
|
|
3
|
+
[](https://github.com/monarchic-ai/monarchic-agent-protocol/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/monarchic-ai/monarchic-agent-protocol/actions/workflows/release.yml)
|
|
5
|
+
|
|
3
6
|
This repository defines the shared, versioned protocol for Monarchic AI. It is the compatibility layer between the orchestrator, runner, and agent roles, so the schemas are minimal and stable while allowing forward-compatible extensions.
|
|
4
7
|
|
|
5
|
-
##
|
|
8
|
+
## Overview
|
|
6
9
|
|
|
7
10
|
- Provide versioned JSON Schemas for language-agnostic validation.
|
|
8
11
|
- Provide Rust, TypeScript, and Protobuf bindings that mirror the schemas.
|
|
9
12
|
- Keep the protocol small and explicit for v1 interoperability.
|
|
10
13
|
|
|
11
|
-
##
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
### Quickstart
|
|
17
|
+
|
|
18
|
+
Install the published package for your language, then use the generated bindings.
|
|
19
|
+
|
|
20
|
+
### Install
|
|
21
|
+
|
|
22
|
+
- Rust (crates.io): `cargo add monarchic-agent-protocol`
|
|
23
|
+
- TypeScript (npm): `npm install @monarchic-ai/monarchic-agent-protocol`
|
|
24
|
+
- Python (PyPI): `pip install monarchic-agent-protocol`
|
|
25
|
+
- Ruby (RubyGems): `gem install monarchic-agent-protocol`
|
|
26
|
+
- Go (Go modules): `go get github.com/monarchic-ai/monarchic-agent-protocol/src/go@vX.Y.Z`
|
|
27
|
+
- Java/Kotlin (JitPack): `implementation("com.github.monarchic-ai:monarchic-agent-protocol:vX.Y.Z")`
|
|
28
|
+
- .NET (NuGet): `dotnet add package Monarchic.AgentProtocol`
|
|
29
|
+
- PHP (Packagist): `composer require monarchic-ai/monarchic-agent-protocol`
|
|
30
|
+
|
|
31
|
+
### Examples
|
|
32
|
+
|
|
33
|
+
- Rust: `examples/rust/task.rs`
|
|
34
|
+
- TypeScript: `examples/ts/task.ts`
|
|
35
|
+
- Protobuf C++: `examples/proto/cpp/task.cpp`
|
|
36
|
+
- Protobuf Java: `examples/proto/java/TaskExample.java`
|
|
37
|
+
- Protobuf Kotlin: `examples/proto/kotlin/TaskExample.kt`
|
|
38
|
+
- Protobuf C#: `examples/proto/csharp/TaskExample.cs`
|
|
39
|
+
- Protobuf Python: `examples/proto/python/task.py`
|
|
40
|
+
- Protobuf Ruby: `examples/proto/ruby/task.rb`
|
|
41
|
+
- Protobuf PHP: `examples/proto/php/task.php`
|
|
42
|
+
- Protobuf Dart: `examples/proto/dart/task.dart`
|
|
43
|
+
- Protobuf Rust: `examples/proto/rust/task.rs`
|
|
44
|
+
|
|
45
|
+
### Versioning
|
|
12
46
|
|
|
13
47
|
- Protocol versions live under `schemas/v1/`.
|
|
14
48
|
- Each v1 object requires `version: "v1"`.
|
|
15
49
|
- New versions must be added under a new directory (e.g. `schemas/v2/`) without changing existing v1 files.
|
|
16
50
|
|
|
17
|
-
|
|
51
|
+
### Schema summary
|
|
52
|
+
|
|
53
|
+
JSON Schema files are generated from the protobuf definitions. Do not edit them by hand.
|
|
18
54
|
|
|
19
55
|
Schema files live under `schemas/v1/`:
|
|
20
56
|
|
|
@@ -23,12 +59,35 @@ Schema files live under `schemas/v1/`:
|
|
|
23
59
|
- `schemas/v1/event.json`
|
|
24
60
|
- `schemas/v1/gate_result.json`
|
|
25
61
|
- `schemas/v1/run_context.json`
|
|
62
|
+
- `schemas/v1/delivery_contract.json`
|
|
26
63
|
- `schemas/v1/agent_role.json`
|
|
64
|
+
- `schemas/v1/dataset_ref.json`
|
|
65
|
+
- `schemas/v1/experiment_spec.json`
|
|
66
|
+
- `schemas/v1/objective_spec.json`
|
|
67
|
+
- `schemas/v1/eval_result.json`
|
|
68
|
+
- `schemas/v1/provenance.json`
|
|
27
69
|
- `schemas/v1/schema.json` (index)
|
|
28
70
|
- `schemas/v1/monarchic_agent_protocol.proto`
|
|
29
71
|
|
|
30
72
|
All schemas allow additional properties for forward compatibility.
|
|
31
73
|
|
|
74
|
+
### Schema index coverage
|
|
75
|
+
|
|
76
|
+
`schemas/v1/schema.json` is the canonical top-level JSON schema index. Its `oneOf` entries currently cover:
|
|
77
|
+
|
|
78
|
+
- `schemas/v1/task.json`
|
|
79
|
+
- `schemas/v1/artifact.json`
|
|
80
|
+
- `schemas/v1/event.json`
|
|
81
|
+
- `schemas/v1/gate_result.json`
|
|
82
|
+
- `schemas/v1/run_context.json`
|
|
83
|
+
- `schemas/v1/dataset_ref.json`
|
|
84
|
+
- `schemas/v1/experiment_spec.json`
|
|
85
|
+
- `schemas/v1/objective_spec.json`
|
|
86
|
+
- `schemas/v1/eval_result.json`
|
|
87
|
+
- `schemas/v1/provenance.json`
|
|
88
|
+
|
|
89
|
+
`schemas/v1/agent_role.json` is a shared schema used by `task.json`.
|
|
90
|
+
|
|
32
91
|
### AgentRole
|
|
33
92
|
|
|
34
93
|
Enum values:
|
|
@@ -66,6 +125,9 @@ Optional fields:
|
|
|
66
125
|
- `constraints`: free-form object
|
|
67
126
|
- `gates_required`: list of gate names to run (ex: `["qa", "security"]`)
|
|
68
127
|
- `run_context`: `RunContext`
|
|
128
|
+
- `delivery_contract`: typed acceptance and risk contract for autonomous delivery loops
|
|
129
|
+
- `objective_spec`: objective scoring contract for deterministic outcome evaluation
|
|
130
|
+
- `experiment_spec`: typed experiment design contract for deterministic in silico runs
|
|
69
131
|
|
|
70
132
|
Example:
|
|
71
133
|
|
|
@@ -93,6 +155,19 @@ Example:
|
|
|
93
155
|
}
|
|
94
156
|
```
|
|
95
157
|
|
|
158
|
+
### DeliveryContract
|
|
159
|
+
|
|
160
|
+
Typed acceptance contract for autonomous delivery execution.
|
|
161
|
+
|
|
162
|
+
Required fields:
|
|
163
|
+
|
|
164
|
+
- `objective`: plain-language objective statement
|
|
165
|
+
- `definition_of_done`: ordered completion checklist
|
|
166
|
+
- `required_checks`: required gate/check names for merge readiness
|
|
167
|
+
- `risk_tier`: `low | medium | high | critical`
|
|
168
|
+
|
|
169
|
+
Optional fields include cycle/turn budgets (`max_cycle_minutes`, `max_agent_turns`) and PR/review/rollback strategy hints.
|
|
170
|
+
|
|
96
171
|
### RunContext
|
|
97
172
|
|
|
98
173
|
Execution hints for a runner.
|
|
@@ -134,6 +209,10 @@ Required fields:
|
|
|
134
209
|
- `summary`: short description
|
|
135
210
|
- `path`: path or locator for the artifact
|
|
136
211
|
- `task_id`: task identifier that produced it
|
|
212
|
+
- `provenance`: typed provenance hashes and runtime metadata
|
|
213
|
+
- `dataset_refs`: datasets used while producing the artifact
|
|
214
|
+
- `eval_results`: typed metric outputs with optional uncertainty bounds
|
|
215
|
+
- `experiment_spec`: optional copy of experiment contract used for this output
|
|
137
216
|
|
|
138
217
|
Example:
|
|
139
218
|
|
|
@@ -163,6 +242,8 @@ Required fields:
|
|
|
163
242
|
Optional fields:
|
|
164
243
|
|
|
165
244
|
- `message`: human-readable details
|
|
245
|
+
- `provenance`: typed runtime/source hashes for event attribution
|
|
246
|
+
- `eval_results`: optional metric snapshot payloads
|
|
166
247
|
|
|
167
248
|
Example:
|
|
168
249
|
|
|
@@ -207,7 +288,74 @@ Example:
|
|
|
207
288
|
}
|
|
208
289
|
```
|
|
209
290
|
|
|
210
|
-
|
|
291
|
+
### DatasetRef
|
|
292
|
+
|
|
293
|
+
Reference to a dataset used by an experiment or output artifact.
|
|
294
|
+
|
|
295
|
+
Required fields:
|
|
296
|
+
|
|
297
|
+
- `dataset_id`
|
|
298
|
+
- `sha256`
|
|
299
|
+
- `format`
|
|
300
|
+
|
|
301
|
+
Optional fields include `uri`, `split`, `size_bytes`, and `description`.
|
|
302
|
+
|
|
303
|
+
### ExperimentSpec
|
|
304
|
+
|
|
305
|
+
Typed contract for model design and acceptance checks.
|
|
306
|
+
|
|
307
|
+
Required fields:
|
|
308
|
+
|
|
309
|
+
- `experiment_id`
|
|
310
|
+
- `objective`
|
|
311
|
+
- `dataset_refs`: list of `DatasetRef`
|
|
312
|
+
- `acceptance`: metric threshold policy
|
|
313
|
+
|
|
314
|
+
Optional fields include `hypothesis`, `model_family`, `seeds`, and free-form `constraints`.
|
|
315
|
+
|
|
316
|
+
### ObjectiveSpec
|
|
317
|
+
|
|
318
|
+
Typed objective scoring contract for progress/outcome checks.
|
|
319
|
+
|
|
320
|
+
Required fields:
|
|
321
|
+
|
|
322
|
+
- `metric_key`
|
|
323
|
+
- `direction`: `maximize`, `minimize`, or `target`
|
|
324
|
+
|
|
325
|
+
Optional fields include `target`, `min_delta`, `tolerance`, `report_file`,
|
|
326
|
+
`report_task_id`, `weight`, and `description`.
|
|
327
|
+
|
|
328
|
+
### EvalResult
|
|
329
|
+
|
|
330
|
+
Typed evaluation output row.
|
|
331
|
+
|
|
332
|
+
Required fields:
|
|
333
|
+
|
|
334
|
+
- `metric`
|
|
335
|
+
- `value`
|
|
336
|
+
- `passed`
|
|
337
|
+
|
|
338
|
+
Optional fields include `lower_ci`, `upper_ci`, `variance`, `seed`, and `notes`.
|
|
339
|
+
|
|
340
|
+
### Provenance
|
|
341
|
+
|
|
342
|
+
Typed provenance contract for reproducibility and traceability.
|
|
343
|
+
|
|
344
|
+
Required fields:
|
|
345
|
+
|
|
346
|
+
- `prompt_sha256`
|
|
347
|
+
- `code_sha256`
|
|
348
|
+
- `runtime`
|
|
349
|
+
- `runner`
|
|
350
|
+
- `orchestrator`
|
|
351
|
+
- `created_at`
|
|
352
|
+
|
|
353
|
+
Optional fields include dataset hashes/references and command/task/pipeline hashes.
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
### Language bindings
|
|
357
|
+
|
|
358
|
+
#### Rust
|
|
211
359
|
|
|
212
360
|
The crate lives at the repo root with sources under `src/rust/lib.rs`.
|
|
213
361
|
|
|
@@ -227,7 +375,7 @@ let task = Task {
|
|
|
227
375
|
};
|
|
228
376
|
```
|
|
229
377
|
|
|
230
|
-
|
|
378
|
+
#### TypeScript
|
|
231
379
|
|
|
232
380
|
TypeScript bindings are in `src/ts/index.ts`.
|
|
233
381
|
|
|
@@ -242,7 +390,7 @@ const task: Task = {
|
|
|
242
390
|
};
|
|
243
391
|
```
|
|
244
392
|
|
|
245
|
-
|
|
393
|
+
#### Go
|
|
246
394
|
|
|
247
395
|
Go module sources live under `src/go` with module path:
|
|
248
396
|
|
|
@@ -250,28 +398,13 @@ Go module sources live under `src/go` with module path:
|
|
|
250
398
|
github.com/monarchic-ai/monarchic-agent-protocol/src/go
|
|
251
399
|
```
|
|
252
400
|
|
|
253
|
-
|
|
401
|
+
#### Protobuf
|
|
254
402
|
|
|
255
403
|
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.
|
|
256
404
|
|
|
257
405
|
Language packages are published per registry. Use the registry package for your language instead of generating local outputs.
|
|
258
406
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
- Rust: `examples/rust/task.rs`
|
|
262
|
-
- TypeScript: `examples/ts/task.ts`
|
|
263
|
-
- Protobuf C++: `examples/proto/cpp/task.cpp`
|
|
264
|
-
- Protobuf Java: `examples/proto/java/TaskExample.java`
|
|
265
|
-
- Protobuf Kotlin: `examples/proto/kotlin/TaskExample.kt`
|
|
266
|
-
- Protobuf C#: `examples/proto/csharp/TaskExample.cs`
|
|
267
|
-
- Protobuf Python: `examples/proto/python/task.py`
|
|
268
|
-
- Protobuf Ruby: `examples/proto/ruby/task.rb`
|
|
269
|
-
- Protobuf Objective-C: `examples/proto/objective-c/TaskExample.m`
|
|
270
|
-
- Protobuf PHP: `examples/proto/php/task.php`
|
|
271
|
-
- Protobuf Dart: `examples/proto/dart/task.dart`
|
|
272
|
-
- Protobuf Rust: `examples/proto/rust/task.rs`
|
|
273
|
-
|
|
274
|
-
## Python (PyPI)
|
|
407
|
+
#### Python (PyPI)
|
|
275
408
|
|
|
276
409
|
Install the published package and import the generated protobuf bindings:
|
|
277
410
|
|
|
@@ -279,15 +412,67 @@ Install the published package and import the generated protobuf bindings:
|
|
|
279
412
|
from monarchic_agent_protocol import monarchic_agent_protocol_pb2 as map_pb2
|
|
280
413
|
```
|
|
281
414
|
|
|
282
|
-
|
|
415
|
+
#### Ruby
|
|
416
|
+
|
|
417
|
+
Ruby bindings live under `src/ruby`.
|
|
418
|
+
|
|
419
|
+
#### Java/Kotlin
|
|
420
|
+
|
|
421
|
+
Java/Kotlin sources live under `src/java`.
|
|
422
|
+
|
|
423
|
+
#### C#
|
|
424
|
+
|
|
425
|
+
C# sources live under `src/csharp`.
|
|
426
|
+
|
|
427
|
+
#### PHP
|
|
428
|
+
|
|
429
|
+
PHP sources live under `src/php`.
|
|
430
|
+
|
|
431
|
+
#### Dart
|
|
432
|
+
|
|
433
|
+
Dart sources live under `src/dart`.
|
|
434
|
+
|
|
435
|
+
## Contributing
|
|
436
|
+
|
|
437
|
+
### Tooling
|
|
283
438
|
|
|
284
439
|
- `nix develop` provides Rust, Node, jq, Python `jsonschema`, and `protoc`.
|
|
285
440
|
- `nix flake check` validates JSON schemas, protobuf codegen, and package imports (PyPI + Rust + npm + Go).
|
|
286
441
|
- JSON Schema test: `scripts/test-json-schema.sh`.
|
|
442
|
+
- Pre-commit schema JSON parse check: `scripts/pre-commit-schema-json-parse.sh`.
|
|
443
|
+
- Pre-commit schema parse smoke test: `scripts/test-pre-commit-schema-json-parse.sh`.
|
|
444
|
+
- Schema edit changelog: `schemas/SCHEMA_CHANGELOG.md`.
|
|
445
|
+
- Schema changelog format test: `scripts/test-schema-changelog-format.sh`.
|
|
446
|
+
- README schema index coverage test: `scripts/test-readme-schema-index-coverage.sh`.
|
|
287
447
|
- Protobuf codegen test (all languages): `scripts/test-proto.sh`.
|
|
448
|
+
- Protobuf availability smoke test: `scripts/test-proto-availability-smoke.sh`.
|
|
288
449
|
- Protobuf codegen (write to `src/<lang>`): `scripts/generate-proto.sh`.
|
|
450
|
+
- Protobuf codegen (write to `src/<lang>` and regenerate JSON schemas): `scripts/generate-proto.sh`.
|
|
451
|
+
- JSON Schema regeneration only: `scripts/generate-json-schema.sh`.
|
|
452
|
+
- JSON Schema generation requires `protoc-gen-jsonschema` (install with `go install github.com/chrusty/protoc-gen-jsonschema/cmd/protoc-gen-jsonschema@latest`).
|
|
453
|
+
|
|
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).
|
|
289
461
|
|
|
290
|
-
|
|
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
|
+
### Schema validation workflow
|
|
467
|
+
|
|
468
|
+
1. Run full schema lint and semantic checks: `bash scripts/lint-schemas.sh`.
|
|
469
|
+
2. Run direct schema fixture checks: `bash scripts/test-json-schema.sh`.
|
|
470
|
+
3. Validate staged schema JSON before commit: `bash scripts/pre-commit-schema-json-parse.sh`.
|
|
471
|
+
4. Verify pre-commit checker behavior is deterministic: `bash scripts/test-pre-commit-schema-json-parse.sh`.
|
|
472
|
+
5. Verify schema changelog entry format: `bash scripts/test-schema-changelog-format.sh`.
|
|
473
|
+
6. Verify README schema index coverage stays aligned: `bash scripts/test-readme-schema-index-coverage.sh`.
|
|
474
|
+
|
|
475
|
+
### Nix packages
|
|
291
476
|
|
|
292
477
|
- `packages.default`: Rust crate for protocol types
|
|
293
478
|
- `packages.rs-lib`: Rust crate for protocol types (local)
|
|
@@ -309,8 +494,12 @@ from monarchic_agent_protocol import monarchic_agent_protocol_pb2 as map_pb2
|
|
|
309
494
|
- `packages.php-lib`: PHP package sources (local)
|
|
310
495
|
- `packages.php-registry-lib`: PHP package from Packagist (registry)
|
|
311
496
|
|
|
312
|
-
|
|
497
|
+
### CI and releases
|
|
313
498
|
|
|
314
499
|
- `.github/workflows/ci.yml` validates JSON schemas, protobuf codegen, and runs `cargo test`.
|
|
315
500
|
- `.github/workflows/release.yml` publishes language packages.
|
|
316
501
|
- Python publishing is implemented for PyPI; other language registry steps are scaffolded.
|
|
502
|
+
|
|
503
|
+
## License
|
|
504
|
+
|
|
505
|
+
LGPL-3.0-only
|
data/schemas/v1/artifact.json
CHANGED
|
@@ -1,29 +1,79 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "
|
|
2
|
+
"$id": "monarchic.agent_protocol.v1.Artifact.schema.json",
|
|
3
3
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
-
"title": "Artifact",
|
|
5
|
-
"type": "object",
|
|
6
4
|
"additionalProperties": true,
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"type": "string"
|
|
11
|
-
|
|
5
|
+
"patternProperties": {
|
|
6
|
+
"^(artifactId)$": {
|
|
7
|
+
"default": "",
|
|
8
|
+
"type": "string"
|
|
9
|
+
},
|
|
10
|
+
"^(datasetRefs)$": {
|
|
11
|
+
"items": {
|
|
12
|
+
"$ref": "monarchic.agent_protocol.v1.DatasetRef.schema.json"
|
|
13
|
+
},
|
|
14
|
+
"type": "array"
|
|
15
|
+
},
|
|
16
|
+
"^(evalResults)$": {
|
|
17
|
+
"items": {
|
|
18
|
+
"$ref": "monarchic.agent_protocol.v1.EvalResult.schema.json"
|
|
19
|
+
},
|
|
20
|
+
"type": "array"
|
|
21
|
+
},
|
|
22
|
+
"^(experimentSpec)$": {
|
|
23
|
+
"$ref": "monarchic.agent_protocol.v1.ExperimentSpec.schema.json"
|
|
12
24
|
},
|
|
25
|
+
"^(taskId)$": {
|
|
26
|
+
"default": "",
|
|
27
|
+
"type": "string"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"properties": {
|
|
13
31
|
"artifact_id": {
|
|
32
|
+
"default": "",
|
|
14
33
|
"type": "string"
|
|
15
34
|
},
|
|
16
|
-
"
|
|
35
|
+
"dataset_refs": {
|
|
36
|
+
"items": {
|
|
37
|
+
"$ref": "monarchic.agent_protocol.v1.DatasetRef.schema.json"
|
|
38
|
+
},
|
|
39
|
+
"type": "array"
|
|
40
|
+
},
|
|
41
|
+
"eval_results": {
|
|
42
|
+
"items": {
|
|
43
|
+
"$ref": "monarchic.agent_protocol.v1.EvalResult.schema.json"
|
|
44
|
+
},
|
|
45
|
+
"type": "array"
|
|
46
|
+
},
|
|
47
|
+
"experiment_spec": {
|
|
48
|
+
"$ref": "monarchic.agent_protocol.v1.ExperimentSpec.schema.json"
|
|
49
|
+
},
|
|
50
|
+
"extensions": {
|
|
51
|
+
"$ref": "google.protobuf.Struct.schema.json"
|
|
52
|
+
},
|
|
53
|
+
"path": {
|
|
54
|
+
"default": "",
|
|
17
55
|
"type": "string"
|
|
18
56
|
},
|
|
57
|
+
"provenance": {
|
|
58
|
+
"$ref": "monarchic.agent_protocol.v1.Provenance.schema.json"
|
|
59
|
+
},
|
|
19
60
|
"summary": {
|
|
61
|
+
"default": "",
|
|
20
62
|
"type": "string"
|
|
21
63
|
},
|
|
22
|
-
"
|
|
64
|
+
"task_id": {
|
|
65
|
+
"default": "",
|
|
23
66
|
"type": "string"
|
|
24
67
|
},
|
|
25
|
-
"
|
|
68
|
+
"type": {
|
|
69
|
+
"default": "",
|
|
70
|
+
"type": "string"
|
|
71
|
+
},
|
|
72
|
+
"version": {
|
|
73
|
+
"default": "",
|
|
26
74
|
"type": "string"
|
|
27
75
|
}
|
|
28
|
-
}
|
|
76
|
+
},
|
|
77
|
+
"title": "Artifact",
|
|
78
|
+
"type": "object"
|
|
29
79
|
}
|