@almadar/std 16.143.0 → 16.145.0

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.
Files changed (97) hide show
  1. package/behaviors/lolo/ml/atoms/std-ml-classify.lolo +121 -0
  2. package/behaviors/lolo/ml/atoms/std-ml-exact-check.lolo +90 -0
  3. package/behaviors/lolo/ml/atoms/std-ml-infer.lolo +141 -0
  4. package/behaviors/lolo/ml/atoms/std-ml-label-capture.lolo +75 -0
  5. package/behaviors/lolo/ml/atoms/std-ml-lookup.lolo +83 -0
  6. package/behaviors/lolo/ml/atoms/std-ml-posterior.lolo +104 -0
  7. package/behaviors/lolo/ml/atoms/std-ml-similarity.lolo +154 -0
  8. package/behaviors/lolo/ml/molecules/std-escalating-decision.lolo +271 -0
  9. package/behaviors/lolo/ml/molecules/std-knowledge-tracing.lolo +115 -0
  10. package/behaviors/lolo/ui/core/atoms/std-board.lolo +28 -6
  11. package/behaviors/lolo/ui/core/atoms/std-browse.lolo +23 -6
  12. package/behaviors/lolo/ui/core/atoms/std-calendar.lolo +85 -2
  13. package/behaviors/lolo/ui/core/atoms/std-file-store.lolo +17 -0
  14. package/behaviors/lolo/ui/core/atoms/std-version-history.lolo +17 -0
  15. package/behaviors/lolo/ui/core/atoms/ui-typography.lolo +1 -1
  16. package/behaviors/lolo/ui/core/molecules/ui-calendar-grid.lolo +18 -0
  17. package/behaviors/lolo/ui/core/molecules/ui-data-grid.lolo +2 -0
  18. package/behaviors/lolo/ui/core/molecules/ui-data-list.lolo +3 -2
  19. package/behaviors/lolo/ui/core/molecules/ui-filter-group.lolo +20 -0
  20. package/behaviors/lolo/ui/core/molecules/ui-search-input.lolo +7 -2
  21. package/behaviors/lolo/ui/core/molecules/ui-table-view.lolo +3 -2
  22. package/behaviors/lolo/ui/core/organisms/ui-entity-cards.lolo +2 -0
  23. package/behaviors/lolo/ui/core/organisms/ui-entity-list.lolo +2 -0
  24. package/behaviors/lolo/ui/core/organisms/ui-entity-table.lolo +2 -0
  25. package/behaviors/lolo/ui/core/organisms/ui-timeline.lolo +2 -0
  26. package/behaviors/registry/factory-signatures.json +5018 -824
  27. package/behaviors/registry/ml/atoms/std-ml-classify.orb +622 -0
  28. package/behaviors/registry/ml/atoms/std-ml-exact-check.orb +505 -0
  29. package/behaviors/registry/ml/atoms/std-ml-infer.orb +770 -0
  30. package/behaviors/registry/ml/atoms/std-ml-label-capture.orb +367 -0
  31. package/behaviors/registry/ml/atoms/std-ml-lookup.orb +473 -0
  32. package/behaviors/registry/ml/atoms/std-ml-posterior.orb +669 -0
  33. package/behaviors/registry/ml/atoms/std-ml-similarity.orb +862 -0
  34. package/behaviors/registry/ml/molecules/std-escalating-decision.orb +1553 -0
  35. package/behaviors/registry/ml/molecules/std-knowledge-tracing.orb +577 -0
  36. package/behaviors/registry/ui/core/atoms/std-board.orb +90 -20
  37. package/behaviors/registry/ui/core/atoms/std-browse.orb +83 -48
  38. package/behaviors/registry/ui/core/atoms/std-calendar.orb +238 -3
  39. package/behaviors/registry/ui/core/atoms/std-file-store.orb +40 -0
  40. package/behaviors/registry/ui/core/atoms/std-version-history.orb +40 -0
  41. package/behaviors/registry/ui/core/atoms/ui-typography.orb +1 -1
  42. package/behaviors/registry/ui/core/molecules/ui-calendar-grid.orb +27 -0
  43. package/behaviors/registry/ui/core/molecules/ui-data-grid.orb +25 -12
  44. package/behaviors/registry/ui/core/molecules/ui-data-list.orb +26 -13
  45. package/behaviors/registry/ui/core/molecules/ui-filter-group.orb +86 -0
  46. package/behaviors/registry/ui/core/molecules/ui-search-input.orb +37 -1
  47. package/behaviors/registry/ui/core/molecules/ui-table-view.orb +25 -12
  48. package/behaviors/registry/ui/core/organisms/ui-entity-cards.orb +13 -0
  49. package/behaviors/registry/ui/core/organisms/ui-entity-list.orb +21 -8
  50. package/behaviors/registry/ui/core/organisms/ui-entity-table.orb +13 -0
  51. package/behaviors/registry/ui/core/organisms/ui-timeline.orb +13 -0
  52. package/canonical-operators.json +30 -6
  53. package/dist/behaviors/behaviors-embeddings.json +134 -134
  54. package/dist/behaviors/exports-reader.js +2462 -2080
  55. package/dist/behaviors/functions/index.d.ts +725 -1
  56. package/dist/behaviors/functions/index.js +2437 -2081
  57. package/dist/behaviors/index.d.ts +1 -1
  58. package/dist/behaviors/index.js +2463 -2081
  59. package/dist/behaviors/knob-embeddings.json +1 -1
  60. package/dist/behaviors/query.js +2462 -2080
  61. package/dist/behaviors/registry/factory-signatures.json +5018 -824
  62. package/dist/behaviors/registry/ml/atoms/std-ml-classify.orb +622 -0
  63. package/dist/behaviors/registry/ml/atoms/std-ml-exact-check.orb +505 -0
  64. package/dist/behaviors/registry/ml/atoms/std-ml-infer.orb +770 -0
  65. package/dist/behaviors/registry/ml/atoms/std-ml-label-capture.orb +367 -0
  66. package/dist/behaviors/registry/ml/atoms/std-ml-lookup.orb +473 -0
  67. package/dist/behaviors/registry/ml/atoms/std-ml-posterior.orb +669 -0
  68. package/dist/behaviors/registry/ml/atoms/std-ml-similarity.orb +862 -0
  69. package/dist/behaviors/registry/ml/molecules/std-escalating-decision.orb +1553 -0
  70. package/dist/behaviors/registry/ml/molecules/std-knowledge-tracing.orb +577 -0
  71. package/dist/behaviors/registry/ui/core/atoms/std-board.orb +90 -20
  72. package/dist/behaviors/registry/ui/core/atoms/std-browse.orb +83 -48
  73. package/dist/behaviors/registry/ui/core/atoms/std-calendar.orb +238 -3
  74. package/dist/behaviors/registry/ui/core/atoms/std-file-store.orb +40 -0
  75. package/dist/behaviors/registry/ui/core/atoms/std-version-history.orb +40 -0
  76. package/dist/behaviors/registry/ui/core/atoms/ui-typography.orb +1 -1
  77. package/dist/behaviors/registry/ui/core/molecules/ui-calendar-grid.orb +27 -0
  78. package/dist/behaviors/registry/ui/core/molecules/ui-data-grid.orb +25 -12
  79. package/dist/behaviors/registry/ui/core/molecules/ui-data-list.orb +26 -13
  80. package/dist/behaviors/registry/ui/core/molecules/ui-filter-group.orb +86 -0
  81. package/dist/behaviors/registry/ui/core/molecules/ui-search-input.orb +37 -1
  82. package/dist/behaviors/registry/ui/core/molecules/ui-table-view.orb +25 -12
  83. package/dist/behaviors/registry/ui/core/organisms/ui-entity-cards.orb +13 -0
  84. package/dist/behaviors/registry/ui/core/organisms/ui-entity-list.orb +21 -8
  85. package/dist/behaviors/registry/ui/core/organisms/ui-entity-table.orb +13 -0
  86. package/dist/behaviors/registry/ui/core/organisms/ui-timeline.orb +13 -0
  87. package/dist/behaviors-embeddings.json +134 -134
  88. package/dist/index.d.ts +1 -1
  89. package/dist/index.js +2498 -2088
  90. package/dist/knob-embeddings.json +1 -1
  91. package/dist/modules/array.js +28 -0
  92. package/dist/modules/contract.js +4 -4
  93. package/dist/modules/data.js +3 -3
  94. package/dist/modules/index.js +35 -7
  95. package/dist/registry/factory-signatures.json +5018 -824
  96. package/dist/registry.js +35 -7
  97. package/package.json +6 -5
@@ -0,0 +1,770 @@
1
+ {
2
+ "description": "std-ml-infer — the learned rung (R4) of the intelligence ladder, and the seam between a .lolo circuit and a trained model deployed on masar (or off-the-shelf HuggingFace weights) reached through the ml service. Sends the caller-supplied input straight to call-service ml infer, then guards the raw output before it ever becomes an effect: validates it against the declared outputContract, clamps it into range, and only then decides. Emits INFERRED when the output satisfies the contract and confidence clears confidenceFloor — carrying the clamped output, confidence, and an empty violations list. Otherwise abstains with INFER_ABSTAINED, whose reason is one of: low confidence (contract satisfied but below floor, violations empty), contract violation (violations populated via contract/violations for diagnosis), or unavailable (the service call itself failed — a masar cold start or a down endpoint, never surfaced as a user-visible error). Use when a numeric or tensor-shaped model answer needs a licensed guard before becoming a decision — classification scores, regressions, embedding-derived predictions — and the next rung (R5 generative) should take over on any abstain.",
3
+ "ledger": {
4
+ "entries": {
5
+ "ent_01KYBPCRRYA4RY273R7TFF3VRF": {
6
+ "bakedName": "Inference",
7
+ "curName": "Inference",
8
+ "id": "ent_01KYBPCRRYA4RY273R7TFF3VRF",
9
+ "kind": "entity",
10
+ "owner": "workspace",
11
+ "renames": []
12
+ },
13
+ "evt_01KYBPCRRY1764RNVM07X1HN1W": {
14
+ "bakedName": "RESET",
15
+ "curName": "RESET",
16
+ "id": "evt_01KYBPCRRY1764RNVM07X1HN1W",
17
+ "kind": "event",
18
+ "owner": "workspace",
19
+ "parent": "trt_01KYBPCRRYRDWPJQ44M6MKZ2YX",
20
+ "renames": []
21
+ },
22
+ "evt_01KYBPCRRY2FMY57YT8MYD3NWX": {
23
+ "bakedName": "INFER_CALL_FAILED",
24
+ "curName": "INFER_CALL_FAILED",
25
+ "id": "evt_01KYBPCRRY2FMY57YT8MYD3NWX",
26
+ "kind": "event",
27
+ "owner": "workspace",
28
+ "parent": "trt_01KYBPCRRYRDWPJQ44M6MKZ2YX",
29
+ "renames": []
30
+ },
31
+ "evt_01KYBPCRRY466WKYEHEYJJD4NJ": {
32
+ "bakedName": "INFER_ABSTAINED",
33
+ "curName": "INFER_ABSTAINED",
34
+ "id": "evt_01KYBPCRRY466WKYEHEYJJD4NJ",
35
+ "kind": "event",
36
+ "owner": "workspace",
37
+ "parent": "trt_01KYBPCRRYRDWPJQ44M6MKZ2YX",
38
+ "renames": []
39
+ },
40
+ "evt_01KYBPCRRY49ZNB6TD5ZPAY80T": {
41
+ "bakedName": "INFERRED_RAW",
42
+ "curName": "INFERRED_RAW",
43
+ "id": "evt_01KYBPCRRY49ZNB6TD5ZPAY80T",
44
+ "kind": "event",
45
+ "owner": "workspace",
46
+ "parent": "trt_01KYBPCRRYRDWPJQ44M6MKZ2YX",
47
+ "renames": []
48
+ },
49
+ "evt_01KYBPCRRYDEDF9WYPE4KRR2Q6": {
50
+ "bakedName": "INFERRED",
51
+ "curName": "INFERRED",
52
+ "id": "evt_01KYBPCRRYDEDF9WYPE4KRR2Q6",
53
+ "kind": "event",
54
+ "owner": "workspace",
55
+ "parent": "trt_01KYBPCRRYRDWPJQ44M6MKZ2YX",
56
+ "renames": []
57
+ },
58
+ "evt_01KYBPCRRYVWRB6GXDRKPNX561": {
59
+ "bakedName": "INFER",
60
+ "curName": "INFER",
61
+ "id": "evt_01KYBPCRRYVWRB6GXDRKPNX561",
62
+ "kind": "event",
63
+ "owner": "workspace",
64
+ "parent": "trt_01KYBPCRRYRDWPJQ44M6MKZ2YX",
65
+ "renames": []
66
+ },
67
+ "evt_01KYBPCRRYXAYYDX6TXDJ6ZD49": {
68
+ "bakedName": "INIT",
69
+ "curName": "INIT",
70
+ "id": "evt_01KYBPCRRYXAYYDX6TXDJ6ZD49",
71
+ "kind": "event",
72
+ "owner": "workspace",
73
+ "parent": "trt_01KYBPCRRYRDWPJQ44M6MKZ2YX",
74
+ "renames": []
75
+ },
76
+ "orb_01KYBPCRRYEW3P2BD0V50BY174": {
77
+ "bakedName": "MlInferOrbital",
78
+ "curName": "MlInferOrbital",
79
+ "id": "orb_01KYBPCRRYEW3P2BD0V50BY174",
80
+ "kind": "orbital",
81
+ "owner": "workspace",
82
+ "renames": []
83
+ },
84
+ "pag_01KYBPCRRY18XQ2SBPNFRTP0SN": {
85
+ "bakedName": "MlInferPage",
86
+ "curName": "MlInferPage",
87
+ "id": "pag_01KYBPCRRY18XQ2SBPNFRTP0SN",
88
+ "kind": "page",
89
+ "owner": "workspace",
90
+ "renames": []
91
+ },
92
+ "trt_01KYBPCRRYRDWPJQ44M6MKZ2YX": {
93
+ "bakedName": "InferenceRun",
94
+ "curName": "InferenceRun",
95
+ "id": "trt_01KYBPCRRYRDWPJQ44M6MKZ2YX",
96
+ "kind": "trait",
97
+ "owner": "workspace",
98
+ "renames": []
99
+ }
100
+ },
101
+ "schemaVersion": 1
102
+ },
103
+ "name": "std-ml-infer",
104
+ "orbitals": [
105
+ {
106
+ "entity": {
107
+ "fields": [
108
+ {
109
+ "default": {},
110
+ "name": "input",
111
+ "type": "object"
112
+ },
113
+ {
114
+ "default": [],
115
+ "items": {
116
+ "type": "number"
117
+ },
118
+ "name": "output",
119
+ "type": "array"
120
+ },
121
+ {
122
+ "default": 0.0,
123
+ "name": "confidence",
124
+ "type": "number"
125
+ },
126
+ {
127
+ "default": [],
128
+ "items": {
129
+ "type": "object"
130
+ },
131
+ "name": "violations",
132
+ "type": "array"
133
+ },
134
+ {
135
+ "default": "",
136
+ "name": "reason",
137
+ "type": "string"
138
+ },
139
+ {
140
+ "default": {},
141
+ "name": "request",
142
+ "type": "object"
143
+ },
144
+ {
145
+ "default": "idle",
146
+ "name": "status",
147
+ "type": "string",
148
+ "values": [
149
+ "idle",
150
+ "inferring",
151
+ "resolved"
152
+ ]
153
+ }
154
+ ],
155
+ "id": "ent_01KYBPCRRYA4RY273R7TFF3VRF",
156
+ "name": "Inference",
157
+ "persistence": "runtime"
158
+ },
159
+ "id": "orb_01KYBPCRRYEW3P2BD0V50BY174",
160
+ "name": "MlInferOrbital",
161
+ "pages": [
162
+ {
163
+ "id": "pag_01KYBPCRRY18XQ2SBPNFRTP0SN",
164
+ "name": "MlInferPage",
165
+ "path": "/ml-infer",
166
+ "traits": [
167
+ {
168
+ "ref": "InferenceRun",
169
+ "refId": "trt_01KYBPCRRYRDWPJQ44M6MKZ2YX"
170
+ }
171
+ ]
172
+ }
173
+ ],
174
+ "traits": [
175
+ {
176
+ "category": "lifecycle",
177
+ "config": {
178
+ "confidenceFloor": {
179
+ "default": 0.7,
180
+ "description": "Minimum service-reported confidence required to answer; below this the atom abstains with reason low confidence",
181
+ "label": "Confidence floor",
182
+ "tier": "policy",
183
+ "type": "float"
184
+ },
185
+ "model": {
186
+ "default": "",
187
+ "description": "hf:<id> for off-the-shelf weights, or a masar checkpoint id, forwarded to the ml service infer action",
188
+ "label": "Model reference",
189
+ "tier": "infra",
190
+ "type": "string"
191
+ },
192
+ "outputContract": {
193
+ "default": {
194
+ "ranges": {}
195
+ },
196
+ "description": "Declared shape and per-dimension ranges the model output must satisfy; a failing check abstains with reason contract violation. Omit shape to assert ranges only — an empty shape [] asserts a SCALAR output, it does not mean unconstrained",
197
+ "label": "Output contract",
198
+ "properties": {
199
+ "ranges": {
200
+ "items": {
201
+ "properties": {
202
+ "max": {
203
+ "name": "max",
204
+ "required": true,
205
+ "type": "number"
206
+ },
207
+ "min": {
208
+ "name": "min",
209
+ "required": true,
210
+ "type": "number"
211
+ }
212
+ },
213
+ "type": "object"
214
+ },
215
+ "name": "ranges",
216
+ "required": false,
217
+ "type": "object"
218
+ },
219
+ "shape": {
220
+ "items": {
221
+ "type": "number"
222
+ },
223
+ "name": "shape",
224
+ "required": false,
225
+ "type": "array"
226
+ }
227
+ },
228
+ "tier": "domain",
229
+ "type": "OutputContract"
230
+ }
231
+ },
232
+ "emits": [
233
+ {
234
+ "description": "Raw ml.infer service result, flattened onto the payload by the call-service effect executor",
235
+ "event": "INFERRED_RAW",
236
+ "eventId": "evt_01KYBPCRRY49ZNB6TD5ZPAY80T",
237
+ "payloadSchema": [
238
+ {
239
+ "name": "output",
240
+ "required": true,
241
+ "type": "[float]"
242
+ },
243
+ {
244
+ "name": "confidence",
245
+ "required": true,
246
+ "type": "number"
247
+ }
248
+ ],
249
+ "tier": "secondary"
250
+ },
251
+ {
252
+ "description": "call-service infer failure signal — a masar cold start or a down endpoint lands here, not as a user-visible error",
253
+ "event": "INFER_CALL_FAILED",
254
+ "eventId": "evt_01KYBPCRRY2FMY57YT8MYD3NWX",
255
+ "payloadSchema": [
256
+ {
257
+ "name": "error",
258
+ "required": true,
259
+ "type": "string"
260
+ }
261
+ ],
262
+ "tier": "secondary"
263
+ },
264
+ {
265
+ "description": "The service answered, the output satisfies outputContract, and confidence clears confidenceFloor — output already clamped",
266
+ "event": "INFERRED",
267
+ "eventId": "evt_01KYBPCRRYDEDF9WYPE4KRR2Q6",
268
+ "payloadSchema": [
269
+ {
270
+ "name": "output",
271
+ "required": true,
272
+ "type": "[float]"
273
+ },
274
+ {
275
+ "name": "confidence",
276
+ "required": true,
277
+ "type": "float"
278
+ },
279
+ {
280
+ "name": "violations",
281
+ "required": true,
282
+ "type": "[object]"
283
+ }
284
+ ],
285
+ "scope": "external",
286
+ "tier": "primary"
287
+ },
288
+ {
289
+ "description": "The abstain — reason is one of: low confidence, contract violation, unavailable. violations is populated only on the contract violation path. request echoes the originating request untouched so the next rung can project its own inputs out of it",
290
+ "event": "INFER_ABSTAINED",
291
+ "eventId": "evt_01KYBPCRRY466WKYEHEYJJD4NJ",
292
+ "payloadSchema": [
293
+ {
294
+ "name": "reason",
295
+ "required": true,
296
+ "type": "string"
297
+ },
298
+ {
299
+ "name": "violations",
300
+ "required": true,
301
+ "type": "[object]"
302
+ },
303
+ {
304
+ "name": "request",
305
+ "type": "object"
306
+ }
307
+ ],
308
+ "scope": "external",
309
+ "tier": "primary"
310
+ }
311
+ ],
312
+ "entityRefIds": {
313
+ "Inference": "ent_01KYBPCRRYA4RY273R7TFF3VRF"
314
+ },
315
+ "id": "trt_01KYBPCRRYRDWPJQ44M6MKZ2YX",
316
+ "linkedEntity": "Inference",
317
+ "linkedEntityId": "ent_01KYBPCRRYA4RY273R7TFF3VRF",
318
+ "name": "InferenceRun",
319
+ "scope": "instance",
320
+ "stateMachine": {
321
+ "events": [
322
+ {
323
+ "id": "evt_01KYBPCRRYXAYYDX6TXDJ6ZD49",
324
+ "key": "INIT",
325
+ "name": "Initialize"
326
+ },
327
+ {
328
+ "id": "evt_01KYBPCRRYVWRB6GXDRKPNX561",
329
+ "key": "INFER",
330
+ "name": "Infer",
331
+ "payloadSchema": [
332
+ {
333
+ "name": "input",
334
+ "required": true,
335
+ "type": "object"
336
+ },
337
+ {
338
+ "name": "request",
339
+ "type": "object"
340
+ }
341
+ ]
342
+ },
343
+ {
344
+ "description": "Raw ml.infer service result, flattened onto the payload by the call-service effect executor",
345
+ "id": "evt_01KYBPCRRY49ZNB6TD5ZPAY80T",
346
+ "key": "INFERRED_RAW",
347
+ "name": "Inferred Raw",
348
+ "payloadSchema": [
349
+ {
350
+ "name": "output",
351
+ "required": true,
352
+ "type": "[float]"
353
+ },
354
+ {
355
+ "name": "confidence",
356
+ "required": true,
357
+ "type": "number"
358
+ }
359
+ ],
360
+ "tier": "secondary"
361
+ },
362
+ {
363
+ "description": "call-service infer failure signal — a masar cold start or a down endpoint lands here, not as a user-visible error",
364
+ "id": "evt_01KYBPCRRY2FMY57YT8MYD3NWX",
365
+ "key": "INFER_CALL_FAILED",
366
+ "name": "Infer Call Failed",
367
+ "payloadSchema": [
368
+ {
369
+ "name": "error",
370
+ "required": true,
371
+ "type": "string"
372
+ }
373
+ ],
374
+ "tier": "secondary"
375
+ },
376
+ {
377
+ "id": "evt_01KYBPCRRY1764RNVM07X1HN1W",
378
+ "key": "RESET",
379
+ "name": "Reset"
380
+ },
381
+ {
382
+ "description": "The service answered, the output satisfies outputContract, and confidence clears confidenceFloor — output already clamped",
383
+ "id": "evt_01KYBPCRRYDEDF9WYPE4KRR2Q6",
384
+ "key": "INFERRED",
385
+ "name": "Inferred",
386
+ "payloadSchema": [
387
+ {
388
+ "name": "output",
389
+ "required": true,
390
+ "type": "[float]"
391
+ },
392
+ {
393
+ "name": "confidence",
394
+ "required": true,
395
+ "type": "float"
396
+ },
397
+ {
398
+ "name": "violations",
399
+ "required": true,
400
+ "type": "[object]"
401
+ }
402
+ ],
403
+ "tier": "primary"
404
+ },
405
+ {
406
+ "description": "The abstain — reason is one of: low confidence, contract violation, unavailable. violations is populated only on the contract violation path. request echoes the originating request untouched so the next rung can project its own inputs out of it",
407
+ "id": "evt_01KYBPCRRY466WKYEHEYJJD4NJ",
408
+ "key": "INFER_ABSTAINED",
409
+ "name": "Infer Abstained",
410
+ "payloadSchema": [
411
+ {
412
+ "name": "reason",
413
+ "required": true,
414
+ "type": "string"
415
+ },
416
+ {
417
+ "name": "violations",
418
+ "required": true,
419
+ "type": "[object]"
420
+ },
421
+ {
422
+ "name": "request",
423
+ "type": "object"
424
+ }
425
+ ],
426
+ "tier": "primary"
427
+ }
428
+ ],
429
+ "states": [
430
+ {
431
+ "isInitial": true,
432
+ "name": "idle"
433
+ },
434
+ {
435
+ "name": "inferring"
436
+ },
437
+ {
438
+ "name": "resolved"
439
+ }
440
+ ],
441
+ "transitions": [
442
+ {
443
+ "effects": [
444
+ [
445
+ "set",
446
+ "@entity.input",
447
+ {}
448
+ ],
449
+ [
450
+ "set",
451
+ "@entity.output",
452
+ []
453
+ ],
454
+ [
455
+ "set",
456
+ "@entity.confidence",
457
+ 0.0
458
+ ],
459
+ [
460
+ "set",
461
+ "@entity.violations",
462
+ []
463
+ ],
464
+ [
465
+ "set",
466
+ "@entity.reason",
467
+ ""
468
+ ],
469
+ [
470
+ "set",
471
+ "@entity.request",
472
+ {}
473
+ ],
474
+ [
475
+ "set",
476
+ "@entity.status",
477
+ "idle"
478
+ ]
479
+ ],
480
+ "event": "INIT",
481
+ "eventId": "evt_01KYBPCRRYXAYYDX6TXDJ6ZD49",
482
+ "from": "idle",
483
+ "to": "idle"
484
+ },
485
+ {
486
+ "effects": [
487
+ [
488
+ "set",
489
+ "@entity.input",
490
+ "@payload.input"
491
+ ],
492
+ [
493
+ "set",
494
+ "@entity.request",
495
+ "@payload.request"
496
+ ],
497
+ [
498
+ "set",
499
+ "@entity.status",
500
+ "inferring"
501
+ ],
502
+ [
503
+ "call-service",
504
+ "ml",
505
+ "infer",
506
+ {
507
+ "input": "@entity.input",
508
+ "model": "@config.model"
509
+ },
510
+ {
511
+ "emit": {
512
+ "failure": "INFER_CALL_FAILED",
513
+ "success": "INFERRED_RAW"
514
+ }
515
+ }
516
+ ]
517
+ ],
518
+ "event": "INFER",
519
+ "eventId": "evt_01KYBPCRRYVWRB6GXDRKPNX561",
520
+ "from": "idle",
521
+ "to": "inferring"
522
+ },
523
+ {
524
+ "effects": [
525
+ [
526
+ "set",
527
+ "@entity.output",
528
+ "@payload.output"
529
+ ],
530
+ [
531
+ "set",
532
+ "@entity.confidence",
533
+ "@payload.confidence"
534
+ ],
535
+ [
536
+ "let",
537
+ [
538
+ [
539
+ "validation",
540
+ [
541
+ "contract/validate-output",
542
+ "@entity.output",
543
+ "@config.outputContract"
544
+ ]
545
+ ]
546
+ ],
547
+ [
548
+ "if",
549
+ [
550
+ "object/get",
551
+ "@validation",
552
+ "valid"
553
+ ],
554
+ [
555
+ "if",
556
+ [
557
+ ">=",
558
+ "@entity.confidence",
559
+ "@config.confidenceFloor"
560
+ ],
561
+ [
562
+ "do",
563
+ [
564
+ "set",
565
+ "@entity.output",
566
+ [
567
+ "contract/clamp-output",
568
+ "@entity.output",
569
+ "@config.outputContract"
570
+ ]
571
+ ],
572
+ [
573
+ "set",
574
+ "@entity.violations",
575
+ []
576
+ ],
577
+ [
578
+ "set",
579
+ "@entity.reason",
580
+ ""
581
+ ],
582
+ [
583
+ "set",
584
+ "@entity.status",
585
+ "resolved"
586
+ ],
587
+ [
588
+ "emit",
589
+ "INFERRED",
590
+ {
591
+ "confidence": "@entity.confidence",
592
+ "output": "@entity.output",
593
+ "violations": "@entity.violations"
594
+ }
595
+ ]
596
+ ],
597
+ [
598
+ "do",
599
+ [
600
+ "set",
601
+ "@entity.violations",
602
+ []
603
+ ],
604
+ [
605
+ "set",
606
+ "@entity.reason",
607
+ "low confidence"
608
+ ],
609
+ [
610
+ "set",
611
+ "@entity.status",
612
+ "resolved"
613
+ ],
614
+ [
615
+ "emit",
616
+ "INFER_ABSTAINED",
617
+ {
618
+ "reason": "low confidence",
619
+ "request": "@entity.request",
620
+ "violations": "@entity.violations"
621
+ }
622
+ ]
623
+ ]
624
+ ],
625
+ [
626
+ "do",
627
+ [
628
+ "set",
629
+ "@entity.violations",
630
+ [
631
+ "contract/violations",
632
+ "@entity.output",
633
+ "@config.outputContract"
634
+ ]
635
+ ],
636
+ [
637
+ "set",
638
+ "@entity.reason",
639
+ "contract violation"
640
+ ],
641
+ [
642
+ "set",
643
+ "@entity.status",
644
+ "resolved"
645
+ ],
646
+ [
647
+ "emit",
648
+ "INFER_ABSTAINED",
649
+ {
650
+ "reason": "contract violation",
651
+ "request": "@entity.request",
652
+ "violations": "@entity.violations"
653
+ }
654
+ ]
655
+ ]
656
+ ]
657
+ ]
658
+ ],
659
+ "event": "INFERRED_RAW",
660
+ "eventId": "evt_01KYBPCRRY49ZNB6TD5ZPAY80T",
661
+ "from": "inferring",
662
+ "to": "resolved"
663
+ },
664
+ {
665
+ "effects": [
666
+ [
667
+ "set",
668
+ "@entity.output",
669
+ []
670
+ ],
671
+ [
672
+ "set",
673
+ "@entity.confidence",
674
+ 0.0
675
+ ],
676
+ [
677
+ "set",
678
+ "@entity.violations",
679
+ []
680
+ ],
681
+ [
682
+ "set",
683
+ "@entity.reason",
684
+ "unavailable"
685
+ ],
686
+ [
687
+ "set",
688
+ "@entity.status",
689
+ "resolved"
690
+ ],
691
+ [
692
+ "emit",
693
+ "INFER_ABSTAINED",
694
+ {
695
+ "reason": "unavailable",
696
+ "request": "@entity.request",
697
+ "violations": "@entity.violations"
698
+ }
699
+ ]
700
+ ],
701
+ "event": "INFER_CALL_FAILED",
702
+ "eventId": "evt_01KYBPCRRY2FMY57YT8MYD3NWX",
703
+ "from": "inferring",
704
+ "to": "resolved"
705
+ },
706
+ {
707
+ "effects": [
708
+ [
709
+ "set",
710
+ "@entity.status",
711
+ "resolved"
712
+ ]
713
+ ],
714
+ "event": "INIT",
715
+ "eventId": "evt_01KYBPCRRYXAYYDX6TXDJ6ZD49",
716
+ "from": "resolved",
717
+ "to": "resolved"
718
+ },
719
+ {
720
+ "effects": [
721
+ [
722
+ "set",
723
+ "@entity.input",
724
+ {}
725
+ ],
726
+ [
727
+ "set",
728
+ "@entity.output",
729
+ []
730
+ ],
731
+ [
732
+ "set",
733
+ "@entity.confidence",
734
+ 0.0
735
+ ],
736
+ [
737
+ "set",
738
+ "@entity.violations",
739
+ []
740
+ ],
741
+ [
742
+ "set",
743
+ "@entity.reason",
744
+ ""
745
+ ],
746
+ [
747
+ "set",
748
+ "@entity.request",
749
+ {}
750
+ ],
751
+ [
752
+ "set",
753
+ "@entity.status",
754
+ "idle"
755
+ ]
756
+ ],
757
+ "event": "RESET",
758
+ "eventId": "evt_01KYBPCRRY1764RNVM07X1HN1W",
759
+ "from": "resolved",
760
+ "to": "idle"
761
+ }
762
+ ]
763
+ }
764
+ }
765
+ ]
766
+ }
767
+ ],
768
+ "schemaVersion": 1,
769
+ "version": "1.0.0"
770
+ }