amiril 0.0.0.dev0__py3-none-any.whl
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.
- amiril/__init__.py +51 -0
- amiril/_adapters.py +399 -0
- amiril/_engine/__init__.py +1 -0
- amiril/_engine/engine.py +113 -0
- amiril/_engine/expr.py +653 -0
- amiril/_engine/numbers.py +111 -0
- amiril/_engine/regex.py +262 -0
- amiril/_engine/rules.py +192 -0
- amiril/_engine/sentence.py +251 -0
- amiril/_engine/timeparse.py +72 -0
- amiril/_engine/validate.py +863 -0
- amiril/_engine/values.py +273 -0
- amiril/_kernel/__init__.py +1 -0
- amiril/_kernel/bundle.py +245 -0
- amiril/_kernel/coerce.py +103 -0
- amiril/_kernel/events.py +87 -0
- amiril/_kernel/guard.py +1196 -0
- amiril/_kernel/ids.py +66 -0
- amiril/_kernel/messages.py +30 -0
- amiril/_kernel/normalise.py +165 -0
- amiril/_kernel/records.py +131 -0
- amiril/_kernel/store.py +661 -0
- amiril/_runtime.py +617 -0
- amiril/adk.py +577 -0
- amiril/control/__init__.py +25 -0
- amiril/control/_delivery.py +567 -0
- amiril/control/_disk.py +418 -0
- amiril/control/_holds.py +252 -0
- amiril/control/_jsonschema.py +265 -0
- amiril/control/_pathc.py +85 -0
- amiril/control/_records.py +293 -0
- amiril/control/_redact.py +79 -0
- amiril/control/_transport.py +184 -0
- amiril/control/_wire.py +73 -0
- amiril/control/client.py +1313 -0
- amiril/control/config.py +204 -0
- amiril/control/schemas/bundle.response.schema.json +22 -0
- amiril/control/schemas/common.schema.json +593 -0
- amiril/control/schemas/decisions.request.schema.json +558 -0
- amiril/control/schemas/decisions.response.schema.json +23 -0
- amiril/control/schemas/error.response.schema.json +54 -0
- amiril/control/schemas/heartbeat.request.schema.json +305 -0
- amiril/control/schemas/heartbeat.response.schema.json +34 -0
- amiril/control/schemas/hold-create.request.schema.json +138 -0
- amiril/control/schemas/hold.response.schema.json +226 -0
- amiril/control/schemas/installation-register.request.schema.json +492 -0
- amiril/control/schemas/installation-register.response.schema.json +85 -0
- amiril/core.py +89 -0
- amiril/docs/README.md +14 -0
- amiril/docs/durability/langgraph.md +292 -0
- amiril/docs/frameworks/adk.md +141 -0
- amiril/docs/frameworks/langgraph.md +154 -0
- amiril/docs/frameworks/no-framework.md +238 -0
- amiril/docs/frameworks/write-an-adapter.md +203 -0
- amiril/durable.py +342 -0
- amiril/langgraph.py +746 -0
- amiril/plain.py +454 -0
- amiril/py.typed +0 -0
- amiril/seams.py +357 -0
- amiril/testing.py +21 -0
- amiril-0.0.0.dev0.dist-info/METADATA +114 -0
- amiril-0.0.0.dev0.dist-info/RECORD +64 -0
- amiril-0.0.0.dev0.dist-info/WHEEL +4 -0
- amiril-0.0.0.dev0.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,593 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://amiril.ai/spec/protocol/1/common.schema.json",
|
|
4
|
+
"title": "amiril.protocol/1 shared definitions",
|
|
5
|
+
"description": "Shapes shared by several request and response bodies. See spec/protocol.md.",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"protocol": {
|
|
8
|
+
"const": "amiril.protocol/1",
|
|
9
|
+
"description": "Protocol version carried in every body."
|
|
10
|
+
},
|
|
11
|
+
"timestamp": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"format": "date-time",
|
|
14
|
+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
|
|
15
|
+
"description": "RFC 3339, UTC, Z suffix, exactly millisecond precision."
|
|
16
|
+
},
|
|
17
|
+
"hr_timestamp": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"format": "date-time",
|
|
20
|
+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3,9}Z$",
|
|
21
|
+
"description": "RFC 3339 wall-clock time, UTC, Z suffix, three to nine fractional digits."
|
|
22
|
+
},
|
|
23
|
+
"uuid": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
|
|
26
|
+
"description": "UUIDv4, lower case."
|
|
27
|
+
},
|
|
28
|
+
"opaque_id": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"minLength": 1,
|
|
31
|
+
"maxLength": 64,
|
|
32
|
+
"description": "An identifier the server minted; compared for equality only."
|
|
33
|
+
},
|
|
34
|
+
"short_string": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"minLength": 1,
|
|
37
|
+
"maxLength": 256
|
|
38
|
+
},
|
|
39
|
+
"identifier": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"pattern": "^[a-z][a-z0-9_]*$",
|
|
42
|
+
"maxLength": 64
|
|
43
|
+
},
|
|
44
|
+
"etag": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"pattern": "^(W/)?\"[^\"]+\"$",
|
|
47
|
+
"maxLength": 256,
|
|
48
|
+
"description": "An HTTP entity tag as RFC 9110 writes it, quoted, optionally weak."
|
|
49
|
+
},
|
|
50
|
+
"trace_id": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"pattern": "^(?!0{32})[0-9a-f]{32}$",
|
|
53
|
+
"description": "W3C trace id, lower-case hex, not all zeros."
|
|
54
|
+
},
|
|
55
|
+
"span_id": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"pattern": "^(?!0{16})[0-9a-f]{16}$",
|
|
58
|
+
"description": "W3C span id, lower-case hex, not all zeros."
|
|
59
|
+
},
|
|
60
|
+
"name_version": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"description": "A component and its version; version null when unknown.",
|
|
63
|
+
"properties": {
|
|
64
|
+
"name": {
|
|
65
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
66
|
+
},
|
|
67
|
+
"version": {
|
|
68
|
+
"oneOf": [
|
|
69
|
+
{
|
|
70
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"type": "null"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"required": [
|
|
79
|
+
"name",
|
|
80
|
+
"version"
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"process": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"description": "Process identity. `id` is minted once per process start; `host` and `pid` are null where the runtime has none (edge runtimes); `runtime` is sent at registration.",
|
|
86
|
+
"properties": {
|
|
87
|
+
"id": {
|
|
88
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/uuid"
|
|
89
|
+
},
|
|
90
|
+
"host": {
|
|
91
|
+
"oneOf": [
|
|
92
|
+
{
|
|
93
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"type": "null"
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"pid": {
|
|
101
|
+
"oneOf": [
|
|
102
|
+
{
|
|
103
|
+
"type": "integer",
|
|
104
|
+
"minimum": 0
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"type": "null"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"started_at": {
|
|
112
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/timestamp"
|
|
113
|
+
},
|
|
114
|
+
"runtime": {
|
|
115
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/name_version"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"required": [
|
|
119
|
+
"id",
|
|
120
|
+
"host",
|
|
121
|
+
"pid",
|
|
122
|
+
"started_at"
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"bundle_ref": {
|
|
126
|
+
"type": "object",
|
|
127
|
+
"description": "A bundle by version and ETag, both exactly as the bundle body carried them.",
|
|
128
|
+
"properties": {
|
|
129
|
+
"version": {
|
|
130
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
131
|
+
},
|
|
132
|
+
"etag": {
|
|
133
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/etag"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"required": [
|
|
137
|
+
"version",
|
|
138
|
+
"etag"
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
"rule_ref": {
|
|
142
|
+
"type": "object",
|
|
143
|
+
"properties": {
|
|
144
|
+
"id": {
|
|
145
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
146
|
+
},
|
|
147
|
+
"version": {
|
|
148
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"required": [
|
|
152
|
+
"id",
|
|
153
|
+
"version"
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
"tool": {
|
|
157
|
+
"type": "object",
|
|
158
|
+
"description": "`name` is the kernel tool id after the alias map; `raw_name` is the name exactly as the framework reports it (the name its tool span carries); `declared_id` is the customer's stable id or null.",
|
|
159
|
+
"properties": {
|
|
160
|
+
"name": {
|
|
161
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
162
|
+
},
|
|
163
|
+
"raw_name": {
|
|
164
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
165
|
+
},
|
|
166
|
+
"declared_id": {
|
|
167
|
+
"oneOf": [
|
|
168
|
+
{
|
|
169
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"type": "null"
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"required": [
|
|
178
|
+
"name",
|
|
179
|
+
"raw_name",
|
|
180
|
+
"declared_id"
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
"agent": {
|
|
184
|
+
"type": "object",
|
|
185
|
+
"description": "Calling agent name (the kernel's agent_id) and the root agent of the run.",
|
|
186
|
+
"properties": {
|
|
187
|
+
"name": {
|
|
188
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
189
|
+
},
|
|
190
|
+
"root": {
|
|
191
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
"required": [
|
|
195
|
+
"name",
|
|
196
|
+
"root"
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
"call": {
|
|
200
|
+
"type": "object",
|
|
201
|
+
"description": "Kernel call identity. `seq`: position among all tool calls in the root run. `ordinal`: position among calls to the same raw tool name within the trace (within the root run when no trace is active). `hook_at`: wall-clock time the pre-call hook ran. When `tool_call_id` is non-null, `id` equals it.",
|
|
202
|
+
"properties": {
|
|
203
|
+
"id": {
|
|
204
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
205
|
+
},
|
|
206
|
+
"attempt": {
|
|
207
|
+
"type": "integer",
|
|
208
|
+
"minimum": 1
|
|
209
|
+
},
|
|
210
|
+
"batch_id": {
|
|
211
|
+
"oneOf": [
|
|
212
|
+
{
|
|
213
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"type": "null"
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
},
|
|
220
|
+
"tool_call_id": {
|
|
221
|
+
"oneOf": [
|
|
222
|
+
{
|
|
223
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"type": "null"
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
"parent_call_id": {
|
|
231
|
+
"oneOf": [
|
|
232
|
+
{
|
|
233
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"type": "null"
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
"seq": {
|
|
241
|
+
"type": "integer",
|
|
242
|
+
"minimum": 1
|
|
243
|
+
},
|
|
244
|
+
"ordinal": {
|
|
245
|
+
"type": "integer",
|
|
246
|
+
"minimum": 1
|
|
247
|
+
},
|
|
248
|
+
"hook_at": {
|
|
249
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/hr_timestamp"
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"required": [
|
|
253
|
+
"id",
|
|
254
|
+
"attempt",
|
|
255
|
+
"batch_id",
|
|
256
|
+
"tool_call_id",
|
|
257
|
+
"parent_call_id",
|
|
258
|
+
"seq",
|
|
259
|
+
"ordinal",
|
|
260
|
+
"hook_at"
|
|
261
|
+
]
|
|
262
|
+
},
|
|
263
|
+
"trace": {
|
|
264
|
+
"type": "object",
|
|
265
|
+
"description": "W3C trace context of the span active at decision time. `span_role` says whether `span_id` is the tool span itself, an enclosing span, or unknown; `tool` requires a span id.",
|
|
266
|
+
"properties": {
|
|
267
|
+
"trace_id": {
|
|
268
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/trace_id"
|
|
269
|
+
},
|
|
270
|
+
"span_id": {
|
|
271
|
+
"oneOf": [
|
|
272
|
+
{
|
|
273
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/span_id"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"type": "null"
|
|
277
|
+
}
|
|
278
|
+
]
|
|
279
|
+
},
|
|
280
|
+
"span_role": {
|
|
281
|
+
"enum": [
|
|
282
|
+
"tool",
|
|
283
|
+
"parent",
|
|
284
|
+
"unknown"
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
"required": [
|
|
289
|
+
"trace_id",
|
|
290
|
+
"span_id",
|
|
291
|
+
"span_role"
|
|
292
|
+
],
|
|
293
|
+
"allOf": [
|
|
294
|
+
{
|
|
295
|
+
"if": {
|
|
296
|
+
"type": "object",
|
|
297
|
+
"properties": {
|
|
298
|
+
"span_role": {
|
|
299
|
+
"const": "tool"
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
"required": [
|
|
303
|
+
"span_role"
|
|
304
|
+
]
|
|
305
|
+
},
|
|
306
|
+
"then": {
|
|
307
|
+
"type": "object",
|
|
308
|
+
"properties": {
|
|
309
|
+
"span_id": {
|
|
310
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/span_id"
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
]
|
|
316
|
+
},
|
|
317
|
+
"evidence": {
|
|
318
|
+
"type": "array",
|
|
319
|
+
"maxItems": 50,
|
|
320
|
+
"items": {
|
|
321
|
+
"type": "object",
|
|
322
|
+
"properties": {
|
|
323
|
+
"path": {
|
|
324
|
+
"type": "string",
|
|
325
|
+
"minLength": 1
|
|
326
|
+
},
|
|
327
|
+
"value": {
|
|
328
|
+
"anyOf": [
|
|
329
|
+
{
|
|
330
|
+
"not": {
|
|
331
|
+
"type": "string"
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"type": "string",
|
|
336
|
+
"maxLength": 1024
|
|
337
|
+
}
|
|
338
|
+
]
|
|
339
|
+
},
|
|
340
|
+
"missing": {
|
|
341
|
+
"type": "boolean"
|
|
342
|
+
},
|
|
343
|
+
"absent": {
|
|
344
|
+
"type": "boolean"
|
|
345
|
+
},
|
|
346
|
+
"name": {
|
|
347
|
+
"type": "string",
|
|
348
|
+
"minLength": 1
|
|
349
|
+
},
|
|
350
|
+
"truncated": {
|
|
351
|
+
"type": "integer",
|
|
352
|
+
"minimum": 0
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
"required": [
|
|
356
|
+
"path",
|
|
357
|
+
"value"
|
|
358
|
+
]
|
|
359
|
+
},
|
|
360
|
+
"description": "Evidence entries as spec/edoc.md defines them (path, value, and the optional missing, absent, name, truncated keys), after redaction; string values cut to 1 KiB."
|
|
361
|
+
},
|
|
362
|
+
"action": {
|
|
363
|
+
"enum": [
|
|
364
|
+
"allow",
|
|
365
|
+
"flag",
|
|
366
|
+
"hold",
|
|
367
|
+
"block"
|
|
368
|
+
]
|
|
369
|
+
},
|
|
370
|
+
"mode": {
|
|
371
|
+
"enum": [
|
|
372
|
+
"shadow",
|
|
373
|
+
"enforce"
|
|
374
|
+
]
|
|
375
|
+
},
|
|
376
|
+
"sync_guidance": {
|
|
377
|
+
"type": "object",
|
|
378
|
+
"description": "Bundle poll interval guidance (spec/protocol.md, Polling).",
|
|
379
|
+
"properties": {
|
|
380
|
+
"poll_interval_ms": {
|
|
381
|
+
"type": "integer",
|
|
382
|
+
"minimum": 1
|
|
383
|
+
},
|
|
384
|
+
"jitter_ms": {
|
|
385
|
+
"type": "integer",
|
|
386
|
+
"minimum": 0
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
"required": [
|
|
390
|
+
"poll_interval_ms",
|
|
391
|
+
"jitter_ms"
|
|
392
|
+
]
|
|
393
|
+
},
|
|
394
|
+
"limits": {
|
|
395
|
+
"type": "object",
|
|
396
|
+
"description": "Per-workspace limits in force (spec/protocol.md, Limits).",
|
|
397
|
+
"properties": {
|
|
398
|
+
"decisions_max_records": {
|
|
399
|
+
"type": "integer",
|
|
400
|
+
"minimum": 1
|
|
401
|
+
},
|
|
402
|
+
"decisions_records_per_minute": {
|
|
403
|
+
"type": "integer",
|
|
404
|
+
"minimum": 1
|
|
405
|
+
},
|
|
406
|
+
"max_body_bytes": {
|
|
407
|
+
"type": "integer",
|
|
408
|
+
"minimum": 1024
|
|
409
|
+
},
|
|
410
|
+
"hold_max_wait_ms": {
|
|
411
|
+
"type": "integer",
|
|
412
|
+
"minimum": 1
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
"required": [
|
|
416
|
+
"decisions_max_records",
|
|
417
|
+
"decisions_records_per_minute",
|
|
418
|
+
"max_body_bytes",
|
|
419
|
+
"hold_max_wait_ms"
|
|
420
|
+
]
|
|
421
|
+
},
|
|
422
|
+
"bundle_rule": {
|
|
423
|
+
"type": "object",
|
|
424
|
+
"description": "Control-plane attributes of one rule. mode, fail_mode and hold_timeout_ms override the document's rule; hold_timeout_ms is at least 1 for a rule that can hold and null (none) otherwise. Only an enforce rule may be fail-closed.",
|
|
425
|
+
"properties": {
|
|
426
|
+
"id": {
|
|
427
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
428
|
+
},
|
|
429
|
+
"version": {
|
|
430
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
431
|
+
},
|
|
432
|
+
"mode": {
|
|
433
|
+
"enum": [
|
|
434
|
+
"off",
|
|
435
|
+
"shadow",
|
|
436
|
+
"enforce"
|
|
437
|
+
]
|
|
438
|
+
},
|
|
439
|
+
"fail_mode": {
|
|
440
|
+
"enum": [
|
|
441
|
+
"open",
|
|
442
|
+
"closed"
|
|
443
|
+
]
|
|
444
|
+
},
|
|
445
|
+
"hold_timeout_ms": {
|
|
446
|
+
"oneOf": [
|
|
447
|
+
{
|
|
448
|
+
"type": "integer",
|
|
449
|
+
"minimum": 1
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"type": "null"
|
|
453
|
+
}
|
|
454
|
+
]
|
|
455
|
+
},
|
|
456
|
+
"applies_to": {
|
|
457
|
+
"type": "object",
|
|
458
|
+
"description": "Agents resolved to every alias name (null: every agent; never an empty list), tool ids as kernel.md defines tool_id (['*']: every tool), environment tags (null: every environment). Intersected with the document's own targeting, never an override. Named applies_to because a rule document uses scope for history scope.",
|
|
459
|
+
"properties": {
|
|
460
|
+
"agents": {
|
|
461
|
+
"oneOf": [
|
|
462
|
+
{
|
|
463
|
+
"type": "array",
|
|
464
|
+
"minItems": 1,
|
|
465
|
+
"items": {
|
|
466
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"type": "null"
|
|
471
|
+
}
|
|
472
|
+
]
|
|
473
|
+
},
|
|
474
|
+
"tools": {
|
|
475
|
+
"type": "array",
|
|
476
|
+
"minItems": 1,
|
|
477
|
+
"items": {
|
|
478
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
"environments": {
|
|
482
|
+
"oneOf": [
|
|
483
|
+
{
|
|
484
|
+
"type": "array",
|
|
485
|
+
"minItems": 1,
|
|
486
|
+
"items": {
|
|
487
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"type": "null"
|
|
492
|
+
}
|
|
493
|
+
]
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
"required": [
|
|
497
|
+
"agents",
|
|
498
|
+
"tools",
|
|
499
|
+
"environments"
|
|
500
|
+
]
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
"required": [
|
|
504
|
+
"id",
|
|
505
|
+
"version",
|
|
506
|
+
"mode",
|
|
507
|
+
"fail_mode",
|
|
508
|
+
"hold_timeout_ms",
|
|
509
|
+
"applies_to"
|
|
510
|
+
],
|
|
511
|
+
"allOf": [
|
|
512
|
+
{
|
|
513
|
+
"if": {
|
|
514
|
+
"type": "object",
|
|
515
|
+
"properties": {
|
|
516
|
+
"mode": {
|
|
517
|
+
"enum": [
|
|
518
|
+
"off",
|
|
519
|
+
"shadow"
|
|
520
|
+
]
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
"required": [
|
|
524
|
+
"mode"
|
|
525
|
+
]
|
|
526
|
+
},
|
|
527
|
+
"then": {
|
|
528
|
+
"type": "object",
|
|
529
|
+
"properties": {
|
|
530
|
+
"fail_mode": {
|
|
531
|
+
"const": "open"
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
]
|
|
537
|
+
},
|
|
538
|
+
"edoc_document": {
|
|
539
|
+
"type": "object",
|
|
540
|
+
"description": "The E-doc rule document. Its full shape is spec/edoc.schema.json; only the envelope is checked here. `ruleset_version` equals the bundle version.",
|
|
541
|
+
"properties": {
|
|
542
|
+
"schema": {
|
|
543
|
+
"const": "amiril.rules/1"
|
|
544
|
+
},
|
|
545
|
+
"ruleset_version": {
|
|
546
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
547
|
+
},
|
|
548
|
+
"rules": {
|
|
549
|
+
"type": "array",
|
|
550
|
+
"items": {
|
|
551
|
+
"type": "object"
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
"required": [
|
|
556
|
+
"schema",
|
|
557
|
+
"ruleset_version",
|
|
558
|
+
"rules"
|
|
559
|
+
]
|
|
560
|
+
},
|
|
561
|
+
"bundle": {
|
|
562
|
+
"type": "object",
|
|
563
|
+
"description": "A published rule bundle (spec/protocol.md, Bundle shape). Rule ids in `rules` and in `document.rules` are the same set, each unique.",
|
|
564
|
+
"properties": {
|
|
565
|
+
"version": {
|
|
566
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/short_string"
|
|
567
|
+
},
|
|
568
|
+
"etag": {
|
|
569
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/etag"
|
|
570
|
+
},
|
|
571
|
+
"published_at": {
|
|
572
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/timestamp"
|
|
573
|
+
},
|
|
574
|
+
"rules": {
|
|
575
|
+
"type": "array",
|
|
576
|
+
"items": {
|
|
577
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/bundle_rule"
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
"document": {
|
|
581
|
+
"$ref": "https://amiril.ai/spec/protocol/1/common.schema.json#/$defs/edoc_document"
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
"required": [
|
|
585
|
+
"version",
|
|
586
|
+
"etag",
|
|
587
|
+
"published_at",
|
|
588
|
+
"rules",
|
|
589
|
+
"document"
|
|
590
|
+
]
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|